/* ============================================================
   Aurolib — Modern design system (2026-07-25)
   Overrides existing class names used across every view so all
   screens modernise without editing individual .cshtml files.

   Loaded AFTER Bootstrap in _Layout.cshtml so these rules win.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    /* --- brand palette --- */
    --primary:        #4F46E5;   /* indigo-600 — clean, close to old #474E93 */
    --primary-dark:   #4338CA;
    --primary-light:  #EEF2FF;   /* indigo-50, soft backgrounds */
    --primary-border: #C7D2FE;   /* indigo-200 */

    --accent:         #7C3AED;   /* violet-600 for highlights */
    --success:        #16A34A;
    --success-light:  #DCFCE7;
    --danger:         #DC2626;
    --danger-light:   #FEE2E2;
    --warning:        #F59E0B;
    --warning-light:  #FEF3C7;

    /* --- neutrals --- */
    /* Page canvas. Deliberately a soft blue rather than near-white: the
       content cards are pure white (--surface), so a tinted canvas makes
       each card read as a distinct panel instead of the whole screen
       looking like one flat sheet of white. Used in exactly one place
       (html, body), so this single value re-tints every screen at once.
       The login page sets its own background with !important and is
       unaffected. */
    --bg:             #DCE6F5;   /* blue canvas (was #F8FAFC slate-50) */
    --surface:        #FFFFFF;
    --surface-alt:    #F1F5F9;   /* slate-100 */
    --border:         #E2E8F0;   /* slate-200 */
    --border-strong:  #CBD5E1;   /* slate-300 */
    --text:           #0F172A;   /* slate-900 */
    --text-muted:     #64748B;   /* slate-500 */
    --text-subtle:    #94A3B8;   /* slate-400 */

    /* --- shadows --- */
    --shadow-sm: 0 1px 2px rgba(15,23,42,.05);
    --shadow-md: 0 4px 12px -2px rgba(15,23,42,.08), 0 2px 4px -1px rgba(15,23,42,.04);
    --shadow-lg: 0 20px 40px -12px rgba(15,23,42,.15), 0 4px 6px -4px rgba(15,23,42,.05);

    --radius-sm: 6px;
    --radius:    10px;
    --radius-lg: 16px;
    --radius-xl: 20px;
}

/* ---------- base ---------- */
html {
    overflow-x: clip;      /* clip (not hidden): stops horizontal scrollbars WITHOUT
                              turning the page into a vertical clip box that cuts off
                              dropdowns/menus on short pages */
}
html, body {
    background-color: var(--bg);
    color: var(--text);
    font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    margin: 0;
    padding: 0;
    overflow-x: clip;
    max-width: 100vw;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Inter', system-ui, sans-serif;
    color: var(--text);
    font-weight: 600;
    letter-spacing: -0.01em;
}
h3 { font-size: 20px; margin: 0 0 12px; }
h4 { font-size: 16px; margin: 0 0 8px; }
h5 { font-size: 14px; margin: 0 0 6px; color: var(--text-muted); }

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

/* ============================================================
   NAVBAR — modern consolidated (2026-07-25 v2)
   8 top-level items, dropdowns open on hover, mega-menu for dense
   groups (Catalogue / Acquisitions / Admin). Right-side cluster
   holds global search + logout icon.
   ============================================================ */

/* Freeze the whole header on scroll. The navbar itself was sticky, but it
   sits inside <header>, whose height equals the navbar, so it had no room to
   stick and scrolled away with its container. Making <header> the sticky
   element (it's a direct child of body, which spans the full page) pins it to
   the top of the viewport for the entire scroll. */
/* Only the top-level application header is the sticky navigation bar.
   Page content may legitimately contain semantic <header> elements (for
   example, the Privacy Policy heading); those must remain in normal flow. */
body > header {
    position: sticky;
    top: 0;
    z-index: 1030;
}

.navbar {
    background: linear-gradient(90deg, #1E1B4B 0%, #312E81 55%, #4338CA 100%) !important;
    box-shadow: var(--shadow-md);
    padding: 6px 24px !important;
    border-bottom: 0;
    display: flex !important;
    align-items: center;
    max-width: 100vw;
    overflow: visible;   /* allow dropdowns to escape */
    flex-wrap: nowrap;
    gap: 12px;
    min-height: 56px;
    position: sticky;
    top: 0;
    z-index: 1000;
}

/* --- Brand mark on the left --- */
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 6px;
    text-decoration: none !important;
    color: #fff;
    flex-shrink: 0;
    margin-right: 12px;
}
.brand:hover { color: #fff; text-decoration: none; }
.brand-mark {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,.14);
    border: 1px solid rgba(255,255,255,.22);
    border-radius: 10px;
    color: #fff;
    font-size: 16px;
    transition: background .15s;
}
.brand:hover .brand-mark { background: rgba(255,255,255,.24); }
.brand-text {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #fff;
    font-family: 'Inter', system-ui, sans-serif;
}
@media (max-width: 1200px) { .brand-text { display: none; } }
@media (max-width: 992px)  { .brand-text { display: inline; } }
.navbar-collapse { flex-grow: 1; display: flex !important; align-items: center; gap: 4px; }

.main-nav {
    display: flex !important;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
    flex: 1 1 auto;
}
.main-nav .nav-item { flex-shrink: 0; position: relative; }

/* Client-requested module order. Keep the routes and dropdown contents in
   their semantic menu items; only their visible position changes. */
.main-nav > .nav-order-home         { order: 1; }
.main-nav > .nav-order-acquisitions { order: 2; }
.main-nav > .nav-order-circulation  { order: 3; }
.main-nav > .nav-order-members      { order: 4; }
.main-nav > .nav-order-catalogue    { order: 5; }
.main-nav > .nav-order-periodicals  { order: 6; }
.main-nav > .nav-order-reports      { order: 7; }
.main-nav > .nav-order-admin        { order: 8; }

/* Top-level links */
.main-nav .nav-link, .navbar-nav .nav-link {
    color: rgba(255,255,255,.92) !important;
    font-weight: 500 !important;
    font-size: 14px !important;
    padding: 8px 14px !important;
    border-radius: 8px !important;
    transition: background .15s ease, color .15s ease;
    display: inline-flex !important;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    white-space: nowrap;
}
.main-nav .nav-link:hover, .main-nav .nav-item.dropdown:hover > .nav-link {
    background: rgba(255,255,255,.14) !important;
    color: #fff !important;
    text-decoration: none;
}
.main-nav .nav-link i { opacity: .85; }
.main-nav .dropdown-toggle::after {
    margin-left: 4px;
    border-top-color: rgba(255,255,255,.6);
    vertical-align: middle;
}

