/* ═══════════════════════════════════════════════════════════════════
   SGRAM - Centralized School Management System
   Custom Stylesheet v1.0
   Comprehensive styling for modern school management interface
   ═══════════════════════════════════════════════════════════════════ */

/* DEMO: logo hidden — remove this block to restore */
img[src*="sgram-logo"] { display: none !important; }

:root {
    /* Brand Color Palette */
    --brand-blue: #4361ee;
    --mid-blue: #4895ef;
    --light-blue: #e8edff;
    --alt-row: #eef2ff;

    /* Status & Alert Colors */
    --accent-green: #28a745;
    --accent-orange: #fd7e14;
    --accent-red: #dc3545;
    --accent-yellow: #ffc107;
    --accent-purple: #6f42c1;
    --accent-teal: #20c997;

    /* Layout Dimensions */
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 65px;
    --topbar-height: 60px;

    /* Shadows & Effects */
    --card-shadow: 0 2px 10px rgba(67, 97, 238, 0.07);
    --card-hover-shadow: 0 8px 24px rgba(67, 97, 238, 0.13);
    --inset-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);

    /* Sizing & Spacing */
    --border-radius: 8px;
    --border-radius-sm: 4px;
    --border-radius-lg: 12px;

    /* Transitions & Animations */
    --transition: all 0.3s ease;
    --transition-fast: all 0.15s ease;

    /* Typography */
    --font-primary: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;

    /* Grid Gaps & Padding */
    --gap-xs: 4px;
    --gap-sm: 8px;
    --gap-md: 16px;
    --gap-lg: 24px;
    --gap-xl: 32px;
}

/* ═══════════════════════════════════════════════════════════════════
   RESET & BASE STYLES
   ═══════════════════════════════════════════════════════════════════ */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    font-size: 0.9375rem;
    line-height: 1.6;
    color: #212529;
    background-color: #f0f4fb;
    margin: 0;
    padding: 0;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    margin-bottom: var(--gap-md);
    font-weight: 600;
    line-height: 1.3;
    color: var(--brand-blue);
}

h1 { font-size: 2rem; }
h2 { font-size: 1.625rem; }
h3 { font-size: 1.375rem; }
h4 { font-size: 1.125rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.875rem; }

p {
    margin-bottom: var(--gap-md);
}

a {
    color: var(--mid-blue);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--brand-blue);
    text-decoration: underline;
}

/* Lists */
ul, ol {
    margin-bottom: var(--gap-md);
    padding-left: var(--gap-lg);
}

li {
    margin-bottom: var(--gap-xs);
}

/* Code */
code, pre {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    background-color: #f5f5f5;
    border-radius: var(--border-radius-sm);
}

code {
    padding: 2px 6px;
    display: inline-block;
}

pre {
    padding: var(--gap-md);
    overflow-x: auto;
    margin-bottom: var(--gap-md);
}

/* ═══════════════════════════════════════════════════════════════════
   CUSTOM SCROLLBAR
   ═══════════════════════════════════════════════════════════════════ */

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c7d2fe;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--brand-blue);
}

/* Firefox Scrollbar */
* {
    scrollbar-color: #c7d2fe #f1f1f1;
    scrollbar-width: thin;
}

/* ═══════════════════════════════════════════════════════════════════
   LAYOUT: SIDEBAR
   ═══════════════════════════════════════════════════════════════════ */

/* ── Sidebar logo / brand header ─────────────────────────────────── */
.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 12px 12px;
    border-bottom: 1px solid #eef0f8;
    background: #fff;
    overflow: hidden;       /* prevent image from breaking out */
    min-height: 70px;
    max-height: 80px;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
    max-width: 100%;
}

/* Explicit dimensions override Bootstrap's img { height: auto } */
.sidebar-logo-img,
.sidebar-logo-img[src] {
    width: 42px  !important;
    height: 42px !important;
    min-width: 42px !important;
    max-width: 42px !important;
    max-height: 42px !important;
    object-fit: contain;
    flex-shrink: 0;
    display: block;
    filter: drop-shadow(0 1px 3px rgba(67,97,238,0.18));
}

.app-name {
    font-size: 1.05rem;
    font-weight: 800;
    color: #4361ee;
    letter-spacing: 2px;
    white-space: nowrap;
    text-shadow: none;
    overflow: hidden;
}

.sidebar.collapsed .app-name {
    display: none;
}

