/* =========================================
   SDM ERP - Master Stylesheet
   Supports: Stateboard (Blue) & CBSE (Orange)
   ========================================= */

/* CSS Variables - Defaults (Stateboard) */
:root {
    --theme-color:   #0D47A1;
    --theme-medium:  #1565C0;
    --theme-light:   #E3F2FD;
    --theme-dark:    #0A2472;
    --sidebar-width: 260px;
    --topbar-height: 60px;
    --transition:    0.25s ease;
    --shadow:        0 2px 12px rgba(0,0,0,0.10);
    --shadow-lg:     0 4px 24px rgba(0,0,0,0.15);
    --radius:        8px;
    --radius-sm:     4px;
}

/* ── Global ── */
* { box-sizing: border-box; }
body {
    font-family: 'Inter', 'Segoe UI', sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.6;
    background: #F5F7FA;
    color: #2d3748;
    margin: 0; padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Headings use Poppins */
h1,h2,h3,h4,h5,h6,
.page-title, .modal-title,
.module-card-header h5,
.sidebar-brand-text h6,
.sidebar-nav .nav-heading {
    font-family: 'Poppins', 'Inter', sans-serif;
    font-weight: 600;
    letter-spacing: -0.01em;
}

/* Sharper label/button text */
label, .btn, th, .badge,
.breadcrumb-item, .dropdown-header {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
}

/* Table data — Inter is best for numbers/IDs */
td, .form-control, .form-control-sm, input, select, textarea {
    font-family: 'Inter', sans-serif;
    font-size: 13.5px;
}

/* Monospace fields: admission no, emp id, phone, aadhar */
td:nth-child(2), .mono {
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.01em;
}
a { text-decoration: none; }
a:hover { text-decoration: none; }
.text-theme { color: var(--theme-color) !important; }
.bg-theme  { background-color: var(--theme-color) !important; }
.btn-theme { background-color: var(--theme-color); color: #fff; border-color: var(--theme-color); }
.btn-theme:hover { background-color: var(--theme-dark); border-color: var(--theme-dark); color: #fff; }
.btn-outline-theme { border-color: var(--theme-color); color: var(--theme-color); background: transparent; }
.btn-outline-theme:hover { background-color: var(--theme-color); color: #fff; }

/* ── Layout ── */
.wrapper { display: flex; min-height: 100vh; }
.main-content { flex: 1; margin-left: var(--sidebar-width); display: flex; flex-direction: column; transition: margin var(--transition); min-width: 0; }
.content-area { padding: 24px; flex: 1; }

/* ── Sidebar ── */
.sidebar {
    width: var(--sidebar-width);
    background: var(--theme-dark);
    background: linear-gradient(180deg, var(--theme-dark) 0%, var(--theme-color) 100%);
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: width var(--transition), transform var(--transition);
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.3) transparent;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.3); border-radius: 4px; }

.sidebar-brand {
    display: flex;
    align-items: center;
    padding: 18px 16px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.15);
    gap: 10px;
}
.logo-circle { width: 42px; height: 42px; background: rgba(255,255,255,0.2); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 18px; flex-shrink: 0; }
.sidebar-school-logo { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(255,255,255,0.3); flex-shrink: 0; }
.sidebar-brand-text h6 { color: #fff; margin: 0; font-size: 13px; font-weight: 700; line-height: 1.3; letter-spacing: 0.01em; }
.sidebar-brand-text small { color: rgba(255,255,255,0.6); font-size: 10px; font-weight: 500; text-transform: uppercase; letter-spacing: 1.5px; font-family: 'Inter', sans-serif; }

.sidebar-year-badge { padding: 8px 16px; background: rgba(255,255,255,0.1); font-size: 12px; color: rgba(255,255,255,0.85); display: flex; align-items: center; }

.sidebar-nav { list-style: none; margin: 0; padding: 8px 0; flex: 1; }
.nav-heading { font-size: 9.5px; font-weight: 700; font-family: 'Inter', sans-serif; text-transform: uppercase; letter-spacing: 2px; color: rgba(255,255,255,0.4); padding: 14px 16px 4px; }
.sidebar-nav .nav-item .nav-link {
    display: flex; align-items: center; padding: 10px 16px; color: rgba(255,255,255,0.82);
    transition: all var(--transition); gap: 10px; font-size: 13px; font-weight: 500;
    font-family: 'Inter', sans-serif; border-left: 3px solid transparent;
    cursor: pointer;
}
.sidebar-nav .nav-item .nav-link i:first-child { width: 18px; text-align: center; font-size: 14px; flex-shrink: 0; }
.sidebar-nav .nav-item .nav-link span { flex: 1; }
.sidebar-nav .nav-item .nav-link .arrow { font-size: 10px; transition: transform var(--transition); }
.sidebar-nav .nav-item .nav-link:hover { color: #fff; background: rgba(255,255,255,0.1); border-left-color: rgba(255,255,255,0.5); }
.sidebar-nav .nav-item.active > .nav-link { color: #fff; background: rgba(255,255,255,0.15); border-left-color: #fff; font-weight: 600; }
.sidebar-nav .nav-item.open > .nav-link .arrow { transform: rotate(90deg); }

.submenu { list-style: none; margin: 0; padding: 4px 0; background: rgba(0,0,0,0.15); display: none; }
.sidebar-nav .nav-item.open .submenu { display: block; }
.submenu li a { display: flex; align-items: center; padding: 8px 16px 8px 44px; color: rgba(255,255,255,0.7); font-size: 13px; gap: 8px; transition: color var(--transition), background var(--transition); border-left: 3px solid transparent; }
.submenu li a i { font-size: 12px; width: 14px; }
.submenu li a:hover { color: #fff; background: rgba(255,255,255,0.08); }
.submenu li a.active { color: #fff; font-weight: 600; background: rgba(255,255,255,0.1); border-left-color: rgba(255,255,255,0.6); }

.sidebar-footer { padding: 12px 16px; border-top: 1px solid rgba(255,255,255,0.15); }
.btn-logout { display: flex; align-items: center; gap: 10px; background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2); color: rgba(255,255,255,0.8); padding: 10px 16px; border-radius: var(--radius); width: 100%; font-size: 13px; cursor: pointer; transition: all var(--transition); }
.btn-logout:hover { background: rgba(255,255,255,0.2); color: #fff; }

/* Collapsed sidebar */
.sidebar-collapsed .sidebar { width: 64px; }
.sidebar-collapsed .sidebar-brand-text,
.sidebar-collapsed .sidebar-year-badge span,
.sidebar-collapsed .nav-item .nav-link span,
.sidebar-collapsed .nav-item .nav-link .arrow,
.sidebar-collapsed .nav-heading,
.sidebar-collapsed .submenu,
.sidebar-collapsed .btn-logout span { display: none; }
.sidebar-collapsed .main-content { margin-left: 64px; }
.sidebar-collapsed .sidebar-brand { justify-content: center; }
.sidebar-collapsed .btn-logout { justify-content: center; }

/* ── Topbar ── */
.topbar {
    height: var(--topbar-height);
    background: #fff;
    display: flex;
    align-items: center;
    padding: 0 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    position: sticky;
    top: 0;
    z-index: 999;
    gap: 12px;
}
.topbar-left { flex: 1; }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.sidebar-toggle { color: var(--theme-color); font-size: 18px; padding: 6px; border: none; background: none; }
.breadcrumb { background: none; padding: 0; margin: 0; font-size: 13px; }
.breadcrumb-item a { color: var(--theme-color); }
.breadcrumb-item.active { color: #555; }
.topbar-year { font-size: 13px; color: #555; background: var(--theme-light); padding: 4px 10px; border-radius: 20px; text-decoration: none !important; display: flex; align-items: center; }
.topbar-year:hover { background: var(--theme-color); color: #fff; }
.topbar-year.dropdown-toggle::after { display: none; }
.year-switcher-menu { min-width: 220px; }
.year-switcher-menu .year-item { cursor: pointer; font-size: 13px; }
.year-switcher-menu .year-item.active-year { color: var(--theme-color); font-weight: 600; }
.year-switcher-menu .year-item.active-year::after { content: ' ✓'; }
.topbar-icon-btn { width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; border-radius: 50%; color: #555; font-size: 16px; transition: background .2s, color .2s; }
.topbar-icon-btn:hover { background: var(--theme-light); color: var(--theme-color); text-decoration: none; }
.school-type-badge { font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 20px; text-transform: uppercase; letter-spacing: 0.5px; }
.school-type-badge.stateboard { background: #E3F2FD; color: #0D47A1; }
.school-type-badge.cbse { background: #FBE9E7; color: #E65100; }
.topbar-user .dropdown-toggle { display: flex; align-items: center; gap: 8px; color: #333; font-size: 14px; }
.topbar-user .dropdown-toggle::after { display: none; }
.user-avatar { width: 34px; height: 34px; background: var(--theme-color); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 13px; overflow: hidden; }
.user-name { font-weight: 600; font-size: 13px; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; letter-spacing: 0.01em; }

/* ── Page Header ── */
.page-header { margin-bottom: 20px; }
.page-header h3 { font-size: 21px; font-weight: 700; color: var(--theme-dark); margin: 0 0 4px; letter-spacing: -0.02em; }
.page-header p { margin: 0; font-size: 13px; color: #718096; font-weight: 400; }
.page-title-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }

/* ── Cards ── */
.card { border: none; border-radius: var(--radius); box-shadow: var(--shadow); }
.card-header { background: #fff; border-bottom: 2px solid var(--theme-light); padding: 14px 18px; font-weight: 600; color: var(--theme-dark); }
.card-theme .card-header { background: var(--theme-color); color: #fff; border-bottom: none; }

/* ── Dashboard Stats ── */
.stats-row .stat-card {
    display: flex; align-items: center; padding: 20px; border-radius: var(--radius);
    box-shadow: var(--shadow); margin-bottom: 20px; gap: 16px; color: #fff;
    background: var(--theme-color);
    transition: transform var(--transition), box-shadow var(--transition);
}
.stats-row .stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.stat-blue  { background: linear-gradient(135deg, #1565C0, #1976D2) !important; }
.stat-green { background: linear-gradient(135deg, #2E7D32, #388E3C) !important; }
.stat-orange { background: linear-gradient(135deg, #E65100, #F57C00) !important; }
.stat-red   { background: linear-gradient(135deg, #B71C1C, #C62828) !important; }
.stat-icon { font-size: 32px; opacity: 0.85; }
.stat-info h2 { font-size: 28px; font-weight: 700; margin: 0; }
.stat-info p  { margin: 0; font-size: 13px; opacity: 0.85; }

.fee-amount-display { display: flex; align-items: baseline; justify-content: center; gap: 4px; margin: 10px 0; }
.fee-amount-display .currency { font-size: 20px; color: var(--theme-color); font-weight: 700; }
.fee-amount-display .amount   { font-size: 32px; color: var(--theme-color); font-weight: 800; }

.quick-actions-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 8px; }
.quick-action-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 12px 8px; background: var(--theme-light); border-radius: var(--radius); color: var(--theme-color); font-size: 12px; text-align: center; transition: all var(--transition); gap: 6px; font-weight: 500; }
.quick-action-btn i { font-size: 20px; }
.quick-action-btn:hover { background: var(--theme-color); color: #fff; transform: scale(1.03); }

.notice-list { overflow-y: auto; max-height: 260px; }
.notice-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 16px; border-bottom: 1px solid #F0F0F0; }
.notice-category { font-size: 10px; font-weight: 700; text-transform: uppercase; padding: 2px 6px; border-radius: 3px; white-space: nowrap; margin-top: 2px; }
.notice-category.academic { background: #E3F2FD; color: #1565C0; }
.notice-category.events   { background: #E8F5E9; color: #2E7D32; }
.notice-category.exams    { background: #FFF8E1; color: #F57F17; }
.notice-category.holiday  { background: #E8F5E9; color: #2E7D32; }
.notice-category.general  { background: #EDE7F6; color: #4527A0; }

/* ── DataTables ── */
.dataTables_wrapper .dataTables_filter input { border: 1px solid #ddd; border-radius: var(--radius-sm); padding: 4px 10px; }
.dataTables_wrapper .dataTables_length select { border: 1px solid #ddd; border-radius: var(--radius-sm); padding: 4px 6px; }
table.dataTable thead th {
    background: var(--theme-light);
    color: var(--theme-dark);
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 2px solid var(--theme-color) !important;
}
table.dataTable tbody td { font-size: 13.5px; vertical-align: middle; }
table.dataTable tbody tr:hover { background: var(--theme-light); }
.page-item.active .page-link { background-color: var(--theme-color); border-color: var(--theme-color); }
.page-link { color: var(--theme-color); }

/* ── Forms ── */
.form-control:focus { border-color: var(--theme-color); box-shadow: 0 0 0 0.2rem rgba(13,71,161,0.15); }
.select2-container--bootstrap4 .select2-selection--single:focus { border-color: var(--theme-color) !important; box-shadow: 0 0 0 0.2rem rgba(13,71,161,0.15) !important; }
.form-section { background: #fff; border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-bottom: 20px; }
.form-section-title { font-size: 15px; font-weight: 700; color: var(--theme-dark); padding-bottom: 12px; border-bottom: 2px solid var(--theme-light); margin-bottom: 18px; display: flex; align-items: center; gap: 8px; }
.form-section-title i { color: var(--theme-color); }
label { font-size: 12.5px; font-weight: 600; color: #4a5568; margin-bottom: 5px; letter-spacing: 0.01em; }

/* ── Modals ── */
.modal-header { background: var(--theme-color); color: #fff; border-radius: var(--radius) var(--radius) 0 0; }
.modal-header .close { color: #fff; opacity: 0.8; text-shadow: none; }
.modal-header .close:hover { opacity: 1; }
.modal-title { font-weight: 600; }


/* ── Badges ── */
.badge { font-size: 11px; font-weight: 600; font-family: 'Inter', sans-serif; padding: 3px 8px; border-radius: 4px; letter-spacing: 0.02em; }
.badge-stateboard { background: #E3F2FD; color: #0D47A1; }
.badge-cbse       { background: #FBE9E7; color: #E65100; }

/* ── Auth Pages ── */
.auth-body { background: linear-gradient(135deg, var(--theme-dark) 0%, var(--theme-color) 100%); min-height: 100vh; display: flex; align-items: center; justify-content: center; }
body.school-stateboard .auth-body { background: linear-gradient(135deg, #0A2472 0%, #0D47A1 100%); }
body.school-cbse       .auth-body { background: linear-gradient(135deg, #BF360C 0%, #E65100 100%); }

/* School Selection */
.select-school-wrapper { width: 100%; padding: 20px; }
.select-school-container { max-width: 800px; margin: 0 auto; }
.select-school-header { text-align: center; color: #fff; margin-bottom: 30px; }
.select-school-header h2 { font-size: 28px; font-weight: 700; }
.select-school-header p { opacity: 0.85; }
.school-card { display: block; border-radius: 12px; overflow: hidden; transition: transform var(--transition), box-shadow var(--transition); text-decoration: none; margin-bottom: 20px; }
.school-card:hover { transform: translateY(-5px); box-shadow: 0 12px 30px rgba(0,0,0,0.25); }
.school-card-inner { background: #fff; border-radius: 12px; overflow: hidden; }
.school-logo-wrapper { padding: 24px; text-align: center; }
.school-logo-placeholder { width: 80px; height: 80px; border-radius: 50%; margin: 0 auto; display: flex; align-items: center; justify-content: center; font-size: 32px; color: #fff; }
.school-logo-placeholder.stateboard { background: linear-gradient(135deg, #0A2472, #0D47A1); }
.school-logo-placeholder.cbse       { background: linear-gradient(135deg, #BF360C, #E65100); }
.school-logo-placeholder img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.school-card-body { padding: 0 20px 16px; text-align: center; }
.school-card-body h4 { color: #222; font-weight: 700; margin: 0 0 4px; font-size: 16px; }
.school-card-body h5 { color: #555; font-weight: 400; margin: 0 0 8px; font-size: 14px; }
.school-card-footer { padding: 14px 20px; text-align: center; color: #fff; font-weight: 600; font-size: 14px; }
.stateboard-footer { background: linear-gradient(90deg, #0D47A1, #1565C0); }
.cbse-footer       { background: linear-gradient(90deg, #E65100, #F57C00); }

/* Login */
.login-container { background: #fff; border-radius: 16px; overflow: hidden; display: flex; max-width: 900px; width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,0.3); }
.login-left { flex: 1; background: var(--theme-color); background: linear-gradient(135deg, var(--theme-dark) 0%, var(--theme-color) 100%); padding: 50px 30px; display: flex; align-items: center; justify-content: center; }
.login-school-info { text-align: center; color: #fff; }
.login-logo { width: 80px; height: 80px; border-radius: 50%; background: rgba(255,255,255,0.2); margin: 0 auto 16px; display: flex; align-items: center; justify-content: center; font-size: 36px; color: #fff; }
.login-logo img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.login-school-info h3 { font-size: 20px; font-weight: 700; margin: 0 0 4px; }
.login-school-info p { opacity: 0.8; font-size: 14px; margin: 0 0 12px; }
.school-type-tag { display: inline-block; background: rgba(255,255,255,0.2); padding: 4px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; }
.school-motto { font-style: italic; opacity: 0.75; font-size: 14px; }
.login-right { flex: 1; padding: 50px 40px; }
.login-title { font-size: 24px; font-weight: 700; color: var(--theme-dark); margin-bottom: 6px; }
.login-form-wrap h4 { margin-bottom: 4px; }

/* ── Module Tables Container ── */
.module-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 24px; }
.module-card-header { padding: 16px 20px; border-bottom: 2px solid var(--theme-light); display: flex; justify-content: space-between; align-items: center; }
.module-card-header h5 { margin: 0; color: var(--theme-dark); font-size: 14.5px; font-weight: 700; letter-spacing: -0.01em; display: flex; align-items: center; gap: 8px; }
.module-card-header h5 i { color: var(--theme-color); }
.module-card-body { padding: 16px; }

/* ── Attendance ── */
.attendance-grid { display: grid; grid-template-columns: 1fr; gap: 2px; }
.attendance-row { display: flex; align-items: center; padding: 8px 12px; background: #fff; border: 1px solid #F0F0F0; border-radius: var(--radius-sm); gap: 12px; }
.attendance-row:hover { background: var(--theme-light); }
.att-student-name { flex: 1; font-size: 14px; font-weight: 500; }
.att-adm-no { font-size: 12px; color: #888; width: 90px; }
.att-status-btns { display: flex; gap: 6px; }
.att-btn { padding: 4px 12px; border: 1px solid #ddd; border-radius: 4px; font-size: 12px; cursor: pointer; background: #f9f9f9; color: #666; transition: all 0.15s; font-weight: 500; }
.att-btn.present.active  { background: #2E7D32; border-color: #2E7D32; color: #fff; }
.att-btn.absent.active   { background: #C62828; border-color: #C62828; color: #fff; }
.att-btn.late.active     { background: #F57F17; border-color: #F57F17; color: #fff; }
.att-btn.half_day.active { background: #E65100; border-color: #E65100; color: #fff; }

/* ── Photo Upload Preview ── */
.photo-upload-wrap { position: relative; display: inline-block; }
.photo-preview { width: 100px; height: 100px; border-radius: 50%; object-fit: cover; border: 3px solid var(--theme-light); }
.photo-upload-btn { position: absolute; bottom: 0; right: 0; background: var(--theme-color); color: #fff; border-radius: 50%; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; font-size: 12px; cursor: pointer; }

/* ── Student Profile Card ── */
.student-profile-card { background: linear-gradient(135deg, var(--theme-dark), var(--theme-color)); color: #fff; border-radius: var(--radius); padding: 24px; display: flex; gap: 20px; align-items: center; }
.student-profile-img { width: 80px; height: 80px; border-radius: 50%; border: 3px solid rgba(255,255,255,0.5); object-fit: cover; }
.student-profile-info h4 { margin: 0 0 4px; font-size: 20px; }
.student-profile-info p { margin: 0; opacity: 0.85; font-size: 13px; }
.student-profile-badges { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.student-profile-badges .badge { background: rgba(255,255,255,0.2); color: #fff; font-size: 11px; padding: 4px 10px; }

/* ── Fee Receipt ── */
.receipt-wrapper { max-width: 700px; margin: 0 auto; background: #fff; padding: 30px; border-radius: var(--radius); }
.receipt-header { text-align: center; border-bottom: 2px solid var(--theme-color); padding-bottom: 16px; margin-bottom: 20px; }
.receipt-school-name { font-size: 20px; font-weight: 800; color: var(--theme-dark); }
.receipt-table th { background: var(--theme-light); color: var(--theme-dark); }
.receipt-amount-row td { font-weight: 700; font-size: 16px; color: var(--theme-color); }
.receipt-stamp { text-align: center; margin-top: 30px; padding-top: 20px; border-top: 1px dashed #ddd; }

/* ── Report Card ── */
.report-card-wrapper { max-width: 700px; margin: 0 auto; background: #fff; padding: 30px; }
.report-card-header { text-align: center; border-bottom: 3px solid var(--theme-color); padding-bottom: 16px; }
.marks-table th  { background: var(--theme-color); color: #fff; }
.grade-A-plus   { color: #2E7D32; font-weight: 700; }
.grade-fail     { color: #C62828; font-weight: 700; }

/* ── Responsive ── */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.mobile-open { transform: translateX(0); }
    .main-content { margin-left: 0 !important; }
    .login-container { flex-direction: column; }
    .login-left { padding: 30px; }
    .content-area { padding: 16px; }
    .quick-actions-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── CBSE Orange overrides ── */
.school-cbse table.dataTable thead th { background: #FBE9E7; color: #BF360C; }
.school-cbse .card-header { border-bottom-color: #FBE9E7; color: #BF360C; }
.school-cbse .form-control:focus { border-color: #E65100; box-shadow: 0 0 0 0.2rem rgba(230,81,0,0.15); }

/* ── Utility ── */
.cursor-pointer { cursor: pointer; }
.hover-scale:hover { transform: scale(1.02); transition: transform 0.15s; }
.section-divider { height: 1px; background: var(--theme-light); margin: 20px 0; }
.empty-state { text-align: center; padding: 40px 20px; color: #999; }
.empty-state i { font-size: 48px; opacity: 0.4; margin-bottom: 12px; }
.loading-overlay { position: fixed; inset: 0; background: rgba(255,255,255,0.7); z-index: 9999; display: flex; align-items: center; justify-content: center; display: none; }
.spinner-theme { color: var(--theme-color); }

/* Select2 theme fix */
.select2-container { width: 100% !important; }
.select2-container--bootstrap4 .select2-selection--single {
    height: calc(1.5em + 0.75rem + 2px) !important;
    padding: 0.375rem 0.75rem !important;
    border: 1px solid #ced4da !important;
    border-radius: 0.25rem !important;
    display: flex !important;
    align-items: center !important;
}
.select2-container--bootstrap4 .select2-selection--single .select2-selection__rendered {
    line-height: 1.5 !important;
    padding-left: 0 !important;
    padding-right: 20px !important;
    color: #495057 !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}
.select2-container--bootstrap4 .select2-selection--single .select2-selection__placeholder {
    color: #6c757d !important;
    line-height: 1.5 !important;
}
.select2-container--bootstrap4 .select2-selection--single .select2-selection__arrow {
    height: 100% !important;
    top: 0 !important;
    right: 8px !important;
    display: flex !important;
    align-items: center !important;
}
.select2-container--bootstrap4 .select2-selection--single .select2-selection__arrow b {
    border-color: #6c757d transparent transparent transparent !important;
    border-width: 5px 4px 0 4px !important;
    margin-top: 0 !important;
    position: static !important;
}
.select2-container--bootstrap4 .select2-selection--multiple {
    min-height: calc(1.5em + 0.75rem + 2px) !important;
    border: 1px solid #ced4da !important;
    border-radius: 0.25rem !important;
    padding: 2px 6px !important;
}
.select2-container--bootstrap4 .select2-selection--multiple .select2-selection__rendered {
    padding: 0 !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 2px !important;
}

/* ── jQuery Validate – Bootstrap 4 error styling ── */
.invalid-feedback { display: block; font-size: 0.82rem; color: #dc3545; margin-top: 0.2rem; }
.is-invalid { border-color: #dc3545 !important; }
.is-invalid:focus { box-shadow: 0 0 0 0.2rem rgba(220,53,69,.25) !important; }
.is-valid { border-color: #28a745 !important; }
/* Select2 invalid ring */
.is-invalid-select2 { border-color: #dc3545 !important; box-shadow: 0 0 0 0.2rem rgba(220,53,69,.15) !important; }
/* Keep error visible even when field loses focus */
label.error { display: none !important; } /* hide any label-based errors; we use div.invalid-feedback only */