/* --- Open dropdowns on hover OR click (bulletproof) --- */
.main-nav .dropdown:hover > .dropdown-menu,
.main-nav .dropdown.open > .dropdown-menu,
.main-nav .dropdown.show > .dropdown-menu,
.main-nav .dropdown-menu.show {
    display: block;
    animation: dropdownFade .12s ease-out;
}
@keyframes dropdownFade {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Standard dropdown (single-column). NOTE: margin-top:0 (was 4px) —
   the 4px gap between trigger and panel used to lose the hover state
   as the mouse crossed the empty space, so links inside the dropdown
   were unreachable. */
.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff !important;
    border: 1px solid var(--border) !important;
    border-radius: 12px !important;
    box-shadow: 0 20px 40px -12px rgba(15,23,42,.25), 0 4px 6px -4px rgba(15,23,42,.1) !important;
    padding: 8px !important;
    margin-top: 0 !important;
    min-width: 260px !important;
    z-index: 1050;
}
/* Invisible "bridge" strip above the panel so a small overshoot on
   the way from the trigger doesn't kill the hover chain. */
.dropdown-menu::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 0;
    right: 0;
    height: 8px;
    background: transparent;
}
.dropdown-item, .dropdown-menu .nav-link {
    color: var(--text) !important;
    background: transparent !important;
    border-radius: 6px !important;
    padding: 8px 12px !important;
    margin: 1px 0 !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    display: flex !important;
    align-items: center;
    gap: 8px;
    text-decoration: none !important;
    transition: background .1s;
}
.dropdown-item i, .dropdown-menu .nav-link i { color: var(--primary); width: 16px; text-align: center; opacity: .8; }
.dropdown-item:hover, .dropdown-menu .nav-link:hover {
    background: var(--primary-light) !important;
    color: var(--primary-dark) !important;
}
.dropdown-item:hover i { color: var(--primary-dark) !important; opacity: 1; }
.dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 6px 4px !important;
    border: 0;
}

/* Mega-menu (multi-column) — used by Catalogue / Acquisitions / Admin */
.mega-drop { position: static !important; }
.dropdown-menu.mega-menu {
    left: 24px;
    right: 24px;
    display: none;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    padding: 20px !important;
    min-width: 640px !important;
    max-width: calc(100vw - 48px);
}
.mega-drop:hover > .dropdown-menu.mega-menu,
.mega-drop.open > .dropdown-menu.mega-menu,
.mega-drop.show > .dropdown-menu.mega-menu,
.dropdown-menu.mega-menu.show { display: grid; }
.mega-col { min-width: 180px; }
.mega-heading {
    font-size: 11px !important;
    font-weight: 700 !important;
    color: var(--primary-dark) !important;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--primary-light);
}
.mega-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    color: var(--text);
    text-decoration: none !important;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    transition: background .1s;
}
.mega-link i { color: var(--primary); opacity: .8; width: 14px; text-align: center; }
.mega-link:hover {
    background: var(--primary-light) !important;
    color: var(--primary-dark) !important;
    text-decoration: none;
}
.mega-link:hover i { color: var(--primary-dark) !important; opacity: 1; }

/* Right-side cluster (search + logout) */
.nav-right {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    flex-shrink: 0;
}
.nav-search {
    position: relative;
    display: flex;
    align-items: center;
}
.nav-search-icon {
    position: absolute;
    left: 12px;
    color: rgba(255,255,255,.6);
    font-size: 13px;
    pointer-events: none;
    z-index: 2;
}
#globalSearch {
    background: rgba(255,255,255,.12) !important;
    border: 1px solid rgba(255,255,255,.18) !important;
    color: #fff !important;
    border-radius: 999px !important;
    padding: 8px 16px 8px 34px !important;
    font-size: 13px !important;
    transition: background .15s;
    width: 300px;
    max-width: 300px;
    min-height: auto !important;
    height: 36px !important;
}
#globalSearch::placeholder { color: rgba(255,255,255,.65); }
#globalSearch:focus {
    background: #fff !important;
    color: var(--text) !important;
    outline: none !important;
    border-color: var(--primary-border) !important;
    box-shadow: 0 0 0 3px rgba(255,255,255,.15) !important;
}
#globalSearch:focus + #globalSearchResults,
.nav-search:focus-within .nav-search-icon { color: var(--primary); }
#globalSearchResults {
    display: none;
    position: absolute;
    top: 44px;
    right: 0;
    background: #fff;
    border: 1px solid var(--border) !important;
    border-radius: 12px !important;
    box-shadow: 0 20px 40px -12px rgba(15,23,42,.3) !important;
    width: 380px;
    max-width: min(380px, calc(100vw - 40px));
    max-height: 420px;
    overflow-y: auto;
    z-index: 1060;
}
.logout-link {
    color: rgba(255,255,255,.85) !important;
    padding: 8px 12px !important;
    border-radius: 8px !important;
    text-decoration: none !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
}
.logout-link:hover {
    background: rgba(255,255,255,.14) !important;
    color: #fff !important;
}

/* Stable desktop navigation layout.
   The old flex-wrap rule allowed the available width, browser zoom and the
   fixed-width global search box to decide which menu items fell onto a second
   line.  That made the same build look different from one librarian PC to
   another.  On desktop widths the seven operational modules always stay on
   row one, while Admin always starts row two.  Search/logout share the right
   side of row two and therefore cannot push module links around. */
@media (min-width: 993px) {
    .navbar {
        align-items: flex-start;
    }

    .brand {
        align-self: flex-start;
    }

    .navbar-collapse {
        position: relative;
        display: block !important;
        min-width: 0;
    }

    .main-nav {
        display: grid !important;
        grid-template-columns: repeat(7, max-content);
        grid-template-rows: repeat(2, 42px);
        grid-auto-flow: row;
        align-items: center;
        width: 100%;
    }

    .main-nav > .nav-order-home         { grid-column: 1; grid-row: 1; }
    .main-nav > .nav-order-acquisitions { grid-column: 2; grid-row: 1; }
    .main-nav > .nav-order-circulation  { grid-column: 3; grid-row: 1; }
    .main-nav > .nav-order-members      { grid-column: 4; grid-row: 1; }
    .main-nav > .nav-order-catalogue    { grid-column: 5; grid-row: 1; }
    .main-nav > .nav-order-periodicals  { grid-column: 6; grid-row: 1; }
    .main-nav > .nav-order-reports      { grid-column: 7; grid-row: 1; }

    .main-nav > .nav-order-admin {
        grid-column: 1;
        grid-row: 2;
    }

    .nav-right {
        position: absolute;
        right: 0;
        bottom: 3px;
        margin-left: 0;
    }
}

