@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    --emerald-950: #022c22;
    --emerald-900: #064e3b;
    --emerald-800: #065f46;
    --emerald-700: #047857;
    --emerald-600: #059669;
    --emerald-500: #10b981;
    --emerald-100: #d1fae5;
    --emerald-50:  #ecfdf5;

    --slate-950: #020617;
    --slate-900: #0f172a;
    --slate-800: #1e293b;
    --slate-700: #334155;
    --slate-600: #475569;
    --slate-500: #64748b;
    --slate-400: #94a3b8;
    --slate-300: #cbd5e1;
    --slate-200: #e2e8f0;
    --slate-100: #f1f5f9;
    --slate-50:  #f8fafc;

    --gold-600: #d97706;
    --gold-500: #f59e0b;
    --gold-100: #fef3c7;

    --canvas: #f3f6f5;
    --sidebar-width: 272px;
    --topbar-height: 68px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 4px 16px -2px rgba(15, 23, 42, 0.08), 0 2px 6px -2px rgba(15, 23, 42, 0.04);
    --shadow-lg: 0 12px 32px -4px rgba(15, 23, 42, 0.12);
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--canvas);
    color: var(--slate-800);
    font-size: 0.9375rem;
    line-height: 1.55;
    margin: 0;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--emerald-700);
    text-decoration: none;
}

a:hover {
    color: var(--emerald-900);
}

/* ==================== PUBLIC HERO GATEWAY ==================== */
.gateway-hero {
    background: linear-gradient(135deg, var(--emerald-950) 0%, var(--emerald-900) 48%, #0c3d46 100%);
    color: #fff;
    position: relative;
    overflow: hidden;
}

.gateway-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 85% 20%, rgba(16, 185, 129, 0.22), transparent 55%),
                radial-gradient(circle at 12% 88%, rgba(245, 158, 11, 0.14), transparent 45%);
    pointer-events: none;
}

.gateway-nav {
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(8px);
}

.brand-crest {
    width: 48px;
    height: 48px;
    object-fit: contain;
    background: #fff;
    border-radius: 50%;
    padding: 3px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.gateway-card {
    background: #fff;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.gateway-card:hover {
    transform: translateY(-2px);
}

.auth-shell {
    min-height: 100vh;
    background: linear-gradient(155deg, var(--emerald-950) 0%, var(--emerald-900) 55%, var(--slate-900) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.auth-card {
    width: 100%;
    max-width: 460px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
    overflow: hidden;
}

.auth-card-wide {
    max-width: 720px;
}

.auth-card-header {
    background: linear-gradient(135deg, var(--emerald-900), var(--emerald-800));
    color: #fff;
    padding: 1.75rem 2rem;
}

/* ==================== APP SHELL (SIDEBAR + MAIN) ==================== */
.app-shell {
    display: flex;
    min-height: 100vh;
}

.app-sidebar {
    width: var(--sidebar-width);
    background: var(--slate-900);
    color: #cbd5e1;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    transition: transform 0.25s ease;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.app-sidebar.sidebar-applicant {
    background: linear-gradient(180deg, var(--emerald-950) 0%, #053226 100%);
}

.sidebar-brand {
    padding: 1.15rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.09);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-brand img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #fff;
    padding: 2px;
    object-fit: contain;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0.75rem;
}

.sidebar-section-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.45);
    padding: 0.75rem 0.75rem 0.35rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.78);
    font-weight: 500;
    font-size: 0.885rem;
    margin-bottom: 2px;
    transition: all 0.15s ease;
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.09);
    color: #fff;
}

.sidebar-link.active {
    background: var(--emerald-600);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.35);
}

.sidebar-link .bi {
    font-size: 1.05rem;
    opacity: 0.9;
}

.sidebar-count {
    margin-left: auto;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    background: rgba(245, 158, 11, 0.2);
    color: #fcd34d;
}

.sidebar-link.active .sidebar-count {
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
}

.sidebar-footer {
    padding: 0.9rem 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.09);
    background: rgba(0, 0, 0, 0.15);
}

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

.app-topbar {
    height: var(--topbar-height);
    background: #fff;
    border-bottom: 1px solid var(--slate-200);
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1020;
}

.app-content {
    padding: 1.5rem;
    flex: 1;
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    z-index: 1035;
}

@media (max-width: 991.98px) {
    .app-sidebar {
        transform: translateX(-100%);
    }
    .app-sidebar.open {
        transform: translateX(0);
    }
    .sidebar-backdrop.show {
        display: block;
    }
    .app-main {
        margin-left: 0;
    }
    .app-content {
        padding: 1rem;
    }
}

/* ==================== CARDS & SURFACES ==================== */
.surface-card {
    background: #fff;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.25rem;
}

.surface-card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--slate-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.surface-card-body {
    padding: 1.25rem;
}

