/* ============================================================
   SS Udaan — Design System v3
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* ─── Tokens ─────────────────────────────────────────────── */
:root {
    --primary:          #6366f1;
    --primary-dark:     #4f46e5;
    --primary-light:    rgba(99,102,241,0.10);
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
    --accent-gradient:  linear-gradient(135deg, #06b6d4 0%, #6366f1 100%);

    --bg-page:   #f1f5f9;
    --bg-card:   rgba(255,255,255,0.82);
    --bg-input:  rgba(255,255,255,0.9);

    --text-main:  #0f172a;
    --text-sub:   #334155;
    --text-muted: #64748b;
    --text-light: #94a3b8;

    --border:        rgba(226,232,240,0.8);
    --border-focus:  rgba(99,102,241,0.5);

    --glass-blur:   blur(20px);
    --glass-shadow: 0 4px 24px rgba(15,23,42,0.06), 0 1px 4px rgba(15,23,42,0.04);
    --glass-shadow-lg: 0 12px 48px rgba(15,23,42,0.10), 0 2px 8px rgba(15,23,42,0.05);
    --glass-border: 1px solid rgba(255,255,255,0.85);

    --sidebar-w:  272px;

    --status-new:         #3b82f6;
    --status-applied:     #f59e0b;
    --status-approved:    #10b981;
    --status-rejected:    #ef4444;
    --status-eligible:    #94a3b8;
    --status-shortlisted: #8b5cf6;

    --radius-sm:  8px;
    --radius:     14px;
    --radius-lg:  20px;
    --radius-xl:  24px;

    --transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── Reset & Base ──────────────────────────────────────── */
*, *::before, *::after {
    margin: 0; padding: 0; box-sizing: border-box;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    background: var(--bg-page);
    color: var(--text-main);
    display: flex;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* Subtle mesh bg */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 50% at 20% 10%,  rgba(99,102,241,0.06) 0%, transparent 70%),
        radial-gradient(ellipse 50% 40% at 85% 80%,  rgba(168,85,247,0.05) 0%, transparent 70%),
        radial-gradient(ellipse 40% 30% at 60% 30%,  rgba(6,182,212,0.04)  0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* ─── Scrollbar ──────────────────────────────────────────── */
::-webkit-scrollbar       { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

::selection { background: rgba(99,102,241,0.18); color: var(--primary-dark); }

/* ─── Sidebar ────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-w);
    position: fixed;
    top: 0; left: 0; bottom: 0;
    background: rgba(255,255,255,0.88);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-right: 1px solid var(--border);
    box-shadow: 2px 0 20px rgba(15,23,42,0.04);
    display: flex;
    flex-direction: column;
    padding: 28px 16px 24px;
    z-index: 100;
    gap: 0;
}

.sidebar-title {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 0 10px;
    margin-bottom: 32px;
    font-size: 1.25rem;
    font-weight: 900;
    letter-spacing: -0.5px;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-section-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.4px;
    color: var(--text-light);
    padding: 0 14px;
    margin: 4px 0 6px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 10px 14px;
    border-radius: var(--radius);
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.88rem;
    text-decoration: none;
    transition: var(--transition);
    border: 1px solid transparent;
    margin-bottom: 3px;
    position: relative;
}

.nav-link:hover {
    background: rgba(99,102,241,0.07);
    color: var(--primary);
    border-color: rgba(99,102,241,0.12);
    transform: translateX(3px);
}

.nav-link.active {
    background: var(--primary-gradient);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 14px rgba(99,102,241,0.35);
    font-weight: 600;
}

.nav-link:active { transform: scale(0.97) !important; }

.nav-icon {
    width: 18px; height: 18px;
    margin-right: 11px;
    flex-shrink: 0;
    opacity: 0.85;
}

.nav-link.active .nav-icon { opacity: 1; }

/* ─── Main Content ───────────────────────────────────────── */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-w);
    padding: 36px 44px;
    max-width: calc(100vw - var(--sidebar-w));
    position: relative;
    z-index: 1;
}

/* ─── Page Header ─────────────────────────────────────────── */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.page-title {
    font-size: 1.85rem;
    font-weight: 800;
    letter-spacing: -0.6px;
    color: var(--text-main);
    line-height: 1.2;
}

/* ─── Cards ──────────────────────────────────────────────── */
.card {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: var(--radius-lg);
    padding: 28px;
    margin-bottom: 24px;
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.card:hover {
    box-shadow: var(--glass-shadow-lg);
    transform: translateY(-1px);
}

/* ─── Metric Grid ────────────────────────────────────────── */
.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-bottom: 26px;
}

.metric-card {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: var(--radius-lg);
    padding: 22px 24px;
    transition: var(--transition);
    cursor: pointer;
    display: block;
    color: inherit;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.metric-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.5), transparent);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    border-radius: inherit;
}

.metric-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--glass-shadow-lg);
}

