/* =========================================================
   Thoracic Surgery Clinic Brand
   عيادة جراحة الصدر - الدكتور محمد حج مصطفى
   ========================================================= */

:root {
    --reports-ink: #012952;
    --reports-muted: #64758a;
    --reports-primary: #012952;
    --reports-primary-dark: #001f3f;
    --reports-accent: #017b92;
    --reports-accent-soft: #e9f8fb;
    --reports-bg: #f5fafc;
    --reports-card: #ffffff;
    --reports-line: #d8e6ec;
    --reports-success: #0f8a70;
    --reports-warning: #c9992e;
    --reports-gold: #c9992e;
    --reports-gold-soft: #fff8e7;
    --reports-shadow: 0 18px 48px rgba(1, 41, 82, .10);
}

html {
    color-scheme: light;
}

body.reports-app,
body.reports-auth-body {
    color: var(--reports-ink);
    background:
        radial-gradient(circle at 92% 4%, rgba(1, 123, 146, .11), transparent 27%),
        radial-gradient(circle at 8% 86%, rgba(201, 153, 46, .07), transparent 24%),
        linear-gradient(180deg, #f9fcfd 0%, #f3f8fb 100%);
}

/* ---------- Topbar / Brand ---------- */
.reports-topbar {
    border-bottom-color: rgba(1, 41, 82, .10);
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 6px 24px rgba(1, 41, 82, .05);
}

.reports-brand {
    min-width: 230px;
}

.reports-brand-mark {
    width: 54px;
    height: 58px;
    padding: 3px;
    border: 1px solid rgba(1, 123, 146, .14);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 10px 25px rgba(1, 41, 82, .12);
}

.reports-brand-mark img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.reports-brand strong {
    color: var(--reports-primary);
    font-size: 16px;
}

.reports-brand small {
    color: var(--reports-accent);
    font-size: 11px;
    font-weight: 800;
}

.reports-nav-link:hover {
    color: var(--reports-primary);
    background: #edf7fa;
}

.reports-nav-link.active,
.btn-primary,
.primary-button {
    color: #fff !important;
    background: linear-gradient(135deg, #012952 0%, #014d70 58%, #017b92 100%);
    box-shadow: 0 10px 24px rgba(1, 41, 82, .20);
}

.reports-user-avatar {
    color: #016b80;
    background: #e5f5f8;
    border: 1px solid #cae9ef;
}

.reports-logout:hover {
    color: #fff;
    border-color: var(--reports-primary);
    background: var(--reports-primary);
}

/* ---------- Headings / cards ---------- */
.reports-page-heading,
.reports-panel,
.reports-metric,
.patient-header,
.tab-panel,
.note-panel,
.important-links-section,
.chart-card,
.table-panel,
.section-card {
    border-color: var(--reports-line) !important;
    box-shadow: 0 12px 32px rgba(1, 41, 82, .055);
}

.reports-kicker,
.reports-panel-heading span,
.reports-auth-kicker {
    color: var(--reports-accent) !important;
}

.reports-page-heading h1,
.reports-panel-heading h2,
.reports-auth-card h2,
.patient-header h1 {
    color: var(--reports-primary);
}

.reports-hero {
    background:
        linear-gradient(120deg, rgba(1, 123, 146, .28), transparent 52%),
        linear-gradient(135deg, #001f3f 0%, #012952 50%, #015d78 100%);
    box-shadow: 0 20px 50px rgba(1, 41, 82, .18);
}

.reports-hero-badge {
    color: #e7fbff;
    border-color: rgba(201, 153, 46, .36);
    background: rgba(201, 153, 46, .12);
}

.reports-metric-primary {
    border-color: #cfe2ea;
    background: linear-gradient(150deg, #fff 0%, #eef8fb 100%);
}

.reports-metric-warning strong {
    color: var(--reports-gold);
}

/* ---------- Forms ---------- */
input,
select,
textarea {
    border-color: #cfdfe7 !important;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--reports-accent) !important;
    box-shadow: 0 0 0 4px rgba(1, 123, 146, .11) !important;
}

.smart-combobox.is-open > input,
.smart-combobox input:focus {
    border-color: var(--reports-accent) !important;
}

.smart-combobox-menu {
    border-color: #cfe2ea;
    box-shadow: 0 18px 45px rgba(1, 41, 82, .18);
}

.smart-combobox-group {
    color: var(--reports-primary);
    background: #edf7fa;
}

.smart-combobox-option:hover,
.smart-combobox-option:focus {
    color: var(--reports-primary);
    background: #eaf7fa;
}

/* ---------- Tabs / statuses ---------- */
.tab.active {
    color: #fff !important;
    background: linear-gradient(135deg, var(--reports-primary), var(--reports-accent)) !important;
    box-shadow: 0 8px 20px rgba(1, 41, 82, .15);
}

.record-number,
.table-serial,
.elapsed-time {
    color: var(--reports-primary);
    background: #eaf4f8;
}

.report-access-open,
.alert-success {
    border-color: #a9dfd3 !important;
    color: #0b6757 !important;
    background: #effaf7 !important;
}

.alert-danger {
    border-color: #efc6c6;
    background: #fff5f5;
}

/* ---------- Pagination / charts ---------- */
.pagination-current {
    color: #fff !important;
    border-color: var(--reports-primary) !important;
    background: linear-gradient(135deg, var(--reports-primary), var(--reports-accent)) !important;
}

.monthly-bar-track span,
.stats-bar-row i {
    background: linear-gradient(180deg, var(--reports-accent), var(--reports-primary));
}

/* ---------- Footer ---------- */
.reports-footer {
    border-top-color: rgba(1, 41, 82, .10);
    background: #fff;
}

.reports-footer span:first-child {
    color: var(--reports-primary);
    font-weight: 900;
}

/* =========================================================
   Login page
   ========================================================= */
body.reports-auth-body {
    background:
        radial-gradient(circle at 10% 12%, rgba(1, 123, 146, .16), transparent 31%),
        radial-gradient(circle at 92% 90%, rgba(201, 153, 46, .11), transparent 26%),
        linear-gradient(145deg, #f8fcfd 0%, #edf7fa 58%, #f8fbfc 100%);
}

.reports-auth-shell {
    width: min(1220px, calc(100% - 36px));
    grid-template-columns: minmax(0, 1.12fr) minmax(390px, .78fr);
    gap: 48px;
}

.reports-auth-intro {
    position: relative;
    padding: 38px;
}

.reports-auth-intro::before {
    content: "";
    position: absolute;
    inset: 4% auto 4% 0;
    width: 2px;
    border-radius: 99px;
    background: linear-gradient(180deg, transparent, var(--reports-gold), transparent);
    opacity: .75;
}

.thoracic-auth-logo {
    width: min(600px, 100%);
    margin-bottom: 24px;
}

.thoracic-auth-logo img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
}

.reports-auth-intro h1 {
    margin-bottom: 3px;
    color: var(--reports-primary);
    font-size: clamp(38px, 5vw, 62px);
}

.thoracic-doctor-name {
    margin: 0 0 12px !important;
    color: var(--reports-accent) !important;
    font-size: clamp(22px, 2.4vw, 31px);
    font-weight: 900;
}

.reports-auth-features span {
    border-color: #cfe2ea;
    color: #36536a;
    background: rgba(255,255,255,.82);
}

.reports-auth-card {
    border-color: rgba(1, 123, 146, .20);
    background: rgba(255,255,255,.95);
    box-shadow: 0 25px 65px rgba(1, 41, 82, .14);
}

.reports-auth-card::before {
    content: "";
    display: block;
    width: 72px;
    height: 4px;
    margin-bottom: 20px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--reports-primary), var(--reports-accent), var(--reports-gold));
}

.reports-auth-submit {
    border-bottom: 3px solid var(--reports-gold);
}

/* ---------- Loader ---------- */
.page-loader {
    background: rgba(245, 250, 252, .97);
}

.loader-card {
    border-color: #d2e5eb;
}

.loader-ring {
    border-color: #d8edf1;
    border-top-color: var(--reports-accent);
    border-right-color: var(--reports-gold);
}

.loader-title {
    color: var(--reports-primary);
}

/* =========================================================
   Print identity
   ========================================================= */
.thoracic-print-header {
    grid-template-columns: 92px 1fr 92px !important;
    border-bottom: 2px solid var(--reports-primary) !important;
}

.thoracic-print-mark {
    width: 78px;
    height: 88px;
    display: grid;
    place-items: center;
}

.thoracic-print-mark img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.thoracic-print-header h1 {
    color: var(--reports-primary);
    font-size: 25px;
}

.thoracic-print-header p {
    margin: 2px 0;
    color: #486071;
}

.thoracic-print-header .thoracic-print-doctor {
    color: var(--reports-accent);
    font-size: 16px;
    font-weight: 900;
}

.report-title {
    color: var(--reports-primary);
}

.print-section h3 {
    color: var(--reports-primary);
    border-right-color: var(--reports-accent) !important;
    background: #edf7fa !important;
}

.medical-print-footer {
    border-top-color: var(--reports-primary) !important;
    color: #536b7b;
}

/* ---------- Mobile ---------- */
@media (max-width: 820px) {
    .reports-auth-shell {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .reports-auth-intro {
        padding: 22px 8px 12px;
        text-align: center;
    }

    .reports-auth-intro::before {
        display: none;
    }

    .thoracic-auth-logo {
        width: min(520px, 100%);
        margin-inline: auto;
        margin-bottom: 12px;
    }

    .reports-auth-intro h1 {
        font-size: 34px;
    }

    .thoracic-doctor-name {
        font-size: 23px;
    }

    .reports-auth-features {
        justify-content: center;
    }
}

@media (max-width: 600px) {
    .reports-brand {
        min-width: 0;
    }

    .reports-brand-mark {
        width: 46px;
        height: 50px;
        border-radius: 14px;
    }

    .reports-auth-card {
        border-radius: 22px;
    }
}

@media print {
    .thoracic-print-header {
        break-inside: avoid;
    }

    .thoracic-print-mark {
        width: 70px;
        height: 80px;
    }
}
