/* =============================================================
   De'Elites Leadership International Schools - School Management System
   Core Stylesheet
   ============================================================= */

:root {
    --navy:        #0F1B2D;
    --navy-mid:    #16243B;
    --navy-soft:   #22314A;
    --gold:        #C9A227;
    --gold-soft:   #E4C862;
    --ivory:       #FAF9F6;
    --white:       #FFFFFF;
    --slate:       #5B6472;
    --slate-light: #8A93A3;
    --border:      #E4E2DC;
    --success:     #1E7145;
    --success-bg:  #E7F4EC;
    --danger:      #B3261E;
    --danger-bg:   #FBEAE9;
    --warning:     #B7791F;
    --warning-bg:  #FBF2E1;
    --info:        #2B5B84;
    --info-bg:     #E9F1F8;

    --font-display: 'Playfair Display', Georgia, serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 2px rgba(15, 27, 45, 0.06);
    --shadow-md: 0 4px 16px rgba(15, 27, 45, 0.08);
    --shadow-lg: 0 12px 32px rgba(15, 27, 45, 0.14);

    --sidebar-width: 264px;
    --topbar-height: 64px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    max-width: 100%;
    overflow-x: hidden;
}

body {
    font-family: var(--font-body);
    color: var(--navy);
    background: var(--ivory);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
    font-family: var(--font-display);
    color: var(--navy);
    margin: 0 0 0.5em;
    line-height: 1.25;
}

