:root {
    --primary: #e7173a;
    --primary-hover: #da3713;
    --secondary: #10B981;
    --dark: #1e293b;
    --light: #f8fafc;
    --danger: #EF4444;
    --warning: #F59E0B;
    --info: #3B82F6;
    --indigo: #6366F1;
    --teal: #14B8A6;
    --emerald: #059669;
}

body {
    background-color: #f1f5f9;
    font-family: 'Inter', sans-serif;
    color: var(--dark);
    -webkit-font-smoothing: antialiased;
}

/* ============================================ */
/* NAVBAR                                       */
/* ============================================ */
.navbar {
    background: rgba(255, 255, 255, 0.9) !important;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.navbar-brand {
    font-weight: 700;
    color: var(--primary) !important;
    letter-spacing: -0.5px;
}

.nav-link {
    font-weight: 500;
    color: var(--dark) !important;
    transition: color 0.2s ease;
}

.nav-link:hover {
    color: var(--primary) !important;
}

/* ============================================ */
/* AUTH CARDS                                    */
/* ============================================ */
.auth-card {
    border: none;
    border-radius: 1rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    background: #ffffff;
    overflow: hidden;
}

.auth-header {
    background: linear-gradient(135deg, var(--primary), #818CF8);
    padding: 2rem;
    text-align: center;
    color: white;
}

.auth-header h3 {
    margin: 0;
    font-weight: 700;
}

/* ============================================ */
/* FORMS                                        */
/* ============================================ */
.form-control,
.form-select {
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    border: 1px solid #cbd5e1;
}

.form-control:focus,
.form-select:focus {
    box-shadow: 0 0 0 4px rgba(231, 23, 58, 0.1);
    border-color: var(--primary);
}

/* ============================================ */
/* BUTTONS                                      */
/* ============================================ */
.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(231, 23, 58, 0.2);
}

/* ============================================ */
/* CARDS                                        */
/* ============================================ */
.dashboard-card {
    border: none;
    border-radius: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease;
}

.dashboard-card:hover {
    transform: translateY(-2px);
}

/* ============================================ */
/* HERO                                         */
/* ============================================ */
.hero-section {
    padding: 6rem 0;
    background: linear-gradient(rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.9)), url('https://images.unsplash.com/photo-1541339907198-e08756dedf3f?ixlib=rb-4.0.3&auto=format&fit=crop&w=1920&q=80') center/cover;
    min-height: calc(100vh - 76px);
    display: flex;
    align-items: center;
}

/* ============================================ */
/* STATUS BADGES                                */
/* ============================================ */
.status-badge {
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-weight: 600;
    font-size: 0.875rem;
    white-space: nowrap;
}

.status-pending {
    background-color: #FEF3C7;
    color: #D97706;
}

.status-approved {
    background-color: #D1FAE5;
    color: #059669;
}

.status-rejected {
    background-color: #FEE2E2;
    color: #DC2626;
}

.status-in-progress {
    background-color: #DBEAFE;
    color: #2563EB;
}

.status-query {
    background-color: #E0E7FF;
    color: #4F46E5;
}

/* ============================================ */
/* TABLES                                       */
/* ============================================ */
.table-glass {
    background: white;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

thead {
    background-color: #f8fafc;
}

th {
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    color: #64748b;
    padding: 1rem !important;
}

td {
    padding: 1rem !important;
    vertical-align: middle;
}

/* ============================================ */
/* STAGE TRACKER / TIMELINE                     */
/* ============================================ */
.stage-tracker {
    position: relative;
    padding: 0;
}

.stage-item {
    display: flex;
    position: relative;
    padding-bottom: 0;
    margin-bottom: 0;
}

.stage-item.stage-last {
    padding-bottom: 0;
}

.stage-connector {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-right: 16px;
    min-width: 36px;
}

.stage-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
    z-index: 1;
    transition: all 0.3s ease;
}

.stage-line {
    width: 3px;
    flex-grow: 1;
    min-height: 32px;
    transition: background 0.3s ease;
}