.sidebar.collapsed .sidebar-logo-img,
.sidebar.collapsed .sidebar-logo-img[src] {
    width: 34px  !important;
    height: 34px !important;
    min-width: 34px !important;
    max-width: 34px !important;
}

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: #ffffff;
    color: #333;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1000;
    box-shadow: 2px 0 16px rgba(67, 97, 238, 0.08);
    border-right: 1px solid #eef0f8;
    transition: width var(--transition), transform var(--transition);
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--gap-md);
    border-bottom: 1px solid #eef0f8;
    font-size: 0.75rem;
    font-weight: bold;
    text-align: center;
    min-height: 70px;
}

.sidebar.collapsed .sidebar-brand {
    padding: var(--gap-sm);
}

.sidebar-brand-logo {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--light-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.25rem;
    margin-right: var(--gap-sm);
    color: var(--brand-blue);
}

.sidebar.collapsed .sidebar-brand-logo {
    margin-right: 0;
}

.sidebar.collapsed .sidebar-brand-text {
    display: none;
}

.sidebar-nav {
    list-style: none;
    padding: var(--gap-md) 0;
}

.sidebar-nav-item {
    margin: 0;
}

.sidebar-nav-link {
    display: flex;
    align-items: center;
    padding: var(--gap-md) var(--gap-md);
    color: #64748b;
    transition: all var(--transition);
    border-left: 3px solid transparent;
    font-size: 0.9375rem;
}

.sidebar-nav-link:hover {
    background-color: var(--light-blue);
    color: var(--brand-blue);
    text-decoration: none;
}

.sidebar-nav-link.active {
    background-color: var(--light-blue);
    color: var(--brand-blue);
    border-left-color: var(--brand-blue);
    font-weight: 600;
}

.sidebar-nav-link i {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: var(--gap-md);
    font-size: 1.125rem;
}

.sidebar.collapsed .sidebar-nav-link i {
    margin-right: 0;
}

.sidebar.collapsed .sidebar-nav-link span {
    display: none;
}

.sidebar-nav-link span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-divider {
    height: 1px;
    background: #eef0f8;
    margin: var(--gap-md) 0;
}

/* Sidebar Mobile Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: var(--topbar-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.sidebar-overlay.show {
    display: block;
}

/* ═══════════════════════════════════════════════════════════════════
   LAYOUT: TOP NAVIGATION BAR
   ═══════════════════════════════════════════════════════════════════ */

.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--topbar-height);
    background: white;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    padding: 0 var(--gap-md);
    z-index: 1050;
    box-shadow: var(--card-shadow);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: var(--gap-md);
    flex: 1;
}

.topbar-logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--brand-blue);
    white-space: nowrap;
}

.sidebar-toggle {
    background: none;
    border: none;
    padding: var(--gap-sm);
    cursor: pointer;
    font-size: 1.25rem;
    color: var(--brand-blue);
    transition: color var(--transition);
    display: none;
}

.sidebar-toggle:hover {
    color: var(--mid-blue);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: var(--gap-lg);
    margin-left: auto;
}

.topbar-search {
    display: flex;
    align-items: center;
    background: #f5f5f5;
    border-radius: var(--border-radius);
    padding: var(--gap-sm) var(--gap-md);
    flex: 0 1 300px;
}

.topbar-search input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    font-size: 0.9375rem;
    margin-left: var(--gap-sm);
}

.topbar-search i {
    color: #999;
}

.topbar-notifications,
.topbar-user {
    position: relative;
}

.topbar-notifications-badge,
.topbar-user-badge {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--light-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition);
    color: var(--brand-blue);
}

.topbar-notifications-badge:hover,
.topbar-user-badge:hover {
    background: var(--mid-blue);
    color: white;
    transform: scale(1.1);
}

.topbar-notifications-badge i,
.topbar-user-badge i {
    font-size: 1rem;
}

.notification-dot {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 10px;
    height: 10px;
    background: var(--accent-red);
    border-radius: 50%;
    border: 2px solid white;
}

.topbar-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: var(--border-radius);
    box-shadow: var(--card-hover-shadow);
    min-width: 280px;
    margin-top: var(--gap-sm);
    z-index: 1100;
    display: none;
    overflow: hidden;
}

.topbar-dropdown.show {
    display: block;
}

.topbar-dropdown-header {
    padding: var(--gap-md);
    background: #eef2ff;
    font-weight: 600;
    color: var(--brand-blue);
    border-bottom: 1px solid #e4e9f7;
}

.topbar-dropdown-item {
    padding: var(--gap-md);
    border-bottom: 1px solid #e0e0e0;
    cursor: pointer;
    transition: background-color var(--transition);
}

.topbar-dropdown-item:last-child {
    border-bottom: none;
}

