/* =============================================
   SPK SAW SIKERMA — Premium Design System v2
   Sidebar: Elegant Green Edition
   ============================================= */

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

:root {
    /* Primary Navy */
    --primary:        #1a2e4a;
    --primary-mid:    #1e3a5f;
    --primary-light:  #2d5a8e;
    --primary-pale:   #e8f0fb;

    /* Accent Green */
    --accent:         #16a34a;
    --accent-light:   #22c55e;
    --accent-pale:    #dcfce7;

    /* Semantic */
    --danger:         #dc2626;
    --danger-pale:    #fee2e2;
    --warning:        #d97706;
    --warning-pale:   #fef3c7;
    --info:           #0284c7;
    --info-pale:      #e0f2fe;
    --purple:         #7c3aed;
    --purple-pale:    #ede9fe;

    /* Neutrals */
    --bg:             #f1f5f9;
    --surface:        #ffffff;
    --border:         #e2e8f0;
    --text:           #1e293b;
    --text-muted:     #64748b;
    --text-light:     #94a3b8;

    /* ===== SIDEBAR EMERALD GREEN ===== */
    --sidebar-width:  260px;
    --sidebar-bg:     #083327;           /* deep emerald green */
    --sidebar-top:    #05261d;           /* dark emerald top */
    --sidebar-hover:  rgba(16,185,129,0.14);
    --sidebar-active: rgba(16,185,129,0.22);
    --sidebar-border: rgba(255,255,255,0.08);
    --sidebar-text:   rgba(255,255,255,0.82);
    --sidebar-muted:  rgba(255,255,255,0.45);
    --sidebar-accent: #10b981;           /* emerald green matching login */

    /* Layout */
    --header-height:  64px;
    --radius-sm:      6px;
    --radius:         10px;
    --radius-lg:      14px;
    --radius-xl:      20px;

    /* Shadows */
    --shadow-sm:  0 1px 3px rgba(0,0,0,0.08);
    --shadow:     0 4px 16px rgba(0,0,0,0.08), 0 1px 4px rgba(0,0,0,0.04);
    --shadow-md:  0 8px 24px rgba(0,0,0,0.1);
    --shadow-lg:  0 16px 48px rgba(0,0,0,0.14);

    --transition:     0.22s cubic-bezier(0.4,0,0.2,1);
    --transition-slow:0.4s cubic-bezier(0.4,0,0.2,1);
}

/* ---- Reset ---- */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* =============================================
   NEW REFERENCE LOGIN CARD STYLES
   ============================================= */
.login-body-wrap {
    background: #f1f5f9;
    min-height: 100vh;
}

.login-page-ref {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    padding: 30px 16px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.login-card-container {
    width: 100%;
    max-width: 440px;
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    transition: transform 0.3s ease;
}

.login-header-banner {
    background: linear-gradient(135deg, #059669 0%, #10b981 50%, #0d9488 100%);
    padding: 36px 24px 28px;
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    text-align: center;
    color: #ffffff;
    position: relative;
}

.login-header-logo {
    width: 76px;
    height: 76px;
    background: #ffffff;
    border-radius: 20px;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
    padding: 8px;
    overflow: hidden;
}

.login-header-logo img,
.school-logo-img {
    max-width: 60px !important;
    max-height: 60px !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    display: block !important;
    margin: 0 auto !important;
}

.login-header-title {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    color: #ffffff;
    text-transform: uppercase;
}

.login-header-sub {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
    max-width: 320px;
    margin: 0 auto 12px;
    line-height: 1.45;
    font-weight: 400;
}

.login-header-school {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 5px 14px;
    border-radius: 99px;
    font-size: 12px;
    font-weight: 600;
    color: #ffffff;
}

.login-card-body {
    padding: 32px 32px 28px;
}

.login-body-title {
    font-size: 24px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 4px;
}

.login-body-sub {
    font-size: 13.5px;
    color: #64748b;
    margin-bottom: 28px;
}

.form-group-ref {
    margin-bottom: 20px;
}

.form-group-ref label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 13.5px;
    color: #334155;
}

.input-wrapper-ref {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon-left {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 2;
}

.input-icon-right {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
}

.form-control-ref {
    width: 100%;
    height: 48px;
    padding-left: 44px;
    padding-right: 44px;
    border: 1.5px solid #dce6f2;
    border-radius: 12px;
    font-size: 14px;
    font-family: inherit;
    color: #1e293b;
    background: #edf4fc;
    transition: all 0.2s ease;
    outline: none;
}

.form-control-ref:focus {
    background: #ffffff;
    border-color: #10b981;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.12);
}

.form-control-ref:hover:not(:focus) {
    border-color: #cbd5e1;
    background: #e8f0fe;
}

.btn-ref-submit {
    width: 100%;
    height: 50px;
    background: linear-gradient(90deg, #10b981 0%, #6366f1 100%);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-size: 15.5px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.35);
    transition: all 0.22s ease;
    margin-top: 10px;
}

.btn-ref-submit:hover {
    background: linear-gradient(90deg, #059669 0%, #4f46e5 100%);
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.45);
    transform: translateY(-1px);
}

.btn-ref-submit:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.login-ref-footer {
    margin-top: 24px;
    text-align: center;
    font-size: 12px;
    color: #94a3b8;
}

@media (max-width: 480px) {
    .login-card-body {
        padding: 24px 20px 20px;
    }
    .login-header-banner {
        padding: 28px 18px 22px;
    }
    .login-header-title {
        font-size: 20px;
    }
}

.login-brand-logo {
    width: 80px; height: 80px;
    background: #ffffff;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 38px;
    margin-bottom: 20px;
    padding: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    animation: logoPulse 4s ease-in-out infinite;
}

.school-logo-img,
.login-brand-logo img {
    max-width: 64px !important;
    max-height: 64px !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    display: block !important;
    margin: 0 auto !important;
}

@keyframes logoPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25); }
    50% { transform: scale(1.03); box-shadow: 0 16px 40px rgba(45, 90, 142, 0.35); }
}