/* Stage Status Colors */
.stage-approved .stage-icon {
    background: #D1FAE5;
    color: #059669;
}
.stage-approved .stage-line {
    background: linear-gradient(to bottom, #10B981, #10B981);
}

.stage-rejected .stage-icon {
    background: #FEE2E2;
    color: #DC2626;
}
.stage-rejected .stage-line {
    background: linear-gradient(to bottom, #EF4444, #E5E7EB);
}

.stage-pending .stage-icon {
    background: #F1F5F9;
    color: #94A3B8;
    border: 2px dashed #CBD5E1;
}
.stage-pending .stage-line {
    background: #E5E7EB;
    border-left: 2px dashed #CBD5E1;
    width: 0;
    margin-left: 1.5px;
}

.stage-content {
    flex: 1;
    background: white;
    border-radius: 10px;
    padding: 14px 18px;
    margin-bottom: 12px;
    border: 1px solid #E2E8F0;
    transition: all 0.2s;
}

.stage-approved .stage-content {
    border-left: 3px solid #10B981;
}

.stage-rejected .stage-content {
    border-left: 3px solid #EF4444;
    background: #FFF5F5;
}

.stage-pending .stage-content {
    border-left: 3px solid #CBD5E1;
    opacity: 0.7;
}

.stage-title {
    font-size: 0.925rem;
    font-weight: 600;
    color: var(--dark);
    margin: 0;
}

.stage-status-badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.stage-badge-approved {
    background: #D1FAE5;
    color: #059669;
}

.stage-badge-rejected {
    background: #FEE2E2;
    color: #DC2626;
}

.stage-badge-pending {
    background: #F1F5F9;
    color: #94A3B8;
}

.stage-remarks {
    padding: 8px 12px;
    background: #F8FAFC;
    border-radius: 6px;
    border-left: 2px solid #CBD5E1;
}

.rejection-alert {
    background: linear-gradient(135deg, #FEE2E2, #FECACA) !important;
    border-left: 4px solid #DC2626 !important;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Compact variant for modals/sidebars */
.stage-tracker-compact .stage-icon {
    width: 28px;
    height: 28px;
    font-size: 12px;
}

.stage-tracker-compact .stage-connector {
    margin-right: 12px;
    min-width: 28px;
}

.stage-tracker-compact .stage-content {
    padding: 10px 14px;
    margin-bottom: 8px;
}

.stage-tracker-compact .stage-title {
    font-size: 0.825rem;
}

.stage-tracker-compact .stage-line {
    min-height: 20px;
}

/* ============================================ */
/* PANEL THEMES                                 */
/* ============================================ */
.panel-department .auth-header,
.panel-department .admin-nav {
    background: linear-gradient(135deg, #0D9488, #14B8A6) !important;
}

.panel-counsellor .auth-header,
.panel-counsellor .admin-nav {
    background: linear-gradient(135deg, #4F46E5, #6366F1) !important;
}

.panel-admission .auth-header,
.panel-admission .admin-nav {
    background: linear-gradient(135deg, #059669, #10B981) !important;
}

.panel-admin .admin-nav {
    background-color: var(--dark) !important;
}

/* ============================================ */
/* DOCUMENT CARDS                               */
/* ============================================ */
.doc-card {
    transition: all 0.2s;
    border: 1px solid #E2E8F0;
}

.doc-card:hover {
    border-color: var(--primary) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* ============================================ */
/* CREDIT DISPLAY                               */
/* ============================================ */
.credit-display {
    background: linear-gradient(135deg, #F0FDF4, #ECFDF5);
    border: 1px solid #BBF7D0;
    border-radius: 12px;
    padding: 20px;
}

.credit-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    border: 4px solid;
}

.credit-accepted {
    border-color: #10B981;
    color: #059669;
    background: #D1FAE5;
}

.credit-remaining {
    border-color: #F59E0B;
    color: #D97706;
    background: #FEF3C7;
}

/* ============================================ */
/* INFO LABELS (admin review)                   */
/* ============================================ */
.info-label {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.info-value {
    font-size: 1rem;
    color: #1e293b;
    font-weight: 500;
    margin-bottom: 1.5rem;
}

/* ============================================ */
/* NOC STYLES                                   */
/* ============================================ */
.noc-preview {
    border: 2px solid #1e293b;
    background: white;
    padding: 40px;
    font-family: 'Times New Roman', Times, serif;
}

.noc-preview .noc-header {
    text-align: center;
    border-bottom: 3px double #1e293b;
    padding-bottom: 20px;
    margin-bottom: 30px;
}

.noc-preview .noc-body {
    line-height: 2;
    font-size: 15px;
}

/* ============================================ */
/* ANIMATIONS                                   */
/* ============================================ */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in-up {
    animation: fadeInUp 0.4s ease-out;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.pulse-animation {
    animation: pulse 2s infinite;
}

/* ============================================ */
/* PANEL SIDEBAR                                */
/* ============================================ */
.panel-layout {
    display: flex;
    min-height: calc(100vh - 64px);
}

.panel-sidebar {
    width: 260px;
    background: white;
    border-right: 1px solid #E2E8F0;
    flex-shrink: 0;
    padding: 0;
    position: sticky;
    top: 64px;
    height: calc(100vh - 64px);
    overflow-y: auto;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.03);
}

.sidebar-header {
    padding: 24px 20px 16px;
    border-bottom: 1px solid #E2E8F0;
}

.sidebar-header h6 {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #94A3B8;
    font-weight: 700;
    margin-bottom: 0;
}

.sidebar-nav {
    padding: 8px 12px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 16px;
    margin: 2px 0;
    border-radius: 10px;
    color: #475569;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.sidebar-link:hover {
    background: #F1F5F9;
    color: #1E293B;
    transform: translateX(2px);
}

.sidebar-link.active {
    background: linear-gradient(135deg, #EEF2FF, #E0E7FF);
    color: #4F46E5;
    font-weight: 600;
}

.sidebar-link .sidebar-icon {
    width: 20px;
    text-align: center;
    margin-right: 10px;
    font-size: 0.85rem;
}

.sidebar-link .sidebar-label {
    flex: 1;
}

.sidebar-link .sidebar-badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 20px;
    min-width: 28px;
    text-align: center;
}

.sidebar-badge-all {
    background: #E0E7FF;
    color: #4F46E5;
}

.sidebar-badge-pending {
    background: #FEF3C7;
    color: #D97706;
}

.sidebar-badge-approved {
    background: #D1FAE5;
    color: #059669;
}

.sidebar-badge-rejected {
    background: #FEE2E2;
    color: #DC2626;
}

/* Active state badge overrides */
.sidebar-link.active .sidebar-badge {
    background: rgba(79, 70, 229, 0.15);
    color: #4F46E5;
}

/* Department panel active colors */
.panel-department .sidebar-link.active {
    background: linear-gradient(135deg, #F0FDFA, #CCFBF1);
    color: #0D9488;
}
.panel-department .sidebar-link.active .sidebar-badge {
    background: rgba(13, 148, 136, 0.15);
    color: #0D9488;
}

/* Counsellor panel active colors */
.panel-counsellor .sidebar-link.active {
    background: linear-gradient(135deg, #EEF2FF, #E0E7FF);
    color: #4F46E5;
}
.panel-counsellor .sidebar-link.active .sidebar-badge {
    background: rgba(79, 70, 229, 0.15);
    color: #4F46E5;
}

/* Admission panel active colors */
.panel-admission .sidebar-link.active {
    background: linear-gradient(135deg, #ECFDF5, #D1FAE5);
    color: #059669;
}
.panel-admission .sidebar-link.active .sidebar-badge {
    background: rgba(5, 150, 105, 0.15);
    color: #059669;
}

/* Admin panel active colors */
.panel-admin .sidebar-link.active {
    background: linear-gradient(135deg, #F1F5F9, #E2E8F0);
    color: #1E293B;
}
.panel-admin .sidebar-link.active .sidebar-badge {
    background: rgba(30, 41, 59, 0.15);
    color: #1E293B;
}

.sidebar-divider {
    height: 1px;
    background: #E2E8F0;
    margin: 8px 16px;
}

.panel-main-content {
    flex: 1;
    min-width: 0;
    padding: 32px;
    background: #F1F5F9;
}

/* ============================================ */
/* RESPONSIVE                                   */
/* ============================================ */
@media (max-width: 768px) {
    .stage-tracker {
        padding-left: 0;
    }
    
    .stage-content {
        padding: 12px;
    }
    
    .hero-section {
        padding: 3rem 0;
        min-height: auto;
    }

    .panel-layout {
        flex-direction: column;
    }

    .panel-sidebar {
        width: 100%;
        height: auto;
        position: relative;
        top: 0;
        border-right: none;
        border-bottom: 1px solid #E2E8F0;
    }

    .sidebar-nav {
        display: flex;
        overflow-x: auto;
        padding: 8px;
        gap: 4px;
    }

    .sidebar-link {
        white-space: nowrap;
        padding: 8px 14px;
        font-size: 0.8rem;
    }

    .panel-main-content {
        padding: 16px;
    }
}