a { color: var(--info); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ── Brand mark ─────────────────────────────────────────────────────── */
.brand-mark {
    position: relative;
    width: 56px;
    height: 56px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.brand-mark-ring { position: absolute; inset: 0; border: 2px solid var(--gold); border-radius: 50%; }
.brand-mark-ring::after { content: ''; position: absolute; inset: 5px; border: 1px solid var(--gold); border-radius: 50%; }
.brand-mark-initials { font-family: var(--font-display); font-weight: 700; font-size: 18px; color: var(--gold-soft); letter-spacing: 0.5px; }
.brand-mark-sm { width: 36px; height: 36px; }
.brand-mark-sm .brand-mark-initials { font-size: 13px; }

/* ── Alerts ─────────────────────────────────────────────────────────── */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 16px; border: 1px solid transparent; }
.alert-success { background: var(--success-bg); color: var(--success); border-color: #bfe3cd; }
.alert-error   { background: var(--danger-bg);  color: var(--danger);  border-color: #f0c6c3; }
.alert-warning { background: var(--warning-bg); color: var(--warning); border-color: #f0dcae; }
.alert-info    { background: var(--info-bg);    color: var(--info);    border-color: #c3d9e9; }

/* ── Forms ──────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; color: var(--navy); margin-bottom: 6px; }
.form-control {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 11px 14px;
    font-size: 14px;
    font-family: var(--font-body);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--white);
    color: var(--navy);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    box-sizing: border-box;
}
.form-control:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.18); }
.form-control.is-invalid { border-color: var(--danger); }
select.form-control { appearance: none; background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%235B6472'/%3E%3C/svg%3E") no-repeat right 14px center; }
textarea.form-control { resize: vertical; min-height: 100px; }

.field-error { display: block; color: var(--danger); font-size: 12.5px; margin-top: 5px; min-height: 1em; }
.field-hint { display: block; font-size: 12px; color: var(--slate-light); margin-top: 5px; }

.form-row-between { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; font-size: 13.5px; flex-wrap: wrap; gap: 8px; }
.checkbox-label { display: inline-flex; align-items: center; gap: 6px; color: var(--slate); cursor: pointer; }
.link-muted { color: var(--slate); font-size: 13.5px; }
.link-muted:hover { color: var(--navy); }

.password-input-wrap { position: relative; }
.toggle-password { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); background: none; border: none; font-size: 12.5px; font-weight: 600; color: var(--slate); padding: 4px 6px; }
.toggle-password:hover { color: var(--navy); }

/* ── Buttons ────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 22px;
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
}
.btn:active { transform: translateY(1px); }
.btn-block { width: 100%; }
.btn-primary { background: var(--navy); color: var(--white); }
.btn-primary:hover { background: var(--navy-mid); text-decoration: none; }
.btn-primary:disabled { background: var(--slate-light); cursor: not-allowed; }
.btn-gold { background: var(--gold); color: var(--navy); }
.btn-gold:hover { background: var(--gold-soft); text-decoration: none; }
.btn-outline { background: transparent; border-color: var(--border); color: var(--navy); }
.btn-outline:hover { border-color: var(--navy); text-decoration: none; }
.btn-danger { background: var(--danger); color: var(--white); }
.btn-danger:hover { background: #922019; text-decoration: none; }
.btn-sm { padding: 7px 14px; font-size: 13px; }

/* ── App shell ──────────────────────────────────────────────────────── */
.app-body { background: var(--ivory); }
.app-shell { display: flex; min-height: 100vh; }

.app-sidebar {
    width: var(--sidebar-width);
    background: var(--navy);
    color: var(--white);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    z-index: 40;
    transition: transform 0.2s ease;
}

.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 20px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.sidebar-brand-text { font-family: var(--font-display); font-weight: 700; font-size: 16px; color: var(--white); letter-spacing: 0.3px; }

.sidebar-nav { flex: 1; padding: 14px 12px; overflow-y: auto; }

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    color: rgba(255,255,255,0.78);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 2px;
    border-left: 3px solid transparent;
}
.sidebar-link:hover { background: rgba(255,255,255,0.06); color: var(--white); text-decoration: none; }
.sidebar-link.active { background: rgba(201, 162, 39, 0.12); color: var(--gold-soft); border-left-color: var(--gold); }
.sidebar-link-icon {
    width: 26px;
    height: 26px;
    flex-shrink: 0;
    border-radius: 7px;
    background: rgba(255,255,255,0.08);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
}
.sidebar-link.active .sidebar-link-icon { background: rgba(201, 162, 39, 0.25); }

.sidebar-footer { padding: 12px; border-top: 1px solid rgba(255,255,255,0.08); }
.sidebar-link-logout:hover { color: #f0a8a3; }

.app-main {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    max-width: 100%;
}

.app-topbar {
    height: var(--topbar-height);
    background: var(--white);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    left: 0;
    z-index: 30;
    margin-left: var(--sidebar-width);
}

.app-topbar-title { font-size: 18px; margin: 0; }

.sidebar-toggle { display: none; flex-direction: column; gap: 4px; background: none; border: none; padding: 8px; flex-shrink: 0; }
.sidebar-toggle span { width: 20px; height: 2px; background: var(--navy); border-radius: 2px; }

.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(15, 27, 45, 0.45); border: none; z-index: 35; }

.app-topbar-user { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }

.app-topbar-role-badge {
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    padding: 5px 10px;
    border-radius: 20px;
    background: var(--info-bg);
    color: var(--info);
}
.role-admin   { background: rgba(201,162,39,0.15); color: #8a6b12; }
.role-teacher { background: var(--info-bg); color: var(--info); }
.role-student { background: var(--success-bg); color: var(--success); }
.role-parent  { background: #EFE9F7; color: #5B3E96; }

.user-menu { position: relative; }
.user-menu-trigger { display: flex; align-items: center; gap: 10px; background: none; border: none; padding: 4px; }
.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--navy);
    color: var(--gold-soft);
    font-weight: 700;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.user-menu-name { font-size: 14px; font-weight: 600; color: var(--navy); }

.user-menu-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 180px;
    padding: 6px;
    z-index: 50;
}
.user-menu-dropdown.open { display: block; }
.user-menu-dropdown a { display: block; padding: 9px 12px; border-radius: var(--radius-sm); color: var(--navy); font-size: 13.5px; }
.user-menu-dropdown a:hover { background: var(--ivory); text-decoration: none; }
.user-menu-dropdown a.danger { color: var(--danger); }

.app-main-inner { padding: 28px; flex: 1; max-width: 100%; overflow-x: hidden; }

.app-footer { padding: 18px 28px; color: var(--slate-light); font-size: 12.5px; border-top: 1px solid var(--border); }

/* ── Page content components ───────────────────────────────────────── */
.page-intro { margin-bottom: 24px; }
.page-intro p { color: var(--slate); margin: 0; }

.page-header-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-header-row .page-intro { margin-bottom: 0; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.stat-card-label { font-size: 12.5px; font-weight: 600; color: var(--slate); text-transform: uppercase; letter-spacing: 0.4px; }
.stat-card-value { font-family: var(--font-display); font-size: 30px; font-weight: 700; color: var(--navy); word-break: break-word; }
.stat-card-hint { font-size: 12px; color: var(--slate-light); }

.card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow-sm); max-width: 100%; overflow-x: auto; }
.card h3 { font-size: 16px; }
.card p { color: var(--slate); font-size: 14px; line-height: 1.6; margin: 0; }

/* ── Tables ─────────────────────────────────────────────────────────── */
.table-wrap { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
table.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data-table th, table.data-table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.data-table th { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.4px; color: var(--slate); background: var(--ivory); }
table.data-table tbody tr:hover { background: rgba(201,162,39,0.05); }

/* ── Filter bar ─────────────────────────────────────────────────────── */
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px; margin-bottom: 18px; max-width: 100%; }
.filter-bar .form-control { width: auto; min-width: 0; flex: 1 1 140px; }
.filter-bar input[type="text"] { flex: 2 1 180px; }

/* ── Badges ─────────────────────────────────────────────────────────── */
.badge { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 4px 10px; border-radius: 20px; text-transform: capitalize; white-space: nowrap; }
.badge-active     { background: var(--success-bg); color: var(--success); }
.badge-inactive   { background: var(--warning-bg); color: var(--warning); }
.badge-graduated  { background: var(--info-bg); color: var(--info); }
.badge-withdrawn  { background: var(--danger-bg); color: var(--danger); }
.badge-draft      { background: #EFEDE8; color: var(--slate); }
.badge-submitted  { background: var(--warning-bg); color: var(--warning); }
.badge-approved   { background: var(--success-bg); color: var(--success); }
.badge-rejected   { background: var(--danger-bg); color: var(--danger); }
.badge-unpaid     { background: var(--danger-bg); color: var(--danger); }
.badge-partial    { background: var(--warning-bg); color: var(--warning); }
.badge-paid       { background: var(--success-bg); color: var(--success); }
.badge-info       { background: var(--info-bg); color: var(--info); }

/* ── Table avatars ──────────────────────────────────────────────────── */
.table-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.table-avatar-placeholder { display: inline-flex; align-items: center; justify-content: center; background: var(--navy); color: var(--gold-soft); font-size: 12px; font-weight: 700; }
.table-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.empty-row { text-align: center; color: var(--slate-light); padding: 32px 16px !important; }

/* ── Pagination ─────────────────────────────────────────────────────── */
.pagination { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 20px; font-size: 13.5px; flex-wrap: wrap; }
.pagination .page-link { font-weight: 600; }
.pagination .page-status { color: var(--slate); }

/* ── Forms: multi-column grid ─────────────────────────────────────────── */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px 24px; min-width: 0; }
.form-group-full { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 12px; margin-top: 8px; padding-top: 18px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.current-photo { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: 12.5px; color: var(--slate); flex-wrap: wrap; }
.current-photo img { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; border: 1px solid var(--border); }

/* ── Profile view ──────────────────────────────────────────────────── */
.profile-grid { display: grid; grid-template-columns: 280px 1fr 1fr; gap: 18px; }
.profile-photo-card { text-align: center; }
.profile-photo { width: 140px; height: 140px; border-radius: 50%; object-fit: cover; margin: 0 auto 14px; border: 3px solid var(--gold); }
.profile-photo-placeholder { display: inline-flex; align-items: center; justify-content: center; background: var(--navy); color: var(--gold-soft); font-family: var(--font-display); font-size: 40px; font-weight: 700; }
.profile-notes { grid-column: 1 / -1; }
.text-muted { color: var(--slate-light); font-size: 13px; }
.text-success { color: var(--success); font-size: 13px; font-weight: 600; }
.text-danger { color: var(--danger); font-size: 13px; font-weight: 600; }
.portal-access { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }

.detail-list { display: grid; grid-template-columns: 130px 1fr; gap: 10px 12px; margin: 0; }
.detail-list dt { font-size: 12.5px; font-weight: 600; color: var(--slate); }
.detail-list dd { margin: 0; font-size: 14px; color: var(--navy); word-break: break-word; }

/* ── Tabs ──────────────────────────────────────────────────────────── */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 22px; flex-wrap: wrap; }
.tab { padding: 10px 16px; font-size: 13.5px; font-weight: 600; color: var(--slate); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab:hover { color: var(--navy); text-decoration: none; }
.tab.active { color: var(--navy); border-bottom-color: var(--gold); }

/* ── Subject / child assignment rows ──────────────────────────────────── */
.subject-assign-list { display: flex; flex-direction: column; gap: 2px; }
.subject-assign-row { display: grid; grid-template-columns: 1fr 240px; align-items: center; gap: 16px; padding: 12px 8px; border-bottom: 1px solid var(--border); }
.subject-assign-row:last-child { border-bottom: none; }
.subject-assign-check { font-size: 14px; color: var(--navy); }
.subject-assign-teacher:disabled { background: var(--ivory); color: var(--slate-light); }

/* ── Attendance status toggle ─────────────────────────────────────────── */
.status-toggle { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.status-option { position: relative; display: inline-flex; align-items: center; }
.status-option input[type="radio"] { position: absolute; opacity: 0; width: 1px; height: 1px; }
.status-option span { display: inline-block; padding: 6px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; border: 1px solid var(--border); color: var(--slate); cursor: pointer; transition: all 0.12s ease; }
.status-option input[type="radio"]:checked + span { border-color: transparent; color: var(--white); }
.status-option-present input:checked + span { background: var(--success); }
.status-option-late input:checked + span { background: var(--warning); }
.status-option-absent input:checked + span { background: var(--danger); }
.status-option-excused input:checked + span { background: var(--info); }
.status-option input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 2px; }
.attendance-table td { vertical-align: middle; }

/* ── Results table / report card ──────────────────────────────────────── */
.results-table .form-control { min-width: 70px; }
.computed-total { font-weight: 700; color: var(--navy); }
.computed-grade { font-weight: 700; color: var(--gold); }

.report-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 32px; box-shadow: var(--shadow-sm); max-width: 100%; overflow-x: auto; }
.report-card-header { display: flex; align-items: center; gap: 18px; padding-bottom: 20px; margin-bottom: 20px; border-bottom: 2px solid var(--gold); flex-wrap: wrap; }
.report-card-school-name { font-size: 22px; margin-bottom: 2px; }
.report-card-subtitle { color: var(--slate); font-size: 13.5px; margin: 0; }
.report-card-student-info { margin-bottom: 20px; }
.report-card-footer { margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--border); text-align: center; font-size: 11.5px; color: var(--slate-light); }

/* ── Announcements ─────────────────────────────────────────────────── */
.announcement-list { display: flex; flex-direction: column; gap: 14px; }
.announcement-card { padding: 20px; }
.announcement-pinned { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.announcement-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 8px; flex-wrap: wrap; }
.announcement-header h3 { margin: 0; font-size: 17px; }
.announcement-excerpt { color: var(--slate); font-size: 14px; line-height: 1.6; margin: 0 0 10px; }
.announcement-meta { font-size: 12.5px; color: var(--slate-light); }
.link-btn-danger { background: none; border: none; padding: 0; color: var(--danger); font-size: 12.5px; text-decoration: underline; cursor: pointer; }

/* ── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 960px) {
    .app-sidebar { transform: translateX(-100%); }
    .app-sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
    .app-main, .app-topbar { margin-left: 0; }
    .sidebar-toggle { display: flex; }
    .sidebar-overlay.open { display: block; }
    .app-main-inner { padding: 18px; }
    .profile-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
    .app-topbar { padding: 0 14px; }
    .user-menu-name { display: none; }
    .app-topbar-role-badge { display: none; }
    .stat-grid { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .page-header-row { flex-direction: column; align-items: stretch; }
    .subject-assign-row { grid-template-columns: 1fr; align-items: flex-start; }
}

@media (max-width: 480px) {
    .filter-bar { flex-direction: column; align-items: stretch; }
    .filter-bar .form-control { width: 100%; flex: none; }
    .report-card { padding: 18px; }
}

/* ── Report card: student photo row, two-column section, Key to Grades, Skills ── */
.report-card-student-row {
    display: flex;
    align-items: flex-start;
    gap: 20px;
}
.report-card-photo {
    width: 90px;
    height: 90px;
    border-radius: 8px;
    object-fit: cover;
    border: 2px solid var(--border);
    flex-shrink: 0;
}
.report-card-photo-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--navy);
    color: var(--gold-soft);
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 700;
}
.report-card-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 20px;
}
.report-card-section-title {
    font-family: var(--font-display);
    font-size: 15px;
    color: var(--navy);
    margin: 0 0 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}