/* --- responsive collapse --- */
@media (max-width: 1200px) {
    #globalSearch { width: 200px; max-width: 200px; }
}
@media (max-width: 992px) {
    .navbar { flex-wrap: wrap; }
    .nav-right { margin-left: 0; width: 100%; justify-content: space-between; padding-top: 6px; border-top: 1px solid rgba(255,255,255,.1); }
    #globalSearch { width: 100%; max-width: 100%; flex: 1; }
    .nav-search { flex: 1; }
    #globalSearchResults { width: 100%; }
    .dropdown-menu.mega-menu { min-width: auto !important; grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .main-nav { width: 100%; }
    .main-nav .nav-item { flex: 1 1 45%; }
    .main-nav .nav-link { justify-content: center; }
}

/* ---------- content container ---------- */
.container-fluid.content {
    padding: 24px 32px;
    max-width: 1600px;
    margin: 0 auto;
    box-sizing: border-box;
    width: 100%;
    overflow-x: clip;   /* clip, not hidden — see note on html/body above */
}
@media (max-width: 900px)  { .container-fluid.content { padding: 16px; } }
@media (max-width: 600px)  { .container-fluid.content { padding: 12px 10px; } }

/* Any large table or wide grid should scroll horizontally INSIDE its
   container rather than push the whole page wider. */
table, .table-responsive, .table-scroll { max-width: 100%; }

/* ---------- the "divbox" everyone uses ---------- */
.divbox {
    background: var(--surface) !important;
    color: var(--text) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-lg) !important;
    padding: 24px !important;
    margin-top: 20px !important;
    box-shadow: var(--shadow-sm);
    font-weight: normal !important;
}
.divbox h3, .divbox h4 { color: var(--primary-dark); }

/* Inner section cards */
.section {
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius) !important;
    padding: 16px 20px !important;
    margin-top: 14px !important;
    box-shadow: var(--shadow-sm);
}
.section h4 { color: var(--primary-dark); }

/* ---------- form inputs ---------- */
input.fld, select.fld, textarea.fld, .form-control,
input[type="text"], input[type="number"], input[type="date"],
input[type="password"], input[type="email"], select, textarea {
    background: var(--surface) !important;
    border: 1px solid var(--border-strong) !important;
    border-radius: var(--radius-sm) !important;
    padding: 8px 12px !important;
    font-size: 14px !important;
    color: var(--text) !important;
    line-height: 1.4 !important;
    transition: border-color .15s, box-shadow .15s;
    box-shadow: none !important;
    height: auto !important;
    min-height: 36px;
}
input.fld:focus, select.fld:focus, textarea.fld:focus,
.form-control:focus, input:focus, select:focus, textarea:focus {
    border-color: var(--primary) !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(79,70,229,.15) !important;
}
label {
    display: inline-flex;
    flex-direction: column;
    gap: 4px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    margin: 4px 8px 4px 0;
}

/* ---------- buttons ---------- */
button, .btn, .btn-primary, .button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px !important;
    border-radius: var(--radius-sm) !important;
    border: 1px solid transparent !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    cursor: pointer;
    transition: transform .05s ease, background .15s ease, box-shadow .15s;
    line-height: 1.4 !important;
    text-decoration: none;
    box-shadow: var(--shadow-sm);
}
button:hover, .btn:hover, .btn-primary:hover, .button:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}
button:active, .btn:active { transform: translateY(0); }

.btn-primary, button.btn-primary, input.btn-primary, .button {
    background: var(--primary) !important;
    color: #fff !important;
    border-color: var(--primary) !important;
}
.btn-primary:hover, button.btn-primary:hover, .button:hover {
    background: var(--primary-dark) !important;
    border-color: var(--primary-dark) !important;
    color: #fff !important;
}
.btn-danger, .btn-mini {
    background: var(--danger) !important;
    color: #fff !important;
    border-color: var(--danger) !important;
    padding: 4px 10px !important;
    font-size: 12px !important;
}
.btn-danger:hover, .btn-mini:hover {
    background: #B91C1C !important;
    color: #fff !important;
}
.btn-small { padding: 4px 10px !important; font-size: 12px !important; }

/* ---------- tables ---------- */
table.data, table.mini {
    width: 100%;
    border-collapse: separate !important;
    border-spacing: 0;
    background: var(--surface);
    border: 1px solid var(--border) !important;
    border-radius: var(--radius) !important;
    /* NOTE: no overflow:hidden here — it would make the table its own scroll
       container and stop the header sticking during page scroll. */
    box-shadow: var(--shadow-sm);
    margin-top: 12px;
}
table.data th, table.mini th {
    background: var(--primary-light) !important;
    color: var(--primary-dark) !important;
    font-weight: 600 !important;
    font-size: 12px !important;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 10px 12px !important;
    text-align: left;
    border: 0 !important;
    border-bottom: 1px solid var(--primary-border) !important;
}
table.data td, table.mini td {
    padding: 8px 12px !important;
    border: 0 !important;
    border-bottom: 1px solid var(--border) !important;
    font-weight: 400 !important;
    color: var(--text) !important;
    font-size: 13px !important;
}
table.data tr:last-child td, table.mini tr:last-child td { border-bottom: 0 !important; }
table.data tr:nth-child(even) td, table.mini tr:nth-child(even) td {
    background: var(--surface-alt);
}
table.data tr:hover td, table.mini tr:hover td { background: var(--primary-light) !important; }
table.data tr.overdue td { background: var(--danger-light) !important; color: #7F1D1D !important; }
table.data tr.soon td    { background: var(--warning-light) !important; }
table.data tr.never td   { background: var(--danger-light) !important; color: #7F1D1D !important; }
table.data tfoot td {
    background: var(--primary-light) !important;
    font-weight: 600 !important;
    border-top: 2px solid var(--primary-border) !important;
}

/* Register (Accession) table dense mode */
table.reg {
    width: 100%;
    border-collapse: separate !important;
    border-spacing: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    /* no overflow:hidden — see table.data note (breaks sticky header) */
    font-size: 12px;
    margin-top: 12px;
}
table.reg th, table.reg td { padding: 6px 8px !important; border-bottom: 1px solid var(--border) !important; }
table.reg th { background: var(--primary-light); color: var(--primary-dark); font-weight: 600; }

/* ---------- KPIs (dashboard) ---------- */
.kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
}
.kpi {
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius) !important;
    padding: 18px !important;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: transform .1s, box-shadow .15s;
}
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.kpi .n {
    font-size: 32px !important;
    font-weight: 700 !important;
    color: var(--primary-dark) !important;
    line-height: 1;
    letter-spacing: -0.02em;
}
.kpi .l {
    font-size: 12px !important;
    color: var(--text-muted) !important;
    margin-top: 8px !important;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 500;
}
.kpi.warn { border-color: var(--warning) !important; }
.kpi.warn .n { color: var(--warning) !important; }
.kpi.danger { border-color: var(--danger) !important; }
.kpi.danger .n { color: var(--danger) !important; }

