/* =====================================================================
   STRONG UI LAYER — bolder type, clearer hierarchy, bigger targets.
   Loaded after common.css. Colours follow the admin theme colour
   (Settings > theme), so nothing here hard-codes the brand colour.
   ===================================================================== */

:root {
    --ui-ink: #14213d;
    --ui-ink-2: #3b4a66;
    --ui-line: #dfe5ef;
    --ui-radius: 16px;
    --ui-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset, 0 14px 30px -22px rgba(20, 33, 61, 0.45);
    --app-ink: #14213d;
    --app-muted: #55627c;
    --app-card-border: #dfe5ef;
    --app-thead-bg: #f1f5fb;
}
body.theme-dark {
    --ui-ink: #f1f2f8;
    --ui-ink-2: #c5c7dc;
    --ui-line: #3a3a55;
    --ui-shadow: 0 14px 30px -22px rgba(0, 0, 0, 0.8);
    --app-ink: #f1f2f8;
    --app-muted: #a9abc6;
    --app-card-border: #3a3a55;
    --app-thead-bg: #26263d;
}

/* ---- Type: heavier everywhere, tight headings ---- */
body {
    font-weight: 500 !important;
    font-size: 0.9rem !important;
    color: var(--ui-ink);
    -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
    font-weight: 700 !important;
    letter-spacing: -0.015em;
    color: var(--ui-ink);
}
h5, .h5 { font-size: 1.1rem !important; }
h6, .h6 { font-size: 0.98rem !important; }
strong, b, .fw-semibold { font-weight: 700 !important; }
.text-muted, small.text-muted { color: var(--app-muted) !important; }
small, .small { font-size: 0.82rem; }

/* ---- Page header: a real title ---- */
.page-head { margin-bottom: 1.25rem; align-items: flex-start; }
.page-head-title, .welcome-h {
    position: relative;
    font-size: 1.65rem !important;
    font-weight: 700 !important;
    letter-spacing: -0.025em;
    line-height: 1.15;
    color: var(--ui-ink) !important;
    padding-inline-start: 16px;
}
.page-head-title::before, .welcome-h::before {
    content: "";
    position: absolute;
    inset-inline-start: 0;
    top: 0.12em;
    bottom: 0.12em;
    width: 6px;
    border-radius: 4px;
    background: var(--bs-primary);
}
.page-head small.text-muted, .page-head p.text-muted {
    display: block;
    margin-top: 4px;
    padding-inline-start: 16px;
    font-size: 0.9rem;
    font-weight: 500;
    max-width: 78ch;
}

/* ---- Sidebar: bold, easy to scan ---- */
.sidebar-link {
    font-weight: 600 !important;
    font-size: 0.92rem !important;
    padding: 0.68rem 0.8rem !important;
    border-radius: 12px !important;
    color: var(--ui-ink) !important;
}
.sidebar-wrapper .menu .sidebar-link svg { width: 20px; height: 20px; stroke-width: 2.1; }
.sidebar-wrapper .menu .sidebar-item:not(.active) > .sidebar-link:hover { background: rgba(var(--bs-primary-rgb), 0.1); color: var(--bs-primary) !important; }
.sidebar-item.active > .sidebar-link {
    font-weight: 700 !important;
    box-shadow: 0 10px 20px -12px rgba(var(--bs-primary-rgb), 0.9);
}
.menu .sidebar-title {
    font-weight: 700 !important;
    font-size: 0.72rem !important;
    letter-spacing: 0.09em !important;
    color: var(--app-muted) !important;
    margin: 1.25rem 0 0.45rem !important;
}
.menu .submenu .submenu-item a { font-weight: 600 !important; font-size: 0.87rem !important; }
.sidebar-wrapper .menu .submenu .submenu-item.active > a { font-weight: 700 !important; }

/* ---- Cards and panels: raised, rounded, clearly edged ---- */
.card, .list-surface {
    border: 1px solid var(--app-card-border) !important;
    border-radius: var(--ui-radius) !important;
    box-shadow: var(--ui-shadow);
}
.card-body { padding: 1.25rem 1.35rem; }
.card-title, .card-header h4 { font-weight: 700 !important; font-size: 1.05rem !important; }
.card h6, .card-body > h6:first-child { font-size: 1rem !important; }

