/* ==========================================================================
   Edusap UI refresh (Nov 2026)
   Loaded LAST in base.html, so every login (admin, principal, staff, pupil)
   gets it. Polish only: colours, corners, shadows, hover and keyboard focus.
   It does not move or resize anything, so existing page layouts stay put.
   ========================================================================== */

:root {
    --es-ink: #1c2340;
    --es-text: #3d4560;
    --es-muted: #6b7590;
    --es-line: #e4e8f0;
    --es-line-soft: #eef1f6;
    --es-soft: #f6f8fc;
    --es-primary: #317bd9;
    --es-primary-dark: #2264b6;
    --es-primary-tint: #e8f0fd;
    --es-ring: rgba(49, 123, 217, .30);
    --es-shadow-sm: 0 1px 2px rgba(20, 32, 70, .06);
    --es-shadow: 0 1px 2px rgba(20, 32, 70, .05), 0 8px 24px rgba(20, 32, 70, .07);
    --es-shadow-lg: 0 24px 60px rgba(20, 32, 70, .22);
}

body {
    background: #f1f3f9;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::selection {
    background: #cfe0fa;
    color: var(--es-ink);
}

/* thin, quiet scrollbars */
* {
    scrollbar-width: thin;
    scrollbar-color: #c7cedb transparent;
}

a {
    transition: color .15s ease;
}

input[type="checkbox"],
input[type="radio"] {
    accent-color: var(--es-primary);
}


/* --------------------------------------------------------------------------
   Keyboard focus: a clear ring, only when using the keyboard
   -------------------------------------------------------------------------- */
button:focus-visible,
.a-btn:focus-visible,
a:focus-visible,
select:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 3px solid var(--es-ring) !important;
    outline-offset: 2px;
}


/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
button,
.a-btn {
    font-weight: 500;
    transition: background-color .15s ease, box-shadow .15s ease, transform .15s ease, color .15s ease, border-color .15s ease;
}

/* raised buttons in page heads, forms and pop-ups: soft shadow + lift on hover */
.page-head button,
.page-head .a-btn,
.page-sub-head button,
.page-sub-head .a-btn,
.modal-footer button,
button[type="submit"]:not(.page-previous):not(.page-next) {
    box-shadow: 0 1px 2px rgba(20, 32, 70, .12);
}
.page-head .search button {
    box-shadow: none;
}
@media (prefers-reduced-motion: no-preference) {
    .page-head button:hover,
    .page-head .a-btn:hover,
    .page-sub-head button:hover,
    .page-sub-head .a-btn:hover,
    .modal-footer button:hover,
    button[type="submit"]:not(.page-previous):not(.page-next):hover {
        transform: translateY(-1px);
    }
}
.page-head button:hover,
.page-head .a-btn:hover,
.page-sub-head button:hover,
.page-sub-head .a-btn:hover,
.modal-footer button:hover,
button[type="submit"]:not(.page-previous):not(.page-next):hover {
    box-shadow: 0 6px 14px rgba(49, 123, 217, .25);
}
.page-head .search button:hover {
    transform: none;
    box-shadow: none;
}
.page-head button:active,
.page-head .a-btn:active,
.page-sub-head button:active,
.modal-footer button:active,
button[type="submit"]:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(20, 32, 70, .12);
}
.close-btn:hover {
    background: #dcdfe6;
    color: #555 !important;
}


/* --------------------------------------------------------------------------
   Search boxes, filters and selects in page heads
   -------------------------------------------------------------------------- */
.search input[type="search"],
.page-head select,
.page-head input[type="text"],
.page-sub-head select,
.page-sub-head input[type="text"],
.select-filter select {
    border: 1px solid var(--es-line);
    border-radius: 10px;
    background-color: #fff;
    color: var(--es-ink);
    transition: border-color .15s ease, box-shadow .15s ease;
}
.search input[type="search"]:hover,
.page-head select:hover,
.page-head input[type="text"]:hover,
.page-sub-head select:hover,
.page-sub-head input[type="text"]:hover,
.select-filter select:hover {
    border-color: #c5cddc;
}
.search input[type="search"]:focus,
.page-head select:focus,
.page-head input[type="text"]:focus,
.page-sub-head select:focus,
.page-sub-head input[type="text"]:focus,
.select-filter select:focus {
    border-color: var(--es-primary);
    box-shadow: 0 0 0 3px var(--es-ring);
    outline: none;
}
.select-filter label {
    color: var(--es-muted);
    font-weight: 600;
}