/* Inline pill KPIs (Reservations, verification) */
.kpi.badge, span.kpi {
    display: inline-block;
    padding: 6px 14px !important;
    background: var(--primary-light) !important;
    color: var(--primary-dark) !important;
    border-radius: 999px !important;
    font-weight: 600 !important;
    font-size: 13px !important;
    text-align: left;
    box-shadow: none;
    border: 1px solid var(--primary-border) !important;
}
.kpi.badge.warn, span.kpi.warn {
    background: var(--warning-light) !important;
    color: #92400E !important;
    border-color: var(--warning) !important;
}

/* ---------- panels (dashboard) ---------- */
.panels { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 20px; }
@media (max-width: 900px) { .panels { grid-template-columns: 1fr; } }
.panel {
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius) !important;
    padding: 18px !important;
    box-shadow: var(--shadow-sm);
}
.panel h4 { color: var(--primary-dark) !important; margin-bottom: 12px; }

/* ---------- tiles (Reports landing / Admin landing) ---------- */
.tile, .rpt-tile {
    display: inline-block !important;
    width: 260px !important;
    min-height: 130px !important;
    padding: 20px !important;
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius) !important;
    margin: 8px !important;
    text-decoration: none !important;
    color: var(--text) !important;
    box-shadow: var(--shadow-sm);
    transition: transform .1s, box-shadow .15s, border-color .15s;
    vertical-align: top;
}
.tile:hover, .rpt-tile:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
    text-decoration: none;
    color: var(--text);
}
.tile h4, .rpt-tile h4 { color: var(--primary-dark) !important; margin-bottom: 8px !important; }
.tile p, .rpt-tile p { color: var(--text-muted) !important; font-weight: normal !important; font-size: 13px !important; }

/* ---------- key-value grid (detail pages) ---------- */
.kv {
    display: grid;
    grid-template-columns: 180px 1fr 180px 1fr;
    gap: 8px 16px;
    align-items: center;
}
@media (max-width: 800px) { .kv { grid-template-columns: 140px 1fr; } }
.kv .k {
    font-weight: 600 !important;
    color: var(--text-muted) !important;
    font-size: 12px !important;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ---------- misc small utilities used by views ---------- */
.badge {
    display: inline-block !important;
    padding: 3px 10px !important;
    border-radius: 999px !important;
    background: var(--primary-light) !important;
    color: var(--primary-dark) !important;
    font-weight: 500 !important;
    font-size: 12px !important;
    border: 1px solid var(--primary-border) !important;
}
/* .tab is a TABLE class in the Biblio views, not a tab button. The :not(table)
   guard keeps this button styling off those tables. */
.tab:not(table) {
    display: inline-block;
    padding: 8px 14px !important;
    margin-right: 6px !important;
    background: var(--surface-alt) !important;
    border: 1px solid var(--border) !important;
    border-bottom: none !important;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0 !important;
    color: var(--text-muted) !important;
    text-decoration: none !important;
    font-weight: 500;
    font-size: 13px !important;
    transition: background .15s;
}
.tab:not(table):hover { background: var(--primary-light) !important; color: var(--primary-dark) !important; }
.tab:not(table).active {
    background: var(--primary) !important;
    color: #fff !important;
    border-color: var(--primary) !important;
}

.scanbox { font-family: 'JetBrains Mono', monospace; font-size: 16px !important; }
.scanlog {
    font-family: 'JetBrains Mono', monospace;
    background: #0F172A !important;
    color: #86EFAC !important;
    padding: 10px !important;
    border-radius: var(--radius-sm);
    font-size: 12px;
    height: 220px;
    overflow-y: auto;
}

/* Notes cards (BookNotes) */
.note-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px;
    margin-top: 8px;
}
.note-meta { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* Msg pill under buttons */
#msg, .msg-line { margin-top: 8px; font-size: 13px; }
.msg-line.ok { color: var(--success); }
.msg-line.err { color: var(--danger); }

/* ---------- footer ----------
   site.css pins .footer with position:absolute; bottom:0, which parks it over
   the bottom strip of the viewport and covers the bottom of a scroll box (its
   down arrow). Force normal flow so it sits AFTER the content, never over it. */
.footer {
    position: static !important;
    margin-top: 40px !important;
    padding: 20px 0 !important;
    background: var(--surface) !important;
    border-top: 1px solid var(--border) !important;
    color: var(--text-muted);
    font-size: 12px;
}
/* site.css also reserves 60px at the page bottom for that absolute footer; not
   needed once the footer flows normally, and it was eating into the table area. */
body { margin-bottom: 0 !important; }
.footer a { color: var(--primary); font-weight: 600; }

/* ---------- Home / dashboard picker ---------- */
.dash-wrap { padding: 24px 0; }
.lib-picker { margin-bottom: 20px; }
.lib-picker input {
    width: 160px !important;
}
.lib-picker button {
    background: var(--primary) !important;
    color: #fff !important;
    padding: 8px 20px !important;
    border-radius: var(--radius-sm) !important;
}

/* ---------- Toast (keep-alive / errors) ---------- */
/* uses inline styles from _Layout; here we just soften typography and
   make sure toast + global-search dropdown can't push viewport wider. */
[style*="position:fixed"][style*="bottom:20px"][style*="right:20px"] {
    font-family: 'Inter', system-ui, sans-serif !important;
    letter-spacing: -0.005em;
    max-width: min(340px, calc(100vw - 40px)) !important;
    box-sizing: border-box;
}
/* global search dropdown also constrained */
#globalSearchResults {
    max-width: min(420px, calc(100vw - 40px)) !important;
    box-sizing: border-box;
}
/* Any absolute/fixed floating element caps at viewport width */
[style*="position:fixed"], [style*="position:absolute"] { max-width: 100vw; box-sizing: border-box; }

