/* ============================================================
   EduNexus — AdminLTE 3.2 Custom Overrides
   Theme: Dark teal sidebar & topbar · Teal accent · Pill buttons
   ============================================================ */

/* ── CSS Variables ───────────────────────────────────────── */
:root {
    --en-font-family:     'Inter', 'Segoe UI', system-ui, -apple-system, Roboto, Arial, sans-serif;

    --en-sidebar-bg:      #0b2e30;
    --en-sidebar-sub:     #082224;
    --en-sidebar-hover:   #123f42;
    --en-sidebar-active:  #0e7c86;
    --en-sidebar-icon:    #8fb7ba;
    --en-sidebar-text:    #ffffff;

    --en-topbar-bg:       #0b2e30;
    --en-topbar-text:     #ffffff;
    --en-topbar-border:   rgba(255,255,255,0.10);

    --en-primary:         #0e7c86;
    --en-primary-dk:      #0b636b;

    --en-page-bg:         #f4f7f7;

    --en-btn-primary-bg:  #0e7c86;
    --en-btn-primary-hov: #0b636b;
    --en-btn-cancel-bg:   #8B0000;
    --en-btn-cancel-hov:  #6d0000;
    --en-btn-danger-bg:   #dc3545;

    --en-radius-btn:      20px;
    --en-radius-input:    20px;
}

body, .btn, .form-control, .input-group-text, .card, .nav-link, .dropdown-menu {
    font-family: var(--en-font-family);
}

body, .form-control, .btn, .card {
    font-size: 0.75rem;
}

/* ── Page background ─────────────────────────────────────── */
.wrapper,
body,
.content-wrapper {
    background-color: var(--en-page-bg) !important;
}

/* Gap between topbar and the first thing on the page (breadcrumb/title/cards) */
.en-page-content {
    padding-top: 18px;
}

/* ============================================================
   SIDEBAR
   ============================================================ */

.main-sidebar,
.main-sidebar .sidebar {
    background-color: var(--en-sidebar-bg) !important;
}

.brand-link {
    background-color: var(--en-sidebar-bg) !important;
    border-bottom: 1px solid rgba(255,255,255,0.08) !important;
}
.brand-link .brand-text {
    color: var(--en-sidebar-text) !important;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* All sidebar nav links */
.sidebar-dark-primary .nav-sidebar .nav-link,
.sidebar-dark-primary .nav-sidebar .nav-treeview .nav-link {
    color: var(--en-sidebar-text) !important;
}

/* Icons */
.sidebar-dark-primary .nav-sidebar .nav-link .nav-icon,
.sidebar-dark-primary .nav-sidebar .nav-treeview .nav-link .nav-icon {
    color: var(--en-sidebar-icon) !important;
}

/* Hover */
.sidebar-dark-primary .nav-sidebar .nav-link:hover,
.sidebar-dark-primary .nav-sidebar .nav-treeview .nav-link:hover {
    background-color: var(--en-sidebar-hover) !important;
    color: var(--en-sidebar-text) !important;
}

/* Active item — solid accent fill so the current page is unmistakably distinct
   from the rest of the (otherwise uniformly dark) sidebar. */
.sidebar-dark-primary .nav-sidebar > .nav-item > .nav-link.active,
.sidebar-dark-primary .nav-sidebar .nav-treeview .nav-link.active {
    background-color: var(--en-sidebar-active) !important;
    border-left: 3px solid #ffffff;
    color: #ffffff !important;
}
.sidebar-dark-primary .nav-sidebar > .nav-item > .nav-link.active .nav-icon,
.sidebar-dark-primary .nav-sidebar .nav-treeview .nav-link.active .nav-icon {
    color: #ffffff !important;
}

/* Sub-menu (treeview) background */
.sidebar-dark-primary .nav-sidebar .nav-treeview {
    background-color: var(--en-sidebar-sub) !important;
}

/* Treeview indent line */
.nav-sidebar .nav-treeview {
    padding-left: 0;
}
.nav-sidebar .nav-treeview .nav-link {
    font-size: 0.75rem;
    padding-top: 0.3rem;
    padding-bottom: 0.3rem;
}

/* nav-item open background */
.sidebar-dark-primary .nav-sidebar > .nav-item.menu-open > .nav-link,
.sidebar-dark-primary .nav-sidebar > .nav-item:hover > .nav-link {
    background-color: var(--en-sidebar-hover) !important;
}

/* Active item — background highlight already signals state, no extra weight needed */
.nav-sidebar .nav-link.active { font-weight: 400; }

/* ============================================================
   TOPBAR
   ============================================================ */

/* Page title injected into topbar by PageTitleService */
.topbar-page-title {
    font-size: 1rem;
    color: var(--en-topbar-text);
    line-height: 1.2;
    white-space: nowrap;
}
.topbar-page-title small {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.65);
}