.topbar-dropdown-item:hover {
    background-color: #f9f9f9;
}

.topbar-dropdown-item.unread {
    background-color: #f0f7ff;
    font-weight: 500;
}

/* ═══════════════════════════════════════════════════════════════════
   LAYOUT: MAIN CONTENT
   ═══════════════════════════════════════════════════════════════════ */

.main-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    margin-top: var(--topbar-height);
    margin-left: var(--sidebar-width);
    padding: var(--gap-lg);
    transition: margin-left var(--transition);
}

.main-content.expanded {
    margin-left: var(--sidebar-width);
}

.main-content.collapsed {
    margin-left: var(--sidebar-collapsed-width);
}

.content-header {
    margin-bottom: var(--gap-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.content-header h1 {
    margin-bottom: 0;
}

.content-header-subtitle {
    font-size: 0.875rem;
    color: #666;
    margin-top: var(--gap-sm);
}

.breadcrumb {
    margin-bottom: var(--gap-md);
    font-size: 0.875rem;
}

.breadcrumb-item {
    display: inline-block;
    color: #666;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: " / ";
    margin: 0 var(--gap-sm);
}

.breadcrumb-item.active {
    color: var(--brand-blue);
    font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════════════
   DASHBOARD STAT CARDS
   ═══════════════════════════════════════════════════════════════════ */

.stat-card {
    background: white;
    border-radius: var(--border-radius);
    padding: var(--gap-lg);
    box-shadow: var(--card-shadow);
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
    border-left: 4px solid var(--mid-blue);
}

.stat-card:hover {
    box-shadow: var(--card-hover-shadow);
    transform: translateY(-4px);
}

.stat-card-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.stat-card-info {
    flex: 1;
}

.stat-card-label {
    font-size: 0.875rem;
    color: #666;
    margin-bottom: var(--gap-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.stat-card-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--brand-blue);
    margin-bottom: var(--gap-sm);
}

.stat-card-subtext {
    font-size: 0.75rem;
    color: #999;
}

.stat-card-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    background: var(--light-blue);
    color: var(--brand-blue);
    margin-left: var(--gap-lg);
}

/* Stat Card Color Variants */
.stat-card.stat-primary {
    border-left-color: var(--brand-blue);
}

.stat-card.stat-primary .stat-card-icon {
    background: rgba(31, 78, 121, 0.15);
    color: var(--brand-blue);
}

.stat-card.stat-success {
    border-left-color: var(--accent-green);
}

.stat-card.stat-success .stat-card-icon {
    background: rgba(40, 167, 69, 0.15);
    color: var(--accent-green);
}

.stat-card.stat-warning {
    border-left-color: var(--accent-orange);
}

.stat-card.stat-warning .stat-card-icon {
    background: rgba(253, 126, 20, 0.15);
    color: var(--accent-orange);
}

.stat-card.stat-danger {
    border-left-color: var(--accent-red);
}

.stat-card.stat-danger .stat-card-icon {
    background: rgba(220, 53, 69, 0.15);
    color: var(--accent-red);
}

.stat-card.stat-info {
    border-left-color: var(--accent-purple);
}

.stat-card.stat-info .stat-card-icon {
    background: rgba(111, 66, 193, 0.15);
    color: var(--accent-purple);
}

/* Animated Counter */
.stat-card-value[data-counter] {
    animation: countUp 1s ease-out;
}

@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ═══════════════════════════════════════════════════════════════════
   STATUS BADGES
   ═══════════════════════════════════════════════════════════════════ */

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all var(--transition);
}

/* Status Badges - Student/User Status */
.badge-active,
.badge-status-active {
    background-color: rgba(40, 167, 69, 0.15);
    color: var(--accent-green);
    border: 1px solid rgba(40, 167, 69, 0.3);
}

.badge-active:hover {
    background-color: rgba(40, 167, 69, 0.25);
}

.badge-inactive,
.badge-status-inactive {
    background-color: rgba(108, 117, 125, 0.15);
    color: #666;
    border: 1px solid rgba(108, 117, 125, 0.3);
}

.badge-pending,
.badge-status-pending {
    background-color: rgba(255, 193, 7, 0.15);
    color: #a67000;
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.badge-approved {
    background-color: rgba(40, 167, 69, 0.15);
    color: var(--accent-green);
    border: 1px solid rgba(40, 167, 69, 0.3);
}

.badge-rejected {
    background-color: rgba(220, 53, 69, 0.15);
    color: var(--accent-red);
    border: 1px solid rgba(220, 53, 69, 0.3);
}

.badge-suspended {
    background-color: rgba(220, 53, 69, 0.15);
    color: var(--accent-red);
    border: 1px solid rgba(220, 53, 69, 0.3);
}

/* Attendance Status Badges */
.badge-present {
    background-color: rgba(40, 167, 69, 0.15);
    color: var(--accent-green);
    border: 1px solid rgba(40, 167, 69, 0.3);
}

.badge-absent {
    background-color: rgba(220, 53, 69, 0.15);
    color: var(--accent-red);
    border: 1px solid rgba(220, 53, 69, 0.3);
}

.badge-leave {
    background-color: rgba(32, 201, 151, 0.15);
    color: var(--accent-teal);
    border: 1px solid rgba(32, 201, 151, 0.3);
}

.badge-unmarked {
    background-color: rgba(108, 117, 125, 0.15);
    color: #666;
    border: 1px solid rgba(108, 117, 125, 0.3);
}

/* Exam & Grade Badges */
.badge-pass {
    background-color: rgba(40, 167, 69, 0.15);
    color: var(--accent-green);
    border: 1px solid rgba(40, 167, 69, 0.3);
}

.badge-fail {
    background-color: rgba(220, 53, 69, 0.15);
    color: var(--accent-red);
    border: 1px solid rgba(220, 53, 69, 0.3);
}

/* Grade Letter Badges */
.badge-grade-a {
    background-color: rgba(40, 167, 69, 0.15);
    color: var(--accent-green);
    font-weight: 700;
    border: 1px solid rgba(40, 167, 69, 0.3);
}

.badge-grade-b {
    background-color: rgba(32, 201, 151, 0.15);
    color: var(--accent-teal);
    font-weight: 700;
    border: 1px solid rgba(32, 201, 151, 0.3);
}

.badge-grade-c {
    background-color: rgba(255, 193, 7, 0.15);
    color: #a67000;
    font-weight: 700;
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.badge-grade-d {
    background-color: rgba(253, 126, 20, 0.15);
    color: var(--accent-orange);
    font-weight: 700;
    border: 1px solid rgba(253, 126, 20, 0.3);
}

.badge-grade-f {
    background-color: rgba(220, 53, 69, 0.15);
    color: var(--accent-red);
    font-weight: 700;
    border: 1px solid rgba(220, 53, 69, 0.3);
}

/* Fee Status Badges */
.badge-paid {
    background-color: rgba(40, 167, 69, 0.15);
    color: var(--accent-green);
    border: 1px solid rgba(40, 167, 69, 0.3);
}

.badge-partially-paid {
    background-color: rgba(255, 193, 7, 0.15);
    color: #a67000;
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.badge-overdue {
    background-color: rgba(220, 53, 69, 0.15);
    color: var(--accent-red);
    border: 1px solid rgba(220, 53, 69, 0.3);
}

/* ═══════════════════════════════════════════════════════════════════
   FORMS & FORM CONTROLS
   ═══════════════════════════════════════════════════════════════════ */

.form-group {
    margin-bottom: var(--gap-lg);
}

.form-label {
    display: block;
    margin-bottom: var(--gap-sm);
    font-weight: 600;
    color: var(--brand-blue);
    font-size: 0.9375rem;
}

.form-label.required::after {
    content: " *";
    color: var(--accent-red);
}

.form-control {
    width: 100%;
    padding: var(--gap-sm) var(--gap-md);
    border: 1px solid #d0d0d0;
    border-radius: var(--border-radius-sm);
    font-family: var(--font-primary);
    font-size: 0.9375rem;
    transition: all var(--transition-fast);
    background-color: white;
}

.form-control:focus {
    outline: none;
    border-color: var(--brand-blue);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.12);
    background-color: white;
}

.form-control:disabled {
    background-color: #f5f5f5;
    color: #999;
    cursor: not-allowed;
}

.form-control.is-invalid {
    border-color: var(--accent-red);
}

.form-control.is-valid {
    border-color: var(--accent-green);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
    font-family: var(--font-primary);
}

select.form-control {
    cursor: pointer;
    appearance: none;
}

/* Input Groups */
.input-group {
    display: flex;
    align-items: center;
    margin-bottom: var(--gap-lg);
}

.input-group > .form-control {
    border-radius: var(--border-radius-sm) 0 0 var(--border-radius-sm);
    margin-bottom: 0;
}

.input-group-append {
    display: flex;
}

.input-group-text {
    padding: var(--gap-sm) var(--gap-md);
    background-color: #f5f5f5;
    border: 1px solid #d0d0d0;
    border-left: none;
    border-radius: 0 var(--border-radius-sm) var(--border-radius-sm) 0;
}

/* Form Feedback */
.invalid-feedback,
.valid-feedback {
    display: block;
    margin-top: var(--gap-xs);
    font-size: 0.875rem;
}

.invalid-feedback {
    color: var(--accent-red);
}

.valid-feedback {
    color: var(--accent-green);
}

.form-text {
    display: block;
    margin-top: var(--gap-xs);
    font-size: 0.875rem;
    color: #666;
}

/* ═══════════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════════ */

.btn {
    display: inline-block;
    padding: var(--gap-sm) var(--gap-lg);
    border: none;
    border-radius: var(--border-radius-sm);
    font-family: var(--font-primary);
    font-size: 0.9375rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    user-select: none;
    vertical-align: middle;
}

.btn:focus {
    outline: none;
}

/* Primary Button */
.btn-primary {
    background-color: var(--mid-blue);
    color: white;
}

.btn-primary:hover {
    background-color: #3451d1;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(67, 97, 238, 0.4);
}

.btn-primary:active {
    background-color: #2c44b8;
    transform: translateY(0);
}

.btn-primary:disabled {
    background-color: #999;
    cursor: not-allowed;
}

/* Success Button */
.btn-success {
    background-color: var(--accent-green);
    color: white;
}

.btn-success:hover {
    background-color: #218838;
    transform: translateY(-1px);
}

/* Danger Button */
.btn-danger {
    background-color: var(--accent-red);
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
    transform: translateY(-1px);
}

/* Secondary Button */
.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

/* Outline Button */
.btn-outline-primary {
    background-color: transparent;
    color: var(--mid-blue);
    border: 2px solid var(--mid-blue);
}

.btn-outline-primary:hover {
    background-color: var(--mid-blue);
    color: white;
}

/* Button Sizes */
.btn-sm {
    padding: 4px 12px;
    font-size: 0.8125rem;
}

.btn-lg {
    padding: var(--gap-md) var(--gap-xl);
    font-size: 1rem;
}

/* ═══════════════════════════════════════════════════════════════════
   ALERTS & NOTIFICATIONS
   ═══════════════════════════════════════════════════════════════════ */

.alert {
    padding: var(--gap-md) var(--gap-lg);
    border-radius: var(--border-radius);
    border: 1px solid;
    margin-bottom: var(--gap-lg);
    display: flex;
    align-items: flex-start;
    gap: var(--gap-md);
}

.alert-success {
    background-color: rgba(40, 167, 69, 0.1);
    border-color: rgba(40, 167, 69, 0.3);
    color: var(--accent-green);
}

.alert-danger {
    background-color: rgba(220, 53, 69, 0.1);
    border-color: rgba(220, 53, 69, 0.3);
    color: var(--accent-red);
}

.alert-warning {
    background-color: rgba(255, 193, 7, 0.1);
    border-color: rgba(255, 193, 7, 0.3);
    color: #a67000;
}

.alert-info {
    background-color: rgba(111, 66, 193, 0.1);
    border-color: rgba(111, 66, 193, 0.3);
    color: var(--accent-purple);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: calc(var(--topbar-height) + var(--gap-lg));
    right: var(--gap-lg);
    z-index: 1200;
    max-width: 400px;
}

.toast {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--card-hover-shadow);
    padding: var(--gap-md) var(--gap-lg);
    margin-bottom: var(--gap-md);
    display: flex;
    align-items: center;
    gap: var(--gap-md);
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(400px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ═══════════════════════════════════════════════════════════════════
   CARDS & TABLES
   ═══════════════════════════════════════════════════════════════════ */

.card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    overflow: hidden;
    margin-bottom: var(--gap-lg);
}

.card-header {
    background: #fff;
    color: #1a1a2e;
    padding: var(--gap-md) var(--gap-lg);
    font-weight: 600;
    border-bottom: 1px solid #eef0f8;
}

.card-body {
    padding: var(--gap-lg);
}

.table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: var(--gap-lg);
}

.table thead {
    background-color: #f0f4fb;
    color: #4b5563;
}

.table thead th {
    padding: var(--gap-md);
    text-align: left;
    font-weight: 600;
}

.table tbody td {
    padding: var(--gap-md);
    border-bottom: 1px solid #e0e0e0;
}

.table tbody tr:hover {
    background-color: #f5f7ff;
}

/* ═══════════════════════════════════════════════════════════════════
   AUTHENTICATION & LOGIN PAGES
   ═══════════════════════════════════════════════════════════════════ */

.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #4361ee 0%, #7c3aed 100%);
    padding: var(--gap-lg);
}

.auth-card {
    background: white;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--card-hover-shadow);
    padding: var(--gap-xl);
    width: 100%;
    max-width: 400px;
}