.metric-card:hover::after { opacity: 1; }
.metric-card:active { transform: scale(0.97) translateY(0); }

.metric-card h3 {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-muted);
    margin-bottom: 14px;
}

.metric-card .value {
    font-size: 2.4rem;
    font-weight: 900;
    letter-spacing: -1px;
    line-height: 1;
}

/* ─── Tables ──────────────────────────────────────────────── */
.table-container {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    border: var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

th, td {
    padding: 15px 22px;
    text-align: left;
}

th {
    padding-top: 13px;
    padding-bottom: 13px;
    background: rgba(241,245,249,0.7);
    border-bottom: 1px solid var(--border);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    white-space: nowrap;
}

td {
    border-bottom: 1px solid rgba(226,232,240,0.4);
    font-size: 0.9rem;
    vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none; }

tbody tr {
    transition: background 0.15s;
}

tbody tr:hover td {
    background: rgba(99,102,241,0.025);
}

/* ─── Badges ──────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    border-radius: 99px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.badge::before {
    content: '';
    width: 5px; height: 5px;
    border-radius: 50%;
    flex-shrink: 0;
}

.badge-new           { background: rgba( 59,130,246,0.10); color: #2563eb; }
.badge-new::before   { background: #2563eb; }

.badge-applied           { background: rgba(245,158, 11,0.10); color: #d97706; }
.badge-applied::before   { background: #d97706; }

.badge-approved           { background: rgba( 16,185,129,0.10); color: #059669; }
.badge-approved::before   { background: #059669; }

.badge-rejected           { background: rgba(239, 68, 68,0.10); color: #dc2626; }
.badge-rejected::before   { background: #dc2626; }

.badge-not_eligible           { background: rgba(148,163,184,0.10); color: #64748b; }
.badge-not_eligible::before   { background: #94a3b8; }

.badge-shortlisted           { background: rgba(139, 92,246,0.10); color: #7c3aed; }
.badge-shortlisted::before   { background: #7c3aed; }

.badge-bin           { background: rgba(100, 116, 139, 0.10); color: #64748b; }
.badge-bin::before   { background: #475569; }

/* ─── Buttons ─────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 10px 20px;
    border-radius: var(--radius);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: var(--transition);
    white-space: nowrap;
    line-height: 1;
}

.btn:active { transform: scale(0.96); }

.btn-primary {
    background: var(--primary-gradient);
    color: #fff;
    box-shadow: 0 4px 14px rgba(99,102,241,0.30);
}

.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(99,102,241,0.42);
    transform: translateY(-2px);
}

.btn-secondary {
    background: rgba(255,255,255,0.9);
    color: var(--text-sub);
    border: 1px solid var(--border);
    box-shadow: 0 1px 4px rgba(15,23,42,0.04);
}

.btn-secondary:hover {
    background: #fff;
    border-color: rgba(99,102,241,0.3);
    color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(15,23,42,0.07);
}

/* ─── Forms ───────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }

.form-group label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-sub);
    margin-bottom: 7px;
    letter-spacing: 0.2px;
}

.form-control {
    width: 100%;
    padding: 11px 15px;
    background: var(--bg-input);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-family: inherit;
    color: var(--text-main);
    transition: var(--transition);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.form-control:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(99,102,241,0.10);
}

.form-control::placeholder { color: var(--text-light); }

select.form-control {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

textarea.form-control { resize: vertical; line-height: 1.7; }

/* ─── Filter Bar ──────────────────────────────────────────── */
.filter-bar {
    display: flex;
    gap: 12px;
    align-items: center;
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    border: var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

/* ─── Detail Grid ─────────────────────────────────────────── */
.detail-grid {
    display: grid;
    grid-template-columns: 1.7fr 1fr;
    gap: 24px;
    align-items: start;
}

/* ─── Pagination ──────────────────────────────────────────── */
.pagination {
    display: flex;
    list-style: none;
    gap: 6px;
    justify-content: center;
    flex-wrap: wrap;
}

.pagination li a,
.pagination li span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 38px; height: 38px;
    padding: 0 10px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-sub);
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition);
}

.pagination li a:hover {
    background: var(--primary-light);
    border-color: rgba(99,102,241,0.3);
    color: var(--primary);
}

.pagination li.active span {
    background: var(--primary-gradient);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 12px rgba(99,102,241,0.35);
    font-weight: 700;
}

.pagination li.disabled span { opacity: 0.4; cursor: not-allowed; }

/* ─── Alerts / Banners ────────────────────────────────────── */
.alert-danger {
    background: rgba(239,68,68,0.07);
    border: 1px solid rgba(239,68,68,0.2);
    color: #dc2626;
    padding: 13px 18px;
    border-radius: var(--radius);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.alert-success {
    background: rgba(16,185,129,0.08);
    border: 1px solid rgba(16,185,129,0.22);
    color: #059669;
    padding: 13px 18px;
    border-radius: var(--radius);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

/* ─── Responsive ──────────────────────────────────────────── */