.main-header.navbar {
    background-color: var(--en-topbar-bg) !important;
    border-bottom: 1px solid var(--en-topbar-border) !important;
    box-shadow: 0 1px 4px rgba(0,0,0,0.16);
}

/* Hamburger toggle */
.main-header .nav-link,
.main-header .navbar-brand {
    color: var(--en-topbar-text) !important;
}
.main-header .nav-link:hover {
    color: #ffffff !important;
    opacity: 0.8;
}

/* User badge top-right */
.navbar-badge {
    background-color: var(--en-primary) !important;
    color: #ffffff !important;
}
.user-badge,
.main-header .user-panel .info,
.navbar-nav .nav-link[data-toggle="dropdown"] {
    color: var(--en-topbar-text) !important;
}
.main-header .dropdown-menu {
    color: #333333;
}

/* ── Breadcrumb trail (auto-derived from route, shown in topbar) ── */
.en-breadcrumb {
    display: flex;
    align-items: center;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.65);
    white-space: nowrap;
}
.en-breadcrumb .en-breadcrumb-sep {
    margin: 0 6px;
    color: rgba(255,255,255,0.4);
}
.en-breadcrumb .en-breadcrumb-current {
    color: #ffffff;
    font-weight: 600;
}

/* ============================================================
   CARDS
   ============================================================ */

.card {
    background: #ffffff;
    border: none;
    border-radius: 8px;
    box-shadow: 0 8px 20px rgb(8 5 5 / 78%), 0 3px 8px rgba(0,0,0,0.16);
    margin-bottom: 20px;
}
.card-header {
    background-color: var(--en-primary) !important;
    color: #ffffff !important;
    border-bottom: none;
    border-radius: 8px 8px 0 0 !important;
}
.card-header h2,
.card-header h3,
.card-header .card-title {
    color: #ffffff !important;
    margin: 0;
    font-size: 0.9rem;
    font-weight: 500;
}
.card-header .btn-tool,
.card-header .card-tools .btn {
    color: rgba(255,255,255,0.85) !important;
}
.card-header .btn-tool:hover {
    color: #ffffff !important;
}

/* Buttons placed inline in a dark card-header — white outline, not the
   global teal outline which is unreadable on a dark background */
.en-panel-dark .en-step-header-btn {
    background-color: transparent !important;
    border: 1px solid rgba(255,255,255,0.6) !important;
    color: #ffffff !important;
}
.en-panel-dark .en-step-header-btn:hover {
    background-color: rgba(255,255,255,0.15) !important;
    border-color: #ffffff !important;
    color: #ffffff !important;
}

/* All coloured card header variants → teal (kept for pages not yet
   migrated to the explicit en-panel-light/en-panel-dark classes) */
.card-header.bg-maroon,
.card-header.bg-purple,
.card-header.bg-admin,
.card-header.bg-admission,
.card-header.bg-fees,
.card-header.bg-primary {
    background-color: var(--en-primary) !important;
    color: #ffffff !important;
}