.auth-card-header {
    text-align: center;
    margin-bottom: var(--gap-xl);
}

.auth-card-logo {
    width: 64px;
    height: 64px;
    margin: 0 auto var(--gap-md);
    background: linear-gradient(135deg, #4361ee, #7c3aed);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    font-weight: 700;
}

.auth-card-title {
    font-size: 1.75rem;
    color: var(--brand-blue);
    margin-bottom: var(--gap-sm);
}

/* ═══════════════════════════════════════════════════════════════════
   LOADING OVERLAY
   ═══════════════════════════════════════════════════════════════════ */

.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.loading-overlay.show {
    display: flex;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ═══════════════════════════════════════════════════════════════════
   ATTENDANCE & CERTIFICATE STYLES
   ═══════════════════════════════════════════════════════════════════ */

.attendance-grid {
    display: grid;
    grid-template-columns: 1fr 80px 80px 80px;
    gap: var(--gap-md);
    margin: var(--gap-lg) 0;
    background: white;
    padding: var(--gap-lg);
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
}

.attendance-radio {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #d0d0d0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.certificate-card {
    background: linear-gradient(135deg, #fffacd 0%, #f0e68c 100%);
    border: 3px solid #daa520;
    border-radius: 4px;
    padding: var(--gap-xl);
    max-width: 600px;
    margin: var(--gap-xl) auto;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    text-align: center;
    font-family: Georgia, serif;
}

.certificate-title {
    font-size: 2rem;
    color: #b8860b;
    margin-bottom: var(--gap-sm);
    font-weight: 700;
}

.certificate-seal {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #daa520;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 2rem;
    margin: 0 auto var(--gap-lg);
}

/* ═══════════════════════════════════════════════════════════════════
   RESPONSIVE DESIGN - MOBILE
   ═══════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .sidebar-toggle {
        display: block;
    }

    .main-content {
        margin-left: 0;
    }

    .topbar-search {
        display: none;
    }

    .stat-card-content {
        flex-direction: column;
    }

    .stat-card-icon {
        margin-left: 0;
        margin-top: var(--gap-md);
    }

    .attendance-grid {
        grid-template-columns: 1fr;
    }

    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.25rem; }
}

/* ═══════════════════════════════════════════════════════════════════
   PRINT STYLES
   ═══════════════════════════════════════════════════════════════════ */

@media print {
    .topbar,
    .sidebar,
    .sidebar-overlay,
    .loading-overlay {
        display: none !important;
    }

    .main-content {
        margin-left: 0 !important;
        margin-top: 0 !important;
        padding: 0 !important;
    }

    .card {
        page-break-inside: avoid;
        border: 1px solid #000 !important;
    }
}

/* ═══════════════════════════════════════════════════════════════════
   REDESIGNED LAYOUT: SIDEBAR (v2)
   ═══════════════════════════════════════════════════════════════════ */

/* Main wrapper – sits to the right of the fixed sidebar */
.main-wrapper {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left var(--transition);
    background: #f0f4fb;
}

.main-wrapper.sidebar-collapsed {
    margin-left: var(--sidebar-collapsed-width);
}

/* Sidebar menu list */
.sidebar-menu {
    padding: 12px 0;
    flex: 1;
}

.sidebar-menu li {
    margin: 2px 10px;
    list-style: none;
}

/* Nav link */
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    color: #64748b;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    white-space: nowrap;
}

.sidebar-link:hover {
    background: #eef2ff;
    color: var(--brand-blue);
    text-decoration: none;
}

.sidebar-link.active {
    background: var(--brand-blue);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(67,97,238,0.3);
}

.sidebar-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.95rem;
    background: #f0f4fb;
    color: #64748b;
}

.sidebar-link:hover .sidebar-icon {
    background: #dde4ff;
    color: var(--brand-blue);
}

.sidebar-link.active .sidebar-icon {
    background: rgba(255,255,255,0.22);
    color: #fff;
}

.sidebar-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: opacity var(--transition), width var(--transition);
}

