/* =====================================================================
   UTL ERP - "Slim" theme (2026-10-09)
   One colour family: navy + its shades, white, cool greys.
   The only other colour is a muted red, kept for errors / danger.
   Loaded by erp/layouts/base.html AFTER its own <style>, BEFORE each page's
   {% block extra_css %} - so a page can still override it.
   Everything is scoped to body.theme-slim (header toggle Slim / Classic)
   and to @media screen - print and PDF output are not touched.
   ===================================================================== */
@media screen {

body.theme-slim {
    --n900: #0f1e36;   /* ink: sidebar, headings            */
    --n700: #1e3a5f;   /* primary: buttons, active, headers */
    --n600: #2c5282;
    --n500: #4a6fa5;
    --n300: #8aa4c8;
    --n200: #c9d6e8;
    --n100: #e8eef6;
    --n050: #f4f7fb;   /* page background                   */
    --line: #d8e0ea;
    --txt:  #1f2937;
    --mut:  #5b6b80;
    --err:  #b42318;   /* errors only */
    --err-bg: #fdf2f1;

    --app-bg: var(--n050);
    --surface-border: var(--line);
    --text-primary: var(--txt);
    --text-secondary: var(--mut);
    --accent: var(--n700);
    --accent-soft: rgba(30, 58, 95, .10);
    --shadow-soft: none;
    --radius-lg: 6px; --radius-md: 6px; --radius-sm: 4px;

    font-family: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-size: 13px;
    color: var(--txt);
    background: var(--n050);
}
body.theme-slim .wrapper { background: var(--n050); }
body.theme-slim h1, body.theme-slim h2, body.theme-slim h3,
body.theme-slim h4, body.theme-slim h5, body.theme-slim h6 { color: var(--n900); font-weight: 600; }

/* ---------- top bar ---------- */
body.theme-slim .main-header.dashboard-topbar {
    min-height: 42px; height: 42px; border-radius: 6px; box-shadow: none;
    background: #fff; border: 1px solid var(--line); backdrop-filter: none;
}
body.theme-slim .dashboard-topbar .nav-link { color: var(--mut); padding: .3rem .6rem; height: 40px; display: flex; align-items: center; }
body.theme-slim .topbar-search input { border-radius: 4px; padding: 5px 10px 5px 30px; font-size: 12px; background: var(--n050); }
body.theme-slim .topbar-pill { border-radius: 4px; padding: 3px 8px; font-size: 11px; color: var(--n700); background: var(--n100); border-color: var(--n200); }
body.theme-slim .topbar-avatar { width: 26px; height: 26px; font-size: 11px; background: var(--n700); box-shadow: none; }

/* ---------- sidebar: navy, flat, compact ---------- */
body.theme-slim .app-sidebar {
    background: var(--n900); border: 0; border-radius: 6px; box-shadow: none;
}
body.theme-slim .app-sidebar .brand-link { border-bottom: 1px solid rgba(255,255,255,.08); padding: .55rem .75rem; }
body.theme-slim .app-sidebar .brand-link, body.theme-slim .app-sidebar .brand-copy strong { color: #fff; }
body.theme-slim .app-sidebar .brand-copy span { color: var(--n300); }
body.theme-slim .app-sidebar .user-panel { display: none !important; }      /* name is in the top bar */
body.theme-slim .app-sidebar .nav-sidebar .nav-link {
    color: #c9d6e8; padding: .32rem .6rem; margin-bottom: 1px; border-radius: 4px; font-size: 12.5px;
}
body.theme-slim .app-sidebar .nav-sidebar .nav-link p { font-size: 12.5px; }
body.theme-slim .app-sidebar .nav-sidebar .nav-link .nav-icon { font-size: .82rem; width: 1.4rem; color: var(--n300); }
body.theme-slim .app-sidebar .nav-sidebar .nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
body.theme-slim .app-sidebar .nav-sidebar .nav-link.active,
body.theme-slim .app-sidebar .nav-sidebar .menu-open > .nav-link { background: var(--n700) !important; color: #fff !important; box-shadow: none !important; }
body.theme-slim .app-sidebar .nav-treeview > .nav-item > .nav-link { padding-left: 1.4rem; font-size: 12px; }
body.theme-slim .app-sidebar .nav-header { color: var(--n300); font-size: 10.5px; padding: .6rem .6rem .25rem; letter-spacing: .05em; }

/* ---------- page header: one thin line ---------- */
body.theme-slim .content-header { padding: 6px 4px 2px !important; }
body.theme-slim .content-header h1,
body.theme-slim .content-header .m-0 { font-size: 1.05rem !important; margin: 0 !important; line-height: 1.6; }
body.theme-slim .content-header h1 i { font-size: .9rem; color: var(--n500) !important; }
body.theme-slim .content-header .row { margin-bottom: 0 !important; align-items: center; }
body.theme-slim .breadcrumb { background: transparent; padding: 0; margin: 0; font-size: 11.5px; }
body.theme-slim .breadcrumb-item, body.theme-slim .breadcrumb-item a { color: var(--mut); }
body.theme-slim .content-header p, body.theme-slim .content-header .lead { font-size: 12px; color: var(--mut); margin: 0; }
body.theme-slim .main-footer { display: none; }   /* 40px back for the work area */

/* ---------- cards ---------- */
body.theme-slim .card {
    border-radius: 6px !important; box-shadow: none !important; border: 1px solid var(--line) !important;
    margin-bottom: 8px; background: #fff;
}
body.theme-slim .card-header {
    padding: .4rem .7rem; min-height: 36px; display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
    background: #fff !important; color: var(--n900) !important; border-bottom: 1px solid var(--line) !important;
    border-radius: 6px 6px 0 0 !important;
}
body.theme-slim .card-header::after { display: none; }
body.theme-slim .card-header .card-title, body.theme-slim .card-title { font-size: 13px !important; font-weight: 600; color: var(--n900) !important; margin: 0; }
body.theme-slim .card-header .card-tools { margin-left: auto; }
body.theme-slim .card-body { padding: .5rem .6rem; }
body.theme-slim .card-footer { padding: .4rem .7rem; background: var(--n050); }
/* coloured card headers (bg-primary, header-premium, gradients) -> one navy look */
body.theme-slim .card-header[class*="bg-"], body.theme-slim .header-premium,
body.theme-slim .card-primary.card-outline > .card-header { background: #fff !important; color: var(--n900) !important; }
body.theme-slim .card[class*="card-outline"] { border-top: 2px solid var(--n700) !important; }

/* ---------- buttons: navy family ---------- */
body.theme-slim .btn { border-radius: 4px; font-size: 12.5px; font-weight: 500; box-shadow: none !important; }
body.theme-slim .btn-sm, body.theme-slim .btn-group-sm > .btn { padding: .22rem .6rem; font-size: 12px; }
body.theme-slim .btn-xs { padding: .1rem .45rem; font-size: 11px; border-radius: 3px; }
body.theme-slim .btn-primary, body.theme-slim .btn-success, body.theme-slim .btn-info { background: var(--n700); border-color: var(--n700); color: #fff; }
body.theme-slim .btn-primary:hover, body.theme-slim .btn-success:hover, body.theme-slim .btn-info:hover { background: var(--n900); border-color: var(--n900); color: #fff; }
body.theme-slim .btn-warning { background: var(--n500); border-color: var(--n500); color: #fff; }
body.theme-slim .btn-secondary, body.theme-slim .btn-light, body.theme-slim .btn-default { background: #fff; border-color: var(--n200); color: var(--n700); }
body.theme-slim .btn-secondary:hover, body.theme-slim .btn-light:hover, body.theme-slim .btn-default:hover { background: var(--n100); color: var(--n900); }
body.theme-slim .btn-danger { background: var(--err); border-color: var(--err); color: #fff; }
body.theme-slim [class*="btn-outline-"]:not(.btn-outline-danger) { background: #fff; border-color: var(--n200); color: var(--n700); }
body.theme-slim [class*="btn-outline-"]:not(.btn-outline-danger):hover { background: var(--n100); color: var(--n900); }
body.theme-slim .btn-outline-danger { color: var(--err); border-color: #f0c4c0; background: #fff; }
body.theme-slim .btn-action { border-radius: 4px !important; padding: .25rem .8rem !important; }

/* ---------- badges, text and background utilities ---------- */
body.theme-slim .badge { font-weight: 500; border-radius: 10px; padding: .22em .6em; font-size: 10.5px; }
body.theme-slim .badge-primary, body.theme-slim .badge-success { background: var(--n700); color: #fff; }
body.theme-slim .badge-info { background: var(--n500); color: #fff; }
body.theme-slim .badge-warning { background: var(--n200); color: var(--n900); }
body.theme-slim .badge-secondary, body.theme-slim .badge-light { background: var(--n100); color: var(--n700); }
body.theme-slim .badge-danger { background: var(--err); color: #fff; }
body.theme-slim .text-primary, body.theme-slim .text-success, body.theme-slim .text-info { color: var(--n700) !important; }
body.theme-slim .text-warning { color: var(--n500) !important; }
body.theme-slim .text-muted, body.theme-slim .text-secondary { color: var(--mut) !important; }
body.theme-slim .text-danger { color: var(--err) !important; }
body.theme-slim .bg-primary, body.theme-slim .bg-success, body.theme-slim .bg-info,
body.theme-slim .bg-gradient-primary, body.theme-slim .bg-gradient-success, body.theme-slim .bg-gradient-info { background: var(--n700) !important; color: #fff !important; }
body.theme-slim .bg-warning, body.theme-slim .bg-gradient-warning { background: var(--n500) !important; color: #fff !important; }
body.theme-slim .bg-light { background: var(--n050) !important; }
/* AdminLTE stat boxes on dashboards -> calm white tiles */
body.theme-slim .small-box, body.theme-slim .info-box { box-shadow: none; border: 1px solid var(--line); border-radius: 6px; background: #fff !important; color: var(--txt) !important; min-height: 0; }
body.theme-slim .small-box .inner h3 { font-size: 1.5rem; color: var(--n900); }
body.theme-slim .small-box .icon > i { color: var(--n200); font-size: 48px; top: 10px; }
body.theme-slim .small-box .small-box-footer { background: var(--n050) !important; color: var(--n700) !important; }
body.theme-slim .info-box .info-box-icon { border-radius: 4px; width: 46px; font-size: 1.2rem; background: var(--n100) !important; color: var(--n700) !important; }

/* ---------- alerts ---------- */
body.theme-slim .alert { border-radius: 4px; padding: .45rem .75rem; font-size: 12.5px; margin-bottom: 8px; border: 1px solid var(--n200); background: var(--n100); color: var(--n900); }
body.theme-slim .alert-danger { background: var(--err-bg); border-color: #f0c4c0; color: var(--err); }
body.theme-slim .alert .close { padding: .35rem .7rem; }

/* ---------- forms ---------- */
body.theme-slim label, body.theme-slim .col-form-label { font-size: 11px; font-weight: 500; color: var(--mut); margin-bottom: 2px; }
body.theme-slim .form-group { margin-bottom: .35rem; }
body.theme-slim .form-control, body.theme-slim .custom-select {
    height: 28px; padding: .15rem .45rem; font-size: 12px; border-radius: 4px; border-color: var(--line); color: var(--txt);
}
body.theme-slim textarea.form-control { height: auto; }
body.theme-slim .form-control-sm { height: 28px; font-size: 12px; }
body.theme-slim .form-control:focus, body.theme-slim .custom-select:focus { border-color: var(--n500); box-shadow: 0 0 0 2px rgba(30,58,95,.12); }
body.theme-slim .input-group-text { font-size: 12px; padding: .2rem .5rem; background: var(--n050); border-color: var(--line); }
body.theme-slim .select2-container .select2-selection--single { height: 30px; border-color: var(--line); border-radius: 4px; }
body.theme-slim .select2-container .select2-selection--single .select2-selection__rendered { line-height: 28px; font-size: 12.5px; }
body.theme-slim .select2-container .select2-selection--single .select2-selection__arrow { height: 28px; }
body.theme-slim .select2-container--default .select2-results__option--highlighted[aria-selected] { background: var(--n700); }
body.theme-slim .custom-control-input:checked ~ .custom-control-label::before { background: var(--n700); border-color: var(--n700); }

/* ---------- tables: dense, sticky header, one header colour ---------- */
body.theme-slim .table { font-size: 12px; color: var(--txt); margin-bottom: 0; }
body.theme-slim .table th, body.theme-slim .table td { padding: .25rem .42rem; vertical-align: middle; border-color: #edf1f6; }
body.theme-slim .table thead th,
body.theme-slim .table .thead-dark th, body.theme-slim .thead-dark th,
body.theme-slim .table thead[style] th {
    background: var(--n100) !important; color: var(--n700) !important; font-weight: 600; font-size: 11.5px;
    border-bottom: 1px solid var(--n200) !important; border-top: 0; white-space: nowrap;
}
body.theme-slim .table thead[style] { background: var(--n100) !important; }
body.theme-slim .table-striped tbody tr:nth-of-type(odd) { background: #fbfcfe; }
body.theme-slim .table-hover tbody tr:hover { background: var(--n050); }
body.theme-slim .table-bordered, body.theme-slim .table-bordered th, body.theme-slim .table-bordered td { border-color: #e6ebf2; }
body.theme-slim .js-scroll-box thead th { background: var(--n100) !important; color: var(--n700) !important; box-shadow: inset 0 -1px 0 var(--n200) !important; }
/* 1920x1200: the grid takes the rest of the screen and scrolls inside */
body.theme-slim .js-scroll-box, body.theme-slim .table-fill { max-height: calc(100vh - 290px); overflow: auto; }
body.theme-slim .dataTables_wrapper { font-size: 12px; }
body.theme-slim .page-item.active .page-link { background: var(--n700); border-color: var(--n700); }
body.theme-slim .page-link { color: var(--n700); padding: .25rem .55rem; font-size: 12px; }

/* ---------- misc ---------- */
body.theme-slim .nav-tabs .nav-link { padding: .35rem .8rem; font-size: 12.5px; color: var(--mut); }
body.theme-slim .nav-tabs .nav-link.active { color: var(--n900); border-top: 2px solid var(--n700); }
body.theme-slim .modal-header { padding: .55rem .9rem; background: #fff; border-bottom: 1px solid var(--line); }
body.theme-slim .modal-title { font-size: 14px; color: var(--n900); }
body.theme-slim .modal-body { padding: .75rem .9rem; }
body.theme-slim .modal-content { border-radius: 6px; border: 1px solid var(--line); }
body.theme-slim .progress-bar { background-color: var(--n700); }
body.theme-slim a { color: var(--n700); }
body.theme-slim a:hover { color: var(--n900); }
body.theme-slim .app-sidebar a { color: inherit; }

/* Slim / Classic switch in the top bar */
.theme-switch { font-size: 11px; border: 1px solid #d8e0ea; background: #fff; color: #1e3a5f; border-radius: 4px; padding: 2px 8px; cursor: pointer; }
.theme-switch:hover { background: #e8eef6; }
}