/* Section sub-headers inside pages — alternating light/dark teal so a
   multi-panel form (New Admission etc.) reads as distinct stacked
   sections instead of one uniform block, matching the reference design. */
.card-header.bg-warning,
.card-header.bg-info {
    background-color: #e3f2f1 !important;
    border-left: 4px solid var(--en-primary) !important;
    border-top: none !important;
    border-right: none !important;
    border-bottom: none !important;
    color: #0b4d52 !important;
}
.card-header.bg-warning .card-title,
.card-header.bg-warning h2,
.card-header.bg-warning h3,
.card-header.bg-info .card-title,
.card-header.bg-info h2,
.card-header.bg-info h3 {
    color: #0b4d52 !important;
}

.card-header.bg-secondary,
.card-header.bg-success {
    background-color: var(--en-primary) !important;
    color: #ffffff !important;
}
.card-header.bg-secondary .card-title,
.card-header.bg-secondary h2,
.card-header.bg-secondary h3,
.card-header.bg-success .card-title,
.card-header.bg-success h2,
.card-header.bg-success h3 {
    color: #ffffff !important;
}

/* ── Explicit, unambiguous panel shade classes ──────────────────────
   Used to hand-set each stacked panel's shade in visual sequence
   (light, dark, light, dark...) — the bg-* Bootstrap classes above are
   applied inconsistently page-to-page, so they can't be bulk-remapped
   without breaking one page or another. New/edited pages should use
   these two directly instead of bg-warning/info/secondary/success. */
.card-header.en-panel-light {
    background-color: #e3f2f1 !important;
    border-left: 4px solid var(--en-primary) !important;
    border-top: none !important;
    border-right: none !important;
    border-bottom: none !important;
    color: #0b4d52 !important;
}
.card-header.en-panel-light .card-title,
.card-header.en-panel-light h2,
.card-header.en-panel-light h3 {
    color: #0b4d52 !important;
}
.card-header.en-panel-dark {
    background-color: var(--en-primary) !important;
    color: #ffffff !important;
}
.card-header.en-panel-dark .card-title,
.card-header.en-panel-dark h2,
.card-header.en-panel-dark h3 {
    color: #ffffff !important;
}

/* ============================================================
   BUTTONS
   ============================================================ */

/* Pill-shaped buttons (standard-size only — table/xs actions keep a small
   radius via .btn-table-action / .btn-xs so they don't look odd at that size) */
.btn:not(.btn-xs):not(.btn-table-action):not(.btn-tool) {
    border-radius: var(--en-radius-btn) !important;
    padding-left: 1.1rem;
    padding-right: 1.1rem;
}

/* Primary = teal */
.btn-primary {
    background-color: var(--en-btn-primary-bg) !important;
    border-color: var(--en-btn-primary-bg) !important;
    color: #ffffff !important;
}
.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background-color: var(--en-btn-primary-hov) !important;
    border-color: var(--en-btn-primary-hov) !important;
    color: #ffffff !important;
}

/* Secondary = white with purple border */
.btn-secondary {
    background-color: #ffffff !important;
    border: 2px solid var(--en-primary) !important;
    color: var(--en-primary) !important;
}
.btn-secondary:hover,
.btn-secondary:focus {
    background-color: var(--en-primary) !important;
    border-color: var(--en-primary) !important;
    color: #ffffff !important;
}

/* Info = purple outline (same as outline-primary) */
.btn-info,
.btn-info.btn-block {
    background-color: transparent !important;
    border: 2px solid var(--en-primary) !important;
    color: var(--en-primary) !important;
}
.btn-info:hover,
.btn-info:focus {
    background-color: var(--en-primary) !important;
    border-color: var(--en-primary) !important;
    color: #ffffff !important;
}

/* Danger = red (deactivate, delete, cancel receipt) */
.btn-danger {
    background-color: var(--en-btn-danger-bg) !important;
    border-color: var(--en-btn-danger-bg) !important;
}