/* Collapsed sidebar – hide text */
.sidebar.collapsed .sidebar-text,
.sidebar.collapsed .app-name {
    display: none;
}

.sidebar.collapsed .sidebar-icon {
    margin: 0 auto;
}

.sidebar.collapsed .sidebar-link {
    justify-content: center;
    gap: 0;
    padding: 10px;
}

.sidebar.collapsed .sidebar-menu li {
    margin: 2px 6px;
}

/* Bottom area: need-help + collapse btn */
.sidebar-bottom {
    padding: 12px 10px 16px;
    border-top: 1px solid #eef0f8;
    margin-top: auto;
}

.need-help-widget {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #eef2ff;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 10px;
    cursor: default;
}

.need-help-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--brand-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: #fff;
    flex-shrink: 0;
}

.need-help-text {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.need-help-text strong {
    color: #1a1a2e;
    font-size: 0.85rem;
    white-space: nowrap;
}

.need-help-text small {
    color: #6b7280;
    font-size: 0.75rem;
    white-space: nowrap;
}

.sidebar-collapse-btn {
    width: 100%;
    background: #f0f4fb;
    border: 1px solid #eef0f8;
    border-radius: 10px;
    color: #64748b;
    padding: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: var(--transition);
}

.sidebar-collapse-btn:hover {
    background: #eef2ff;
    color: var(--brand-blue);
    border-color: #dde4ff;
}

/* Collapsed sidebar – hide need-help text */
.sidebar.collapsed .need-help-text {
    display: none;
}

.sidebar.collapsed .need-help-widget {
    justify-content: center;
    padding: 10px;
}

/* Mobile open state */
.sidebar.mobile-open {
    transform: translateX(0) !important;
}

/* ═══════════════════════════════════════════════════════════════════
   REDESIGNED LAYOUT: TOPBAR (v2)
   ═══════════════════════════════════════════════════════════════════ */

.top-navbar {
    position: sticky;
    top: 0;
    z-index: 900;
    background: #fff;
    border-bottom: 1px solid #e8eaf0;
    height: 62px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    gap: 16px;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
    min-width: 0;
}

.topbar-toggle-btn {
    background: none;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555;
    font-size: 1.1rem;
    cursor: pointer;
    flex-shrink: 0;
    transition: var(--transition);
}

.topbar-toggle-btn:hover {
    background: #eef2ff;
    color: var(--brand-blue);
}

.topbar-search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f0f4fb;
    border: 1px solid #e4e9f7;
    border-radius: 10px;
    padding: 7px 14px;
    flex: 1;
    max-width: 380px;
}