.kpi-card {
    background: #fff;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-md);
    padding: 1.15rem 1.25rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    height: 100%;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.kpi-card:hover {
    border-color: var(--emerald-500);
    box-shadow: var(--shadow-md);
}

.kpi-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--slate-900);
    line-height: 1.15;
    letter-spacing: -0.02em;
}

.kpi-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--slate-500);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.kpi-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.kpi-icon.emerald { background: var(--emerald-50); color: var(--emerald-700); }
.kpi-icon.gold    { background: var(--gold-100); color: var(--gold-600); }
.kpi-icon.blue    { background: #eff6ff; color: #1d4ed8; }
.kpi-icon.indigo  { background: #eef2ff; color: #4338ca; }
.kpi-icon.rose    { background: #fff1f2; color: #be123c; }

/* ==================== BUTTONS ==================== */
.btn-emerald {
    background: var(--emerald-700);
    border-color: var(--emerald-700);
    color: #fff;
    font-weight: 600;
}

.btn-emerald:hover, .btn-emerald:focus {
    background: var(--emerald-800);
    border-color: var(--emerald-800);
    color: #fff;
}

.btn-outline-emerald {
    color: var(--emerald-700);
    border-color: var(--emerald-600);
    font-weight: 600;
}

.btn-outline-emerald:hover {
    background: var(--emerald-700);
    color: #fff;
}

.btn {
    border-radius: 9px;
    font-weight: 600;
    font-size: 0.875rem;
}

.form-control, .form-select {
    border-radius: 9px;
    border-color: var(--slate-300);
    font-size: 0.9rem;
    padding: 0.55rem 0.85rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--emerald-600);
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.14);
}

.form-label {
    font-weight: 600;
    font-size: 0.83rem;
    color: var(--slate-700);
    margin-bottom: 0.35rem;
}

/* ==================== BADGES ==================== */
.badge-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 700;
    white-space: nowrap;
}

.badge-emerald { background: #065f46; color: #fff; }
.badge-success { background: #dcfce7; color: #166534; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger  { background: #fee2e2; color: #991b1b; }
.badge-info    { background: #e0f2fe; color: #075985; }
.badge-indigo  { background: #e0e7ff; color: #3730a3; }
.badge-neutral { background: #f1f5f9; color: #475569; }

/* ==================== PIPELINE STEPPER ==================== */
.pipeline-stepper {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.5rem;
    position: relative;
}

@media (max-width: 991.98px) {
    .pipeline-stepper {
        grid-template-columns: repeat(2, 1fr);
    }
}

.pipeline-node {
    background: var(--slate-50);
    border: 1px solid var(--slate-200);
    border-radius: 10px;
    padding: 0.75rem;
    position: relative;
}

.pipeline-node.done {
    background: var(--emerald-50);
    border-color: #a7f3d0;
}

.pipeline-node.rejected {
    background: #fef2f2;
    border-color: #fecaca;
}

.pipeline-node.current {
    background: #fffbeb;
    border-color: #fcd34d;
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.15);
}

.pipeline-step-num {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 0.72rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--slate-200);
    color: var(--slate-700);
}

.pipeline-node.done .pipeline-step-num {
    background: var(--emerald-600);
    color: #fff;
}

.pipeline-node.rejected .pipeline-step-num {
    background: #dc2626;
    color: #fff;
}

.pipeline-node.current .pipeline-step-num {
    background: var(--gold-500);
    color: #fff;
}

/* ==================== TABLES ==================== */
.table-modern {
    margin-bottom: 0;
}

.table-modern thead th {
    background: var(--slate-50);
    color: var(--slate-600);
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--slate-200);
    padding: 0.75rem 0.9rem;
    white-space: nowrap;
}

.table-modern tbody td {
    padding: 0.8rem 0.9rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--slate-100);
    font-size: 0.875rem;
}

.table-modern tbody tr:hover {
    background: #f8fbfa;
}

.avatar-thumb {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    object-fit: cover;
    border: 1px solid var(--slate-200);
    background: var(--slate-100);
}

.avatar-lg {
    width: 112px;
    height: 128px;
    border-radius: 12px;
    object-fit: cover;
    border: 2px solid var(--slate-200);
    background: var(--slate-100);
}

.avatar-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--emerald-100);
    color: var(--emerald-800);
    font-weight: 800;
}

/* ==================== PRINT DOCUMENTS ==================== */
.official-document {
    max-width: 860px;
    margin: 1.5rem auto;
    background: #fff;
    padding: 2.25rem 2.75rem;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--slate-200);
}

@media print {
    body {
        background: #fff !important;
        color: #000 !important;
    }
    .no-print, .app-sidebar, .app-topbar, .sidebar-backdrop {
        display: none !important;
    }
    .app-main {
        margin-left: 0 !important;
    }
    .app-content {
        padding: 0 !important;
    }
    .official-document, .surface-card {
        box-shadow: none !important;
        border: none !important;
        margin: 0 !important;
        padding: 0 !important;
        max-width: 100% !important;
    }
}