/* Outline = purple border/text, fills on hover */
.btn-outline-primary {
    color: var(--en-primary) !important;
    border-color: var(--en-primary) !important;
    background-color: transparent !important;
}
.btn-outline-primary:hover,
.btn-outline-primary:focus {
    background-color: var(--en-primary) !important;
    border-color: var(--en-primary) !important;
    color: #ffffff !important;
}

/* Outline secondary in tables (View, Edit) */
.btn-outline-secondary {
    color: var(--en-primary) !important;
    border-color: var(--en-primary) !important;
    background-color: transparent !important;
}
.btn-outline-secondary:hover {
    background-color: var(--en-primary) !important;
    color: #ffffff !important;
}

/* ============================================================
   BREADCRUMB / CONTENT HEADER
   ============================================================ */

.content-header { padding: 10px 15px 0; }
.content-header h1 { font-size: 1.3rem; font-weight: 500; color: #333; }
.breadcrumb-item.active { color: #666; }
.breadcrumb-item a { color: var(--en-primary); }

/* ============================================================
   TABLES
   ============================================================ */

.table .btn-xs { padding: 2px 6px; font-size: 11px; margin-right: 2px; white-space: nowrap; }
.table-responsive { border-radius: 0 0 8px 8px; }
.table thead th { background-color: #f8f8fc; color: #444; border-bottom: 2px solid #e0e0e8; font-weight: 500; }

/* Action column (Edit/Deactivate/etc.) — size to content, keep buttons on one line */
.table td:last-child:has(.btn) {
    white-space: nowrap;
    width: 1%;
}

/* Tables read too large/shouty across the app — tighten base size and
   soften <strong> (used on most "Name" columns) from browser-default 700
   down to 600, since that bold weight at full body size is what actually
   reads as "large text", not the font-size itself. */
.table { font-size: 0.85rem; }
.table strong { font-weight: 600; }

/* Client-side sort headers */
.sortable-th { cursor: pointer; user-select: none; white-space: nowrap; }
.sortable-th:hover { background-color: #ececf5; }
.sortable-th .sort-icon { margin-left: 4px; opacity: 0.4; font-size: 10px; }
.sortable-th.sorted-asc .sort-icon::after  { content: '▲'; opacity: 1; }
.sortable-th.sorted-desc .sort-icon::after { content: '▼'; opacity: 1; }
.sortable-th:not(.sorted-asc):not(.sorted-desc) .sort-icon::after { content: '⇅'; }

/* Search box embedded directly in a table's (dark) card-header */
.card-header.en-panel-dark .input-group-text,
.card-header.bg-admission .input-group-text,
.card-header.bg-admin .input-group-text,
.card-header.bg-fees .input-group-text,
.card-header.bg-primary .input-group-text {
    background: #ffffff;
    border: none;
    color: #6c757d;
    border-top-left-radius: 20px;
    border-bottom-left-radius: 20px;
}
.card-header.en-panel-dark .input-group .form-control,
.card-header.bg-admission .input-group .form-control,
.card-header.bg-admin .input-group .form-control,
.card-header.bg-fees .input-group .form-control,
.card-header.bg-primary .input-group .form-control {
    border: none;
    border-top-right-radius: 20px;
    border-bottom-right-radius: 20px;
    padding-left: 0;
}

.table-hover tbody tr td .btn-row-action { opacity: 0; transition: opacity .15s; }
.table-hover tbody tr:hover td .btn-row-action { opacity: 1; }

/* ============================================================
   SPLIT PANEL LAYOUT
   ============================================================ */

.split-panel { display: flex; gap: 0; align-items: flex-start; }
.split-panel .split-list  { flex: 1 1 58%; min-width: 0; }
.split-panel .split-form  {
    flex: 0 0 360px;
    background: #ffffff;
    border: 1px solid #e0e0e8;
    border-radius: 8px;
    padding: 18px;
    margin-left: 16px;
    position: sticky;
    top: 70px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.14), 0 2px 4px rgba(0,0,0,0.08);
    overflow: hidden;
}
/* A .card-header placed directly inside .split-form must escape the panel's
   own 18px padding so it renders as a full-bleed colour bar — exactly like
   every other card-header in the app — instead of an inset, boxed-in block. */
.split-panel .split-form > .card-header {
    margin: -18px -18px 18px -18px;
    border-radius: 0 !important;
}
.split-panel .split-form h5 {
    font-size: .95rem;
    font-weight: 500;
    color: var(--en-primary);
    border-bottom: 2px solid #e3f2f1;
    padding-bottom: 8px;
    margin-bottom: 14px;
}
@media (max-width: 900px) {
    .split-panel { flex-direction: column; }
    .split-panel .split-form {
        flex: none; width: 100%; margin-left: 0; margin-top: 16px; position: static;
    }
}

/* ============================================================
   FILTER / SEARCH TOOLBAR ROWS
   A header-less `.card > .card-body.py-2` is used across list pages
   (Classes, Schools, AcademicYears, Employees, etc.) purely to hold a
   school-picker and/or search box. Flatten that card chrome so the row
   reads as a lightweight toolbar, not a big boxed panel, and shrink the
   search input into a compact rounded pill (matches the reference design).
   ============================================================ */
.card:has(> .card-body.py-2):not(:has(> .card-header)) {
    background: transparent;
    border: none;
    box-shadow: none;
    margin-bottom: 8px;
}
.card:has(> .card-body.py-2):not(:has(> .card-header)) > .card-body {
    padding: 4px 0;
}
.card:has(> .card-body.py-2):not(:has(> .card-header)) input[type="text"],
.card:has(> .card-body.py-2):not(:has(> .card-header)) input:not([type]) {
    border-radius: var(--en-radius-input) !important;
    max-width: 260px;
    padding-left: 14px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='%236c757d' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001q.044.06.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1 1 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

/* ============================================================
   SEARCH BAR UTILITY
   ============================================================ */

.table-search-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.table-search-bar .input-group { max-width: 320px; }
.table-search-bar .results-count { font-size: 12px; color: #6c757d; margin-left: auto; }

/* Rounded, icon-style search inputs (pill shape across the whole group) */
.table-search-bar .input-group .input-group-text {
    background: #ffffff;
    border-right: none;
    color: #6c757d;
    border-top-left-radius: var(--en-radius-input) !important;
    border-bottom-left-radius: var(--en-radius-input) !important;
}
.table-search-bar .input-group .form-control {
    border-left: none;
    padding-left: 0;
    border-top-right-radius: var(--en-radius-input) !important;
    border-bottom-right-radius: var(--en-radius-input) !important;
}
.table-search-bar .input-group:focus-within {
    box-shadow: 0 0 0 2px rgba(14,124,134,0.25);
    border-radius: var(--en-radius-input);
}

/* ============================================================
   FORM HELPERS
   ============================================================ */

.form-section-title {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #6c757d;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: .25rem;
    margin-bottom: .75rem;
    margin-top: .5rem;
}
.validation-message { color: #dc3545; font-size: 0.8rem; margin-top: 3px; }

/* AdminLTE bolds form labels by default — flatten to a normal weight,
   matching the lighter, less-shouty look of the reference design */
label,
.form-label {
    font-weight: 400 !important;
}

/* ============================================================
   SOFT PILL BADGES
   ============================================================ */

.badge-success  { background-color: #d4edda !important; color: #0f4419 !important; border-radius: 12px !important; padding: 3px 10px !important; font-weight: 700 !important; }
.badge-danger   { background-color: #f8d7da !important; color: #58141c !important; border-radius: 12px !important; padding: 3px 10px !important; font-weight: 700 !important; }
.badge-warning  { background-color: #fff3cd !important; color: #664d03 !important; border-radius: 12px !important; padding: 3px 10px !important; font-weight: 700 !important; }
.badge-info     { background-color: #e3f2f1 !important; color: #0b4d52 !important; border-radius: 12px !important; padding: 3px 10px !important; font-weight: 700 !important; }
.badge-secondary { background-color: #e2e3e5 !important; color: #2b2f31 !important; border-radius: 12px !important; padding: 3px 10px !important; font-weight: 700 !important; }
.badge-primary  { background-color: #e3f2f1 !important; color: #0b4d52 !important; border-radius: 12px !important; padding: 3px 10px !important; font-weight: 700 !important; }

.info-box { box-shadow: 0 4px 10px rgba(0,0,0,0.10); border-radius: 6px; }
.info-box .info-box-icon.bg-primary { background-color: var(--en-primary) !important; }

/* ============================================================
   SMALL-BOX DASHBOARD WIDGETS (AdminLTE-style stat cards —
   big number + icon + "More info" footer link)
   ============================================================ */
.small-box {
    position: relative;
    display: block;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.12);
    color: #fff;
    margin-bottom: 20px;
    overflow: hidden;
}
.small-box > .inner { padding: 16px 18px; }
.small-box h3 {
    font-size: 2.1rem;
    font-weight: 700;
    margin: 0 0 4px;
    white-space: nowrap;
    color: #fff;
}
.small-box p {
    font-size: 1rem;
    margin-bottom: 0;
    color: rgba(255,255,255,0.95);
}
.small-box .icon {
    position: absolute;
    top: 2px;
    right: 12px;
    font-size: 68px;
    color: rgba(255,255,255,0.35);
    transition: transform .3s ease;
}
.small-box:hover .icon { transform: scale(1.1); }
.small-box > .small-box-footer {
    position: relative;
    display: block;
    z-index: 10;
    padding: 6px 0;
    color: rgba(255,255,255,0.9);
    text-align: center;
    background: rgba(0,0,0,0.12);
    text-decoration: none;
}
.small-box > .small-box-footer:hover {
    color: #fff;
    background: rgba(0,0,0,0.22);
}
.small-box.bg-primary { background-color: var(--en-primary) !important; }

/* Bootstrap's bg-warning is bright yellow — white text (the small-box default) is low
   contrast, so darken the text here, matching .badge-warning's existing dark-on-light pairing. */
.small-box.bg-warning h3,
.small-box.bg-warning p,
.small-box.bg-warning .small-box-footer { color: #664d03; }
.small-box.bg-warning .icon { color: rgba(102,77,3,0.35); }
.small-box.bg-warning .small-box-footer { background: rgba(0,0,0,0.08); }
.small-box.bg-warning .small-box-footer:hover { background: rgba(0,0,0,0.16); }

/* ============================================================
   UTILITY — INFO PANEL (replaces alert-warning used as section panels)
   ============================================================ */

.en-panel {
    background: #e3f2f1;
    border-left: 4px solid var(--en-primary);
    border-radius: 4px;
    color: #0b4d52;
    padding: 8px 12px;
    margin-bottom: 1rem;
    font-weight: 500;
    box-shadow: 0 8px 20px rgb(8 5 5 / 78%), 0 3px 8px rgba(0,0,0,0.16);
}

/* ── Table action button standard ──────────────────────────── */
.btn-table-action {
    border: 2px solid var(--en-primary) !important;
    color: var(--en-primary) !important;
    background: #ffffff !important;
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 11px;
    margin-right: 3px;
}
.btn-table-action:hover {
    background: var(--en-primary) !important;
    color: #ffffff !important;
}

/* ── btn-outline-info → purple ──────────────────────────────── */
.btn-outline-info {
    color: var(--en-primary) !important;
    border-color: var(--en-primary) !important;
    background-color: transparent !important;
}
.btn-outline-info:hover {
    background-color: var(--en-primary) !important;
    color: #ffffff !important;
}

/* ── btn-outline-success → keep green ───────────────────────── */
/* already Bootstrap default — no override needed */

/* ── btn-outline-warning → amber outline ────────────────────── */
/* keep as-is for explicit warning actions */

/* ── Page-level icon color normalization ────────────────────── */
/* h2/h3 icons that use text-info (teal) → purple */
h2 .text-info, h3 .text-info,
.page-header .text-info {
    color: var(--en-primary) !important;
}
/* h2/h3 icons that use text-warning (amber) → purple */
h2 .text-warning, h3 .text-warning,
.page-header .text-warning {
    color: var(--en-primary) !important;
}
/* h2/h3 icons that use text-success (green) → purple */
h2 .text-success, h3 .text-success,
.page-header .text-success {
    color: var(--en-primary) !important;
}
/* h2/h3 icons that use text-primary → already purple */

/* ============================================================
   MISC
   ============================================================ */

/* Empty state */
.empty-state { text-align: center; padding: 3rem 1rem; color: #6c757d; }
.empty-state i { font-size: 3rem; margin-bottom: 1rem; opacity: .35; display: block; }
.empty-state p { font-size: 1rem; margin: 0; }

/* Timetable weekly grid */
.timetable-grid th { text-align: center; vertical-align: middle; }
.timetable-cell { transition: background-color .12s ease; }
.timetable-cell:hover { background-color: rgba(14, 124, 134, 0.08); }
.timetable-cell-conflict { background-color: rgba(220, 53, 69, 0.12) !important; }
.timetable-slot-filled { background-color: rgba(14, 124, 134, 0.10); border-left: 3px solid var(--en-sidebar-active); }

/* Page header */
.page-header { margin-bottom: 20px; }
.page-header h2 { margin: 0 0 5px 0; font-size: 1.3rem; font-weight: 500; }
.page-header small { color: #999; }

/* Loading */
.panel-loading { text-align: center; padding: 40px 0; color: #999; }

/* Toast */
#blazor-error-ui .dismiss { cursor: pointer; }
.modal-backdrop { display: none !important; }

/* Long-content modals (e.g. Correspondence entry with rich-text editors + attachments,
   Manual Journal's growable ledger-line table) overflow the viewport with no way to
   reach fields below the fold — cap the dialog height and let the body scroll instead,
   keeping header/footer always visible.
   Targets `.d-block` rather than `.show`: every modal in this app is a Razor @if block
   that's only in the DOM at all when visible, so `d-block` (present on all of them) is
   the reliable "this modal is showing" signal — `show` is applied inconsistently across
   pages and would silently miss most modals if used here instead. */
.modal.d-block .modal-dialog {
    max-height: calc(100vh - 3.5rem);
    display: flex;
}
.modal.d-block .modal-content {
    max-height: calc(100vh - 3.5rem);
}
.modal.d-block .modal-body {
    overflow-y: auto;
}
#toast-container { margin-top: 55px; }
.toast-top-right { top: 70px !important; }
#toast-container > div {
    border-radius: 10px !important;
    box-shadow: 0 8px 20px rgba(0,0,0,0.18) !important;
    opacity: 1 !important;
}

/* "Search [Entity]" panel (Design System rule 4a) — a detached circular search button
   with a visible gap from its text input, instead of Bootstrap's fused input-group. */
.en-search-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1.5px solid var(--en-primary);
    background: #fff;
    color: var(--en-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 10px;
    flex-shrink: 0;
    transition: background-color .15s, color .15s;
}
.en-search-btn:hover, .en-search-btn:focus {
    background: var(--en-primary);
    color: #fff;
}

/* Flatpickr */
.flatpickr-input { background-color: #fff !important; }

/* Tom Select */
.ts-wrapper.form-control { padding: 0; }
.ts-control { border: none !important; box-shadow: none !important; min-height: 33px; }
.ts-wrapper.form-control-sm .ts-control { min-height: 28px; font-size: .875rem; }

/* Info boxes responsive */
@media (max-width: 576px) { .info-box-number { font-size: 1.2rem; } }

/* ============================================================
   FOLDER-STYLE TABS (.nav-tabs)
   The active tab reads as a raised folder tab fused to the panel below it —
   no gap, matching border, rounded top corners — instead of the flat
   Bootstrap default. Applies globally; no markup changes needed anywhere
   nav-tabs is already used.
   ============================================================ */
.nav-tabs {
    border-bottom: 1px solid #dee2e6;
    gap: 2px;
}
.nav-tabs .nav-link {
    border: 1px solid transparent;
    border-radius: 8px 8px 0 0;
    color: #5a6b6c;
    font-weight: 500;
    padding: 0.55rem 1.1rem;
    background-color: transparent;
    transition: background-color .12s ease, color .12s ease;
}
.nav-tabs .nav-link:hover {
    border-color: #e9ecef #e9ecef #dee2e6;
    background-color: #f4f7f7;
    color: var(--en-primary-dk);
    isolation: isolate;
}
.nav-tabs .nav-link.active,
.nav-tabs .nav-item.show .nav-link {
    color: var(--en-primary-dk);
    background-color: #ffffff;
    border-color: #dee2e6 #dee2e6 #ffffff;
    font-weight: 700;
    margin-bottom: -1px;
}

/* Contextual-help / page-info banner ("Salable products are built from production
   products.") — use the pre-existing `.en-panel` class (defined above, under UTILITY —
   INFO PANEL), not a new one. Bold the lead-in line with a plain <strong>. */

/* ============================================================
   TABLE PANEL — search/filter/count integrated into the same card as
   the table, in one light header row, instead of a separate filter card
   stacked above a separate table card. Structure:
   <div class="card en-table-panel">
     <div class="card-header en-table-panel-header"> ...search/filter/count... </div>
     <div class="card-body p-0"> ...table... </div>
   </div>
   ============================================================ */
.en-table-panel-header {
    background-color: var(--en-primary) !important;
    border-bottom: none !important;
    border-radius: 8px 8px 0 0 !important;
    padding: 0.9rem 1.1rem;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}
.en-table-panel-header .en-table-search {
    /* Shrinks before it wraps onto its own line — search + one filter dropdown must
       fit on one row even in a narrow split-panel list column; a 4th+ filter is the
       only thing allowed to push onto a second line (see .en-table-filter below). */
    flex: 1 1 140px;
    min-width: 120px;
    max-width: 320px;
    position: relative;
}
.en-table-panel-header .en-table-search input {
    padding-left: 2.2rem;
    border-radius: var(--en-radius-input);
}
.en-table-panel-header .en-table-search i {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9aa5a5;
}
.en-table-panel-header .en-table-filter {
    flex: 0 1 150px;
    min-width: 110px;
    max-width: 180px;
}
.en-table-panel-header .en-table-count {
    margin-left: auto;
    color: #ffffff;
    font-size: 0.8rem;
    white-space: nowrap;
}

/* Any card-body directly holding a table scrolls horizontally instead of
   overflowing the page. The table-panel pattern above (and every other list/
   split-panel page built the same way) never wrapped <table> in Bootstrap's
   .table-responsive, so a wide table pushed the whole page wider than the
   viewport on narrow/mobile screens instead of scrolling in place. One rule
   here fixes every page using the pattern — no per-page markup change needed. */
.card-body:has(> table) {
    overflow-x: auto;
}

/* Table header row — light teal tint instead of Bootstrap's neutral grey
   `.thead-light`, so a table sitting under a dark teal panel header (or a
   search box) reads as one continuous teal-toned block, not a color jump.
   Use in place of `thead-light` on any <thead>. */
.en-thead th {
    background-color: #e3f2f1 !important;
    color: #0b4d52 !important;
    border-color: #bfe0de !important;
}

/* Search-match highlight — wraps the matched substring in a result row/cell.
   Use on a <mark> tag: <mark class="en-search-highlight">@match</mark>. */
.en-search-highlight {
    background-color: #fff3a3;
    color: inherit;
    padding: 0 1px;
    border-radius: 2px;
}