.key-to-grades td, .report-card-skills td {
    font-size: 12.5px;
    padding: 6px 10px;
}
.report-card-skills { margin-top: 20px; }

.report-card-remarks {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}
.report-card-remarks p {
    font-size: 13.5px;
    color: var(--navy);
    margin: 0 0 8px;
}
.report-card-signature {
    margin-top: 24px;
    text-align: right;
}
.signature-image {
    width: 140px;
    max-height: 60px;
    object-fit: contain;
    margin-left: auto;
    margin-bottom: 4px;
}
.signature-line {
    font-size: 13px;
    color: var(--navy);
    border-top: 1px solid var(--navy);
    display: inline-block;
    padding-top: 4px;
    min-width: 180px;
    text-align: center;
}

@media (max-width: 700px) {
    .report-card-two-col { grid-template-columns: 1fr; }
    .report-card-student-row { flex-direction: column; align-items: center; text-align: center; }
}

/* ── Print / PDF output — full-width fix ─────────────────────────────── */
@media print {
    .app-sidebar, .app-topbar, .app-footer, .sidebar-overlay, .no-print {
        display: none !important;
    }
    .app-shell { display: block !important; }
    .app-main { margin-left: 0 !important; width: 100% !important; max-width: 100% !important; }
    .app-main-inner { padding: 0 !important; max-width: 100% !important; }
    .report-card {
        box-shadow: none !important;
        border: none !important;
        padding: 6mm !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    /* This is the key fix: overflow:auto clips content that's off-screen
       at print time instead of showing it, which is what was cutting
       information off the printed page. */
    .table-wrap {
        overflow: visible !important;
        max-width: 100% !important;
        border: none !important;
        box-shadow: none !important;
    }
    table.data-table {
        width: 100% !important;
        table-layout: fixed !important;
        font-size: 9.5pt !important;
    }
    /* white-space:nowrap (used for on-screen tables) also forces tables
       wider than the page — allow wrapping only for print. */
    table.data-table th, table.data-table td {
        white-space: normal !important;
        word-break: break-word !important;
        padding: 4px 6px !important;
    }
    .report-card-two-col { grid-template-columns: 1fr 1fr !important; }
    body { background: #fff !important; }
    @page { size: A4 portrait; margin: 10mm; }
}
/* =============================================================
   FORCE MOBILE FULL-WIDTH FIX — paste at the very bottom of
   assets/css/style.css. Uses !important so it overrides anything
   else on the page regardless of source order or specificity.
   ============================================================= */
@media (max-width: 960px) {
    html, body {
        width: 100% !important;
        max-width: 100vw !important;
        overflow-x: hidden !important;
    }
    .app-shell {
        display: block !important;
        width: 100% !important;
        max-width: 100vw !important;
    }
    .app-sidebar {
        position: fixed !important;
        transform: translateX(-100%) !important;
        z-index: 40 !important;
    }
    .app-sidebar.open {
        transform: translateX(0) !important;
    }
    .app-main {
        margin-left: 0 !important;
        width: 100% !important;
        max-width: 100vw !important;
    }
    .app-topbar {
        margin-left: 0 !important;
        width: 100% !important;
        max-width: 100vw !important;
        box-sizing: border-box !important;
    }
    .app-main-inner {
        width: 100% !important;
        max-width: 100vw !important;
        padding: 16px !important;
        box-sizing: border-box !important;
    }
    .sidebar-toggle {
        display: flex !important;
    }
}
