@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --bg: #fafafa;
    --surface: rgba(255, 255, 255, 0.85);
    --surface-solid: #ffffff;
    --ink: #0f172a;
    --muted: #64748b;
    --brand: #2563eb;
    --brand-soft: #eff6ff;
    --danger: #ef4444;
    --ok: #10b981;
    --line: #e2e8f0;
    --radius-lg: 12px;
    --radius-md: 8px;
    --control-h: 40px;
    --heading-lg: 26px;
    --heading-md: 20px;
    --shadow-soft: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.03);
    --shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: #f8fafc;
    background-attachment: fixed;
    color: var(--ink);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.app-shell {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
}

.sidebar {
    background: #0f172a;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    color: #f1f5f9;
    padding: 32px 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.sidebar h1 { margin: 0; font-size: 20px; font-weight: 700; color: #ffffff; letter-spacing: -0.01em; }
.sidebar p { margin: 4px 0 0; color: #64748b; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em;}
.sidebar nav { display: grid; gap: 4px; }
.sidebar a {
    color: #94a3b8;
    text-decoration: none;
    padding: 10px 14px;
    border-radius: 6px;
    background: transparent;
    transition: all 0.2s;
    font-weight: 500;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar a:hover { 
    background: rgba(255, 255, 255, 0.05); 
    color: #f8fafc;
}
.sidebar a.active { 
    background: #1e293b;
    color: #ffffff;
    font-weight: 600;
    box-shadow: inset 2px 0 0 var(--brand);
}

.profile-box {
    margin-top: auto;
    padding: 16px;
    background: #1e293b;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.05);
    font-size: 13px;
}
.profile-box strong { color: #f8fafc; }
.profile-box small { color: #94a3b8; }
.profile-box a { color: #60a5fa; text-decoration: none; display: block; margin-top: 8px; font-weight: 600; }
.profile-box a:hover { color: #93c5fd; }

.content {
    padding: 32px;
    display: grid;
    gap: 24px;
    align-content: start;
}

.content section.panel > h3,
.content section.panel > h2,
.content form.panel > h3,
.content form.panel > h2,
.content div.panel > h3,
.content div.panel > h2 {
    font-size: var(--heading-md);
    line-height: 1.3;
    margin: 0 0 20px;
    color: var(--ink);
    font-weight: 600;
    letter-spacing: -0.02em;
}

.hero {
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    color: #fff;
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: 0 20px 40px -10px rgba(37, 99, 235, 0.3);
    position: relative;
    overflow: hidden;
}
.hero::after {
    content: '';
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    background: url('data:image/svg+xml;utf8,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><circle cx="50%" cy="50%" r="40" fill="none" stroke="rgba(255,255,255,0.05)" stroke-width="2"/></svg>') center/150px;
    opacity: 0.5;
    pointer-events: none;
}
.hero h2 { margin: 0 0 12px; font-weight: 700; letter-spacing: -0.02em; position: relative; z-index: 1;}
.page-hero h2 { margin: 0 0 8px; font-size: var(--heading-lg); position: relative; z-index: 1;}
.page-hero p, .hero p { margin: 0; color: #bfdbfe; font-size: 16px; position: relative; z-index: 1;}

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}
.card {
    background: var(--surface-solid);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-soft);
    transition: all 0.2s ease-in-out;
}
.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
    border-color: #cbd5e1;
}
.card h3 { margin: 0; font-size: 32px; font-weight: 700; color: var(--brand); letter-spacing: -0.05em;}
.card p { margin: 8px 0 0; color: var(--muted); font-weight: 500;}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 24px;
}

.panel {
    background: var(--surface-solid);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-soft);
}
.panel h3 { margin-top: 0; }
.profile-hero h2 { margin: 0 0 8px; font-size: var(--heading-lg); }
.profile-hero p { margin: 0; color: var(--muted); }

.profile-summary .kv-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}
.profile-summary .kv-grid p {
    margin: 0;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: rgba(248, 250, 252, 0.5);
    transition: background 0.2s;
}
.profile-summary .kv-grid p:hover {
    background: var(--surface-solid);
    box-shadow: 0 4px 12px rgba(0,0,0,0.02);
}
.profile-summary .kv-grid span {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--brand);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.profile-summary .kv-grid strong {
    font-size: 15px;
    color: var(--ink);
    font-weight: 500;
}
.profile-head {
    display: flex;
    gap: 14px;
    align-items: center;
    margin-bottom: 14px;
}
.profile-avatar-wrap {
    flex: 0 0 auto;
}
.profile-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #bfdbfe;
}
.profile-avatar-fallback {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 700;
    color: #1e3a8a;
    background: #dbeafe;
    border: 2px solid #bfdbfe;
}
.profile-head-meta {
    display: grid;
    gap: 2px;
}
.profile-head-meta strong {
    font-size: 18px;
}
.profile-head-meta span {
    color: var(--muted);
    font-size: 14px;
}
.profile-head-meta small {
    color: #64748b;
}
.progress-wrap {
    display: grid;
    gap: 6px;
    margin-bottom: 14px;
}
.progress-track {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
}
.progress-track span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #1d4ed8, #3b82f6);
}
.mini-form {
    margin-top: 14px;
}
.table-filter {
    margin: 0 0 12px;
}
canvas { width: 100%; background: var(--surface-solid); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 10px; box-shadow: var(--shadow-soft); }

form { display: grid; gap: 16px; }
input, select, textarea, button, label {
    font: inherit;
}
label { font-weight: 500; color: #475569; font-size: 14px;}
input, select, textarea {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-md);
    padding: 12px 14px;
    background: var(--surface-solid);
    min-height: var(--control-h);
    transition: all 0.2s;
    box-shadow: 0 1px 2px rgba(0,0,0,0.01) inset;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2);
}
textarea {
    resize: vertical;
}
input[type="checkbox"],
input[type="radio"] {
    width: auto;
    min-height: 0;
    height: 20px;
    width: 20px;
    padding: 0;
    vertical-align: middle;
    accent-color: var(--brand);
}
.check-row {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}
button {
    border: 0;
    border-radius: var(--radius-md);
    padding: 12px 24px;
    background: linear-gradient(to right, #2563eb, #3b82f6);
    color: #fff;
    cursor: pointer;
    min-height: var(--control-h);
    font-weight: 600;
    letter-spacing: 0.2px;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2);
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
button:hover { 
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.3);
}
button:active {
    transform: translateY(0);
}
.btn-secondary { 
    background: conic-gradient(from 90deg at 50% 50%, #64748b, #475569);
    box-shadow: 0 4px 6px -1px rgba(100, 116, 139, 0.2);
}
.btn-secondary:hover { box-shadow: 0 10px 15px -3px rgba(100, 116, 139, 0.3); }
.btn-danger { 
    background: linear-gradient(to right, #dc2626, #ef4444);
    box-shadow: 0 4px 6px -1px rgba(220, 38, 38, 0.2);
}
.btn-danger:hover { box-shadow: 0 10px 15px -3px rgba(220, 38, 38, 0.3); }

.table-wrap { overflow: auto; border-radius: var(--radius-md); border: 1px solid var(--line); background: var(--surface-solid); }
table {
    width: 100%;
    border-collapse: collapse;
    min-width: 620px;
}
.profile-table {
    min-width: 520px;
}
th, td {
    border-bottom: 1px solid var(--line);
    padding: 14px 16px;
    text-align: left;
    font-size: 14px;
    vertical-align: middle;
}
th {
    background: #f8fafc;
    color: #334155;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.05em;
}
tr:hover td {
    background: #f1f5f9;
}

.inline-form {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
}
.inline-form input, .inline-form select { width: auto; min-width: 120px; }
.inline-form button { min-width: 120px; }

.alert {
    border-radius: var(--radius-md);
    padding: 14px 16px;
    border: 1px solid transparent;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
}
.alert.success { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.alert.error { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.alert.info { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.hint { color: var(--muted); font-size: 13px; margin-top: 4px; }
.mono-wrap {
    white-space: normal;
    word-break: break-all;
    overflow-wrap: anywhere;
}
a { color: #2563eb; transition: color 0.2s; font-weight: 500;}
a:hover { color: #1d4ed8; }
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid var(--line);
    letter-spacing: 0.3px;
}
.badge.ok { background: #ecfdf5; color: #059669; border-color: #a7f3d0; box-shadow: 0 2px 5px rgba(5, 150, 105, 0.1); }
.badge.warn { background: #fffbeb; color: #d97706; border-color: #fde68a; box-shadow: 0 2px 5px rgba(217, 119, 6, 0.1);}
.badge.muted { background: #f1f5f9; color: #64748b; border-color: #e2e8f0; box-shadow: 0 2px 5px rgba(100, 116, 139, 0.1);}
.pagination {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 20px;
}
.page-link {
    display: inline-block;
    padding: 10px 16px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: #f8fafc;
    color: #334155;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}
.page-link:hover {
    background: #fff;
    border-color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}
.page-info {
    color: var(--muted);
    font-size: 14px;
    font-weight: 500;
}

.notice-list {
    display: grid;
    gap: 12px;
}
.notice-card {
    display: grid;
    gap: 6px;
    text-decoration: none;
    border: 1px solid var(--line);
    border-left: 4px solid var(--brand);
    border-radius: var(--radius-md);
    padding: 16px;
    background: var(--surface-solid);
    color: inherit;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}
.notice-card:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
.notice-card strong {
    color: #0f172a;
    font-weight: 600;
}
.notice-card span {
    color: #64748b;
    font-size: 14px;
}
.notice-card.notice-warn {
    border-left-color: #f59e0b;
    background: #fffbeb;
}
.notice-card.notice-muted {
    border-left-color: #94a3b8;
    background: #f8fafc;
}

.login-body {
    display: grid;
    justify-items: center;
    align-items: start;
    min-height: 100vh;
    padding: 24px 0 40px;
    background: #020617;
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;
}
.login-body::before {
    content: '';
    position: absolute;
    top: 0; left: 50%;
    width: 100vw; height: 600px;
    background: radial-gradient(ellipse at top, rgba(37, 99, 235, 0.15) 0%, transparent 80%);
    transform: translateX(-50%);
    pointer-events: none;
    z-index: 0;
}

.login-card {
    width: min(94vw, 440px);
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5);
    position: relative;
    z-index: 1;
}
.login-card h1 { margin-top: 0; font-weight: 800; font-size: 32px; letter-spacing: -0.03em; color: #0f172a; }

.auth-shell {
    width: min(1000px, 94vw);
    display: grid;
    place-items: center;
    position: relative;
    z-index: 1;
}
.auth-card {
    width: min(94vw, 520px);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 20px;
    padding: 32px;
    box-shadow: 0 24px 50px rgba(0, 0, 0, 0.35);
}
.auth-card-wide { width: min(94vw, 620px); }
.auth-card h1 {
    margin: 0 0 4px;
    font-size: 34px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #0f172a;
}
.subtle-form {
    border-top: 1px solid #e2e8f0;
    padding-top: 14px;
}
.auth-links-row {
    margin-top: 8px;
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}
.auth-reset-box {
    margin-top: 12px;
    border-top: 1px solid #e2e8f0;
    padding-top: 14px;
    display: grid;
    gap: 10px;
}
.auth-reset-box h3 {
    margin: 0;
    font-size: 20px;
    color: #0f172a;
}
.auth-reset-box a {
    font-weight: 600;
}
.policy-block {
    border-top: 1px solid #e2e8f0;
    padding-top: 12px;
    margin-top: 8px;
}
.policy-block h3 {
    margin: 0 0 6px;
    font-size: 18px;
    color: #0f172a;
}
.policy-block p {
    margin: 0;
    color: #334155;
}
.reset-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    border-radius: 999px;
    border: 1px solid #86efac;
    background: #f0fdf4;
    color: #166534;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 700;
}

.landing-shell {
    width: min(1220px, 94vw);
    display: grid;
    gap: 24px;
    position: relative;
    z-index: 1;
}
.landing-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.brand-mark {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #f8fafc;
}
.brand-logo {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: #f8fafc;
    background: linear-gradient(130deg, #0284c7 0%, #0ea5e9 100%);
    box-shadow: 0 10px 18px rgba(2, 132, 199, 0.35);
}
.brand-text {
    display: grid;
    gap: 1px;
}
.brand-text strong {
    font-size: 18px;
    letter-spacing: 0.3px;
}
.brand-text span {
    font-size: 12px;
    color: #cbd5e1;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.landing-nav-links {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.btn-solid,
.btn-ghost,
.btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    border-radius: 12px;
    padding: 11px 16px;
    min-height: 42px;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s, color 0.2s, background-color 0.2s, border-color 0.2s;
}
.btn-solid {
    background: linear-gradient(120deg, #0284c7 0%, #0ea5e9 100%);
    color: #fff;
    box-shadow: 0 8px 18px rgba(2, 132, 199, 0.25);
}
.btn-solid:hover { color: #fff; transform: translateY(-1px); }
.btn-ghost {
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.18);
    color: #e2e8f0;
}
.btn-ghost:hover { color: #fff; }
.btn-outline {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #0f172a;
}
.btn-outline:hover {
    background: #f8fafc;
    color: #020617;
}
.btn-solid:focus-visible,
.btn-ghost:focus-visible,
.btn-outline:focus-visible {
    outline: 3px solid rgba(14, 165, 233, 0.45);
    outline-offset: 2px;
}
.landing-hero {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 24px;
    align-items: stretch;
}
.landing-hero > div,
.landing-card {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 40px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5);
    color: #f8fafc;
}
.landing-kicker {
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #38bdf8;
    font-size: 12px;
    font-weight: 700;
}
.free-badge {
    margin: 0 0 10px;
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: #34d399;
    font-size: 13px;
    font-weight: 700;
}
.landing-hero h1 {
    margin: 12px 0;
    font-size: clamp(32px, 4vw, 52px);
    line-height: 1.08;
    letter-spacing: -0.04em;
    color: #ffffff;
}
.landing-hero p {
    margin: 0 0 12px;
    color: #94a3b8;
    font-size: 17px;
}
.landing-cta-row {
    margin: 10px 0 14px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.landing-cta-row a {
    min-width: 150px;
}
.landing-card h3 {
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 24px;
    color: #ffffff;
}
.landing-card ul {
    margin: 0;
    padding-left: 18px;
    color: #94a3b8;
    display: grid;
    gap: 8px;
}
.landing-spec-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(220px, 1fr));
    gap: 18px;
}
.landing-spec {
    background: rgba(15, 23, 42, 0.52);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 18px;
    padding: 22px;
    color: #e2e8f0;
    backdrop-filter: blur(8px);
}
.landing-spec h3 {
    margin: 0 0 8px;
    color: #f8fafc;
}
.landing-spec p {
    margin: 0;
    color: #cbd5e1;
}
.landing-footer {
    margin-top: 4px;
    background: rgba(15, 23, 42, 0.6);
    border-radius: 20px;
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(20px);
}
.landing-footer-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(210px, 1fr));
    gap: 18px;
}
.landing-footer h4 {
    margin: 0 0 8px;
    color: #ffffff;
    font-size: 18px;
}
.landing-footer p {
    margin: 0 0 6px;
    color: #94a3b8;
}
.landing-footer-links {
    display: grid;
    gap: 8px;
}
.landing-footer-links a {
    color: #38bdf8;
    text-decoration: none;
    font-weight: 600;
}
.marketing-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(160px, 1fr));
    gap: 14px;
}
.marketing-stats article {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 16px;
    display: grid;
    gap: 4px;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(20px);
}
.marketing-stats strong {
    color: #ffffff;
    font-size: 22px;
    line-height: 1.1;
}
.marketing-stats span {
    color: #94a3b8;
    font-size: 14px;
}
.marketing-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(260px, 1fr));
    gap: 18px;
}
.marketing-card {
    background: rgba(10, 16, 44, 0.62);
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 18px;
    padding: 22px;
    color: #e2e8f0;
}
.marketing-card h3 {
    margin: 0 0 10px;
    color: #f8fafc;
}
.marketing-card ul {
    margin: 0;
    padding-left: 18px;
    display: grid;
    gap: 8px;
    color: #cbd5e1;
}
.marketing-cta {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 32px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(20px);
    text-align: center;
}
.marketing-cta h3 {
    margin: 0 0 12px;
    font-size: 32px;
    color: #ffffff;
    letter-spacing: -0.02em;
}
.marketing-cta p {
    margin: 0 auto 24px;
    color: #94a3b8;
    max-width: 600px;
    font-size: 18px;
}
.marketing-cta .landing-cta-row {
    justify-content: center;
}
.donation-section {
    background: rgba(15, 23, 42, 0.68);
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 20px;
    padding: 24px;
    color: #e2e8f0;
}
.donation-section h3 {
    margin: 0 0 8px;
    color: #f8fafc;
    font-size: 28px;
}
.donation-section > p {
    margin: 0 0 14px;
    color: #cbd5e1;
}
.donation-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(210px, 1fr));
    gap: 14px;
    margin-bottom: 10px;
}
.donation-grid article {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 14px;
    padding: 16px;
    color: #f8fafc;
}
.donation-grid h4 {
    margin: 0 0 8px;
    font-size: 18px;
    color: #ffffff;
}
.donation-grid p {
    margin: 0 0 6px;
    color: #94a3b8;
}
.landing-copyright {
    margin: 14px 0 0;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    color: #64748b;
    font-size: 13px;
    text-align: center;
}
.tutorial-actions {
    margin-top: 14px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.payroll-form input[type="number"] {
    height: 44px;
}
.payroll-form .inline-form button {
    min-width: 160px;
}

dialog.modal {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    width: min(560px, 92vw);
    padding: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(16px);
}
dialog.modal.modal-full {
    width: min(980px, 96vw);
    max-height: 90vh;
    overflow: auto;
}
.emp-section {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.65);
    overflow: hidden;
}
.emp-section summary {
    list-style: none;
    cursor: pointer;
    padding: 14px 16px;
    font-weight: 800;
    color: var(--ink);
    background: rgba(241, 245, 249, 0.75);
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.emp-section summary::-webkit-details-marker { display: none; }
.emp-section summary::after {
    content: '▾';
    color: var(--muted);
    font-weight: 900;
}
.emp-section[open] summary::after { content: '▴'; }
.emp-section-body { padding: 16px; }
.modal-form {
    display: grid;
    gap: 12px;
}
.modal-form h3 {
    margin: 0 0 4px;
    font-size: 24px;
}
.modal-form .hint {
    margin: 0 0 8px;
}
.modal-actions {
    margin-top: 12px;
    display: flex;
    gap: 12px;
}
.modal-danger-text {
    margin: 8px 0 0;
    padding: 12px 16px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: var(--radius-md);
    color: #991b1b;
    font-weight: 600;
}
dialog.modal::backdrop {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
}

@media (max-width: 980px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar {
        position: sticky;
        top: 0;
        z-index: 100;
        padding: 16px;
        gap: 12px;
    }
    .sidebar h1 { font-size: 22px; }
    .sidebar nav {
        display: flex;
        gap: 10px;
        overflow-x: auto;
        padding-bottom: 8px;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }
    .sidebar nav a {
        flex: 0 0 auto;
        min-width: max-content;
    }
    .profile-box {
        display: none;
    }
    .content {
        padding: 24px;
        gap: 20px;
    }
    .grid-2 { grid-template-columns: 1fr; }
    .landing-hero { grid-template-columns: 1fr; }
    .landing-spec-grid { grid-template-columns: 1fr; }
    .marketing-stats { grid-template-columns: repeat(2, minmax(160px, 1fr)); }
    .marketing-grid { grid-template-columns: 1fr; }
    .donation-grid { grid-template-columns: 1fr; }
    .landing-nav { flex-direction: column; align-items: flex-start; gap: 12px; }
    .landing-nav-links { width: 100%; }
    .landing-footer-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .content {
        padding: 16px;
        gap: 16px;
    }
    .panel {
        padding: 16px;
    }
    .content section.panel > h3,
    .content section.panel > h2,
    .content form.panel > h3,
    .content form.panel > h2,
    .content div.panel > h3,
    .content div.panel > h2 {
        font-size: 20px;
    }
    .page-hero h2,
    .profile-hero h2 {
        font-size: 24px;
    }
    .cards {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    }
    th, td {
        font-size: 13px;
        padding: 10px 12px;
    }
    table { min-width: 520px; }
    .profile-table { min-width: 460px; }

    .inline-form {
        display: grid;
        grid-template-columns: 1fr;
        gap: 12px;
        align-items: stretch;
    }
    .inline-form input,
    .inline-form select,
    .inline-form button {
        width: 100%;
        min-width: 0;
    }
    .inline-form a {
        display: inline-block;
        width: 100%;
        padding: 12px;
        border: 1px solid var(--line);
        border-radius: var(--radius-md);
        background: var(--surface-solid);
        color: var(--ink);
        text-decoration: none;
        text-align: center;
        font-weight: 500;
    }
    .payroll-form .inline-form button {
        min-width: 0;
    }
    .pagination {
        gap: 8px;
    }
    .page-link {
        width: auto;
        min-height: var(--control-h);
        display: inline-flex;
        align-items: center;
    }
    dialog.modal {
        width: 95vw;
        padding: 20px;
    }
    dialog.modal.modal-full {
        width: 100vw;
        height: 100vh;
        max-height: none;
        border-radius: 0;
        padding: 18px;
    }
    .modal-actions { flex-direction: column; }
    .modal-actions button { width: 100%; }

    .settings-table td,
    .settings-table th,
    .device-table td,
    .device-table th {
        white-space: normal;
        word-break: break-word;
        overflow-wrap: anywhere;
    }
}

@media (max-width: 520px) {
    .sidebar { padding: 12px; }
    .sidebar h1 { font-size: 20px; }
    .page-hero h2,
    .profile-hero h2 { font-size: 22px; }
    .auth-card { padding: 24px 18px; }
    .auth-card h1 { font-size: 28px; }
    .auth-links-row { gap: 10px; }
    .landing-nav-links { width: 100%; }
    .landing-nav-links a,
    .landing-cta-row a { width: 100%; }
    .marketing-stats { grid-template-columns: 1fr; }
    .tutorial-actions a,
    .tutorial-actions button { width: 100%; }
    .landing-hero > div,
    .landing-card,
    .landing-spec,
    .landing-footer,
    .marketing-cta,
    .marketing-card,
    .donation-section {
        padding: 18px;
    }

    table { min-width: 460px; }
    .profile-table { min-width: 420px; }
    th, td {
        font-size: 12px;
        padding: 8px 10px;
    }
    .badge { font-size: 11px; }

    .settings-table { min-width: 420px; }
    .device-table { min-width: 430px; }
    .device-table--wide { min-width: 560px; }

    .device-table--wide th:nth-child(3),
    .device-table--wide td:nth-child(3),
    .device-table--wide th:nth-child(4),
    .device-table--wide td:nth-child(4),
    .device-table--wide th:nth-child(5),
    .device-table--wide td:nth-child(5),
    .device-table--wide th:nth-child(9),
    .device-table--wide td:nth-child(9),
    .device-table--wide th:nth-child(10),
    .device-table--wide td:nth-child(10) {
        display: none;
    }
}

@media print {
    body {
        background: #fff !important;
    }
    body::before,
    body::after,
    .sidebar,
    .tutorial-actions {
        display: none !important;
    }
    .app-shell {
        grid-template-columns: 1fr !important;
    }
    .content {
        padding: 0 !important;
    }
    .panel,
    .card,
    .table-wrap {
        box-shadow: none !important;
        border: 1px solid #cbd5e1 !important;
        background: #fff !important;
    }
}
