/* ═══════════════════════════════════════════════════
   rent.astafev.com — "Midnight Estate" Design System
   Dark indigo theme for property rental management
   ═══════════════════════════════════════════════════ */

:root {
    --bg-deep: #06080f;
    --bg-primary: #0b1021;
    --bg-secondary: #111836;
    --bg-card: #171f42;
    --bg-card-hover: #1e2854;
    --bg-input: #0e1330;
    --border: #252e56;
    --border-focus: #6366f1;
    --text: #e8eaf6;
    --text-muted: #8890b5;
    --text-dim: #5c6490;
    --accent: #818cf8;
    --accent-hover: #6366f1;
    --accent-deep: #4f46e5;
    --accent-glow: rgba(99, 102, 241, 0.15);
    --success: #34d399;
    --success-bg: rgba(52, 211, 153, 0.1);
    --warning: #fbbf24;
    --warning-bg: rgba(251, 191, 36, 0.1);
    --danger: #f87171;
    --danger-bg: rgba(248, 113, 113, 0.1);
    --info: #60a5fa;
    --info-bg: rgba(96, 165, 250, 0.1);
    --radius: 10px;
    --radius-sm: 6px;
    --radius-lg: 14px;
    --shadow: 0 4px 24px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 40px rgba(0,0,0,0.5);
    --transition: 0.2s ease;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
}

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

html { font-size: 15px; }

body {
    font-family: var(--font);
    background: var(--bg-deep);
    color: var(--text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    line-height: 1.5;
}

/* ── Layout ── */

.app-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 240px;
    background: var(--bg-primary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: transform var(--transition);
}

.sidebar-brand {
    padding: 20px;
    border-bottom: 1px solid var(--border);
}

.sidebar-brand h1 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: -0.02em;
}

.sidebar-brand small {
    display: block;
    font-size: 0.72rem;
    color: var(--text-dim);
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

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

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition);
    font-size: 0.88rem;
    font-weight: 500;
    user-select: none;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.nav-item:hover { background: var(--bg-card); color: var(--text); }
.nav-item.active { background: var(--accent-glow); color: var(--accent); }
.nav-item .nav-icon { font-size: 1.15rem; width: 24px; text-align: center; }

.sidebar-footer {
    padding: 12px 14px;
    border-top: 1px solid var(--border);
    font-size: 0.75rem;
    color: var(--text-dim);
}

.main-content {
    flex: 1;
    margin-left: 240px;
    padding: 24px 28px;
    max-width: 1280px;
}

/* ── Header ── */

.page-header {
    margin-bottom: 24px;
}

.page-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
}

.page-header .subtitle {
    color: var(--text-muted);
    font-size: 0.88rem;
    margin-top: 2px;
}

.header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

/* ── Cards ── */

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    transition: all var(--transition);
}

.card:hover { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent-glow); }

.card-title {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-dim);
    margin-bottom: 8px;
}

.card-value {
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--text);
    font-family: var(--font-mono);
    letter-spacing: -0.02em;
}

.card-value .unit {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-left: 4px;
}

.card-sub {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ── Stats grid ── */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

/* ── Tables ── */

.table-wrap {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
}

.table-header h3 {
    font-size: 0.95rem;
    font-weight: 600;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 10px 16px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-dim);
    border-bottom: 1px solid var(--border);
    background: var(--bg-secondary);
    white-space: nowrap;
}

td {
    padding: 12px 16px;
    font-size: 0.88rem;
    border-bottom: 1px solid rgba(37, 46, 86, 0.5);
    vertical-align: middle;
}

tr:hover td { background: var(--bg-card-hover); }
tr:last-child td { border-bottom: none; }

td.mono {
    font-family: var(--font-mono);
    font-size: 0.84rem;
}

/* ── Status badges ── */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.badge-paid { background: var(--success-bg); color: var(--success); }
.badge-partial { background: var(--warning-bg); color: var(--warning); }
.badge-overdue { background: var(--danger-bg); color: var(--danger); }
.badge-pending { background: var(--info-bg); color: var(--info); }
.badge-active { background: var(--success-bg); color: var(--success); }
.badge-terminated { background: var(--danger-bg); color: var(--danger); }
.badge-vacant { background: var(--warning-bg); color: var(--warning); }
.badge-occupied { background: var(--accent-glow); color: var(--accent); }
.badge-bank { background: var(--accent-glow); color: var(--accent); }
.badge-cash { background: var(--success-bg); color: var(--success); }
.badge-card { background: var(--warning-bg); color: var(--warning); }
.badge-auto { background: var(--info-bg); color: var(--info); }
.badge-manual { background: rgba(255,255,255,0.06); color: var(--text-muted); }
.badge-verified { background: var(--success-bg); color: var(--success); }

.badge::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

/* ── Buttons ── */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.84rem;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    font-family: inherit;
}

