/* ==========================================================================
   School Management — "Light & airy" design system
   Loaded after the Limitless template CSS and overrides it.
   ========================================================================== */

@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("../fonts/inter/inter-latin-wght-normal.woff2") format("woff2");
}

:root {
    /* Brand */
    --sm-primary: #4f46e5;
    --sm-primary-hover: #4338ca;
    --sm-primary-soft: #eef2ff;
    --sm-primary-ring: rgba(79, 70, 229, .16);

    /* Neutrals */
    --sm-ink: #0f172a;
    --sm-text: #334155;
    --sm-muted: #64748b;
    --sm-faint: #94a3b8;
    --sm-line: #e2e8f0;
    --sm-line-soft: #eef2f6;
    --sm-canvas: #f8fafc;
    --sm-surface: #ffffff;
    --sm-hover: #f1f5f9;

    /* Status */
    --sm-success: #059669; --sm-success-soft: #ecfdf5;
    --sm-warning: #d97706; --sm-warning-soft: #fffbeb;
    --sm-danger: #dc2626;  --sm-danger-soft: #fef2f2;
    --sm-info: #0284c7;    --sm-info-soft: #f0f9ff;

    /* Shape */
    --sm-radius-sm: 8px;
    --sm-radius: 10px;
    --sm-radius-lg: 14px;
    --sm-shadow-xs: 0 1px 2px rgba(15, 23, 42, .04);
    --sm-shadow-sm: 0 1px 3px rgba(15, 23, 42, .06), 0 1px 2px rgba(15, 23, 42, .03);
    --sm-shadow-md: 0 10px 30px -12px rgba(15, 23, 42, .18);
    --sm-shadow-lg: 0 24px 48px -16px rgba(15, 23, 42, .22);

    --sm-sidebar-w: 260px;
    --sm-topbar-h: 64px;
}