.login-brand h1 {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 12px;
    color: #ffffff;
}

.login-brand p.brand-sub {
    font-size: 14.5px;
    color: rgba(255, 255, 255, 0.78);
    text-align: center;
    max-width: 300px;
    line-height: 1.65;
    font-weight: 400;
}

.login-brand .school-name {
    margin-top: 24px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 99px;
    padding: 10px 22px;
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.brand-feature-list {
    margin-top: 36px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 310px;
}

.brand-feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(255, 255, 255, 0.88);
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 11px 16px;
    border-radius: 12px;
    backdrop-filter: blur(8px);
    transition: all 0.25s ease;
}

.brand-feature-item:hover {
    background: rgba(255, 255, 255, 0.14);
    transform: translateX(4px);
}

.brand-feature-icon {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.brand-feature-item span {
    font-size: 13px;
    font-weight: 500;
}

/* Right Panel Form */
.login-panel {
    width: 460px;
    min-height: 100vh;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 44px;
    position: relative;
    z-index: 2;
    box-shadow: -20px 0 60px rgba(0, 0, 0, 0.18);
}

.login-panel-title {
    font-size: 26px;
    font-weight: 700;
    color: #1e3a5f;
    margin-bottom: 6px;
    letter-spacing: -0.3px;
    text-align: center;
}

.login-panel-sub {
    font-size: 13.5px;
    color: #64748b;
    margin-bottom: 32px;
    text-align: center;
}

/* Custom Input Styling for Login */
.login-panel .form-group {
    margin-bottom: 20px;
    width: 100%;
}

.login-panel .form-group label {
    display: block;
    margin-bottom: 7px;
    font-weight: 600;
    font-size: 13px;
    color: #1e293b;
}

.login-panel .form-control {
    width: 100%;
    height: 48px;
    padding: 0 44px 0 16px;
    border: 1.5px solid #d9e3f0;
    border-radius: 12px;
    font-size: 14px;
    font-family: inherit;
    color: #1e293b;
    background: #edf3fb;
    transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
}

.login-panel .form-control:focus {
    background: #ffffff;
    border-color: #1e3a5f;
    box-shadow: 0 0 0 4px rgba(30, 58, 95, 0.12);
}

.login-panel .form-control:hover:not(:focus) {
    border-color: #cbd5e1;
    background: #e8f0fe;
}

.login-panel .input-wrapper {
    position: relative;
    width: 100%;
}

.login-panel .input-wrapper .input-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    transition: color 0.2s ease, transform 0.2s ease;
    z-index: 2;
}

.login-panel .input-wrapper .input-icon:hover {
    color: #1e3a5f;
}

.login-panel .btn-login,
.login-panel button.btn-primary {
    width: 100%;
    height: 48px;
    background: linear-gradient(135deg, #1e3a5f 0%, #1a2e4a 100%) !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 12px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 6px 18px rgba(30, 58, 95, 0.28);
    transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 10px;
}

.login-panel .btn-login:hover {
    background: linear-gradient(135deg, #2b4c7e 0%, #1e3a5f 100%);
    box-shadow: 0 8px 24px rgba(30, 58, 95, 0.38);
    transform: translateY(-1px);
}

.login-panel .btn-login:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(30, 58, 95, 0.25);
}

.login-panel .btn-login.loading {
    opacity: 0.85;
    cursor: not-allowed;
}

.login-footer-copy {
    position: absolute;
    bottom: 24px;
    left: 0;
    font-size: 11.5px;
    color: #94a3b8;
    text-align: center;
    width: 100%;
}

/* Success Overlay Animation */
.login-success-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

.login-success-overlay.active {
    opacity: 1;
    visibility: visible;
}

.login-success-card {
    background: #ffffff;
    padding: 40px 36px;
    border-radius: 24px;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.3);
    transform: scale(0.85) translateY(20px);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.35s ease;
    max-width: 380px;
    width: 90%;
    position: relative;
    overflow: hidden;
}