.topbar-search-box i {
    color: #aaa;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.topbar-search-box input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 0.875rem;
    color: #555;
    width: 100%;
}

.topbar-search-box input::placeholder {
    color: #bbb;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* Notification / icon button */
.topbar-icon-btn {
    background: none;
    border: none;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.topbar-icon-btn:hover {
    background: #eef2ff;
    color: var(--brand-blue);
}

.topbar-notif-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 16px;
    height: 16px;
    background: var(--accent-red);
    color: #fff;
    border-radius: 50%;
    font-size: 9px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
}

/* User button */
.topbar-user-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 10px;
    transition: var(--transition);
}

.topbar-user-btn:hover {
    background: #eef2ff;
}

.user-avatar-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand-blue), #7c3aed);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 700;
    flex-shrink: 0;
}

.user-info-text {
    display: flex;
    flex-direction: column;
    text-align: left;
    line-height: 1.2;
}

.user-display-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
}

.user-display-role {
    font-size: 0.72rem;
    color: #888;
    white-space: nowrap;
}

/* Page content area */
.page-content {
    flex: 1;
    padding: 0;
}

/* Page footer */
.page-footer {
    background: #fff;
    border-top: 1px solid #e8eaf0;
    padding: 14px 20px;
    margin-top: auto;
    text-align: center;
}