.btn-primary {
    background: var(--accent-deep);
    color: #fff;
    border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-hover); box-shadow: 0 0 16px var(--accent-glow); }

.btn-outline {
    background: transparent;
    color: var(--accent);
    border-color: var(--border);
}
.btn-outline:hover { border-color: var(--accent); background: var(--accent-glow); }

.btn-danger {
    background: var(--danger-bg);
    color: var(--danger);
    border-color: rgba(248, 113, 113, 0.3);
}
.btn-danger:hover { background: rgba(248, 113, 113, 0.2); }

.btn-sm { padding: 5px 10px; font-size: 0.78rem; }
.btn-icon { padding: 6px 8px; }
.btn-group { display: flex; gap: 8px; }

/* ── Forms ── */

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

input, select, textarea {
    width: 100%;
    padding: 9px 13px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.88rem;
    font-family: inherit;
    transition: border-color var(--transition);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

input::placeholder, textarea::placeholder { color: var(--text-dim); }

select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238890b5' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

textarea { resize: vertical; min-height: 80px; }

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

/* ── Modal ── */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(6, 8, 15, 0.85);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.15s ease;
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 560px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.2s ease;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 { font-size: 1.05rem; font-weight: 600; }

.modal-close {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: var(--bg-card);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all var(--transition);
}
.modal-close:hover { background: var(--danger-bg); color: var(--danger); }

.modal-body { padding: 22px; }

/* ── Progress bar ── */

.progress-bar {
    height: 8px;
    background: var(--bg-input);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 8px;
}

.progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.progress-fill.good { background: linear-gradient(90deg, var(--success), #2dd4bf); }
.progress-fill.ok { background: linear-gradient(90deg, var(--warning), #fb923c); }
.progress-fill.bad { background: linear-gradient(90deg, var(--danger), #fb7185); }

/* ── Toast ── */

#toast-container {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    font-size: 0.84rem;
    font-weight: 500;
    box-shadow: var(--shadow);
    animation: slideIn 0.25s ease;
    max-width: 360px;
}

.toast-success { background: #065f46; color: #d1fae5; border-left: 3px solid var(--success); }
.toast-error { background: #7f1d1d; color: #fecaca; border-left: 3px solid var(--danger); }
.toast-info { background: #1e3a5f; color: #bfdbfe; border-left: 3px solid var(--info); }

/* ── Login ── */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-deep);
    background-image: radial-gradient(ellipse at 50% 0%, rgba(99, 102, 241, 0.08) 0%, transparent 60%);
}

.login-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 36px;
    width: 380px;
    box-shadow: var(--shadow-lg);
}

.login-box h1 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 4px;
    text-align: center;
}

.login-box .login-sub {
    text-align: center;
    font-size: 0.82rem;
    color: var(--text-dim);
    margin-bottom: 28px;
}

.login-box .form-group { margin-bottom: 14px; }

.login-box .btn-primary {
    width: 100%;
    padding: 11px;
    font-size: 0.92rem;
    justify-content: center;
    margin-top: 6px;
}

/* ── Period selector ── */

.period-selector {
    display: flex;
    align-items: center;
    gap: 8px;
}

.period-selector .btn {
    padding: 5px 10px;
    font-size: 0.82rem;
}

.period-selector .period-label {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text);
    min-width: 140px;
    text-align: center;
    text-transform: capitalize;
}

/* ── Tenant type tabs ── */

.tabs {
    display: flex;
    gap: 2px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    padding: 3px;
    margin-bottom: 16px;
}

.tab {
    flex: 1;
    padding: 7px 14px;
    font-size: 0.78rem;
    font-weight: 600;
    text-align: center;
    border-radius: 4px;
    cursor: pointer;
    color: var(--text-dim);
    background: transparent;
    border: none;
    transition: all var(--transition);
    font-family: inherit;
}

.tab.active { background: var(--accent-deep); color: #fff; }
.tab:hover:not(.active) { color: var(--text); }

/* ── Empty state ── */

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-dim);
}

.empty-state .icon { font-size: 2.5rem; margin-bottom: 10px; }
.empty-state p { font-size: 0.88rem; }

/* ── File upload ── */

.file-drop {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 28px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
    color: var(--text-dim);
    font-size: 0.85rem;
}

.file-drop:hover, .file-drop.dragover {
    border-color: var(--accent);
    background: var(--accent-glow);
    color: var(--accent);
}

.file-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 10px;
}

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
}

.file-item a { color: var(--accent); text-decoration: none; }
.file-item a:hover { text-decoration: underline; }

/* ── Chart placeholder ── */

.chart-bars {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    height: 160px;
    padding: 10px 0;
}

.chart-bar {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 0;
}

.chart-bar-fill {
    width: 100%;
    min-height: 2px;
    border-radius: 3px 3px 0 0;
    background: linear-gradient(180deg, var(--accent), var(--accent-deep));
    transition: height 0.5s ease;
    position: relative;
}

.chart-bar-fill.secondary {
    background: linear-gradient(180deg, rgba(129,140,248,0.3), rgba(99,102,241,0.15));
}

.chart-bar-label {
    font-size: 0.62rem;
    color: var(--text-dim);
    white-space: nowrap;
}

.chart-bar-value {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

/* ── Animations ── */

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideIn { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: translateX(0); } }

/* ── Responsive ── */

.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 52px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    z-index: 99;
    padding: 0 16px;
    align-items: center;
    justify-content: space-between;
}