/* ============================================================
   LEGACY CLASS OVERRIDES
   Old Aurobhavan views declare inline styles like .size, .sizebig,
   .heading, .font-style, .txtbox etc. with old colours + fonts.
   These rules bring them into the modern system without touching
   the individual .cshtml files.
   ============================================================ */

/* Old sized text inputs — normalise to modern input look. Width kept
   close to the original so table layouts don't reflow badly. */
input.size, select.size, .size {
    width: 170px !important;
    min-height: 36px;
    padding: 8px 12px !important;
    background: var(--surface) !important;
    border: 1px solid var(--border-strong) !important;
    border-radius: var(--radius-sm) !important;
    font-size: 14px !important;
    color: var(--text) !important;
    box-shadow: none !important;
}
input.sizeM, select.sizeM, .sizeM {
    width: 140px !important;
    min-height: 36px;
    padding: 8px 12px !important;
    background: var(--surface) !important;
    border: 1px solid var(--border-strong) !important;
    border-radius: var(--radius-sm) !important;
    font-size: 14px !important;
    color: var(--text) !important;
    box-shadow: none !important;
}
input.sizeS, select.sizeS, .sizeS {
    width: 80px !important;
    min-height: 36px;
    padding: 8px 12px !important;
    background: var(--surface) !important;
    border: 1px solid var(--border-strong) !important;
    border-radius: var(--radius-sm) !important;
    font-size: 14px !important;
    color: var(--text) !important;
    box-shadow: none !important;
}
input.sizebig, select.sizebig, .sizebig {
    width: 100%;
    max-width: 480px;
    min-height: 36px;
    padding: 8px 12px !important;
    background: var(--surface) !important;
    border: 1px solid var(--border-strong) !important;
    border-radius: var(--radius-sm) !important;
    font-size: 14px !important;
    color: var(--text) !important;
    box-shadow: none !important;
}
input.sizebig_email, select.sizebig_email {
    width: 100%;
    max-width: 360px;
    min-height: 36px;
    padding: 8px 12px !important;
    background: var(--surface) !important;
    border: 1px solid var(--border-strong) !important;
    border-radius: var(--radius-sm) !important;
    font-size: 14px !important;
    color: var(--text) !important;
    box-shadow: none !important;
    text-transform: none !important;   /* email is case-sensitive */
}
input.size:focus, input.sizeM:focus, input.sizeS:focus,
input.sizebig:focus, input.sizebig_email:focus,
select.size:focus, select.sizeM:focus, select.sizeS:focus, select.sizebig:focus {
    border-color: var(--primary) !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(79,70,229,.15) !important;
}
input.txtbox, .txtbox {
    padding: 8px 12px !important;
    background: var(--surface) !important;
    border: 1px solid var(--border-strong) !important;
    border-radius: var(--radius-sm) !important;
    font-size: 14px !important;
    color: var(--text) !important;
    min-height: 36px;
}

/* Old page-level heading (Master screens) */
.heading, h1.heading, h2.heading, h3.heading, div.heading {
    font-family: 'Inter', system-ui, sans-serif !important;
    color: var(--primary-dark) !important;
    font-size: 22px !important;
    font-weight: 700 !important;
    letter-spacing: -0.02em !important;
    margin: 0 0 12px !important;
    padding: 0 !important;
    background: none !important;
}

/* Old label style */
.font-style, span.font-style, label.font-style, div.font-style {
    font-family: 'Inter', system-ui, sans-serif !important;
    font-weight: 600 !important;
    font-size: 13px !important;
    color: var(--text) !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
}

/* Old table header/cell class used on some Master screens */
.header_style {
    background: var(--primary-light) !important;
    color: var(--primary-dark) !important;
    font-weight: 600 !important;
    font-size: 12px !important;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 10px 12px !important;
    border: 0 !important;
    border-bottom: 1px solid var(--primary-border) !important;
}

/* Alternative variants of the boxed container */
.divbox_new, .box, .panel_new {
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-lg) !important;
    padding: 24px !important;
    margin-top: 20px !important;
    box-shadow: var(--shadow-sm);
    color: var(--text) !important;
}

/* Old tab variants */
.tab_new, .tab_new_active {
    padding: 8px 14px !important;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0 !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    text-decoration: none !important;
    display: inline-block;
    background: var(--surface-alt) !important;
    color: var(--text-muted) !important;
    border: 1px solid var(--border) !important;
    border-bottom: none !important;
}
.tab_new_active {
    background: var(--primary) !important;
    color: #fff !important;
    border-color: var(--primary) !important;
}

/* Any hard-coded old-purple text colours in inline styles */
[style*="#4335A7"], [style*="#3d0b9b"], [style*="#170aca"],
[style*="#034694"], [style*="#474E93"], [style*="#041142"] {
    color: var(--primary-dark) !important;
}
/* Hard-coded old cream/orange backgrounds */
[style*="background-color: #fff3e1"], [style*="background:#fff3e1"],
[style*="background-color: bisque"], [style*="background:bisque"] {
    background: var(--surface-alt) !important;
}
/* Old h6 red error banner style */
h6[style*="darkred"] {
    color: var(--danger) !important;
    background: var(--danger-light) !important;
    padding: 8px 12px !important;
    border-radius: var(--radius-sm) !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    margin-top: 8px !important;
}

/* All the remaining size/text/tab variants I found in Biblio + Gift views —
   normalise them to the same modern input treatment. */
.sizetext, input.sizetext,
.sizebigText, input.sizebigText, textarea.sizebigText,
.sizebigtext2, input.sizebigtext2, textarea.sizebigtext2,
.sizeB, input.sizeB, select.sizeB {
    padding: 8px 12px !important;
    background: var(--surface) !important;
    border: 1px solid var(--border-strong) !important;
    border-radius: var(--radius-sm) !important;
    font-size: 14px !important;
    color: var(--text) !important;
    min-height: 36px;
    font-family: 'Inter', system-ui, sans-serif !important;
}
.sizetext:focus, .sizebigText:focus, .sizebigtext2:focus, .sizeB:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(79,70,229,.15) !important;
    outline: none !important;
}
textarea.sizebigText, textarea.sizebigtext2 { min-height: 80px; }