/* ---- Tables: strong header, readable rows ---- */
.table { --bs-table-color: var(--ui-ink); margin-bottom: 0; }
.table thead th {
    font-weight: 700 !important;
    font-size: 0.74rem !important;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--ui-ink-2) !important;
    background: var(--app-thead-bg) !important;
    border-bottom: 2px solid var(--ui-line) !important;
    padding-top: 0.85rem !important;
    padding-bottom: 0.85rem !important;
    white-space: nowrap;
}
.table tbody td {
    font-size: 0.88rem !important;
    font-weight: 500;
    padding-top: 0.8rem;
    padding-bottom: 0.8rem;
    border-color: var(--ui-line);
    vertical-align: middle;
}
.table tbody td:first-child { font-weight: 700; color: var(--ui-ink); }
.table-hover > tbody > tr:hover > *, .list-surface .table tbody tr:hover > * { background: rgba(var(--bs-primary-rgb), 0.055) !important; }
.table-sm tbody td { padding-top: 0.55rem; padding-bottom: 0.55rem; }
.table caption { font-weight: 700; color: var(--ui-ink); }

/* ---- Buttons: bold labels, solid presence ---- */
.btn {
    font-weight: 700 !important;
    font-size: 0.88rem !important;
    letter-spacing: 0.005em;
    border-radius: 11px !important;
    padding: 0.55rem 1.05rem;
    border-width: 1.5px;
    transition: transform 0.12s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}