.mobile-header h1 { font-size: 1rem; font-weight: 700; color: var(--accent); }

.burger {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

/* ── Utility ── */

.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.gap-8 { gap: 8px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.w-full { width: 100%; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cursor-pointer { cursor: pointer; }
.hidden { display: none !important; }

/* ── Filter pills ── */

.filter-pills {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.filter-pill {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    transition: all var(--transition);
    font-family: inherit;
    white-space: nowrap;
}

.filter-pill:hover { border-color: var(--accent); color: var(--text); }

.filter-pill.active {
    background: var(--accent-deep);
    border-color: var(--accent);
    color: #fff;
}

.filter-pill.active-bank {
    background: rgba(96, 165, 250, 0.15);
    border-color: var(--info);
    color: var(--info);
}

.filter-pill.active-cash {
    background: rgba(52, 211, 153, 0.15);
    border-color: var(--success);
    color: var(--success);
}

/* ── PDF Viewer overlay ── */

.pdf-overlay {
    position: fixed;
    inset: 0;
    background: rgba(6, 8, 15, 0.92);
    z-index: 600;
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.15s ease;
}

.pdf-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    min-height: 52px;
}

.pdf-header .pdf-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    margin-right: 12px;
}

.pdf-header .btn-group { flex-shrink: 0; }

.pdf-body {
    flex: 1;
    display: flex;
    align-items: stretch;
}

.pdf-body iframe {
    flex: 1;
    border: none;
    background: #fff;
}

/* ── Table scroll (mobile) ── */

.table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ── Lease detail ── */

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.detail-field {
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.detail-field .label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-dim);
    margin-bottom: 4px;
}

.detail-field .value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}

.detail-field .value.mono {
    font-family: var(--font-mono);
}

/* ── File grid ── */

.files-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.file-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.file-card:hover { border-color: var(--accent); }

.file-card .file-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.file-card .file-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.file-card .file-name {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-card .file-size {
    font-size: 0.72rem;
    color: var(--text-dim);
}

.file-card .file-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

/* ── Report tabs ── */

.report-tabs {
    display: flex;
    gap: 2px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    padding: 3px;
    margin-bottom: 20px;
}

.report-tab {
    flex: 1;
    padding: 8px 16px;
    font-size: 0.82rem;
    font-weight: 600;
    text-align: center;
    border-radius: 4px;
    cursor: pointer;
    color: var(--text-dim);
    background: transparent;
    border: none;
    transition: all var(--transition);
    font-family: inherit;
}

.report-tab.active { background: var(--accent-deep); color: #fff; }
.report-tab:hover:not(.active) { color: var(--text); }

/* ── Chart legend ── */

.chart-legend {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-top: 8px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.chart-legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.chart-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 2px;
}

.chart-legend-dot.bank { background: var(--accent); }
.chart-legend-dot.cash { background: var(--success); }

/* ── Stacked bar ── */

.chart-bar-stack {
    width: 100%;
    display: flex;
    flex-direction: column-reverse;
    border-radius: 3px 3px 0 0;
    overflow: hidden;
}

.chart-bar-stack .bar-bank {
    background: linear-gradient(180deg, var(--accent), var(--accent-deep));
}

.chart-bar-stack .bar-cash {
    background: linear-gradient(180deg, var(--success), #059669);
}

/* ── Responsive improvements ── */

@media (max-width: 768px) {
    .mobile-header { display: flex; }
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
    .main-content { margin-left: 0; padding: 68px 14px 20px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .form-row { grid-template-columns: 1fr; }
    table { font-size: 0.82rem; }
    th, td { padding: 8px 10px; }
    .card-value { font-size: 1.3rem; }
    .modal { max-width: 95vw; }
    .detail-grid { grid-template-columns: 1fr; }
    .files-grid { grid-template-columns: 1fr; }
    .filter-pills { gap: 4px; }
    .filter-pill { padding: 5px 10px; font-size: 0.72rem; }
    .pdf-header { padding: 8px 12px; }
    .pdf-header .pdf-title { font-size: 0.78rem; }
    .report-tabs { flex-wrap: wrap; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .header-row { flex-direction: column; align-items: flex-start; }
    .period-selector { width: 100%; justify-content: space-between; }
}