/* Tab variants used in Biblio/Gift views.
   IMPORTANT: in the Biblio views .tab1 / .tab2 / .tab_c are TABLE elements, not
   clickable tab buttons. The :not(table) guard keeps this button styling off
   those tables (otherwise every one gets wrapped in an indigo rounded box and
   forced to display:inline-block, which mangles the layout). */
.tab1:not(table), .tab2:not(table), .tab_c:not(table) {
    display: inline-block;
    padding: 8px 14px !important;
    margin-right: 4px !important;
    background: var(--surface-alt) !important;
    border: 1px solid var(--border) !important;
    border-bottom: none !important;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0 !important;
    color: var(--text-muted) !important;
    text-decoration: none !important;
    font-weight: 500 !important;
    font-size: 13px !important;
    cursor: pointer;
}
.tab1:not(table):hover, .tab2:not(table):hover, .tab_c:not(table):hover {
    background: var(--primary-light) !important;
    color: var(--primary-dark) !important;
}
.tab_c:not(table) { background: var(--primary) !important; color: #fff !important; border-color: var(--primary) !important; }

/* Gift/Catalogue checkbox modals own their layout inside each legacy view.
   Do not style .modal-wrap globally: it is a full dialog, not a helper row. */
label.required::after {
    content: ' *'; color: var(--danger);
}
input.required, select.required, textarea.required { border-left: 3px solid var(--danger) !important; }

/* Additional legacy class variants found in Biblio / Gift / Circulation views */
.divbox2, .divbox2_head, .catalogue-box {
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-lg) !important;
    padding: 20px !important;
    margin-top: 16px !important;
    box-shadow: var(--shadow-sm);
    color: var(--text) !important;
}
.divbox2_head {
    background: var(--primary-light) !important;
    color: var(--primary-dark) !important;
    font-weight: 600 !important;
    padding: 12px 20px !important;
    border-bottom: 1px solid var(--primary-border) !important;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
    margin-top: 0 !important;
}
.sizebigtext, textarea.sizebigtext {
    width: 100% !important;
    min-width: 300px;
    min-height: 80px;
    padding: 8px 12px !important;
    background: var(--surface) !important;
    border: 1px solid var(--border-strong) !important;
    border-radius: var(--radius-sm) !important;
    font-size: 14px !important;
    color: var(--text) !important;
    font-family: 'Inter', system-ui, sans-serif !important;
}
.sizebigtext:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(79,70,229,.15) !important;
    outline: none !important;
}

/* Bootstrap btn variants — bring them into the modern palette */
.btn.btn-success, button.btn-success, input.btn-success {
    background: var(--success) !important;
    color: #fff !important;
    border-color: var(--success) !important;
    border-radius: var(--radius-sm) !important;
    padding: 8px 16px !important;
    font-weight: 600 !important;
}
.btn.btn-success:hover { background: #15803D !important; border-color: #15803D !important; }
.btnSrch, .section_btn {
    background: var(--primary) !important;
    color: #fff !important;
    padding: 8px 16px !important;
    border: 0 !important;
    border-radius: var(--radius-sm) !important;
    font-weight: 600 !important;
}
.btnSrch:hover, .section_btn:hover {
    background: var(--primary-dark) !important;
}

/* Result-table scroll box (used across Biblio / Circulation / Admin / Reports).
   The HEIGHT is set by JS (sizeAll in _Layout) to reach from the table's top down
   to the window bottom, so the box — and the down arrow at the bottom of its
   scrollbar — always ends on screen no matter how far down the page the table
   starts. The 60vh below is only a fallback if JS doesn't run. Extra rows scroll
   INSIDE the box, so page length doesn't grow with the number of rows.
   overflow-y:scroll keeps the NATIVE scrollbar (with its up/down arrow buttons)
   always visible; we do NOT use ::-webkit-scrollbar custom styling, which strips
   those arrows. The header freezes at the top of the box via the sticky rule
   further down. */
.table-responsive, .table-scroll, .auto-scroll {
    margin-top: 12px;
    max-height: 60vh;   /* fallback only; JS sets the exact px height */
    overflow-x: auto;
    overflow-y: scroll;
    scrollbar-width: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--border);
    border-radius: 10px;
    box-sizing: border-box;
    scroll-margin-top: 80px;   /* when a filled table is scrolled into view it
                                  parks just under the sticky navbar */
}
.table-responsive table, .table-scroll table {
    margin: 0 !important;
    background: transparent !important;
}

/* Data-health reports contain several independent tables on one page. Give
   their descriptive columns predictable room and keep every row readable;
   horizontal scrolling is preferable to compressed, overlapping text. */
.auro-health-table {
    width: 100% !important;
    min-width: 940px;
    table-layout: fixed;
}
.auro-health-table th,
.auro-health-table td {
    padding: 10px 12px !important;
    line-height: 1.35 !important;
    vertical-align: top !important;
    text-align: left !important;
    overflow-wrap: anywhere;
}
.auro-health-table thead th {
    background: #eef2f7 !important;
}
.auro-health-table .auro-health-action {
    text-align: center !important;
}
.auro-health-table .auro-health-action .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    white-space: normal !important;
    line-height: 1.25 !important;
}

/* Modal / dialog classes used by Circulation delete confirm */
.delete_modal, .modal {
    background: rgba(15,23,42,.6) !important;
    backdrop-filter: blur(4px);
}

/* Legacy checkbox-driven popups used z-index 100, so the now-sticky two-row
   application header could cover the dialog title. Keep every real dialog
   above the navigation layer. */
.modal {
    z-index: 1100 !important;
}
.delete_modal-content, .modal-content {
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: var(--shadow-lg) !important;
    padding: 20px !important;
}
.close {
    background: transparent !important;
    border: 0 !important;
    color: var(--text-muted) !important;
    font-size: 22px !important;
    line-height: 1 !important;
    padding: 4px 8px !important;
    cursor: pointer;
}
.close:hover { color: var(--danger) !important; }