.login-success-overlay.active .login-success-card {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.success-icon-wrapper {
    width: 76px;
    height: 76px;
    margin: 0 auto 20px;
    background: #dcfce7;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #16a34a;
    box-shadow: 0 8px 25px rgba(22, 163, 74, 0.25);
    animation: successPulse 2s infinite ease-in-out;
}

@keyframes successPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 8px 25px rgba(22, 163, 74, 0.25); }
    50% { transform: scale(1.05); box-shadow: 0 12px 35px rgba(22, 163, 74, 0.4); }
}

.success-checkmark {
    width: 44px;
    height: 44px;
}

.checkmark-circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.checkmark-check {
    transform-origin: 50% 50%;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: stroke 0.4s cubic-bezier(0.65, 0, 0.45, 1) 0.4s forwards;
}

@keyframes stroke {
    100% { stroke-dashoffset: 0; }
}

.login-success-card h3 {
    font-size: 22px;
    font-weight: 700;
    color: #1e3a5f;
    margin-bottom: 8px;
}

.login-success-card p {
    font-size: 13.5px;
    color: #64748b;
    line-height: 1.6;
    margin-bottom: 24px;
}

.success-progress-bar {
    height: 4px;
    width: 100%;
    background: #f1f5f9;
    position: absolute;
    bottom: 0;
    left: 0;
}

.success-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #16a34a, #22c55e);
    animation: progressFill 1.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes progressFill {
    to { width: 100%; }
}

/* Responsive adjustments */
@media (max-width: 900px) {
    .login-brand { display: none; }
    .login-panel { width: 100%; max-width: 460px; box-shadow: none; padding: 40px 24px; }
}

/* =============================================
   FORM ELEMENTS
   ============================================= */
.form-group { margin-bottom: 20px; }
.form-group label {
    display: block;
    margin-bottom: 7px;
    font-weight: 600;
    font-size: 13px;
    color: var(--text);
}
.form-group label .required { color: var(--danger); margin-left: 2px; }

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
    color: var(--text);
    background: var(--surface);
    transition: all var(--transition);
    outline: none;
}
.form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(22,163,74,0.12);
}
.form-control:hover:not(:focus) { border-color: #adb5bd; }

.input-wrapper { position: relative; }
.input-wrapper .form-control { padding-right: 44px; }
.input-wrapper .input-icon {
    position: absolute; right: 14px; top: 50%;
    transform: translateY(-50%);
    cursor: pointer; color: var(--text-light);
    font-size: 16px; transition: color var(--transition); user-select: none;
}
.input-wrapper .input-icon:hover { color: var(--accent); }

select.form-control {
    cursor: pointer; appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2364748b' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px;
}
textarea.form-control { resize: vertical; min-height: 90px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.form-check { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.form-check input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; }

/* =============================================
   BUTTONS
   ============================================= */
.btn {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 9px 20px; border: none; border-radius: var(--radius);
    font-size: 13.5px; font-weight: 600; font-family: inherit;
    cursor: pointer; text-decoration: none;
    transition: all var(--transition); white-space: nowrap;
    position: relative; overflow: hidden;
}
.btn::after { content:''; position:absolute; inset:0; background:rgba(255,255,255,0); transition:background var(--transition); }
.btn:hover::after { background:rgba(255,255,255,0.1); }
.btn:active { transform: scale(0.97); }

.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-light)); color:#fff; box-shadow:0 4px 14px rgba(30,58,95,0.3); }
.btn-primary:hover { box-shadow:0 6px 20px rgba(30,58,95,0.4); transform:translateY(-1px); }

