/* Photopsis — Main Stylesheet */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: Arial, sans-serif;
    background: #f0f4f8;
    color: #333;
    line-height: 1.5;
}

/* ── Layout ── */
.page { padding: 24px; }
.container { max-width: 1300px; margin: 0 auto; }

/* ── Topbar ── */
.topbar {
    background: #1a237e;
    color: white;
    padding: 12px 24px;
    border-radius: 10px;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.topbar h1 { font-size: 18px; font-weight: 600; }
.topbar a { color: white; text-decoration: none; font-size: 13px; opacity: 0.8; margin-left: 16px; }
.topbar a:hover { opacity: 1; }

/* ── Cards ── */
.card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    border: 1px solid #e0e0e0;
    margin-bottom: 16px;
}
.card h2 {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}
.card h3 {
    font-size: 13px;
    font-weight: 600;
    color: #666;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ── Stats grid ── */
.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}
.stat {
    background: white;
    border-radius: 8px;
    padding: 14px;
    text-align: center;
    border: 1px solid #e0e0e0;
}
.stat-val { font-size: 24px; font-weight: 700; color: #1a237e; }
.stat-label { font-size: 11px; color: #888; margin-top: 2px; }

/* ── Table ── */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #e0e0e0;
}
.data-table th {
    background: #f8f9fa;
    font-size: 11px;
    font-weight: 600;
    color: #666;
    text-align: left;
    padding: 12px 16px;
    border-bottom: 1px solid #e0e0e0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.data-table td {
    padding: 13px 16px;
    border-bottom: 1px solid #f5f5f5;
    font-size: 13px;
    vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #fafbff; }

/* ── Patient cell ── */
.patient-name { font-weight: 600; font-size: 14px; color: #1a1a2e; }
.patient-id { font-size: 11px; color: #999; margin-top: 2px; }

/* ── Modality pill ── */
.pill {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 500;
    background: #e8eaf6;
    color: #3949ab;
}

/* ── Status badges ── */
.status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
}
.status-ready    { background: #e8f5e9; color: #2e7d32; }
.status-processing { background: #fff8e1; color: #f57f17; }
.status-signed   { background: #f5f5f5; color: #9e9e9e; }
.status-error    { background: #ffebee; color: #c62828; }
.status-pending  { background: #fff8e1; color: #f57f17; }

/* ── Status dots ── */
.dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}
.dot-green { background: #4caf50; }
.dot-gray  { background: #9e9e9e; }
.dot-red   { background: #f44336; }
.dot-spin  {
    width: 7px; height: 7px;
    border-radius: 50%;
    border: 2px solid #ffc107;
    border-top-color: transparent;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Buttons ── */
.btn {
    padding: 9px 20px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    text-decoration: none;
    display: inline-block;
    transition: background 0.15s;
}
.btn-primary   { background: #1a237e; color: white; }
.btn-primary:hover { background: #283593; }
.btn-success   { background: #2e7d32; color: white; }
.btn-success:hover { background: #1b5e20; }
.btn-sm        { padding: 6px 14px; font-size: 12px; }
.btn-disabled  { background: #f5f5f5; color: #bbb; border: 1px solid #e0e0e0; cursor: not-allowed; }
.btn-block     { width: 100%; text-align: center; }

/* ── Forms ── */
.field { margin-bottom: 14px; }
.field label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #555;
    margin-bottom: 5px;
}
.field input,
.field select {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    outline: none;
    transition: border-color 0.15s;
}
.field input:focus,
.field select:focus { border-color: #3949ab; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ── Alerts / flash ── */
.alert {
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 16px;
}
.alert-error   { background: #ffebee; color: #c62828; }
.alert-success { background: #e8f5e9; color: #2e7d32; }
.alert-info    { background: #e3f2fd; color: #1565c0; }

/* ── Report page ── */
.report-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.report-image { width: 100%; border-radius: 6px; border: 1px solid #e0e0e0; }
.report-text {
    white-space: pre-wrap;
    line-height: 1.9;
    font-size: 14px;
    color: #333;
    max-height: 550px;
    overflow-y: auto;
    padding: 4px;
}
.report-meta {
    font-size: 12px;
    color: #888;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}
.badge {
    padding: 4px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    color: white;
}
.badge-draft  { background: #c62828; }
.badge-signed { background: #2e7d32; }
.signed-info {
    background: #e8f5e9;
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 12px;
    color: #2e7d32;
    margin-top: 8px;
    text-align: center;
}

/* ── Login page ── */
.login-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}
.login-card {
    background: white;
    border-radius: 12px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    border: 1px solid #e0e0e0;
}
.login-logo { text-align: center; margin-bottom: 30px; }
.login-logo h1 { font-size: 28px; color: #1a237e; font-weight: 700; }
.login-logo p  { font-size: 13px; color: #888; margin-top: 4px; }

/* ── Footer ── */
.page-footer {
    text-align: right;
    font-size: 11px;
    color: #aaa;
    margin-top: 10px;
}

/* ── Empty state ── */
.empty {
    text-align: center;
    padding: 40px;
    color: #999;
    font-size: 14px;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .stats { grid-template-columns: repeat(2, 1fr); }
    .report-grid { grid-template-columns: 1fr; }
    .grid2 { grid-template-columns: 1fr; }
}
