/* ============================================================
   Tamanna Performance Portal – Custom Stylesheet
   ============================================================ */

:root {
    --sidebar-width: 260px;
    --topnav-height: 60px;
    --sidebar-bg: #1a1f36;
    --sidebar-text: #c5cae9;
    --sidebar-active-bg: rgba(99,102,241,0.15);
    --sidebar-active-text: #818cf8;
    --sidebar-section-color: #5c6186;
    --brand-primary: #6366f1;
    --brand-primary-hover: #4f46e5;
    --card-shadow: 0 10px 30px rgba(15, 23, 42, .08);
    --card-shadow-hover: 0 18px 35px rgba(15, 23, 42, .14);
    --transition: .25s ease;
}

[data-bs-theme="dark"] {
    --sidebar-bg: #0f172a;
    --sidebar-text: #94a3b8;
    --sidebar-active-bg: rgba(99,102,241,0.25);
    --topnav-bg: #1e293b;
    --page-bg: #0f172a;
    --card-bg: #1e293b;
}

/* ── Layout ───────────────────────────────────────────────── */
body {
    display: flex;
    min-height: 100vh;
    font-family: 'Segoe UI', system-ui, sans-serif;
    background:
        radial-gradient(circle at 0% 0%, rgba(99,102,241,0.08) 0%, rgba(99,102,241,0) 35%),
        radial-gradient(circle at 100% 0%, rgba(16,185,129,0.08) 0%, rgba(16,185,129,0) 30%),
        var(--bs-body-bg);
}

/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: linear-gradient(180deg, #121a32 0%, #1a1f36 100%);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 1030;
    transition: transform var(--transition), width var(--transition);
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar.collapsed {
    width: 72px;
}

.sidebar.collapsed .sidebar-brand-text,
.sidebar.collapsed .sidebar-user-name,
.sidebar.collapsed .sidebar-nav-link span,
.sidebar.collapsed .sidebar-nav-section,
.sidebar.collapsed .sidebar-footer-link span,
.sidebar.collapsed .badge-role {
    display: none;
}

.sidebar-header {
    padding: 1rem 1.2rem;
    border-bottom: 1px solid rgba(255,255,255,.10);
    backdrop-filter: blur(8px);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: .75rem;
    text-decoration: none;
    color: inherit;
}

.sidebar-brand-icon {
    width: 44px;
    height: 44px;
    background: var(--brand-primary);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: #fff;
    flex-shrink: 0;
}

.sidebar-user {
    display: flex;
    align-items: center;
    padding: 1rem 1.2rem;
    border-bottom: 1px solid rgba(255,255,255,.06);
}

.avatar-circle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--brand-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .85rem;
    flex-shrink: 0;
}

.sidebar-user-name {
    color: #e2e8f0;
    font-size: .875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-nav {
    list-style: none;
    padding: .75rem 0;
    margin: 0;
    flex: 1;
}

.sidebar-nav-section {
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--sidebar-section-color);
    padding: 1rem 1.4rem .4rem;
}

.sidebar-nav-item {
    margin: 1px 8px;
}

.sidebar-nav-link {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .55rem .85rem;
    color: var(--sidebar-text);
    text-decoration: none;
    border-radius: 12px;
    font-size: .875rem;
    transition: background var(--transition), color var(--transition), transform var(--transition);
    white-space: nowrap;
}

.sidebar-nav-link i {
    font-size: 1rem;
    width: 20px;
    flex-shrink: 0;
}

.sidebar-nav-link:hover,
.sidebar-nav-item.active .sidebar-nav-link {
    background: var(--sidebar-active-bg);
    color: var(--sidebar-active-text);
    transform: translateX(2px);
}

.sidebar-footer {
    padding: 1rem 1.2rem;
    border-top: 1px solid rgba(255,255,255,.08);
}

.sidebar-footer-link {
    display: flex;
    align-items: center;
    gap: .5rem;
    color: var(--sidebar-section-color);
    text-decoration: none;
    font-size: .8rem;
    transition: color var(--transition);
}

