:root {
    --navy-950: #0a192f;
    --navy-900: #0f2544;
    --navy-800: #173661;
    --navy-700: #1e4b85;
    --saffron-600: #d97706;
    --saffron-500: #f59e0b;
    --saffron-100: #fef3c7;
    --emerald-700: #047857;
    --emerald-600: #059669;
    --emerald-100: #d1fae5;
    --rose-700: #be123c;
    --rose-100: #ffe4e6;
    --sky-700: #0369a1;
    --sky-100: #e0f2fe;
    --indigo-700: #4338ca;
    --indigo-100: #e0e7ff;
    --amber-700: #b45309;
    --amber-100: #fef3c7;
    --slate-900: #0f172a;
    --slate-800: #1e293b;
    --slate-700: #334155;
    --slate-600: #475569;
    --slate-500: #64748b;
    --slate-400: #94a3b8;
    --slate-300: #cbd5e1;
    --slate-200: #e5eaf1;
    --slate-100: #f1f5f9;
    --slate-50: #f8fafc;
    --bg-canvas: #f3f6fb;
    --sidebar-width: 262px;
    --radius: 14px;
    --radius-sm: 9px;
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.04), 0 1px 2px rgba(15, 23, 42, 0.03);
    --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.06);
    --font-sans: 'Segoe UI', 'Nirmala UI', 'Noto Sans Devanagari', 'Mangal', system-ui, -apple-system, BlinkMacSystemFont, Roboto, Arial, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.lang-switch {
    display: inline-flex;
    align-items: center;
    background: var(--slate-100);
    border: 1px solid var(--slate-200);
    border-radius: 999px;
    padding: 2px;
    gap: 2px;
}
.lang-pill {
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    color: var(--slate-600);
    text-decoration: none;
    transition: all 0.15s ease;
}
.lang-pill:hover { text-decoration: none; color: var(--navy-900); }
.lang-pill.active {
    background: var(--navy-900);
    color: #ffffff;
}

*, *::before, *::after { box-sizing: border-box; }
html, body {
    margin: 0;
    padding: 0;
    font-family: var(--font-sans);
    background: var(--bg-canvas);
    color: var(--slate-900);
    line-height: 1.55;
    font-size: 14.5px;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--navy-700); text-decoration: none; }
a:hover { text-decoration: underline; }

/* App Shell: Left Sidebar + Right Content */
.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #0a1b34 0%, #11294d 100%);
    color: #e2e8f0;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 50;
    border-right: 1px solid rgba(255, 255, 255, 0.07);
    transition: transform 0.22s ease;
}

.sidebar-tricolor {
    height: 3px;
    flex-shrink: 0;
    background: linear-gradient(90deg, #ff9933 0%, #ff9933 33.3%, #ffffff 33.3%, #ffffff 66.6%, #138808 66.6%, #138808 100%);
}

.sidebar-brand {
    padding: 18px 18px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #ffffff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.sidebar-brand:hover { text-decoration: none; }
.brand-emblem {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    background: linear-gradient(135deg, #fbbf24, #d97706);
    color: var(--navy-950);
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 16px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}
.brand-title { font-size: 17px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; }
.brand-subtitle { font-size: 11px; color: #94a3b8; margin-top: 2px; }

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 14px 12px;
}
.nav-section-label {
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
    padding: 10px 12px 6px;
}
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9.5px 12px;
    border-radius: 10px;
    color: #cbd5e1;
    font-size: 13.5px;
    font-weight: 500;
    margin-bottom: 3px;
    transition: background 0.15s, color 0.15s;
}
.sidebar-link svg {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
    opacity: 0.8;
}
.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    text-decoration: none;
}
.sidebar-link.active {
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.2), rgba(245, 158, 11, 0.06));
    color: #fcd34d;
    font-weight: 600;
    box-shadow: inset 3px 0 0 #f59e0b;
}
.sidebar-link.active svg { opacity: 1; color: #fbbf24; }

.sidebar-footer {
    padding: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.15);
}
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}
.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
    color: #fcd34d;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 13px;
    flex-shrink: 0;
}
.user-meta { min-width: 0; }
.user-name { font-size: 13px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11px; color: #94a3b8; }

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

.topbar {
    height: 60px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--slate-200);
    padding: 0 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    position: sticky;
    top: 0;
    z-index: 30;
}
.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.gov-crumbs { font-size: 12.5px; color: var(--slate-500); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gov-crumbs strong { color: var(--navy-900); }
.topbar-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.menu-toggle {
    display: none;
    background: #fff;
    border: 1px solid var(--slate-200);
    border-radius: 8px;
    padding: 6px 9px;
    cursor: pointer;
    color: var(--navy-900);
}
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 45;
}