/* Gift catalog dropdown wrappers — same rounded input treatment */
.cbkmn_mkey_drpdwn, .cbook_ctyp_drpdwn, select.cbkmn_mkey_drpdwn, select.cbook_ctyp_drpdwn {
    padding: 8px 12px !important;
    border: 1px solid var(--border-strong) !important;
    border-radius: var(--radius-sm) !important;
    background: var(--surface) !important;
    min-height: 36px;
    font-size: 14px !important;
    /* A bare <select> sizes itself to its longest option, which pushed these
       out of their grid column and underneath the next field's label
       ("Circulation Type" was overlapping "Main key"). Pin them to the
       column width instead. */
    width: 100% !important;
    max-width: 100%;
    box-sizing: border-box;
}

/* Gift catalogue field labels sit in their own grid column next to the input.
   Keep them LEFT aligned: every other label on these screens is left aligned,
   so right-aligning only these made "Call No." sit indented and out of line
   with "Sub Title", "Subject", "Language" etc. directly above and below it. */
.gift-form-row { align-items: center; }
.gift-form-row > [class*="col-"] { min-width: 0; }
.gift-label {
    text-align: left;
    padding-right: 12px;
    line-height: 36px;
}

/* ---------------------------------------------------------------
   App-wide guard against the layout bug this came from.

   These legacy screens lay out a label column next to an input
   column. A bare <select> sizes itself to its LONGEST OPTION and an
   <input> with a size/width attribute can exceed its column, so the
   control spills sideways, pushes the next label out of line, and
   overlaps it. Constraining every form control to its own column
   fixes the whole class of misalignment rather than one screen at a
   time, and cannot make a control wider than it already was.
   --------------------------------------------------------------- */
/* Scoped to the grid row/column itself rather than .container, because not
   every one of these legacy forms is wrapped in a .container, and the overlap
   happens inside the columns. */
/* IMPORTANT: only DATA-ENTRY controls. Buttons are <input type="button"> in
   these views, and capping them to the column width truncated their labels
   ("Screen 2" rendered as "Screen", "Refresh" was clipped). Never constrain
   buttons, checkboxes or radios here. */
.row > [class*="col-"] select,
.row > [class*="col-"] input[type="text"],
.row > [class*="col-"] input[type="number"],
.row > [class*="col-"] input[type="date"],
.row > [class*="col-"] input[type="password"],
.row > [class*="col-"] input[type="email"],
.row > [class*="col-"] input:not([type]),
.row > [class*="col-"] textarea {
    max-width: 100% !important;
    box-sizing: border-box;
}

/* A <select> with no width sizes to its longest option, which is the single
   most common cause of a control spilling into the next label's column. */
.row > [class*="col-"] select {
    width: 100% !important;
}

/* ---------------------------------------------------------------
   Bootstrap requires .row > .col-* > .row. These legacy views nest a
   .row DIRECTLY inside another .row in 35 places. The inner row then
   becomes a flex ITEM with no width basis, so it collapses and shoves
   every sibling column out of position -- that is what detached the
   labels from their boxes in the Volume Header popup.

   Giving a directly-nested row a full-width basis makes it occupy its
   own line, which is what the markup intended. This cannot reorder or
   resize anything that was already laid out correctly.
   --------------------------------------------------------------- */
.row > .row {
    flex: 0 0 100%;
    max-width: 100%;
    width: 100%;
    margin-left: 0;
    margin-right: 0;
}

/* Modal headings on the dark header bar: the legacy stylesheet set a dark
   colour, making titles like "Volume Header" invisible on blue. */
.modal-header.bg-primary .modal-title,
.modal-header.bg-primary .close { color: #fff !important; opacity: 1; }

/* Buttons must keep their natural width so their captions stay readable. */
.row > [class*="col-"] input[type="button"],
.row > [class*="col-"] input[type="submit"],
.row > [class*="col-"] input[type="reset"],
.row > [class*="col-"] button {
    width: auto !important;
    max-width: none !important;
    white-space: nowrap;
}

/* Vertically centre label text against its input on legacy Bootstrap rows,
   so short labels don't sit at the top of a taller control. */
.container .row > [class*="col-"] { min-width: 0; }

/* Bootstrap form-row layout still used in Gift screens */
.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 0;
}
.form-row > * { flex: 1 1 200px; }

/* ---------- Login page ---------- */
/* Full-viewport dark gradient. Body is a vertical flex column so the
   footer sits at the bottom instead of becoming a horizontal sibling
   of the login card (which is what caused "Rishi Technovision Pvt. Ltd."
   to float off to the side of the screen). */