.sidebar-footer-link:hover { color: var(--sidebar-text); }

/* ── Main Content ────────────────────────────────────────── */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left var(--transition);
}

.main-content.expanded { margin-left: 72px; }

/* ── Top Nav ─────────────────────────────────────────────── */
.topnav {
    height: var(--topnav-height);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    background: rgba(255,255,255,.72);
    border-bottom: 1px solid rgba(15,23,42,.08);
    backdrop-filter: blur(8px);
    position: sticky;
    top: 0;
    z-index: 1020;
    gap: .75rem;
}

.page-content {
    padding: 1.5rem;
    flex: 1;
}

.page-footer { border-top: 1px solid var(--bs-border-color); }

/* ── Stat Cards ──────────────────────────────────────────── */
.stat-card {
    border: none;
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    transition: transform var(--transition), box-shadow var(--transition);
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--card-shadow-hover);
}

.stat-card .stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.1;
}

/* ── Chart Card ──────────────────────────────────────────── */
.chart-card {
    border: none;
    border-radius: 16px;
    box-shadow: var(--card-shadow);
}

/* ── Tables ──────────────────────────────────────────────── */
.table-card {
    border: none;
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    overflow: hidden;
}

.card {
    border: 1px solid rgba(148,163,184,.20);
    backdrop-filter: blur(8px);
}

.btn-primary {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    border: none;
    box-shadow: 0 8px 20px rgba(79,70,229,.25);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
    transform: translateY(-1px);
}

.form-control,
.form-select,
.input-group-text {
    border-radius: 10px;
    border-color: #dbe3ee;
}

.form-control:focus,
.form-select:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 .2rem rgba(99,102,241,.15);
}

/* ── Status Badges ───────────────────────────────────────── */
.badge-pending  { background-color: #f59e0b; color: #000; }
.badge-verified { background-color: #10b981; color: #fff; }
.badge-rejected { background-color: #ef4444; color: #fff; }

/* ── Auth Page ───────────────────────────────────────────── */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at 20% 20%, rgba(16,185,129,.25) 0%, transparent 35%),
        radial-gradient(circle at 80% 10%, rgba(99,102,241,.35) 0%, transparent 42%),
        linear-gradient(135deg, #0f172a 0%, #1e1b4b 45%, #0f172a 100%);
}

.auth-card {
    width: 100%;
    max-width: 420px;
    border: none;
    border-radius: 22px;
    border: 1px solid rgba(255,255,255,.20);
    background: rgba(255,255,255,.92);
    backdrop-filter: blur(12px);
    box-shadow: 0 24px 60px rgba(15,23,42,.32);
}

.auth-logo {
    width: 60px;
    height: 60px;
    background: var(--brand-primary);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: #fff;
    margin: 0 auto 1rem;
}

/* ── Performance Score ───────────────────────────────────── */
.score-badge {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--brand-primary);
}

/* ── Rank Badge ──────────────────────────────────────────── */
.rank-1  { color: #f59e0b; font-weight: 700; }
.rank-2  { color: #94a3b8; font-weight: 700; }
.rank-3  { color: #cd7f32; font-weight: 700; }

/* ── Print ───────────────────────────────────────────────── */
@media print {
    .sidebar, .topnav, .btn, .dataTables_filter,
    .dataTables_length, .alert, .no-print { display: none !important; }
    .main-content { margin-left: 0 !important; }
    .page-content { padding: 0 !important; }
    .table { font-size: .8rem; }
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.mobile-open {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
}

[data-bs-theme="dark"] .topnav {
    background: rgba(15,23,42,.72);
    border-bottom: 1px solid rgba(148,163,184,.18);
}

[data-bs-theme="dark"] .card {
    background: rgba(30,41,59,.92);
    border-color: rgba(148,163,184,.18);
}

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select,
[data-bs-theme="dark"] .input-group-text {
    border-color: #334155;
    background: #0f172a;
    color: #e2e8f0;
}