/* ═══════════════════════════════════════════════════════════════════
   DASHBOARD REDESIGN STYLES (v2)
   ═══════════════════════════════════════════════════════════════════ */

/* Dashboard page header */
.dash-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
}

.dash-page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 4px;
}

.dash-page-subtitle {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0;
}

.dash-date-badge {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid #e8eaf0;
    border-radius: 10px;
    padding: 8px 16px;
    font-size: 0.85rem;
    color: #555;
    white-space: nowrap;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

/* ── Stat Cards ── */
.dash-stat-card {
    background: #fff;
    border-radius: 14px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    transition: var(--transition);
    border: 1px solid #f0f0f5;
}

.dash-stat-card:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.dash-stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.dash-icon-green  { background: rgba(40,167,69,0.12);  color: #28a745; }
.dash-icon-blue   { background: rgba(67,97,238,0.12);  color: #4361ee; }
.dash-icon-orange { background: rgba(253,126,20,0.12); color: #fd7e14; }
.dash-icon-red    { background: rgba(220,53,69,0.12);  color: #dc3545; }
.dash-icon-purple { background: rgba(111,66,193,0.12); color: #6f42c1; }

.dash-icon-blue-soft   { background: rgba(67,97,238,0.10);  }
.dash-icon-green-soft  { background: rgba(40,167,69,0.10);  }
.dash-icon-orange-soft { background: rgba(253,126,20,0.10); }
.dash-icon-red-soft    { background: rgba(220,53,69,0.10);  }

.dash-stat-body {
    flex: 1;
    min-width: 0;
}

.dash-stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1;
    margin-bottom: 4px;
}

.dash-stat-label {
    font-size: 0.8rem;
    color: #6b7280;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 6px;
}

.dash-stat-trend {
    font-size: 0.78rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.trend-up   { color: #28a745; }
.trend-down { color: #dc3545; }

/* ── Dash Card (generic panel) ── */
.dash-card {
    background: #fff;
    border-radius: 14px;
    border: 1px solid #f0f0f5;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.dash-card-header {
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.dash-card-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0;
}

.dash-card-subtitle {
    font-size: 0.78rem;
    color: #9ca3af;
    display: block;
    margin-top: 2px;
}

.dash-card-body {
    padding: 20px;
    flex: 1;
}

/* ── Chart Legend ── */
.chart-legend {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    color: #555;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ── System Status Panel ── */
.sys-status-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 20px;
    border-bottom: 1px solid #f8f8fb;
    transition: background var(--transition-fast);
}

.sys-status-item:last-child {
    border-bottom: none;
}

.sys-status-item:hover {
    background: #fafafe;
}

.sys-status-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.875rem;
    color: #444;
}

.sys-status-icon {
    width: 28px;
    text-align: center;
    font-size: 0.95rem;
}

.sys-pill {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
}

.sys-ok {
    background: rgba(40,167,69,0.1);
    color: #28a745;
}

.sys-warn {
    background: rgba(255,193,7,0.15);
    color: #a67000;
}

.sys-error {
    background: rgba(220,53,69,0.1);
    color: #dc3545;
}

/* ── Quick Actions ── */
.quick-action-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 20px;
    color: #333;
    text-decoration: none;
    border-bottom: 1px solid #f8f8fb;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background var(--transition-fast);
}

.quick-action-item:last-child {
    border-bottom: none;
}

.quick-action-item:hover {
    background: #eef2ff;
    text-decoration: none;
    color: var(--brand-blue);
}

.qa-icon {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.qa-label {
    flex: 1;
}

.qa-arrow {
    font-size: 0.7rem;
    opacity: 0.5;
}

/* ── Recent Schools Table ── */
.dash-table {
    border-collapse: collapse;
    width: 100%;
    font-size: 0.875rem;
}

.dash-table thead th {
    padding: 10px 16px;
    background: #f8f9fc;
    color: #6b7280;
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    border-bottom: 1px solid #eee;
}

.dash-table tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid #f5f5f8;
    vertical-align: middle;
}

.dash-table tbody tr:last-child td {
    border-bottom: none;
}

.dash-table tbody tr:hover td {
    background: #fafafe;
}

.school-name-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.school-avatar {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--brand-blue), #7c3aed);
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dash-badge-active {
    display: inline-flex;
    align-items: center;
    background: rgba(40,167,69,0.1);
    color: #28a745;
    border-radius: 20px;
    padding: 2px 10px;
    font-size: 0.72rem;
    font-weight: 600;
}

.dash-btn-icon {
    width: 30px;
    height: 30px;
    border-radius: 7px;
    background: #eef2ff;
    color: var(--brand-blue);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    text-decoration: none;
    transition: var(--transition-fast);
}

.dash-btn-icon:hover {
    background: var(--brand-blue);
    color: #fff;
    text-decoration: none;
}

/* ── Activity Feed ── */
.activity-feed {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid #f5f5f8;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--brand-blue);
    margin-top: 5px;
    flex-shrink: 0;
}

.activity-content {
    flex: 1;
    min-width: 0;
}

.activity-action {
    font-size: 0.875rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 2px;
}

.activity-meta {
    font-size: 0.78rem;
    color: #9ca3af;
}

.activity-time {
    font-size: 0.75rem;
    color: #bbb;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .main-wrapper {
        margin-left: 0 !important;
    }

    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    .topbar-search-box {
        display: none;
    }

    .dash-page-header {
        flex-direction: column;
    }

    .need-help-widget {
        display: none;
    }
}

/* End of site.css */