@media (max-width: 992px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .sidebar-backdrop.open { display: block; }
    .main-wrapper { margin-left: 0; }
    .menu-toggle { display: inline-flex; align-items: center; justify-content: center; }
    .topbar { padding: 0 16px; }
}

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 28px; }
@media (max-width: 768px) { .container { padding: 0 16px; } }
.main-content { padding: 24px 0 48px; flex: 1; }

/* Cards & Surfaces */
.card {
    background: #ffffff;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.card-header {
    padding: 16px 22px;
    border-bottom: 1px solid var(--slate-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.card-title { margin: 0; font-size: 15.5px; font-weight: 700; color: var(--navy-900); }
.card-body { padding: 22px; }

/* Grids */
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1120px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* Stat Cards */
.stat-card {
    background: #ffffff;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius);
    padding: 18px 20px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    background: #eef2ff;
    color: var(--navy-700);
}
.stat-card.emerald .stat-icon { background: #ecfdf5; color: var(--emerald-700); }
.stat-card.saffron .stat-icon { background: #fffbeb; color: var(--saffron-600); }
.stat-card.indigo .stat-icon { background: #eef2ff; color: var(--indigo-700); }
.stat-card.rose .stat-icon { background: #fff1f2; color: var(--rose-700); }
.stat-label { font-size: 12px; color: var(--slate-500); font-weight: 600; }
.stat-value { font-size: 26px; font-weight: 800; color: var(--navy-900); margin-top: 4px; line-height: 1.15; letter-spacing: -0.02em; }
.stat-sub { font-size: 12px; color: var(--slate-500); margin-top: 5px; }

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 22px;
}
.page-title { margin: 0; font-size: 22px; font-weight: 800; color: var(--navy-900); letter-spacing: -0.02em; }
.page-subtitle { margin: 3px 0 0; color: var(--slate-500); font-size: 13.5px; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 16px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease;
    line-height: 1.25;
    font-family: inherit;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-sm { padding: 6px 12px; font-size: 12.5px; border-radius: 7px; }
.btn-lg { padding: 11px 20px; font-size: 14.5px; border-radius: 10px; }
.btn-primary { background: var(--navy-900); color: #ffffff; }
.btn-primary:hover { background: var(--navy-800); color: #ffffff; }
.btn-saffron { background: var(--saffron-600); color: #ffffff; }
.btn-saffron:hover { background: #b45309; color: #ffffff; }
.btn-emerald { background: var(--emerald-700); color: #ffffff; }
.btn-emerald:hover { background: var(--emerald-600); color: #ffffff; }
.btn-danger { background: var(--rose-700); color: #ffffff; }
.btn-danger:hover { background: #9f1239; color: #ffffff; }
.btn-outline { background: #ffffff; color: var(--slate-700); border-color: var(--slate-300); }
.btn-outline:hover { background: var(--slate-50); color: var(--navy-900); border-color: var(--slate-400); }

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
}
.badge-emerald { background: var(--emerald-100); color: var(--emerald-700); }
.badge-amber { background: var(--amber-100); color: var(--amber-700); }
.badge-rose { background: var(--rose-100); color: var(--rose-700); }
.badge-sky { background: var(--sky-100); color: var(--sky-700); }
.badge-indigo { background: var(--indigo-100); color: var(--indigo-700); }
.badge-slate { background: var(--slate-100); color: var(--slate-700); }

/* Alerts */
.alert { padding: 13px 16px; border-radius: 10px; margin-bottom: 18px; border: 1px solid transparent; font-size: 13.5px; }
.alert-success { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.alert-error { background: #fff1f2; border-color: #fecdd3; color: #9f1239; }
.alert-info { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }
.alert-warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }

/* Tables */
.table-wrap { width: 100%; overflow-x: auto; }
table.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data-table th {
    text-align: left;
    padding: 11px 14px;
    background: #f8fafc;
    color: var(--slate-500);
    font-weight: 700;
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--slate-200);
    white-space: nowrap;
}
table.data-table td { padding: 13px 14px; border-bottom: 1px solid var(--slate-100); vertical-align: middle; }
table.data-table tr:last-child td { border-bottom: none; }
table.data-table tr:hover td { background: #f8fbff; }

/* Forms */
.form-section { margin-bottom: 24px; padding-bottom: 22px; border-bottom: 1px solid var(--slate-100); }
.form-section:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.form-section-title { font-size: 14.5px; font-weight: 700; color: var(--navy-900); margin: 0 0 14px; display: flex; align-items: center; gap: 8px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 18px; }
@media (max-width: 768px) { .form-grid, .form-grid-3 { grid-template-columns: 1fr; } }
.col-span-full { grid-column: 1 / -1; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-label { font-size: 12.5px; font-weight: 600; color: var(--slate-700); }
.req { color: var(--rose-700); }
.form-control {
    width: 100%;
    padding: 9.5px 12px;
    border: 1px solid var(--slate-300);
    border-radius: 8px;
    font-size: 13.5px;
    font-family: inherit;
    background: #ffffff;
    color: var(--slate-900);
    transition: border-color 0.15s, box-shadow 0.15s;
}
.form-control:focus { outline: none; border-color: var(--navy-700); box-shadow: 0 0 0 3px rgba(30, 75, 133, 0.12); }
.form-hint { font-size: 11.5px; color: var(--slate-500); }

.mono { font-family: var(--font-mono); font-size: 12.5px; }
.hash-pill { font-family: var(--font-mono); font-size: 11.5px; background: var(--slate-100); border: 1px solid var(--slate-200); padding: 3px 8px; border-radius: 6px; word-break: break-all; display: inline-block; color: var(--slate-800); }

/* Stepper */
.stepper { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin: 0 0 20px; }
@media (max-width: 900px) { .stepper { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.step-item { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--slate-200); background: #fff; font-size: 12px; }
.step-item.done { background: #ecfdf5; border-color: #6ee7b7; color: #065f46; }
.step-item.active { background: #eff6ff; border-color: #60a5fa; color: #1e3a8a; font-weight: 700; }
.step-item.returned { background: #fff1f2; border-color: #fda4af; color: #9f1239; }
.step-num { font-size: 10.5px; font-weight: 700; text-transform: uppercase; opacity: 0.7; }

/* Hero Banner Card */
.hero-banner {
    background: linear-gradient(135deg, #0b1f3a 0%, #173a6b 65%, #1e4b85 100%);
    color: #ffffff;
    border-radius: 18px;
    padding: 32px;
    margin-bottom: 22px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}
.hero-banner h1 { margin: 0 0 10px; font-size: 27px; font-weight: 800; line-height: 1.22; letter-spacing: -0.02em; }
.hero-banner p { margin: 0; color: #dbeafe; font-size: 14.5px; max-width: 560px; }

/* Portal Cards */
.portal-card {
    background: #ffffff;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius);
    padding: 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 12px;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.portal-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--slate-300); }

/* Blockchain Blocks */
.block-card { border: 1px solid var(--slate-200); border-left: 4px solid var(--emerald-600); border-radius: 10px; padding: 14px 16px; background: #ffffff; margin-bottom: 12px; }
.block-card.broken { border-left-color: var(--rose-700); background: #fff1f2; }

.site-footer { padding: 18px 0; font-size: 12.5px; color: var(--slate-500); border-top: 1px solid var(--slate-200); background: #ffffff; }

/* Utilities */
.flex { display: flex; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.flex-wrap { flex-wrap: wrap; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 18px; }
.text-sm { font-size: 13px; }
.text-xs { font-size: 12px; }
.text-muted { color: var(--slate-500); }
.font-bold { font-weight: 700; }

@media print {
    .sidebar, .sidebar-backdrop, .topbar, .site-footer, .no-print { display: none !important; }
    .main-wrapper { margin-left: 0 !important; }
    body { background: #ffffff; }
    .main-content { padding: 0; }
    .card { border: none; box-shadow: none; }
}
