:root {
    --sidebar-bg: #10192e;
    --sidebar-bg-2: #1d2740;
    --sidebar-active: #2b3f6b;
    --sidebar-text: #b9c2d6;
    --brand: #1d2740;
    --brand-dark: #10192e;
    --brand-light: #3b5a99;
    --gold: #c9a227;
    --bg: #f4f6fb;
}

* { font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; }

body { background: var(--bg); color: #1e293b; }

/* ---------- Layout shell ---------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
    width: 260px;
    background: linear-gradient(180deg, var(--sidebar-bg), var(--sidebar-bg-2));
    color: var(--sidebar-text);
    position: fixed; top: 0; bottom: 0; left: 0;
    display: flex; flex-direction: column;
    transition: transform .25s ease;
    z-index: 1040;
}
.sidebar .brand {
    padding: 1.4rem 1.25rem;
    font-size: 1.15rem; font-weight: 700; color: #fff;
    display: flex; align-items: center; gap: .6rem;
    border-bottom: 1px solid rgba(255,255,255,.06);
}
.sidebar .brand i { color: var(--gold); }
.sidebar .brand img { height: 34px; width: 34px; border-radius: 50%; object-fit: cover; }
.sidebar .nav-link {
    color: var(--sidebar-text);
    padding: .7rem 1.25rem; margin: .15rem .6rem;
    border-radius: .6rem; display: flex; align-items: center; gap: .75rem;
    font-weight: 500; transition: all .18s ease;
}
.sidebar .nav-link i { width: 20px; text-align: center; }
.sidebar .nav-link:hover { background: rgba(255,255,255,.07); color: #fff; }
.sidebar .nav-link.active { background: var(--sidebar-active); color: #fff; box-shadow: 0 6px 16px rgba(29,39,64,.45); }
.sidebar .nav-section { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: #64748b; padding: 1rem 1.5rem .35rem; }
.sidebar-footer { margin-top: auto; padding: 1rem 1.25rem; border-top: 1px solid rgba(255,255,255,.06); }

.main { flex: 1; margin-left: 260px; display: flex; flex-direction: column; }
.topbar {
    height: 64px; background: #fff; border-bottom: 1px solid #e2e8f0;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 1.5rem; position: sticky; top: 0; z-index: 1030;
}
.content { padding: 1.75rem; }

/* ---------- Cards ---------- */
.card {
    border: none; border-radius: 1rem;
    box-shadow: 0 1px 3px rgba(15,23,42,.06), 0 1px 2px rgba(15,23,42,.04);
}
.stat-card { overflow: hidden; position: relative; animation: rise .45s ease both; }
.stat-card .icon {
    width: 52px; height: 52px; border-radius: .85rem;
    display: flex; align-items: center; justify-content: center; font-size: 1.3rem; color: #fff;
}
.stat-card .value { font-size: 1.9rem; font-weight: 700; line-height: 1; }
.stat-card .label { color: #64748b; font-size: .85rem; }

.bg-grad-indigo { background: linear-gradient(135deg,#6366f1,#4338ca); }
.bg-grad-green  { background: linear-gradient(135deg,#10b981,#059669); }
.bg-grad-amber  { background: linear-gradient(135deg,#f59e0b,#d97706); }
.bg-grad-red    { background: linear-gradient(135deg,#ef4444,#dc2626); }
.bg-grad-blue   { background: linear-gradient(135deg,#3b82f6,#2563eb); }
.bg-grad-slate  { background: linear-gradient(135deg,#64748b,#475569); }

@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.stat-card:nth-child(2){animation-delay:.05s}
.stat-card:nth-child(3){animation-delay:.1s}
.stat-card:nth-child(4){animation-delay:.15s}

/* ---------- Forms ---------- */
.form-card { max-width: 920px; }
.form-label { font-weight: 600; font-size: .85rem; color: #334155; }
.form-control, .form-select { border-radius: .6rem; padding: .6rem .85rem; border-color: #e2e8f0; }
.form-control:focus, .form-select:focus { border-color: var(--brand); box-shadow: 0 0 0 .2rem rgba(29,39,64,.15); }
.btn-brand { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-brand:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }

/* ---------- Document cards ---------- */
.doc-tile { border: 1px dashed #cbd5e1; border-radius: 1rem; overflow: hidden; transition: .2s; background: #fff; }
.doc-tile:hover { border-color: var(--brand); box-shadow: 0 8px 24px rgba(29,39,64,.12); }
.doc-thumb { height: 170px; background: #f8fafc; display: flex; align-items: center; justify-content: center; cursor: zoom-in; overflow: hidden; position: relative; }
.doc-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.doc-thumb .placeholder { color: #94a3b8; font-size: 2.2rem; }
.doc-thumb #preview- { display: none; }

/* ---------- Auth ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 2rem 1rem;
    background: radial-gradient(1200px 600px at 10% 10%, #2b3f6b 0%, transparent 60%),
                radial-gradient(1000px 500px at 90% 90%, #1d2740 0%, transparent 55%), #10192e; }
.auth-card { width: 100%; max-width: 460px; border-radius: 1.25rem; }
.auth-brand { text-align: center; color: #fff; margin-bottom: 1.25rem; }
.auth-brand img { height: 64px; margin-bottom: .5rem; }
.auth-brand .tagline { letter-spacing: .18em; font-size: .72rem; color: rgba(255,255,255,.55); text-transform: uppercase; }

.avatar-sm { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; }
.badge-soft { font-weight: 600; padding: .4em .7em; border-radius: .5rem; }

@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.show { transform: none; }
    .main { margin-left: 0; }
}