/* ---------- Base ---------- */
html { background: var(--sm-canvas); }
body {
    color: var(--sm-text);
    background: var(--sm-canvas);
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.55;
    font-feature-settings: "cv11", "ss01";
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { color: var(--sm-ink); font-weight: 650; letter-spacing: -.015em; }
a { color: var(--sm-primary); }
a:hover { color: var(--sm-primary-hover); }
::selection { background: var(--sm-primary-soft); color: var(--sm-ink); }
:focus-visible { outline: 2px solid var(--sm-primary); outline-offset: 2px; }
hr { border-color: var(--sm-line); }
.text-muted { color: var(--sm-muted) !important; }
.font-weight-semibold { font-weight: 600; }
.font-italic { font-style: normal !important; }
.text-primary { color: var(--sm-primary) !important; }
.text-danger { color: var(--sm-danger) !important; }
.text-success { color: var(--sm-success) !important; }
.text-info, .text-teal { color: var(--sm-info) !important; }
.bg-primary { background-color: var(--sm-primary) !important; }

/* Thin, quiet scrollbars */
* { scrollbar-width: thin; scrollbar-color: #cbd5e1 transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { border: 3px solid transparent; border-radius: 999px; background: #cbd5e1; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- Top bar ---------- */
.app-topbar.navbar {
    min-height: var(--sm-topbar-h);
    padding: 0 20px 0 0;
    border-bottom: 1px solid var(--sm-line);
    background: rgba(255, 255, 255, .92);
    backdrop-filter: saturate(180%) blur(8px);
    box-shadow: none;
    /* backdrop-filter creates its own stacking layer; lift it above page content
       so the account dropdown is never drawn behind cards or banners. */
    position: relative;
    z-index: 1030;
}
.app-topbar__brand {
    display: flex;
    align-items: center;
    align-self: stretch;
    width: var(--sm-sidebar-w);
    padding: 0 20px;
}
.navbar-brand-title {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
    margin: 0;
    color: var(--sm-ink);
    font-size: 15.5px;
    font-weight: 700;
    letter-spacing: -.02em;
}
.navbar-brand-title:hover { color: var(--sm-ink); }
.navbar-brand-name { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.navbar-brand-mark {
    display: grid;
    flex: none;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 10px;
    color: #fff;
    background: linear-gradient(135deg, #6366f1, var(--sm-primary) 55%, #7c3aed);
    box-shadow: 0 6px 14px -6px rgba(79, 70, 229, .6);
}
.app-topbar .navbar-nav-link {
    display: flex;
    align-items: center;
    min-height: 40px;
    margin: 12px 0;
    padding: 0 10px;
    border-radius: var(--sm-radius);
    color: var(--sm-muted);
}
.app-topbar .navbar-nav-link:hover, .app-topbar .show > .navbar-nav-link { color: var(--sm-ink); background: var(--sm-hover); }
.app-topbar .navbar-nav-link:before { display: none; }
.app-topbar .navbar-toggler { padding: 8px 10px; border: 0; border-radius: var(--sm-radius); color: var(--sm-text); }
.app-topbar .navbar-toggler:hover { background: var(--sm-hover); }

.app-session-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-right: 10px;
    padding: 6px 12px;
    border: 1px solid var(--sm-line);
    border-radius: 999px;
    color: var(--sm-text);
    background: var(--sm-surface);
    font-size: 12.5px;
    font-weight: 600;
    white-space: nowrap;
}
a.app-session-pill:hover { color: var(--sm-primary); border-color: #c7d2fe; background: var(--sm-primary-soft); }
.app-session-pill i { color: var(--sm-primary); font-size: 13px; }
.app-session-pill--quiet { margin: 0; }

.app-avatar { width: 36px; height: 36px; flex: none; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--sm-line); }
.app-avatar--sm { width: 30px; height: 30px; }
.app-user { gap: 10px; }
.app-user, .app-user:hover, .app-user:focus, .app-user * { text-decoration: none !important; }
.app-user.dropdown-toggle:after { margin-left: 4px; color: var(--sm-faint); }
.app-topbar .dropdown-user .navbar-nav-link > .app-user__text { display: flex; flex-direction: column; margin: 0; line-height: 1.25; text-align: left; }
.app-user__name { color: var(--sm-ink); font-size: 13.5px; font-weight: 600; }
.app-user__role { color: var(--sm-muted); font-size: 12px; }

/* ---------- Sidebar ---------- */
.app-sidebar.sidebar {
    width: var(--sm-sidebar-w);
    border-right: 1px solid var(--sm-line);
    background: var(--sm-surface);
    box-shadow: none;
}
.app-sidebar .sidebar-content { background: transparent; }
.app-sidebar .card { border: 0; background: transparent; box-shadow: none; }
.app-sidebar .sidebar-user { margin: 16px 14px 6px; border: 1px solid var(--sm-line); border-radius: var(--sm-radius-lg); background: var(--sm-canvas); }
.app-sidebar .sidebar-user .card-body { padding: 12px 14px; }
.app-sidebar .sidebar-user img { object-fit: cover; box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--sm-line); }
.app-sidebar .sidebar-user .media-title { color: var(--sm-ink); font-size: 13.5px; line-height: 1.3; }
.app-sidebar .sidebar-user .opacity-50 { color: var(--sm-muted); opacity: 1 !important; }
.app-sidebar__cog { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 8px; color: var(--sm-muted); }
.app-sidebar__cog:hover { color: var(--sm-primary); background: var(--sm-primary-soft); }

.app-sidebar .nav-sidebar { padding: 8px 12px 28px; }
.app-sidebar .nav-sidebar .nav-item > .nav-link {
    display: flex;
    align-items: center;
    min-height: 40px;
    margin: 2px 0;
    padding: 9px 12px;
    border-radius: var(--sm-radius);
    color: #475569;
    font-weight: 500;
    transition: background-color .15s ease, color .15s ease;
}
.app-sidebar .nav-sidebar .nav-item > .nav-link i { margin-right: 12px; color: var(--sm-faint); font-size: 16px; transition: color .15s ease; }
.app-sidebar .nav-sidebar .nav-item > .nav-link:hover { color: var(--sm-ink); background: var(--sm-hover); }
.app-sidebar .nav-sidebar .nav-item > .nav-link:hover i { color: var(--sm-text); }
.app-sidebar .nav-sidebar .nav-item > .nav-link.active,
.app-sidebar .nav-sidebar .nav-item-open > .nav-link:not(.disabled) {
    color: var(--sm-primary);
    background: var(--sm-primary-soft);
    font-weight: 600;
    box-shadow: none;
}
.app-sidebar .nav-sidebar .nav-item > .nav-link.active i,
.app-sidebar .nav-sidebar .nav-item-open > .nav-link i { color: var(--sm-primary); }
.app-sidebar .nav-item-submenu > .nav-link:after { color: var(--sm-faint); }
.app-sidebar .nav-group-sub { margin: 2px 0 6px; padding: 0 0 0 22px; background: transparent !important; }
.app-sidebar .nav-group-sub .nav-link {
    position: relative;
    min-height: 34px !important;
    padding: 7px 12px 7px 20px !important;
    border-radius: 8px !important;
    color: var(--sm-muted) !important;
    background: transparent !important;
    font-size: 13px;
    font-weight: 500 !important;
}
.app-sidebar .nav-group-sub .nav-link:before {
    position: absolute;
    top: 50%;
    left: 6px;
    width: 5px;
    height: 5px;
    content: "";
    border-radius: 50%;
    background: #cbd5e1;
    transform: translateY(-50%);
}
.app-sidebar .nav-group-sub .nav-link:hover { color: var(--sm-ink) !important; background: var(--sm-hover) !important; }
.app-sidebar .nav-group-sub .nav-link.active { color: var(--sm-primary) !important; background: transparent !important; font-weight: 600 !important; }
.app-sidebar .nav-group-sub .nav-link.active:before { background: var(--sm-primary); box-shadow: 0 0 0 3px var(--sm-primary-ring); }

/* Collapsed (icon-only) sidebar on desktop */
@media (min-width: 768px) {
    .sidebar-xs .app-sidebar.sidebar-main { width: 72px; }
    .sidebar-xs .app-sidebar .nav-sidebar { padding: 8px 10px; }
    .sidebar-xs .app-sidebar .nav-sidebar .nav-item > .nav-link { justify-content: center; padding: 10px 0; }
    .sidebar-xs .app-sidebar .nav-sidebar .nav-item > .nav-link i { margin: 0; }
    .sidebar-xs .app-sidebar .nav-group-sub { padding: 6px; border: 1px solid var(--sm-line); border-radius: var(--sm-radius); background: var(--sm-surface) !important; box-shadow: var(--sm-shadow-md); }
}

/* ---------- Page frame & header ---------- */
.content-wrapper { background: var(--sm-canvas); }
.content { padding: 8px 32px 40px; }
.app-page-header { border: 0; background: transparent; }
.app-page-header__inner { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 28px 32px 20px; }
.app-breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 6px; color: var(--sm-muted); font-size: 12.5px; font-weight: 500; }
.app-breadcrumb a { color: var(--sm-muted); }
.app-breadcrumb a:hover { color: var(--sm-primary); }
.app-breadcrumb i { margin-right: 3px; font-size: 12px; vertical-align: -1px; }
.app-breadcrumb__sep { color: #cbd5e1; }
.app-page-title { margin: 0; color: var(--sm-ink); font-size: 26px; font-weight: 700; line-height: 1.2; letter-spacing: -.025em; }

/* ---------- Cards ---------- */
.card {
    margin-bottom: 24px;
    border: 1px solid var(--sm-line);
    border-radius: var(--sm-radius-lg);
    background: var(--sm-surface);
    box-shadow: var(--sm-shadow-sm);
}
.card-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--sm-line-soft);
    border-radius: var(--sm-radius-lg) var(--sm-radius-lg) 0 0 !important;
    background: transparent;
}
.card-header:not([class*=bg-]):not([class*=alpha-]) { background: transparent; }
.card-title, .card-header .card-title { color: var(--sm-ink); font-size: 15.5px; font-weight: 650; letter-spacing: -.01em; }
.card-body { padding: 24px; }
.card-footer { padding: 16px 24px; border-top: 1px solid var(--sm-line-soft); background: var(--sm-canvas); }
/* Template panel controls: keep "collapse", drop the pointless "remove card" button. */
.list-icons-item[data-action="remove"] { display: none !important; }
.list-icons-item[data-action="collapse"] { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 8px; color: var(--sm-faint); opacity: 1; }
.list-icons-item[data-action="collapse"]:hover { color: var(--sm-text); background: var(--sm-hover); }
.card-body > fieldset > legend, .card-body legend { color: var(--sm-ink); font-size: 14px; font-weight: 650; }