.btn-sm { font-size: 0.82rem !important; padding: 0.4rem 0.8rem; border-radius: 10px !important; }
.btn-primary { box-shadow: 0 10px 18px -12px rgba(var(--bs-primary-rgb), 0.95); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 14px 22px -12px rgba(var(--bs-primary-rgb), 0.95); }
.btn:active { transform: translateY(1px); }
.btn-outline-secondary { color: var(--ui-ink) !important; border-color: #b9c2d3 !important; background: var(--app-card-bg); }
.btn-outline-secondary:hover { background: var(--ui-ink) !important; border-color: var(--ui-ink) !important; color: #fff !important; }
body.theme-dark .btn-outline-secondary:hover { background: #f1f2f8 !important; color: #14141f !important; }
.btn-light { font-weight: 700 !important; border: 1.5px solid var(--ui-line) !important; }
.btn:focus-visible, .nav-link:focus-visible, .sidebar-link:focus-visible, a:focus-visible, [tabindex="0"]:focus-visible {
    outline: 3px solid rgba(var(--bs-primary-rgb), 0.55) !important;
    outline-offset: 2px;
    box-shadow: none !important;
}

/* ---- Forms: bold labels, taller fields ---- */
.form-label, label {
    font-weight: 700 !important;
    font-size: 0.84rem !important;
    color: var(--ui-ink);
    margin-bottom: 0.35rem;
}
.form-label.small, label.small { font-size: 0.8rem !important; }
.form-check-label { font-weight: 600 !important; font-size: 0.88rem !important; }
.form-control, .form-select {
    min-height: 44px;
    border: 1.5px solid var(--app-control-border, #cfd6e2) !important;
    border-radius: 11px !important;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--ui-ink);
}
.form-control-sm, .form-select-sm { min-height: 38px; font-size: 0.86rem; border-radius: 10px !important; }
textarea.form-control { min-height: 0; }
.form-control::placeholder { font-weight: 400; }
.form-switch .form-check-input { width: 2.6em; height: 1.4em; }
.form-check-input { border-width: 1.5px; border-color: #9aa5b8; }
.input-group-text { font-weight: 700; border-width: 1.5px; }

/* ---- Tabs: thick underline, bold label ---- */
.nav-tabs { border-bottom: 2px solid var(--ui-line); gap: 4px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.nav-tabs::-webkit-scrollbar { display: none; }
.nav-tabs .nav-link {
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--app-muted);
    border: 0 !important;
    border-bottom: 3px solid transparent !important;
    margin-bottom: -2px;
    padding: 0.7rem 1rem;
    white-space: nowrap;
    background: transparent !important;
}
.nav-tabs .nav-link:hover { color: var(--ui-ink); }
.nav-tabs .nav-link.active { color: var(--bs-primary) !important; border-bottom-color: var(--bs-primary) !important; }

/* ---- Badges, alerts, pagination ---- */
.badge { font-weight: 700; font-size: 0.74rem; letter-spacing: 0.02em; padding: 0.42em 0.7em; border-radius: 8px; }
.alert { border-radius: 14px; border-width: 1.5px; font-weight: 600; }
.alert-info { background: #eaf3ff; border-color: #b9d6ff; color: #12386b; }
.alert-warning { background: #fff5db; border-color: #f2d27a; color: #5f4500; }
body.theme-dark .alert-info { background: #1d2a44; border-color: #2f4a7a; color: #cfe1ff; }
body.theme-dark .alert-warning { background: #3a3016; border-color: #6b5620; color: #ffe7a6; }
.page-link { font-weight: 700; border-radius: 9px !important; margin: 0 2px; }

/* ---- Drawers and filter chips used by the newer screens ---- */
.enq-drawer, .sub-drawer, .sa-drawer { border-start-start-radius: 22px; border-end-start-radius: 22px; padding: 24px !important; }
.enq-drawer h5, .sub-drawer h5, .sa-drawer h5 { font-size: 1.3rem !important; }
.enq-drawer h6, .sub-drawer h6, .sa-drawer h6 { margin-top: 1.1rem; padding-top: 0.9rem; border-top: 1.5px solid var(--ui-line); text-transform: uppercase; font-size: 0.76rem !important; letter-spacing: 0.08em; color: var(--app-muted) !important; }
.enq-chip { font-weight: 700; border-width: 1.5px !important; padding: 8px 16px !important; }
.mk-ops { font-weight: 700; border-width: 1.5px !important; }
.mk-card h6 { font-size: 1.1rem !important; }
.mk-dl dd, .enq-dl dd, .sa-dl dd { font-weight: 700; }

/* ---- "Needs attention" strip on the dashboard ---- */
.attn { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 1.25rem; }
.attn-item {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 16px; border-radius: 16px; text-decoration: none;
    background: var(--app-card-bg); border: 1.5px solid var(--app-card-border); box-shadow: var(--ui-shadow);
    color: var(--ui-ink); transition: transform 0.15s ease, border-color 0.15s ease;
}
.attn-item:hover { transform: translateY(-2px); border-color: var(--bs-primary); color: var(--ui-ink); }
.attn-item.is-hot { border-color: #e2574c; background: linear-gradient(0deg, rgba(226, 87, 76, 0.07), rgba(226, 87, 76, 0.07)), var(--app-card-bg); }
.attn-n { flex: none; min-width: 44px; height: 44px; padding: 0 10px; display: grid; place-items: center; border-radius: 12px; background: rgba(var(--bs-primary-rgb), 0.12); color: var(--bs-primary); font-size: 1.2rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.attn-item.is-hot .attn-n { background: #e2574c; color: #fff; }
.attn-label { font-weight: 700; font-size: 0.9rem; line-height: 1.25; }
.attn-sub { display: block; font-weight: 500; font-size: 0.78rem; color: var(--app-muted); }
.attn-title { font-size: 0.76rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--app-muted); margin-bottom: 8px; }
.attn-ok { padding: 14px 16px; border-radius: 16px; border: 1.5px dashed var(--ui-line); font-weight: 600; color: var(--app-muted); margin-bottom: 1.25rem; }

@media (max-width: 575.98px) {
    .page-head-title, .welcome-h { font-size: 1.3rem !important; }
    .btn { padding: 0.5rem 0.85rem; }
}
@media (prefers-reduced-motion: reduce) { .btn, .attn-item { transition: none; } }