/* plain form fields everywhere: softer border + focus ring */
.form-control {
    border-color: var(--es-line);
    border-radius: 8px;
    box-shadow: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.form-control:focus {
    border-color: var(--es-primary);
    box-shadow: 0 0 0 3px var(--es-ring);
}


/* --------------------------------------------------------------------------
   Tables (.common-table is used on almost every list page)
   -------------------------------------------------------------------------- */
.common-table .tr-body {
    color: var(--es-text);
}
.common-table .table > thead > tr.tr-head > th {
    color: #5b6582;
    font-weight: 600;
    font-size: 12px;
    letter-spacing: .02em;
    background: var(--es-soft);
    border-bottom: 1px solid var(--es-line);
}
.common-table .table > thead > tr.tr-head > th:first-child {
    border-top-left-radius: 10px;
}
.common-table .table > thead > tr.tr-head > th:last-child {
    border-top-right-radius: 10px;
}
.common-table .table:not(.table-bordered):not(.table-border-0) > tbody > tr.tr-body > td {
    border-top: 1px solid var(--es-line-soft);
}
.common-table .table > tbody > tr.tr-body > td {
    transition: background-color .12s ease;
}
/* row hover (rows that show a status colour keep their colour) */
.common-table .table > tbody > tr.tr-body:not([data-state]):hover > td:not([data-state]) {
    background-color: #f4f8ff;
}
/* row action icons: tint on hover so they read as buttons */
.common-table .tr-body .fa {
    border-radius: 8px;
    transition: color .15s ease, background-color .15s ease;
}
.common-table .tr-body a:hover > .fa,
.common-table .tr-body .fa[onclick]:hover,
.common-table .tr-body .fa.handCursor:hover {
    color: var(--es-primary);
    background-color: var(--es-primary-tint);
}
.common-table .tr-body .fa.fa-trash:hover,
.common-table .tr-body a:hover > .fa.fa-trash {
    color: #d64545;
    background-color: #fdecec;
}
.common-table .tr-body button .fa,
.common-table .tr-body .a-btn .fa,
.common-table .tr-body button:hover .fa,
.common-table .tr-body .a-btn:hover .fa {
    background-color: transparent;
    color: #fff;
}
.no-data td {
    color: var(--es-muted);
    padding: 28px 10px !important;
}


/* --------------------------------------------------------------------------
   Pagination
   -------------------------------------------------------------------------- */
.paginated button {
    border-radius: 8px;
    letter-spacing: 0;
    min-width: 32px;
    padding: 5px 10px;
    border: 1px solid transparent;
}
.paginated button:hover {
    background: var(--es-primary-tint);
    border-color: transparent;
    color: var(--es-primary) !important;
}
.paginated .current .text-muted {
    display: inline-block;
    min-width: 32px;
    padding: 4px 10px;
    border-radius: 8px;
    background: var(--es-primary);
    color: #fff !important;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
}


/* --------------------------------------------------------------------------
   Sidebar: calmer hover, small icon nudge
   -------------------------------------------------------------------------- */
.sidebar-menu li a {
    transition: background-color .2s ease, color .2s ease;
}
.sidebar-menu li a:not(.active):hover,
.sidebar-menu li a:not(.active):focus {
    background: rgba(255, 255, 255, .08);
}
.sidebar-menu li a:not(.active):hover::before {
    background: #5d8fe0;
}
.sidebar-menu li a .fa,
.sidebar-menu li a img {
    transition: transform .2s ease;
}
@media (prefers-reduced-motion: no-preference) {
    .sidebar-menu li a:hover > .fa:first-child,
    .sidebar-menu li a:hover > img {
        transform: translateX(2px);
    }
}


/* --------------------------------------------------------------------------
   Pop-ups and dropdown menus
   -------------------------------------------------------------------------- */
.modal-content {
    border: none;
    border-radius: 16px;
    box-shadow: var(--es-shadow-lg);
}
.modal-header {
    border-bottom-color: var(--es-line);
}
.modal-footer {
    border-top-color: var(--es-line);
}
.modal-backdrop.in {
    opacity: .4;
}
.dropdown-menu {
    border: 1px solid var(--es-line);
    border-radius: 12px;
    box-shadow: var(--es-shadow);
}
.dropdown-menu > li > a {
    transition: background-color .12s ease, color .12s ease;
}
.dropdown-menu > li > a:hover,
.dropdown-menu > li > a:focus {
    background-color: var(--es-primary-tint);
    color: var(--es-primary-dark);
}


/* ==========================================================================
   SHARED LAYER (step 1): gives the ~800 older pages the Study Materials look
   without touching their HTML. Same rule as above: no layout moves.
   ========================================================================== */

/* ---------- page title bar ---------- */
.page-head h1 {
    color: var(--es-ink);
    font-weight: 700;
    letter-spacing: -.01em;
}
@media (min-width: 768px) {
    .page-head h1 { font-size: 23px; padding-top: 4px; }
}
.page-head button:not(.fa),
.page-head .a-btn,
.page-sub-head button:not(.fa),
.page-sub-head .a-btn {
    border-radius: 10px;
    padding: 8px 16px;
    font-weight: 600;
}

/* search box + its magnifier button, joined */
.search input[type="search"] {
    border-radius: 10px 0 0 10px;
    border-right-width: 0;
    padding-left: 12px;
}
.search input[type="search"]::placeholder { color: #9aa2b8; }
.search button {
    border: 1px solid var(--es-line);
    border-left-width: 0;
    border-radius: 0 10px 10px 0;
    background: #fff;
    color: var(--es-primary);
}
.search button:hover {
    background: var(--es-primary-tint);
    color: var(--es-primary) !important;
}
.search input[type="search"]:focus { box-shadow: none; }
.search:focus-within input[type="search"],
.search:focus-within button { border-color: var(--es-primary); }

/* ---------- class / division tabs (slider rows) as chips ---------- */
.var_slick_slider {
    border: 1px solid var(--es-line);
    border-radius: 14px;
    box-shadow: var(--es-shadow-sm);
    padding: 10px 10px 5px;
}
.var_slick_slider .slick_slider li button {
    border: 1px solid var(--es-line);
    border-radius: 999px;
    background: var(--es-soft);
    color: var(--es-text);
    font-weight: 600;
    padding: 6px 16px;
    box-shadow: none;
}
.var_slick_slider .slick_slider li button:hover {
    background: var(--es-primary-tint);
    border-color: #c9dbf7;
    color: var(--es-primary-dark) !important;
}
.var_slick_slider .slick_slider li button.active,
.var_slick_slider .slick_slider li button.active:hover {
    background: var(--es-primary);
    border-color: var(--es-primary);
    color: #fff !important;
}

/* ---------- filter rows ---------- */
.select-filter select,
.select-filter .chosen-container { border-radius: 10px; }

/* "All / category" radio filters that submit on click -> chips */
label:has(> input[type="radio"][onclick*="submit"]) {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0 6px 8px 0;
    padding: 4px 14px;
    border: 1px solid var(--es-line);
    border-radius: 999px;
    background: #fff;
    color: var(--es-text);
    font-weight: 600;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
label:has(> input[type="radio"][onclick*="submit"]):hover {
    background: var(--es-primary-tint);
    border-color: #c9dbf7;
}
label:has(> input[type="radio"][onclick*="submit"]:checked) {
    background: var(--es-primary);
    border-color: var(--es-primary);
    color: #fff;
}
label:has(> input[type="radio"][onclick*="submit"]) > input { margin: 0; }

/* checkbox / radio choices in forms -> chips */
.chose-checkbox-radio .label-item {
    border-color: var(--es-line);
    border-radius: 999px;
    padding: 4px 12px;
    background: #fff;
    transition: background-color .15s ease, border-color .15s ease;
}
.chose-checkbox-radio .label-item:hover { background: var(--es-soft); }
.chose-checkbox-radio .label-item:has(input:checked) {
    background: var(--es-primary-tint);
    border-color: #b9d1f5;
    color: var(--es-primary-dark);
}

/* ---------- tables: one clean card ---------- */
.common-table .table:not(.table-bordered) {
    border: 1px solid var(--es-line);
    border-radius: 14px;
    box-shadow: var(--es-shadow);
    border-collapse: separate;
    border-spacing: 0;
}
.common-table .table:not(.table-bordered) > tbody > tr:last-child > td:first-child { border-bottom-left-radius: 14px; }
.common-table .table:not(.table-bordered) > tbody > tr:last-child > td:last-child { border-bottom-right-radius: 14px; }
.common-table .table:not(.table-bordered) > thead > tr.tr-head > th:first-child { border-top-left-radius: 14px; }
.common-table .table:not(.table-bordered) > thead > tr.tr-head > th:last-child { border-top-right-radius: 14px; }

/* yes / no / waiting icons read as status */
.common-table .tr-body .fa-check,
.common-table .tr-body .fa-check-circle { color: #17704b; }
.common-table .tr-body .fa-clock-o { color: #a16207; }
.common-table .tr-body td > .fa-times:only-child,
.common-table .tr-body td > .fa-times:first-child { color: #b54848; }

/* empty table: folder icon above the message */
.no-data td::before {
    content: "\f07c";
    display: block;
    margin-bottom: 8px;
    font-family: FontAwesome;
    font-size: 30px;
    color: #c3cde0;
}

/* ---------- forms ---------- */
.page-form {
    border: 1px solid var(--es-line);
    border-radius: 16px;
    box-shadow: var(--es-shadow);
}
.page-form .page-body label {
    color: var(--es-muted);
    font-weight: 600;
}
.page-form .page-body input[type="text"],
.page-form .page-body input[type=""],
.page-form .page-body input[type="number"],
.page-form .page-body input[type="date"],
.page-form .page-body input[type="password"],
.page-form .page-body input[type="email"],
.page-form .page-body input[type="url"],
.page-form .page-body input[type="time"],
.page-form .page-body select,
.page-form .page-body textarea {
    border-color: var(--es-line);
    color: var(--es-ink);
    transition: border-color .15s ease, box-shadow .15s ease;
}
.page-form .page-body input:hover,
.page-form .page-body select:hover,
.page-form .page-body textarea:hover { border-color: #c5cddc; }
.page-form .page-body input:focus,
.page-form .page-body select:focus,
.page-form .page-body textarea:focus {
    border-color: var(--es-primary);
    box-shadow: 0 0 0 3px var(--es-ring);
    outline: none;
}
.page-form .page-footer { border-top: 1px solid var(--es-line-soft); }

/* ---------- tabs ---------- */
.nav-tabs { border-bottom-color: var(--es-line); }
.nav-tabs > li > a {
    border-radius: 10px 10px 0 0;
    color: var(--es-text);
    font-weight: 600;
}
.nav-tabs > li > a:hover {
    background: var(--es-primary-tint);
    border-color: transparent;
    color: var(--es-primary-dark);
}
.nav-tabs > li.active > a,
.nav-tabs > li.active > a:focus,
.nav-tabs > li.active > a:hover {
    color: var(--es-primary);
    border-color: var(--es-line) var(--es-line) transparent;
}
.tab-content {
    border-radius: 0 14px 14px 14px;
    box-shadow: var(--es-shadow);
}

/* ---------- module tiles (admin top bar) and white panels ---------- */
.cards-gray,
.var_slick_slider + .var_slick_slider { box-shadow: var(--es-shadow-sm); }
.cards-gray { border: 1px solid var(--es-line); border-radius: 16px; }
.cards-gray .item {
    border: 1px solid transparent;
    transition: background-color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.cards-gray .item:not(.active):hover {
    background: #fff;
    border-color: #c9dbf7;
    color: var(--es-primary-dark);
    box-shadow: 0 8px 20px rgba(49, 123, 217, .16);
}
.cards-gray .item:not(.active):hover img:first-of-type { display: none; }
.cards-gray .item:not(.active):hover img:last-of-type { display: inline-block; }
@media (prefers-reduced-motion: no-preference) {
    .cards-gray .item:not(.active):hover { transform: translateY(-2px); }
}