.btn-success { background: linear-gradient(135deg, var(--accent), var(--accent-light)); color:#fff; box-shadow:0 4px 14px rgba(22,163,74,0.3); }
.btn-success:hover { box-shadow:0 6px 20px rgba(22,163,74,0.4); transform:translateY(-1px); }

.btn-danger { background: linear-gradient(135deg, var(--danger), #ef4444); color:#fff; box-shadow:0 4px 14px rgba(220,38,38,0.3); }
.btn-danger:hover { box-shadow:0 6px 20px rgba(220,38,38,0.4); transform:translateY(-1px); }

.btn-warning { background: linear-gradient(135deg, var(--warning), #f59e0b); color:#fff; box-shadow:0 4px 14px rgba(217,119,6,0.3); }
.btn-warning:hover { box-shadow:0 6px 20px rgba(217,119,6,0.4); transform:translateY(-1px); }

.btn-info { background: linear-gradient(135deg, var(--info), #38bdf8); color:#fff; box-shadow:0 4px 14px rgba(2,132,199,0.3); }
.btn-info:hover { box-shadow:0 6px 20px rgba(2,132,199,0.4); transform:translateY(-1px); }

.btn-purple { background: linear-gradient(135deg, var(--purple), #8b5cf6); color:#fff; box-shadow:0 4px 14px rgba(124,58,237,0.3); }
.btn-purple:hover { box-shadow:0 6px 20px rgba(124,58,237,0.4); transform:translateY(-1px); }

.btn-outline { background:transparent; border:1.5px solid var(--accent); color:var(--accent); }
.btn-outline:hover { background:var(--accent); color:#fff; }

.btn-ghost { background:transparent; color:var(--text-muted); border:1.5px solid var(--border); }
.btn-ghost:hover { background:var(--bg); color:var(--text); }

.btn-sm { padding: 6px 14px; font-size: 12.5px; border-radius: var(--radius-sm); }
.btn-lg { padding: 14px 32px; font-size: 15px; }
.btn-block { width:100%; justify-content:center; }

/* =============================================
   APP LAYOUT
   ============================================= */
.app-wrapper { display:flex; min-height:100vh; }

/* =============================================
   SIDEBAR — EMERALD GREEN ELEGANT
   ============================================= */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #05261d 0%, #083327 100%);
    position: fixed; top:0; left:0; height:100vh;
    overflow-y: auto; overflow-x: hidden;
    z-index: 200;
    display: flex; flex-direction: column;
    transition: transform var(--transition-slow);
    scrollbar-width: thin;
    scrollbar-color: rgba(16,185,129,0.25) transparent;
    box-shadow: 4px 0 24px rgba(0,0,0,0.25);
}
.sidebar::-webkit-scrollbar { width: 3px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(16,185,129,0.25); border-radius: 4px; }

/* Sidebar Header */
.sidebar-header {
    padding: 20px 18px 16px;
    border-bottom: 1px solid var(--sidebar-border);
    background: rgba(0,0,0,0.18);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-logo {
    width: 42px; height: 42px;
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(16,185,129,0.4);
}

.sidebar-title h3 { font-size: 14px; font-weight: 800; color: #fff; letter-spacing: 0.5px; }
.sidebar-title span { font-size: 10.5px; color: var(--sidebar-muted); display:block; margin-top:2px; line-height:1.4; }

/* Nav */
.sidebar-nav { padding: 10px 0; flex: 1; }

.nav-section {
    padding: 14px 18px 5px;
    font-size: 9.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.4px;
    color: rgba(255, 255, 255, 0.45);
}

.nav-link {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 18px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: all var(--transition);
    margin: 2px 8px;
    border-radius: var(--radius);
}

.nav-link:hover {
    background: rgba(16, 185, 129, 0.14);
    color: #ffffff;
    border-left-color: #10b981;
}

.nav-link.active {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%) !important;
    color: #ffffff !important;
    border-left-color: #34d399 !important;
    font-weight: 700;
    box-shadow: 0 6px 18px rgba(16, 185, 129, 0.35);
}

.nav-icon {
    width: 30px; height: 30px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 15px;
    background: rgba(255,255,255,0.08);
    flex-shrink: 0;
    transition: background var(--transition);
}
.nav-link:hover .nav-icon {
    background: rgba(16, 185, 129, 0.25);
}
.nav-link.active .nav-icon {
    background: rgba(255, 255, 255, 0.22) !important;
    color: #ffffff !important;
}

/* ---- Sidebar User Panel (bottom) ---- */
.sidebar-user-panel {
    margin: 10px 10px 14px;
    border: 1px solid var(--sidebar-border);
    border-radius: var(--radius);
    overflow: hidden;
    background: rgba(0,0,0,0.22);
}

.sidebar-user-info {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 14px;
    text-decoration: none;
    transition: background var(--transition);
    cursor: pointer;
}
.sidebar-user-info:hover { background: var(--sidebar-hover); }

.sidebar-user-photo {
    width: 38px; height: 38px;
    border-radius: 50%;
    border: 2px solid rgba(16, 185, 129, 0.6);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 15px; color: #fff;
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    flex-shrink: 0;
    overflow: hidden;
}
.sidebar-user-photo img { width:100%; height:100%; object-fit:cover; border-radius:50%; }

.sidebar-user-text { flex: 1; min-width: 0; }
.sidebar-user-text strong {
    display: block; font-size: 13px; font-weight: 700;
    color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-user-text small {
    font-size: 11px; color: var(--sidebar-muted);
}

.sidebar-user-badge {
    display: inline-flex; align-items: center;
    padding: 2px 8px; border-radius: 10px;
    font-size: 10px; font-weight: 700;
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.35);
    margin-top: 3px;
}

.sidebar-edit-icon { color: var(--sidebar-muted); font-size: 13px; flex-shrink:0; }
.sidebar-user-info:hover .sidebar-edit-icon { color: var(--sidebar-accent); }

/* Logout button */
.sidebar-logout {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 14px;
    background: rgba(220,38,38,0.12);
    border-top: 1px solid var(--sidebar-border);
    color: #fca5a5;
    font-size: 13px; font-weight: 600;
    text-decoration: none;
    transition: all var(--transition);
    cursor: pointer;
    border: none; width: 100%; font-family: inherit;
}
.sidebar-logout:hover {
    background: rgba(220,38,38,0.25);
    color: #fff;
}

/* =============================================
   MAIN CONTENT
   ============================================= */
.main-content { margin-left: var(--sidebar-width); flex:1; min-height:100vh; display:flex; flex-direction:column; }

.top-bar {
    background: var(--surface);
    height: var(--header-height);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 28px;
    box-shadow: 0 1px 0 var(--border), var(--shadow-sm);
    position: sticky; top: 0; z-index: 100;
}

.top-bar-left { display: flex; align-items: center; gap: 14px; }

.sidebar-toggle {
    display: none; background: none; border: none; cursor: pointer;
    padding: 8px; border-radius: var(--radius); color: var(--text-muted);
    transition: all var(--transition);
}
.sidebar-toggle:hover { background: var(--bg); color: var(--text); }

.top-bar-title h1 { font-size: 17px; font-weight: 700; color: var(--primary); line-height: 1.2; }
.breadcrumb { display:flex; align-items:center; gap:5px; font-size:11.5px; color:var(--text-light); margin-top:1px; }
.breadcrumb span { color: var(--text-muted); font-weight: 500; }

.top-bar-right { display: flex; align-items: center; gap: 14px; }

.top-clock {
    font-size: 12.5px; color: var(--text-muted); font-weight: 600;
    font-variant-numeric: tabular-nums;
    background: var(--bg); padding: 5px 12px;
    border-radius: var(--radius); border: 1px solid var(--border);
}

.user-chip {
    display: flex; align-items: center; gap: 10px;
    padding: 5px 14px 5px 6px;
    border-radius: 40px; background: var(--bg);
    border: 1px solid var(--border);
    transition: all var(--transition); cursor: default;
}
.user-chip:hover { border-color: var(--accent); background: var(--accent-pale); }

.user-avatar {
    width: 34px; height: 34px;
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    color: #fff; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 13px; overflow: hidden;
}
.user-avatar img { width:100%; height:100%; object-fit:cover; border-radius:50%; }
.user-chip span { font-size: 13px; font-weight: 600; color: var(--text); }

.page-content { padding: 28px; flex: 1; animation: pageIn 0.3s ease; }

@keyframes pageIn { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:translateY(0)} }

/* =============================================
   CARDS
   ============================================= */
.card {
    background: var(--surface); border-radius: var(--radius-lg);
    box-shadow: var(--shadow); margin-bottom: 22px;
    border: 1px solid var(--border); overflow: hidden;
    transition: box-shadow var(--transition);
}
.card:hover { box-shadow: var(--shadow-md); }

.card-header {
    padding: 16px 22px;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    background: linear-gradient(to right, #f9fafb, var(--surface));
}

.card-header h3 {
    font-size: 15px; font-weight: 700; color: var(--primary);
    display: flex; align-items: center; gap: 8px;
}
.card-icon {
    width: 28px; height: 28px; border-radius: 7px;
    background: var(--accent-pale);
    display: flex; align-items: center; justify-content: center; font-size: 13px;
}

.card-body { padding: 22px; }
.card-body-sm { padding: 14px 20px; }

/* =============================================
   STAT CARDS
   ============================================= */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 18px; margin-bottom: 24px;
}

.stat-card {
    background: var(--surface); border-radius: var(--radius-lg);
    padding: 20px; box-shadow: var(--shadow); border: 1px solid var(--border);
    display: flex; align-items: center; gap: 16px;
    transition: all var(--transition); position: relative; overflow: hidden;
}
.stat-card::before {
    content:''; position:absolute; top:0; left:0; right:0; height:3px; border-radius:3px 3px 0 0;
}
.stat-card.blue::before  { background: linear-gradient(90deg, var(--info), #38bdf8); }
.stat-card.green::before { background: linear-gradient(90deg, var(--accent), var(--accent-light)); }
.stat-card.orange::before{ background: linear-gradient(90deg, var(--warning), #f59e0b); }
.stat-card.purple::before{ background: linear-gradient(90deg, var(--purple), #8b5cf6); }
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }

.stat-icon { width:52px; height:52px; border-radius:13px; display:flex; align-items:center; justify-content:center; font-size:22px; flex-shrink:0; }
.stat-icon.blue   { background:var(--info-pale);    color:var(--info); }
.stat-icon.green  { background:var(--accent-pale);  color:var(--accent); }
.stat-icon.orange { background:var(--warning-pale); color:var(--warning); }
.stat-icon.purple { background:var(--purple-pale);  color:var(--purple); }

.stat-info h4 { font-size:30px; font-weight:800; color:var(--primary); line-height:1; letter-spacing:-1px; font-variant-numeric:tabular-nums; }
.stat-info p { font-size:12px; color:var(--text-muted); margin-top:4px; font-weight:500; }

/* =============================================
   TABLE
   ============================================= */
.table-responsive { overflow-x: auto; }
table { width:100%; border-collapse:collapse; }
table th {
    padding: 10px 16px; text-align:left; background:#f8fafc;
    font-weight:700; color:var(--primary); font-size:11.5px;
    text-transform:uppercase; letter-spacing:0.6px;
    border-bottom: 2px solid var(--border); white-space:nowrap;
}
table td { padding:11px 16px; border-bottom:1px solid #f1f5f9; font-size:13.5px; color:var(--text); vertical-align:middle; }
table tbody tr { transition: background var(--transition); }
table tbody tr:hover { background: #f0fdf4; }
table tbody tr:last-child td { border-bottom: none; }

.table-search { display:flex; align-items:center; gap:12px; margin-bottom:16px; flex-wrap:wrap; }
.search-input { position:relative; flex:1; min-width:220px; }
.search-input input {
    width:100%; padding:9px 14px 9px 38px;
    border:1.5px solid var(--border); border-radius:var(--radius);
    font-size:13.5px; font-family:inherit; color:var(--text);
    background:var(--surface); transition:all var(--transition); outline:none;
}
.search-input input:focus { border-color:var(--accent); box-shadow:0 0 0 3px rgba(22,163,74,0.1); }
.search-input::before { content:'🔍'; position:absolute; left:12px; top:50%; transform:translateY(-50%); font-size:13px; pointer-events:none; }

.rank-1   { background: linear-gradient(to right, #fffbeb, #fff) !important; }
.rank-top { background: linear-gradient(to right, #f0fdf4, #fff) !important; }

/* =============================================
   BADGES
   ============================================= */
.badge {
    display:inline-flex; align-items:center; gap:4px;
    padding:4px 10px; border-radius:20px;
    font-size:12px; font-weight:600;
}
.badge-success { background:var(--accent-pale);  color:#14532d; }
.badge-danger  { background:var(--danger-pale);  color:#991b1b; }
.badge-info    { background:var(--info-pale);    color:#075985; }
.badge-warning { background:var(--warning-pale); color:#92400e; }
.badge-primary { background:var(--primary-pale); color:var(--primary); }
.badge-purple  { background:var(--purple-pale);  color:#4c1d95; }

/* =============================================
   ALERTS
   ============================================= */
.alert {
    padding:13px 16px; border-radius:var(--radius); margin-bottom:18px;
    font-size:13.5px; display:flex; align-items:flex-start; gap:10px;
    border:1px solid transparent; animation:alertIn 0.3s ease; position:relative;
}
@keyframes alertIn { from{opacity:0;transform:translateY(-6px)} to{opacity:1;transform:translateY(0)} }
.alert-icon { font-size:16px; flex-shrink:0; margin-top:1px; }
.alert-content { flex:1; }
.alert-close { background:none; border:none; cursor:pointer; font-size:16px; color:inherit; opacity:0.6; padding:0; transition:opacity var(--transition); flex-shrink:0; }
.alert-close:hover { opacity:1; }
.alert-success { background:#f0fdf4; color:#14532d; border-color:#86efac; }
.alert-danger  { background:#fef2f2; color:#991b1b; border-color:#fecaca; }
.alert-info    { background:#f0f9ff; color:#075985; border-color:#bae6fd; }
.alert-warning { background:#fffbeb; color:#92400e; border-color:#fde68a; }

/* =============================================
   PROGRESS BAR
   ============================================= */
.progress-bar-wrap { background:var(--border); border-radius:20px; height:8px; overflow:hidden; }
.progress-bar { height:100%; border-radius:20px; transition:width 1s cubic-bezier(0.4,0,0.2,1); }
.progress-bar.blue   { background:linear-gradient(90deg, var(--info), #38bdf8); }
.progress-bar.green  { background:linear-gradient(90deg, var(--accent), var(--accent-light)); }
.progress-bar.orange { background:linear-gradient(90deg, var(--warning), #f59e0b); }
.progress-bar.purple { background:linear-gradient(90deg, var(--purple), #8b5cf6); }

/* =============================================
   MODAL
   ============================================= */
.modal-overlay {
    position:fixed; inset:0; background:rgba(0,0,0,0.5);
    backdrop-filter:blur(4px); z-index:1000;
    display:flex; align-items:center; justify-content:center;
    opacity:0; pointer-events:none; transition:opacity var(--transition);
}
.modal-overlay.open { opacity:1; pointer-events:all; }
.modal-box {
    background:var(--surface); border-radius:var(--radius-xl);
    padding:36px 32px; max-width:420px; width:90%;
    box-shadow:var(--shadow-lg);
    transform:scale(0.92) translateY(16px); transition:transform var(--transition);
    text-align:center;
}
.modal-overlay.open .modal-box { transform:scale(1) translateY(0); }
.modal-icon { width:60px; height:60px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:26px; margin:0 auto 20px; }
.modal-icon.danger  { background:var(--danger-pale); }
.modal-icon.warning { background:var(--warning-pale); }
.modal-box h3 { font-size:18px; font-weight:700; color:var(--primary); margin-bottom:8px; }
.modal-box p { color:var(--text-muted); font-size:14px; margin-bottom:26px; line-height:1.6; }
.modal-actions { display:flex; gap:10px; justify-content:center; }

/* =============================================
   ACTIONS & QUICK ACTIONS
   ============================================= */
.actions { display:flex; gap:8px; flex-wrap:wrap; align-items:center; }

.quick-actions { display:grid; grid-template-columns:repeat(auto-fit, minmax(150px, 1fr)); gap:12px; }
.quick-action-card {
    display:flex; flex-direction:column; align-items:center; gap:9px;
    padding:18px 14px; border-radius:var(--radius-lg);
    border:1.5px solid var(--border); background:var(--surface);
    text-decoration:none; color:var(--text); text-align:center;
    transition:all var(--transition); cursor:pointer;
}
.quick-action-card:hover {
    border-color:var(--accent); background:var(--accent-pale);
    transform:translateY(-3px); box-shadow:var(--shadow-md);
}
.quick-action-icon { width:46px; height:46px; border-radius:12px; display:flex; align-items:center; justify-content:center; font-size:20px; }
.quick-action-card span { font-size:12.5px; font-weight:600; color:var(--text); }

/* =============================================
   WORKFLOW STEPS
   ============================================= */
.workflow-steps { display:flex; gap:0; flex-wrap:wrap; margin-top:10px; }
.workflow-step { flex:1; min-width:110px; display:flex; flex-direction:column; align-items:center; gap:7px; text-align:center; position:relative; padding:14px 8px; }
.workflow-step:not(:last-child)::after { content:'→'; position:absolute; right:-6px; top:22px; font-size:16px; color:var(--text-light); }
.workflow-step-num { width:34px; height:34px; border-radius:50%; background:var(--primary-pale); border:2px solid var(--primary-light); display:flex; align-items:center; justify-content:center; font-size:12px; font-weight:700; color:var(--primary); }
.workflow-step.done .workflow-step-num { background:var(--accent-pale); border-color:var(--accent); color:var(--accent); }
.workflow-step span { font-size:11.5px; color:var(--text-muted); font-weight:500; line-height:1.3; }

/* =============================================
   PODIUM
   ============================================= */
.podium { display:flex; justify-content:center; align-items:flex-end; gap:10px; padding:24px 16px 0; margin-bottom:24px; }
.podium-item { display:flex; flex-direction:column; align-items:center; gap:7px; }
.podium-avatar { width:58px; height:58px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:20px; font-weight:800; color:#fff; border:3px solid #fff; box-shadow:0 4px 16px rgba(0,0,0,0.2); }
.podium-avatar.gold   { background:linear-gradient(135deg,#f59e0b,#fbbf24); border-color:#fde68a; }
.podium-avatar.silver { background:linear-gradient(135deg,#6b7280,#9ca3af); border-color:#e5e7eb; }
.podium-avatar.bronze { background:linear-gradient(135deg,#b45309,#d97706); border-color:#fde68a; }
.podium-name { font-size:12px; font-weight:600; color:var(--text); text-align:center; max-width:95px; }
.podium-score { font-size:11px; color:var(--text-muted); }
.podium-block { display:flex; align-items:center; justify-content:center; border-radius:var(--radius) var(--radius) 0 0; font-size:18px; font-weight:800; color:rgba(255,255,255,0.7); }
.podium-block.gold   { width:88px; height:88px; background:linear-gradient(135deg,#fbbf24,#f59e0b); }
.podium-block.silver { width:78px; height:68px; background:linear-gradient(135deg,#9ca3af,#6b7280); }
.podium-block.bronze { width:73px; height:54px; background:linear-gradient(135deg,#d97706,#b45309); }

/* =============================================
   MEDAL
   ============================================= */
.medal { display:inline-flex; align-items:center; gap:4px; font-weight:700; }
.medal-gold   { color:#d97706; }
.medal-silver { color:#6b7280; }
.medal-bronze { color:#b45309; }

/* =============================================
   MATRIX TABLE
   ============================================= */
.matrix-table th, .matrix-table td { text-align:center; font-size:12.5px; }
.matrix-table th:first-child, .matrix-table td:first-child { text-align:left; }
.matrix-highlight { background:#eff6ff !important; font-weight:600; }

/* =============================================
   PHOTO UPLOAD
   ============================================= */
.photo-upload-wrap {
    position: relative; display: inline-block; cursor: pointer;
}
.photo-upload-wrap:hover .photo-overlay { opacity: 1; }
.photo-avatar-lg {
    width: 100px; height: 100px; border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    display: flex; align-items: center; justify-content: center;
    font-size: 36px; font-weight: 800; color: #fff;
    border: 4px solid var(--accent-pale);
    overflow: hidden; margin: 0 auto;
}
.photo-avatar-lg img { width:100%; height:100%; object-fit:cover; }
.photo-overlay {
    position: absolute; inset: 0; border-radius: 50%;
    background: rgba(0,0,0,0.5);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: opacity var(--transition);
    font-size: 22px;
}

/* =============================================
   PRINT
   ============================================= */
@media print {
    .sidebar, .top-bar, .no-print { display:none !important; }
    .main-content { margin-left:0 !important; }
    .page-content { padding:0; }
    .card { box-shadow:none !important; border:1px solid #ddd; }
}

/* Mobile Brand Header for Login (Hidden on Desktop) */
.mobile-brand-header {
    display: none;
}

/* =============================================
   MOBILE & RESPONSIVE DESIGN SYSTEM
   ============================================= */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
}

@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); z-index:300; }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; width: 100%; }
    .sidebar-toggle { display: flex; }
    .sidebar-backdrop { display:none; position:fixed; inset:0; background:rgba(0,0,0,0.5); z-index:250; }
    .sidebar-backdrop.open { display:block; }
    
    /* Login Page Mobile Layout */
@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); z-index:300; }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; width: 100%; }
    .sidebar-toggle { display: flex; }
    .sidebar-backdrop { display:none; position:fixed; inset:0; background:rgba(0,0,0,0.5); z-index:250; }
    .sidebar-backdrop.open { display:block; }
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
    .form-row { grid-template-columns: 1fr; }
}

/* Mobile Stack for Login Page (Screen Width <= 650px) */
@media (max-width: 650px) {
    .login-page {
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        background: #0f1c2e;
        padding: 24px 14px;
        min-height: 100vh;
        overflow-y: auto;
    }

    .login-brand {
        flex: none;
        width: 100%;
        max-width: 440px;
        padding: 20px 16px 12px;
        background: transparent;
    }

    .login-brand-logo {
        width: 64px !important;
        height: 64px !important;
        max-width: 64px !important;
        max-height: 64px !important;
        font-size: 32px;
        margin-bottom: 10px;
        padding: 6px;
    }

    .login-brand-logo img, .school-logo-img {
        max-width: 50px !important;
        max-height: 50px !important;
    }

    .login-brand h1 {
        font-size: 22px;
        margin-bottom: 4px;
    }

    .login-brand p.brand-sub {
        font-size: 12px;
        max-width: 280px;
        line-height: 1.4;
    }

    .login-brand .school-name {
        margin-top: 10px;
        padding: 5px 14px;
        font-size: 11.5px;
    }

    .brand-feature-list, .brand-year {
        display: none !important;
    }

    .login-panel {
        width: 100% !important;
        max-width: 440px !important;
        min-height: auto !important;
        border-radius: 24px !important;
        padding: 32px 24px !important;
        box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35) !important;
        margin-top: 12px;
    }

    .login-footer-copy {
        position: relative !important;
        inset: auto !important;
        margin-top: 20px !important;
        margin-bottom: 0 !important;
    }

    .stats-grid { grid-template-columns: 1fr; }
    .page-content { padding: 16px 12px; }
    .top-clock { display: none; }
    .top-bar { padding: 0 12px; }
    .card { padding: 18px 14px; }
}