body.login-body {
    background-color: #1E1B4B !important;
    background-image: linear-gradient(135deg, #1E1B4B 0%, #312E81 40%, #4338CA 100%) !important;
    min-height: 100vh;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    overflow-x: hidden;
}
body.login-body .container-fluid,
body.login-body .container-fluid.content {
    flex: 1 1 auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    max-width: none !important;
    padding: 20px !important;
    background: transparent !important;
    margin: 0 auto !important;
    width: 100% !important;
}
body.login-body footer {
    background: transparent !important;
    text-align: center !important;
    padding: 16px 20px !important;
    margin: 0 !important;
    border: 0 !important;
    color: rgba(255,255,255,.7) !important;
    font-size: 12px !important;
    display: block !important;
    width: 100% !important;
}
body.login-body footer,
body.login-body footer p,
body.login-body footer a {
    color: rgba(255,255,255,.85) !important;
    text-decoration: none !important;
}
body.login-body footer a:hover { color: #fff !important; text-decoration: underline !important; }

/* ==========================================================================
   RESULT-TABLE SCROLL
   The scroll box itself is defined up top (.table-responsive/.table-scroll/
   .auto-scroll: JS-sized height with a 60vh fallback, native scrollbar, sticky
   header). The rules below just neutralise the legacy per-view CSS that fights
   it: old views set their own inner-scroll tbody (.tab tbody { display:block;
   height:250px; overflow }) and fixed pixel cell widths, which misalign columns
   and cause tiny scroll boxes. These overrides use !important; the legacy inline
   rules don't, so these win, letting the shared box + sticky header do the work.
   ========================================================================== */
.tab tbody, .tab1 tbody, .tab2 tbody, .tab3 tbody, .tab_c tbody, .tab_new tbody,
.tab_book tbody, .tab_acc tbody,
table.data tbody, .table-responsive tbody, .table-scroll tbody {
    display: table-row-group !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    width: auto !important;
}
.tab, .tab1, .tab2, .tab3, .tab_c, .tab_new, .tab_book, .tab_acc { table-layout: auto !important; }
.tab td, .tab th, .tab1 td, .tab1 th, .tab2 td, .tab2 th, .tab3 td, .tab3 th,
.tab_c td, .tab_c th, .tab_new td, .tab_new th,
.tab_book td, .tab_book th, .tab_acc td, .tab_acc th {
    width: auto !important;
    white-space: normal !important;
}
/* Big result grids fill their container; the small catalogue-card tables
   (.tab_c) stay compact at their natural size so a 2-column table doesn't
   stretch weirdly across the page. */
table.tab, table.tab1, table.tab2, table.tab_new { width: 100% !important; }

/* ---- FROZEN COLUMN HEADER (inside each table's own scroll box) ----
   The header row sticks to the TOP OF THE BOX (top:0), so as you scroll this
   table's rows the column titles stay put. th appears only in the header row of
   these tables, and JS-built result tables put it in <tbody> (no <thead>), so we
   target th directly. The header cells already have an opaque background so rows
   don't show through them. */
.tab th, .tab1 th, .tab2 th, .tab3 th, .tab_new th,
.tab_book th, .tab_acc th,
table.data th, table.reg th, table.mini th, table.table-bordered th {
    position: sticky !important;
    top: 0 !important;
    z-index: 5;
    box-shadow: 0 2px 4px -2px rgba(15,23,42,.25);
}
/* A real spacer so the LAST row clears the bottom edge when scrolled fully down
   (padding-bottom is unreliable inside a scroll container). */
.table-responsive::after, .table-scroll::after, .auto-scroll::after {
    content: ""; display: block; height: 12px;
}

/* ============================================================
   READABILITY LAYER  (2026-08-03)

   Goal: field labels legible for readers with strong prescriptions,
   and input boxes that read as inputs instead of a wall of white.

   HARD RULE FOLLOWED THROUGHOUT: this block changes only COLOUR,
   BACKGROUND and FONT-WEIGHT. It never changes font-size, padding,
   margin, border-width, width, height, display or position, so it
   cannot move, resize or re-wrap anything on any screen — including
   the Volume Header popups (Screen 1/2/3/4), which are ordinary
   .row/.col markup inside a modal and are covered by the same rules.

   Why the selectors look unusual: in these legacy views a label is a
   BARE TEXT NODE inside a Bootstrap column, e.g.
       <div class="col-md-2">Call No.:</div>
   There is no <label> element and no class to hook. CSS cannot select
   a text node, so the column is made bold and every ELEMENT child is
   set back to normal. The result: bare label text turns bold, while
   inputs, tables and nested rows inside that column are untouched.
   ============================================================ */

:root {
    --input-border: #A9BEE3;   /* subtle blue, replaces flat slate grey       */
    --input-bg:     #FCFDFF;   /* barely-there blue tint, lifts off the white */
    --input-bg-ro:  #F1F5FB;   /* read-only / disabled: clearly not editable  */
}

/* ---- 1. Labels: bold --------------------------------------------------- */
/* The column carries the weight; element children are reset below.
 *
 * DELIBERATELY NO `color` HERE. Several screens put a light text colour on
 * the ROW for a dark banner, e.g.
 *     <div class="row" style="background:#171075; color:whitesmoke">
 *         <div class="col-12">MAIN DESCRIPTION OF THE BOOK</div>
 *     </div>
 * A colour set on the column would beat the colour inherited from the row,
 * turning that white heading dark-on-dark and effectively invisible. Body
 * text already inherits the near-black --text, so bolding alone gives the
 * readability gain with none of that risk. */
.row > [class*="col-"] {
    font-weight: 600;
}

/* Reset every ELEMENT child back to normal weight, leaving only the bare
   label text bold. <b>/<strong>/<th> keep their own emphasis. */
.row > [class*="col-"] > *:not(b):not(strong):not(th) {
    font-weight: 400;
}

/* Values the user typed stay normal weight so they read as data, not label. */
.row > [class*="col-"] input,
.row > [class*="col-"] select,
.row > [class*="col-"] textarea,
.row > [class*="col-"] table td {
    font-weight: 400;
}

/* Legacy label/heading classes used across the Master and Gift screens.
   Weight only — see the colour note above. */
.gift-label, td.lbl, .lbl {
    font-weight: 600 !important;
}

/* Table headers: stronger weight, nothing else.
 *
 * NO `color` HERE EITHER, and this one matters most: dozens of views set
 * their own header style in an inline <style> block, e.g.
 *     th { background: #474E93; color: white; font-weight: bold; }
 * Because the rule below carries !important it would beat that plain
 * declaration and repaint every one of those white headers dark-on-purple,
 * i.e. unreadable, across the whole application. Weight is safe to force;
 * colour is not, because the view owns the background it sits on. */
table th, .tab th, .tab1 th, .tab2 th, .tab_c th,
table.data th, table.reg th, table.mini th {
    font-weight: 700 !important;
}

/* ---- 2. Inputs: subtle blue border + faint tint ---------------------- */
/* border-WIDTH is unchanged (1px, as set earlier in this file); only the
   colour changes, so no element shifts by even a pixel. */
input.fld, select.fld, textarea.fld, .form-control,
input[type="text"], input[type="number"], input[type="date"],
input[type="password"], input[type="email"], select, textarea,
input.size, input.sizebig, input.sizeM, input.sizeS,
input.sizebigtext, input.sizebigtext2, .txtbox {
    border-color: var(--input-border) !important;
    background-color: var(--input-bg) !important;
    color: var(--text) !important;
}

/* Read-only and disabled fields: visibly not editable, no geometry change. */
input[readonly], select[readonly], textarea[readonly],
input:disabled, select:disabled, textarea:disabled {
    background-color: var(--input-bg-ro) !important;
    color: #46536B !important;
}

/* Placeholder text: legible rather than washed out. */
input::placeholder, textarea::placeholder { color: #7A8AA6 !important; opacity: 1; }

/* Hover gives a slightly stronger blue so the target is obvious. */
input[type="text"]:hover, input[type="number"]:hover, input[type="date"]:hover,
input[type="password"]:hover, input[type="email"]:hover,
select:hover, textarea:hover, .form-control:hover {
    border-color: #7E9BD4 !important;
}

/* Buttons deliberately get NO rule here. Verified across all views: every
   button is <input type="button"> carrying .btn/.btn-primary classes and
   none uses the .size/.sizebig input classes, so the selectors above cannot
   match a button. Adding a "reset" rule here would have been the real risk —
   it would have stripped the styling from all 400+ buttons. */