/* ---------- Tabs ---------- */
.nav-tabs { margin-bottom: 22px; border-bottom: 1px solid var(--sm-line); }
.nav-tabs .nav-item { margin-bottom: -1px; }
.nav-tabs .nav-link, .nav-tabs-highlight .nav-link {
    margin-right: 4px;
    padding: 10px 14px;
    border: 0 !important;
    border-bottom: 2px solid transparent !important;
    border-radius: 0;
    color: var(--sm-muted);
    background: transparent !important;
    font-weight: 600;
}
.nav-tabs .nav-link:hover { color: var(--sm-ink); }
.nav-tabs .nav-link.active, .nav-tabs .nav-item.show .nav-link, .nav-tabs-highlight .nav-link.active {
    color: var(--sm-primary);
    border-bottom-color: var(--sm-primary) !important;
}
.nav-tabs-highlight .nav-link:before { display: none !important; }
.nav-tabs .nav-link i { margin-right: 6px; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 40px;
    padding: 8px 16px;
    border-radius: var(--sm-radius);
    font-weight: 600;
    letter-spacing: -.005em;
    font-size: 14px;
    white-space: nowrap;
    box-shadow: none !important;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .05s ease;
}
.btn:active { transform: translateY(1px); }
.btn-sm { min-height: 32px; padding: 5px 12px; border-radius: 8px; font-size: 13px; }
.btn-lg { min-height: 48px; padding: 10px 22px; font-size: 15px; }
.btn-block { display: flex; }
.btn-primary { border-color: var(--sm-primary); color: #fff; background: var(--sm-primary); box-shadow: 0 1px 2px rgba(79, 70, 229, .3), inset 0 1px 0 rgba(255,255,255,.12) !important; }
.btn-primary:hover, .btn-primary:focus, .btn-primary:not(:disabled):not(.disabled):active { border-color: var(--sm-primary-hover); color: #fff; background: var(--sm-primary-hover); }
.btn-danger { border-color: var(--sm-danger); color: #fff; background: var(--sm-danger); }
.btn-danger:hover, .btn-danger:focus { border-color: #b91c1c; color: #fff; background: #b91c1c; }
.btn-success { border-color: var(--sm-success); color: #fff; background: var(--sm-success); }
.btn-success:hover, .btn-success:focus { border-color: #047857; color: #fff; background: #047857; }
.btn-light, .btn-default, .btn-secondary, .btn-outline-secondary, .btn-outline.bg-slate, .btn-white {
    border: 1px solid var(--sm-line) !important;
    color: var(--sm-text) !important;
    background: var(--sm-surface) !important;
    box-shadow: var(--sm-shadow-xs) !important;
}
.btn-light:hover, .btn-default:hover, .btn-secondary:hover, .btn-outline-secondary:hover, .btn-white:hover { color: var(--sm-ink) !important; background: var(--sm-hover) !important; }
.btn-info, .btn-teal { border-color: var(--sm-primary); color: #fff; background: var(--sm-primary); }
.btn-link { color: var(--sm-primary); }
.btn i { line-height: 1; }
.btn .ml-2 { margin-left: 8px !important; }
.btn .mr-2 { margin-right: 8px !important; }
.btn:disabled, .btn.disabled { opacity: .55; }

/* Selector forms put their action button in a narrow col-md-2: let it fill the column and wrap if needed. */
@media (min-width: 768px) {
    .col-md-2 .btn { width: 100%; white-space: normal; text-align: center; }
}

/* Row action menu (☰ ▾) used in every table */
.list-icons .dropdown-toggle, .list-icons-item.dropdown-toggle {
    display: inline-grid;
    width: 34px;
    height: 32px;
    place-items: center;
    border-radius: 8px;
    color: var(--sm-muted);
}
.list-icons .dropdown-toggle:hover { color: var(--sm-ink); background: var(--sm-hover); }

/* ---------- Forms ---------- */
label, .col-form-label { color: #334155; font-size: 13px; font-weight: 600; }
.form-group { margin-bottom: 18px; }
.form-text, .form-text.text-muted { margin-top: 6px; color: var(--sm-muted); font-size: 12.5px; }
.form-control, .custom-select {
    height: auto;
    min-height: 42px;
    padding: 9px 13px;
    border: 1px solid #d5dce6;
    border-radius: var(--sm-radius);
    color: var(--sm-ink);
    background-color: var(--sm-surface);
    font-size: 14px;
    box-shadow: var(--sm-shadow-xs);
    transition: border-color .15s ease, box-shadow .15s ease;
}
.form-control:hover:not(:focus):not(:disabled) { border-color: #c3ccd9; }
.form-control:focus, .custom-select:focus { border-color: var(--sm-primary); box-shadow: 0 0 0 4px var(--sm-primary-ring); }
.form-control::placeholder { color: var(--sm-faint); }
.form-control:disabled, .form-control[readonly] { color: var(--sm-muted); background: var(--sm-canvas); }
textarea.form-control { min-height: 96px; }
.form-control-lg { min-height: 48px; font-size: 15px; }
.is-invalid, .form-control.is-invalid { border-color: var(--sm-danger) !important; }
.invalid-feedback, .validation-invalid-label { color: var(--sm-danger); font-size: 12.5px; }

/* Select2 — match text inputs */
.select2-container .select2-selection--single,
.select2-container .select2-selection--multiple {
    min-height: 42px;
    padding: 0;
    border: 1px solid #d5dce6 !important;
    border-radius: var(--sm-radius) !important;
    background: var(--sm-surface);
    box-shadow: var(--sm-shadow-xs);
}
.select2-selection--single .select2-selection__rendered {
    display: flex;
    align-items: center;
    min-height: 40px;
    padding: 0 38px 0 13px !important;
    color: var(--sm-ink);
    font-size: 14px;
}
.select2-selection--single .select2-selection__placeholder { color: var(--sm-faint); }
.select2-selection--single .select2-selection__arrow { top: 50% !important; right: 12px !important; margin-top: -8px !important; }
.select2-selection--single .select2-selection__arrow:after { color: var(--sm-faint); }
.select2-container--open .select2-selection--single,
.select2-container--focus .select2-selection--single,
.select2-container--focus .select2-selection--multiple { border-color: var(--sm-primary) !important; box-shadow: 0 0 0 4px var(--sm-primary-ring); }
.select2-dropdown { overflow: hidden; border: 1px solid var(--sm-line) !important; border-radius: var(--sm-radius) !important; box-shadow: var(--sm-shadow-lg); }
.select2-search--dropdown { padding: 8px; }
.select2-search--dropdown .select2-search__field { min-height: 36px; border: 1px solid var(--sm-line) !important; border-radius: 8px; }
.select2-results__option { margin: 0 6px; padding: 8px 10px; border-radius: 7px; }
.select2-results__options { padding: 6px 0; }
.select2-results__option--highlighted[aria-selected] { color: var(--sm-ink) !important; background: var(--sm-hover) !important; }
.select2-results__option[aria-selected=true] { color: var(--sm-primary) !important; background: var(--sm-primary-soft) !important; font-weight: 600; }
.select2-selection--multiple .select2-selection__choice { border-radius: 6px; background: var(--sm-primary-soft); color: var(--sm-primary); border: 0; }

/* Uniform file input */
.uniform-uploader { display: flex; width: 100%; min-height: 42px; overflow: hidden; border: 1px solid #d5dce6; border-radius: var(--sm-radius); background: var(--sm-surface); box-shadow: var(--sm-shadow-xs); }
.uniform-uploader .filename { flex: 1; padding: 10px 13px; border: 0 !important; color: var(--sm-muted); background: transparent; line-height: 1.4; }
.uniform-uploader .action, .uniform-uploader .btn {
    min-height: 0;
    margin: 4px;
    padding: 6px 14px;
    border: 0 !important;
    border-radius: 7px !important;
    color: var(--sm-primary) !important;
    background: var(--sm-primary-soft) !important;
    font-weight: 600;
}
.uniform-uploader:hover .action { background: #e0e7ff !important; }

/* Checkboxes / radios (uniform) */
.uniform-checker span, .uniform-choice span { border-color: #c3ccd9; border-radius: 5px; }
.uniform-choice span { border-radius: 50%; }
.uniform-checker span.checked, .uniform-choice span.checked { border-color: var(--sm-primary); color: var(--sm-primary); }

/* Date pickers */
.datepicker.dropdown-menu, .picker__holder { border: 1px solid var(--sm-line); border-radius: var(--sm-radius); box-shadow: var(--sm-shadow-lg); }
.datepicker table tr td.active, .datepicker table tr td.active:hover,
.datepicker table tr td span.active { color: #fff !important; background: var(--sm-primary) !important; text-shadow: none; }
.datepicker table tr td.today { background: var(--sm-primary-soft) !important; color: var(--sm-primary); }
.datepicker table tr td, .datepicker table tr th { border-radius: 7px; }

/* Wizard steps (student admission) */
.wizard > .steps > ul > li .number { border-color: var(--sm-line); color: var(--sm-muted); }
.wizard > .steps > ul > li.current .number { border-color: var(--sm-primary); color: var(--sm-primary); }
.wizard > .steps > ul > li.done .number { border-color: var(--sm-primary); color: #fff; background: var(--sm-primary); }
.wizard > .steps > ul > li:before, .wizard > .steps > ul > li:after { background-color: var(--sm-line); }
.wizard > .steps > ul > li.done:before, .wizard > .steps > ul > li.done:after, .wizard > .steps > ul > li.current:before { background-color: var(--sm-primary); }

/* ---------- Tables ---------- */
.table { margin-bottom: 0; color: var(--sm-text); }
.table th, .table td { padding: 13px 16px; border-color: var(--sm-line-soft); vertical-align: middle; }
.table thead th {
    border-top: 0;
    border-bottom: 1px solid var(--sm-line) !important;
    color: var(--sm-muted);
    background: var(--sm-canvas);
    font-size: 11.5px;
    font-weight: 650;
    letter-spacing: .05em;
    text-transform: uppercase;
    white-space: nowrap;
}
.table tbody tr { transition: background-color .12s ease; }
.table tbody tr:hover { background: #fafbff; }
.table-striped tbody tr:nth-of-type(odd) { background: #fbfcfe; }
.table-bordered, .table-bordered th, .table-bordered td { border-color: var(--sm-line); }
.table-responsive { border-radius: var(--sm-radius); }
.card > .table:last-child, .card > .table-responsive:last-child > .table { border-radius: 0 0 var(--sm-radius-lg) var(--sm-radius-lg); }
.table img.rounded-circle { object-fit: cover; box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--sm-line); }

/* Some templates put .table-responsive on the <table> itself (which makes it display:block and shrink).
   On larger screens show those as normal full-width tables; phones keep horizontal scrolling. */
@media (min-width: 992px) {
    table.table.table-responsive { display: table; width: 100%; }
}

/* DataTables */
.dataTables_wrapper { width: 100%; }
.datatable-header, .datatable-footer { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 0 0 18px; border: 0; }
.datatable-footer { padding: 18px 0 0; border-top: 0; }
.dataTables_filter, .dataTables_length { float: none; margin: 0; }
.dataTables_filter > label, .dataTables_length > label { display: flex; align-items: center; gap: 10px; margin: 0; color: var(--sm-muted); font-weight: 500; }
.dataTables_filter > label > span:first-child, .dataTables_length > label > span:first-child { float: none; margin: 0; }
.dataTables_filter input {
    min-width: 220px;
    min-height: 38px;
    margin: 0 !important;
    padding: 7px 12px 7px 34px;
    border: 1px solid #d5dce6;
    border-radius: var(--sm-radius);
    background: var(--sm-surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 11px center;
    box-shadow: var(--sm-shadow-xs);
}
.dataTables_filter input:focus { border-color: var(--sm-primary); outline: 0; box-shadow: 0 0 0 4px var(--sm-primary-ring); }
.dataTables_filter > label:after { display: none; }
.dataTables_length .select2-container { min-width: 76px; }
.dt-buttons { display: inline-flex; float: none; margin: 0 0 0 auto; }
.dt-buttons > .btn, .dt-buttons > .dt-button {
    min-height: 38px;
    margin: 0 !important;
    padding: 6px 13px;
    border: 1px solid var(--sm-line) !important;
    border-radius: 0 !important;
    color: var(--sm-text) !important;
    background: var(--sm-surface) !important;
    font-size: 13px;
}
.dt-buttons > .btn + .btn { margin-left: -1px !important; }
.dt-buttons > .btn:first-child { border-radius: var(--sm-radius) 0 0 var(--sm-radius) !important; }
.dt-buttons > .btn:last-child { border-radius: 0 var(--sm-radius) var(--sm-radius) 0 !important; }
.dt-buttons > .btn:hover { color: var(--sm-ink) !important; background: var(--sm-hover) !important; }
.dataTables_info { padding: 0; color: var(--sm-muted); font-size: 13px; }
.dataTables_paginate { float: none; margin: 0 0 0 auto; }
.dataTables_paginate .paginate_button {
    min-width: 34px;
    height: 34px;
    margin-left: 4px;
    padding: 0 10px;
    border: 1px solid transparent;
    border-radius: 8px !important;
    color: var(--sm-text) !important;
    line-height: 32px;
}
.dataTables_paginate .paginate_button:hover:not(.disabled):not(.current) { color: var(--sm-ink) !important; background: var(--sm-hover) !important; }
.dataTables_paginate .paginate_button.current, .dataTables_paginate .paginate_button.current:hover,
.dataTables_paginate .paginate_button.current:focus { border-color: var(--sm-primary); color: #fff !important; background: var(--sm-primary) !important; box-shadow: none; }
.dataTables_paginate .paginate_button.disabled { color: var(--sm-faint) !important; }
table.dataTable thead .sorting:before, table.dataTable thead .sorting:after,
table.dataTable thead .sorting_asc:after, table.dataTable thead .sorting_desc:after { color: #cbd5e1; opacity: 1; }
table.dataTable thead .sorting_asc:after, table.dataTable thead .sorting_desc:after { color: var(--sm-primary); }
div.dt-button-collection { border: 1px solid var(--sm-line); border-radius: var(--sm-radius); box-shadow: var(--sm-shadow-lg); }

/* ---------- Dropdowns, badges, alerts ---------- */
.dropdown-menu {
    min-width: 200px;
    padding: 6px;
    border: 1px solid var(--sm-line);
    border-radius: var(--sm-radius-lg);
    background: var(--sm-surface);
    box-shadow: var(--sm-shadow-lg);
}
.dropdown-item { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 8px; color: var(--sm-text); font-weight: 500; }
.dropdown-item i { margin-right: 0 !important; color: var(--sm-faint); font-size: 15px; }
.dropdown-item:hover, .dropdown-item:focus { color: var(--sm-ink); background: var(--sm-hover); }
.dropdown-item:hover i { color: var(--sm-text); }
.dropdown-item.active, .dropdown-item:active { color: var(--sm-primary); background: var(--sm-primary-soft); }
.dropdown-item.text-danger, .dropdown-item.text-danger i { color: var(--sm-danger) !important; }
.dropdown-item.text-danger:hover { background: var(--sm-danger-soft); }
.dropdown-divider { margin: 6px 0; border-color: var(--sm-line-soft); }
.dropdown-item button, .dropdown-item form button { padding: 0; border: 0; background: none; color: inherit; }

.badge { padding: 4px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; letter-spacing: .01em; }
.badge-primary { color: var(--sm-primary); background: var(--sm-primary-soft); }
.badge-success { color: var(--sm-success); background: var(--sm-success-soft); }
.badge-danger { color: var(--sm-danger); background: var(--sm-danger-soft); }
.badge-warning { color: var(--sm-warning); background: var(--sm-warning-soft); }
.badge-info { color: var(--sm-info); background: var(--sm-info-soft); }

.alert {
    padding: 13px 16px;
    border: 1px solid transparent !important;
    border-radius: var(--sm-radius);
    font-size: 13.5px;
}
.alert-danger { border-color: #fecaca !important; color: #991b1b; background: var(--sm-danger-soft); }
.alert-success { border-color: #a7f3d0 !important; color: #065f46; background: var(--sm-success-soft); }
.alert-info { border-color: #bae6fd !important; color: #075985; background: var(--sm-info-soft); }
.alert-warning { border-color: #fde68a !important; color: #92400e; background: var(--sm-warning-soft); }
.alert .close { opacity: .5; text-shadow: none; }
.alert-styled-left, .alert-bordered { border-left-width: 1px !important; }
.alert-styled-left:after, .alert[class*=alert-styled-]:after { display: none; }

/* Notifications (PNotify / SweetAlert) */
.ui-pnotify .ui-pnotify-container, .ui-pnotify .alert { border-radius: var(--sm-radius-lg) !important; box-shadow: var(--sm-shadow-lg) !important; }
.swal2-popup { border-radius: 18px !important; font-family: inherit !important; padding: 28px !important; }
.swal2-title { color: var(--sm-ink) !important; font-weight: 700 !important; }
.swal2-styled { min-height: 40px; border-radius: var(--sm-radius) !important; font-weight: 600 !important; box-shadow: none !important; }
.swal2-styled.swal2-confirm { background: var(--sm-primary) !important; }

/* Modals */
.modal-content { border: 0; border-radius: 18px; box-shadow: var(--sm-shadow-lg); }
.modal-header { padding: 20px 24px; border-bottom: 1px solid var(--sm-line-soft); }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--sm-line-soft); }
.modal-backdrop.show { opacity: .4; background: #0f172a; }

/* Neutral column divider (settings page) */
@media (min-width: 768px) { .app-divider-right { border-right: 1px solid var(--sm-line); } }

/* Lists & media (profile pages) */
.list-group-item { border-color: var(--sm-line-soft); }
.media-title { color: var(--sm-ink); }

/* Pagination (non-datatable) */
.page-link { border-color: var(--sm-line); color: var(--sm-text); }
.page-item.active .page-link { border-color: var(--sm-primary); background: var(--sm-primary); }

/* ---------- Full calendar ---------- */
.fc { color: var(--sm-text); }
.fc-toolbar h2 { color: var(--sm-ink); font-size: 17px; font-weight: 650; }
.fc-unthemed th, .fc-unthemed td, .fc-unthemed thead, .fc-unthemed tbody, .fc-unthemed .fc-divider,
.fc-unthemed .fc-row, .fc-unthemed .fc-content, .fc-unthemed .fc-popover, .fc-unthemed .fc-list-view { border-color: var(--sm-line-soft); }
.fc-unthemed .fc-head th, .fc-day-header { padding: 10px 0 !important; color: var(--sm-muted); background: var(--sm-canvas); font-size: 11.5px; font-weight: 650; letter-spacing: .05em; text-transform: uppercase; }
.fc-unthemed td.fc-today { background: var(--sm-primary-soft); }
.fc-day-number { padding: 6px 8px !important; color: var(--sm-text); font-size: 12.5px; font-weight: 500; }
.fc-today .fc-day-number { color: var(--sm-primary); font-weight: 700; }
.fc-other-month .fc-day-number { color: #cbd5e1; }
.fc-basic-view .fc-body .fc-row { min-height: 5.5em; }
.fc-button, .fc .btn { min-height: 34px; border: 1px solid var(--sm-line) !important; color: var(--sm-text) !important; background: var(--sm-surface) !important; font-size: 13px; text-transform: capitalize; }
.fc-button:hover { background: var(--sm-hover) !important; }
.fc-state-active, .fc-button.active, .fc .btn.active { border-color: var(--sm-primary) !important; color: var(--sm-primary) !important; background: var(--sm-primary-soft) !important; }
.fc-event { border-radius: 6px; border-color: var(--sm-primary); background: var(--sm-primary); }

/* ---------- Dashboard ---------- */
.dashboard-welcome {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
    padding: 28px 30px;
    overflow: hidden;
    border: 1px solid #e0e7ff;
    border-radius: 18px;
    color: var(--sm-ink);
    background:
        radial-gradient(600px 200px at 100% 0%, rgba(124, 58, 237, .14), transparent 60%),
        radial-gradient(500px 220px at 0% 100%, rgba(79, 70, 229, .12), transparent 60%),
        linear-gradient(135deg, #ffffff, #f5f7ff);
    box-shadow: var(--sm-shadow-sm);
}
.dashboard-welcome h2 { margin: 0 0 6px; color: var(--sm-ink); font-size: 24px; font-weight: 700; letter-spacing: -.025em; }
.dashboard-welcome p { margin: 0; color: var(--sm-muted); font-size: 14.5px; }
.dashboard-welcome__badge {
    padding: 8px 14px;
    white-space: nowrap;
    border: 1px solid #c7d2fe;
    border-radius: 999px;
    color: var(--sm-primary);
    background: rgba(255, 255, 255, .8);
    font-size: 13px;
    font-weight: 600;
}
.metric-card { position: relative; min-height: 132px; overflow: hidden; padding: 22px !important; transition: box-shadow .2s ease, transform .2s ease; }
.metric-card:hover { transform: translateY(-2px); box-shadow: var(--sm-shadow-md); }
.metric-card:after { display: none; }
.metric-card__icon { display: grid; width: 44px; height: 44px; place-items: center; border-radius: 12px; color: var(--sm-primary); background: var(--sm-primary-soft); font-size: 19px; }
.row > div:nth-child(4n+2) .metric-card__icon { color: #0891b2; background: #ecfeff; }
.row > div:nth-child(4n+3) .metric-card__icon { color: #7c3aed; background: #f5f3ff; }
.row > div:nth-child(4n+4) .metric-card__icon { color: #059669; background: #ecfdf5; }
.metric-card__number { margin: 16px 0 4px; color: var(--sm-ink); font-size: 30px; font-weight: 750; line-height: 1; letter-spacing: -.03em; }
.metric-card__label { color: var(--sm-muted); font-size: 13px; font-weight: 500; letter-spacing: 0; text-transform: none; }

/* ---------- Auth / public pages ---------- */
.login-cover {
    min-height: calc(100vh - 64px);
    background:
        radial-gradient(700px 400px at 15% 10%, rgba(99, 102, 241, .12), transparent 60%),
        radial-gradient(600px 400px at 90% 90%, rgba(124, 58, 237, .10), transparent 60%),
        var(--sm-canvas);
}
.auth-shell { display: grid; width: min(1000px, 94vw); min-height: 580px; overflow: hidden; border: 1px solid var(--sm-line); border-radius: 24px; background: #fff; box-shadow: var(--sm-shadow-lg); grid-template-columns: 1.05fr .95fr; }
.auth-story {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 52px;
    overflow: hidden;
    color: #fff;
    background:
        radial-gradient(500px 300px at 100% 0%, rgba(167, 139, 250, .45), transparent 60%),
        linear-gradient(150deg, #312e81, #4f46e5 60%, #6366f1);
}
.auth-story:after {
    position: absolute;
    right: -80px;
    bottom: -80px;
    width: 280px;
    height: 280px;
    content: "";
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 50%;
    box-shadow: 0 0 0 40px rgba(255, 255, 255, .04), 0 0 0 80px rgba(255, 255, 255, .03);
}
.auth-story__mark { display: grid; width: 52px; height: 52px; place-items: center; border: 1px solid rgba(255,255,255,.28); border-radius: 15px; background: rgba(255,255,255,.14); font-size: 23px; backdrop-filter: blur(4px); }
.auth-story h1 { max-width: 400px; margin: 28px 0 12px; color: #fff; font-size: 38px; font-weight: 750; line-height: 1.1; letter-spacing: -.035em; }
.auth-story p { max-width: 390px; color: rgba(255,255,255,.8); font-size: 15px; line-height: 1.7; }
.auth-story__footer { position: relative; z-index: 1; color: rgba(255,255,255,.7); font-size: 12px; }
.auth-panel { display: flex; align-items: center; padding: 52px; }
.auth-panel form { width: 100%; }
.auth-panel h2 { margin-bottom: 8px; color: var(--sm-ink); font-size: 28px; font-weight: 750; letter-spacing: -.03em; }
.auth-panel .form-control { min-height: 48px; }
.auth-panel .btn { min-height: 48px; }
.auth-kicker { margin-bottom: 26px; color: var(--sm-muted); }
.auth-security { display: flex; align-items: center; gap: 7px; margin-top: 20px; color: var(--sm-muted); font-size: 12px; }

/* Public top bar & footer (login, password reset, policy pages) */
.navbar.navbar-dark:not(.app-topbar), .navbar.navbar-light:not(.app-topbar) {
    min-height: 64px;
    padding: 0 24px;
    border-bottom: 1px solid var(--sm-line);
    color: var(--sm-text);
    background: rgba(255, 255, 255, .92);
    box-shadow: none;
}
.navbar.navbar-dark:not(.app-topbar) { align-items: center; }
.navbar.navbar-dark:not(.app-topbar) > .mr-4 { display: flex; align-items: center; }
.navbar:not(.app-topbar) .navbar-brand-title, .navbar:not(.app-topbar) .navbar-brand-title:hover { color: var(--sm-ink); }
.navbar.navbar-dark:not(.app-topbar) .navbar-nav-link, .navbar.navbar-dark:not(.app-topbar) .navbar-text { color: var(--sm-muted); }
.navbar.navbar-dark:not(.app-topbar) .navbar-nav-link:hover { color: var(--sm-ink); background: var(--sm-hover); }
.navbar.navbar-dark:not(.app-topbar) .navbar-toggler { color: var(--sm-text); }
#navbar-footer, .navbar-footer, .navbar.fixed-bottom { color: var(--sm-muted); }
/* Public-page footer: the template's negative navbar-collapse margins pushed it 4px past the window edge. */
@media (min-width: 768px) {
    #navbar-footer { margin-left: 0; margin-right: 0; }
}

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
    .content { padding: 4px 20px 32px; }
    .app-page-header__inner { padding: 22px 20px 16px; }
}
@media (max-width: 767.98px) {
    .app-topbar.navbar { padding: 0 8px 0 0; }
    .app-topbar__brand { width: auto; flex: 1; padding: 0 14px; }
    .app-topbar .navbar-collapse { margin: 0 -8px 0 0; padding: 4px 14px 12px; border-top: 1px solid var(--sm-line-soft); }
    .app-topbar .navbar-nav-link { margin: 4px 0; }
    .app-topbar .dropdown-user .navbar-nav-link > .app-user__text { display: none; }
    .app-sidebar.sidebar { width: 100%; }
    /* Fully hide the full-width menu; opening it (.sidebar-mobile-main) slides it to left: 0. */
    .sidebar-main, .sidebar-main .sidebar-content { left: -100%; }
    .sidebar-mobile-toggler { border-bottom: 1px solid var(--sm-line) !important; color: var(--sm-ink); background: var(--sm-surface) !important; }
    .sidebar-mobile-toggler a { color: var(--sm-muted) !important; }
    .content { padding: 0 14px 28px; }
    .app-page-header__inner { align-items: center; padding: 18px 14px 14px; }
    .app-page-title { font-size: 21px; }
    .card-header { padding: 16px 18px; }
    .card-body { padding: 18px; }
    .dashboard-welcome { align-items: flex-start; flex-direction: column; padding: 22px; }
    .dashboard-welcome h2 { font-size: 21px; }
    .datatable-header, .datatable-footer { flex-direction: column; align-items: stretch; }
    .dataTables_filter input { min-width: 0; width: 100%; }
    .dt-buttons { margin: 0; }
    .dataTables_paginate { margin: 0; }
    .auth-shell { width: min(520px, 94vw); min-height: auto; grid-template-columns: 1fr; }
    .auth-story { padding: 30px; }
    .auth-story h1 { margin: 22px 0 8px; font-size: 28px; }
    .auth-story__footer { display: none; }
    .auth-panel { padding: 30px 26px; }
    .table-responsive { border: 0; }
}

/* ---------- Print ---------- */
@media print {
    .navbar, .sidebar, .page-header, .app-topbar { display: none !important; }
    .content { padding: 0; }
    .card { border: 0; box-shadow: none; }
}

/* Inline score inputs in tables (marks entry): match the form controls */
.table input[type="number"]:not(.form-control),
.table input[type="text"]:not(.form-control) {
    width: 76px;
    min-height: 36px;
    padding: 5px 8px;
    border: 1px solid #d5dce6;
    border-radius: 8px;
    color: var(--sm-ink);
    background: var(--sm-surface);
    box-shadow: var(--sm-shadow-xs);
}
.table input[type="number"]:not(.form-control):focus,
.table input[type="text"]:not(.form-control):focus { border-color: var(--sm-primary); outline: 0; box-shadow: 0 0 0 4px var(--sm-primary-ring); }

/* ---------- Attendance ---------- */
.att-code { display: inline-grid; min-width: 26px; height: 24px; padding: 0 5px; place-items: center; border-radius: 6px; font-size: 12px; font-weight: 700; }
.att-code.att-present { color: #047857; background: #d1fae5; }
.att-code.att-absent  { color: #b91c1c; background: #fee2e2; }
.att-code.att-late    { color: #b45309; background: #fef3c7; }
.att-code.att-leave   { color: #1d4ed8; background: #dbeafe; }
.att-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border: 1px solid var(--sm-line); border-radius: 8px; background: var(--sm-surface); color: var(--sm-muted); font-size: 13px; font-weight: 500; }
.att-chip b { color: var(--sm-ink); }
.att-chip.att-present b { color: #047857; } .att-chip.att-absent b { color: #b91c1c; }
.att-chip.att-late b { color: #b45309; } .att-chip.att-leave b { color: #1d4ed8; }
.att-summary { display: inline-flex; flex-wrap: wrap; gap: 8px; }

/* one-tap choices on the daily register */
.att-radio { position: relative; display: inline-block; margin: 0; cursor: pointer; }
.att-radio input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.att-radio span { display: grid; width: 40px; height: 34px; place-items: center; border: 1px solid var(--sm-line); border-radius: 8px; color: var(--sm-faint); background: var(--sm-surface); font-size: 13px; font-weight: 700; transition: background-color .12s ease, color .12s ease, border-color .12s ease; }
.att-radio:hover span { border-color: #c3ccd9; color: var(--sm-text); }
.att-radio input:focus-visible + span { outline: 2px solid var(--sm-primary); outline-offset: 2px; }
.att-radio.att-present input:checked + span { border-color: #059669; color: #fff; background: #059669; }
.att-radio.att-absent input:checked + span  { border-color: #dc2626; color: #fff; background: #dc2626; }
.att-radio.att-late input:checked + span    { border-color: #d97706; color: #fff; background: #d97706; }
.att-radio.att-leave input:checked + span   { border-color: #2563eb; color: #fff; background: #2563eb; }
.att-take td { padding-top: 9px; padding-bottom: 9px; }

/* monthly register grid */
.att-register-wrap { max-width: 100%; }
.att-register { font-size: 13px; }
.att-register th, .att-register td { padding: 6px 4px !important; text-align: center; white-space: nowrap; }
.att-register .att-name { position: sticky; left: 0; z-index: 1; min-width: 180px; padding-left: 16px !important; text-align: left; background: var(--sm-surface); }
.att-register thead .att-name { background: var(--sm-canvas); }
.att-register .att-day a { display: block; color: var(--sm-text); line-height: 1.15; }
.att-register .att-day a.disabled { pointer-events: none; }
.att-register .att-day small { display: block; color: var(--sm-faint); font-size: 10px; text-transform: none; letter-spacing: 0; }
.att-register .att-day a:hover { color: var(--sm-primary); }
.att-register .att-sun { background: #f8fafc; }
.att-register .att-cell .att-code { min-width: 22px; height: 20px; font-size: 11px; }

.att-percent { color: var(--sm-ink); font-size: 44px; font-weight: 750; line-height: 1; letter-spacing: -0.03em; }
.att-percent.is-low { color: var(--sm-danger); }
