/*!
 * Dashcode-style admin theme (local)
 * Custom build — mimics the Dashcode admin template visual language
 */

:root {
    --dc-primary: #4669fa;
    --dc-primary-rgb: 70, 105, 250;
    --dc-primary-hover: #3b5ce0;
    --dc-primary-soft: #eef2ff;
    --dc-secondary: #a0aec0;
    --dc-success: #50c793;
    --dc-info: #0ce7fa;
    --dc-warning: #fa916b;
    --dc-danger: #f1595c;

    --dc-body-bg: #f1f5f9;
    --dc-card-bg: #ffffff;
    --dc-sidebar-bg: #1e293b;
    --dc-sidebar-bg-hover: #27364b;
    --dc-sidebar-text: #cbd5e1;
    --dc-sidebar-heading: #ffffff;
    --dc-sidebar-border: rgba(255, 255, 255, 0.06);
    --dc-border: #e2e8f0;

    --dc-text: #0f172a;
    --dc-text-muted: #64748b;
    --dc-heading: #1e293b;

    --dc-sidebar-width: 248px;
    --dc-sidebar-collapsed: 72px;
    --dc-header-height: 64px;

    --dc-radius: 10px;
    --dc-radius-sm: 6px;
    --dc-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
    --dc-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
    --dc-transition: 0.22s ease;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background-color: var(--dc-body-bg);
    color: var(--dc-text);
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 15.5px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3, h4, h5, h6 {
    color: var(--dc-heading);
    font-weight: 600;
}

.text-muted { color: var(--dc-text-muted) !important; }

/* ==========================================================
   Layout wrapper
========================================================== */
.dc-app {
    display: flex;
    min-height: 100vh;
}

.dc-main {
    flex: 1;
    margin-left: var(--dc-sidebar-width);
    display: flex;
    flex-direction: column;
    min-width: 0;
    transition: margin-left var(--dc-transition);
}

.dc-content {
    padding: 1.75rem 1.75rem 2.5rem;
    flex: 1;
}

/* ==========================================================
   Sidebar
========================================================== */
.dc-sidebar {
    width: var(--dc-sidebar-width);
    background-color: var(--dc-sidebar-bg);
    border-right: 1px solid var(--dc-sidebar-border);
    position: fixed;
    top: 0; left: 0; bottom: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: width var(--dc-transition), transform var(--dc-transition);
    z-index: 1030;
}

.dc-sidebar-brand {
    height: var(--dc-header-height);
    padding: 0 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    border-bottom: 1px solid var(--dc-sidebar-border);
    flex-shrink: 0;
}

.dc-sidebar-brand .brand-logo {
    width: 34px; height: 34px;
    background: linear-gradient(135deg, var(--dc-primary) 0%, #6d8dff 100%);
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.dc-sidebar-brand .brand-name {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--dc-sidebar-heading);
    letter-spacing: -0.01em;
    white-space: nowrap;
}

.dc-sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0.6rem 0.6rem 1rem;
}

.dc-sidebar-nav::-webkit-scrollbar { width: 4px; }
.dc-sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.15); border-radius: 4px; }

.dc-nav { list-style: none; padding: 0; margin: 0; }

.dc-nav-section-title {
    font-size: 0.74rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.55);
    padding: 0.85rem 0.85rem 0.4rem;
    margin: 0;
    white-space: nowrap;
}

.dc-nav-item { margin: 0 0; }

.dc-nav-link {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.42rem 0.85rem;
    color: var(--dc-sidebar-text);
    font-size: 1.04rem;
    font-weight: 500;
    border-radius: var(--dc-radius-sm);
    position: relative;
    white-space: nowrap;
    transition: background-color var(--dc-transition), color var(--dc-transition);
}

.dc-nav-link i {
    font-size: 1.08rem;
    width: 18px;
    color: rgba(255, 255, 255, 0.55);
    transition: color var(--dc-transition);
    flex-shrink: 0;
    text-align: center;
}

/* The label itself wraps (up to 2 lines, then an ellipsis) instead of
   overflowing or forcing the sidebar wider — most nav labels are short and
   stay on one line regardless, this only kicks in for a long one (e.g. a
   report renamed to a full descriptive title). `min-width: 0` is the usual
   flexbox fix needed before a flex child will actually wrap rather than
   just push the row wider. */
.dc-nav-link span {
    flex: 1 1 auto;
    min-width: 0;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.25;
}

.dc-nav-link:hover {
    background-color: var(--dc-sidebar-bg-hover);
    color: #ffffff;
}

.dc-nav-link:hover i { color: #ffffff; }

.dc-nav-link.active {
    background-color: transparent;
    color: #4fa3ff;
    box-shadow: none;
    font-weight: 600;
}

.dc-nav-link.active i { color: #4fa3ff; }

/* Group headers (e.g. "HR Module") always carry a subtle tint so they read
   as a section heading, distinct from the plain leaf links nested under
   them — not just on hover/expand, which still layer on top of this. Extra
   margin around the whole group block (header + its submenu) keeps
   consecutive groups from touching and looking crowded. */
.dc-nav-link.has-caret {
    background-color: rgba(255, 255, 255, 0.035);
    font-weight: 600;
    font-size: 1.1rem;
}

.dc-nav-group {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

.dc-nav-link.has-caret .dc-caret {
    margin-left: auto;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.45);
    transition: transform var(--dc-transition);
}

.dc-nav-link.has-caret[aria-expanded="true"] .dc-caret {
    transform: rotate(180deg);
    color: #ffffff;
}

.dc-nav-link.has-caret[aria-expanded="true"]:not(.active) {
    background-color: var(--dc-sidebar-bg-hover);
    color: #ffffff;
}

.dc-nav-link.has-caret[aria-expanded="true"]:not(.active) i { color: #ffffff; }

.dc-submenu {
    list-style: none;
    padding: 0.12rem 0 0.22rem 0;
    margin: 0.08rem 0 0.22rem 1.25rem;
    border-left: none;
}

.dc-submenu .dc-nav-item { margin: 0.08rem 0; }

/* A group nested inside a group (menu_items allows any depth) — indented one
   more step, with a hairline so the extra level is readable rather than looking
   like a sibling of the links above it. */
.dc-submenu-nested {
    margin-left: 0.9rem;
    border-left: 1px solid var(--dc-sidebar-border);
}
.dc-nav-subgroup { list-style: none; margin: 0.08rem 0; }

.dc-submenu .dc-nav-link {
    padding: 0.42rem 0.75rem;
    font-size: 1rem;
    font-weight: 500;
    gap: 0.6rem;
}

/* A group nested inside another group (e.g. Quality > OEE Report >
   Monthly/Yearly) is still its own "heading" relative to ITS OWN children
   — keep it visually bigger than its plain leaf siblings at this same
   depth, even though the more general .dc-submenu .dc-nav-link rule above
   would otherwise win the cascade (equal specificity, later in the file). */
.dc-submenu .dc-nav-link.has-caret {
    font-size: 1.1rem;
}

.dc-submenu .dc-nav-link i {
    font-size: 1rem;
    width: 16px;
}

.dc-submenu .dc-nav-link::before {
    display: none;
}

.dc-submenu .dc-nav-link.has-caret::before { display: none; }

.dc-submenu .dc-nav-link:hover::before,
.dc-submenu .dc-nav-link.active::before {
    background-color: currentColor;
    opacity: 1;
}

.dc-submenu .dc-nav-link.active {
    background-color: transparent;
    color: #4fa3ff;
    font-weight: 600;
    box-shadow: none;
}

.dc-submenu .dc-nav-link.active::before {
    background-color: #4fa3ff !important;
    opacity: 1;
}

.dc-submenu .dc-submenu {
    margin: 0.1rem 0 0.25rem 1.5rem;
    padding-left: 0;
}

/* ==========================================================
   Header
========================================================== */
.dc-header {
    height: var(--dc-header-height);
    background-color: #fff;
    border-bottom: 1px solid var(--dc-border);
    position: sticky;
    top: 0;
    z-index: 1020;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    backdrop-filter: saturate(180%) blur(8px);
}

.dc-header-left, .dc-header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.dc-header-action {
    display: flex;
    align-items: center;
}
.dc-header-action:empty {
    display: none;
}

/* ---- Slightly compact header controls (Upload/Export/New + user menu) ---- */
.dc-header .dc-header-right { gap: 0.6rem; }

.dc-header .btn-dc {
    height: 32px;
    padding: 0 0.75rem;
    font-size: 0.78rem;
    gap: 0.3rem;
}
.dc-header .btn-dc i { font-size: 0.85rem; }

.dc-header .dc-user {
    gap: 0.5rem;
    padding: 0.2rem 0.4rem 0.2rem 0.2rem;
}
.dc-header .dc-user .user-avatar {
    width: 30px;
    height: 30px;
    font-size: 0.78rem;
}
.dc-header .dc-user .user-name { font-size: 0.78rem; }
.dc-header .dc-user .user-role { font-size: 0.66rem; }
.dc-header .dc-user > i.bi-chevron-down { font-size: 0.7rem; }

.dc-sidebar-toggle {
    background: transparent;
    border: none;
    width: 38px;
    height: 38px;
    border-radius: var(--dc-radius-sm);
    color: var(--dc-text-muted);
    font-size: 1.25rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color var(--dc-transition), color var(--dc-transition);
}

.dc-sidebar-toggle:hover {
    background-color: var(--dc-primary-soft);
    color: var(--dc-primary);
}

.dc-header-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--dc-heading);
}

.dc-breadcrumb .breadcrumb {
    margin: 0;
    padding: 0;
    background: transparent;
    font-size: .92rem;
    line-height: 1.2;
}
.dc-breadcrumb .breadcrumb-item {
    color: #6b7280;
}
.dc-breadcrumb .breadcrumb-item + .breadcrumb-item::before {
    content: "›";
    color: #cbd5e1;
    padding: 0 .35rem;
}
.dc-breadcrumb .breadcrumb-item a {
    color: #6b7280;
    text-decoration: none;
    font-weight: 500;
    transition: color .15s ease;
}
.dc-breadcrumb .breadcrumb-item a:hover {
    color: var(--dc-primary);
}
.dc-breadcrumb .breadcrumb-item.active {
    color: var(--dc-heading);
    font-weight: 600;
}

.dc-search {
    position: relative;
    display: flex;
    align-items: center;
}

.dc-search i {
    position: absolute;
    left: 0.9rem;
    color: var(--dc-text-muted);
    font-size: 0.95rem;
}

.dc-search input {
    height: 38px;
    border: 1px solid var(--dc-border);
    background-color: var(--dc-body-bg);
    border-radius: var(--dc-radius-sm);
    padding: 0 0.9rem 0 2.35rem;
    min-width: 280px;
    font-size: 0.88rem;
    color: var(--dc-text);
    outline: none;
    transition: border-color var(--dc-transition), background-color var(--dc-transition), box-shadow var(--dc-transition);
}

.dc-search input:focus {
    border-color: var(--dc-primary);
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(var(--dc-primary-rgb), 0.15);
}

.dc-icon-btn {
    position: relative;
    background: transparent;
    border: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    color: var(--dc-text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color var(--dc-transition), color var(--dc-transition);
}

.dc-icon-btn:hover {
    background-color: var(--dc-primary-soft);
    color: var(--dc-primary);
}

.dc-icon-btn .dc-badge-dot {
    position: absolute;
    top: 8px;
    right: 9px;
    width: 8px;
    height: 8px;
    background-color: var(--dc-danger);
    border: 2px solid #fff;
    border-radius: 50%;
}

.dc-user {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.25rem 0.5rem 0.25rem 0.25rem;
    background: transparent;
    border: none;
    cursor: pointer;
    border-radius: 999px;
    transition: background-color var(--dc-transition);
}

.dc-user:hover { background-color: var(--dc-body-bg); }

.dc-user .user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--dc-primary) 0%, #8fa3ff 100%);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
}

.dc-user .user-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.15;
}

.dc-user .user-name {
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--dc-heading);
}

.dc-user .user-role {
    font-size: 0.72rem;
    color: var(--dc-text-muted);
}

.dropdown-menu {
    border: 1px solid var(--dc-border);
    border-radius: var(--dc-radius);
    box-shadow: var(--dc-shadow);
    padding: 0.35rem;
    font-size: 0.88rem;
}

.dropdown-item {
    border-radius: var(--dc-radius-sm);
    padding: 0.5rem 0.75rem;
}

.dropdown-item:hover {
    background-color: var(--dc-primary-soft);
    color: var(--dc-primary);
}

/* ==========================================================
   Page header
========================================================== */
.dc-page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.dc-page-title {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--dc-heading);
    letter-spacing: -0.015em;
}

.dc-breadcrumb {
    font-size: 0.82rem;
    color: var(--dc-text-muted);
    margin-top: 0.25rem;
}

.dc-breadcrumb a { color: var(--dc-text-muted); }
.dc-breadcrumb a:hover { color: var(--dc-primary); }
.dc-breadcrumb .sep { margin: 0 0.4rem; opacity: 0.6; }

/* ==========================================================
   Cards & stats
========================================================== */
.dc-card {
    background-color: var(--dc-card-bg);
    border: 1px solid var(--dc-border);
    border-radius: var(--dc-radius);
    box-shadow: var(--dc-shadow-sm);
}

/* Reusable filter toolbar — used on index pages above the table card.
   Add class `dc-filter-toolbar` to the <form> wrapping your name/status/etc.
   filter inputs, and place it just before the .dc-card. */
.dc-filter-toolbar {
    background: var(--dc-card-bg);
    border: 1px solid var(--dc-border);
    border-radius: var(--dc-radius);
    padding: .6rem .85rem;
    margin-top: 1rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--dc-shadow-sm);
}
.dc-filter-toolbar .form-label {
    font-size: .75rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: .4px;
    margin-bottom: .2rem;
}
.dc-filter-toolbar .form-control,
.dc-filter-toolbar .form-select {
    font-size: .88rem;
    padding: .4rem .6rem;
    height: auto;
}
.dc-filter-toolbar .btn {
    font-size: .85rem;
    padding: .4rem .8rem;
    white-space: nowrap;
}

/* When a card uses our own filter toolbar, hide DataTables' built-in
   search box so we don't have two search inputs side-by-side. */
.dc-card.no-dt-search .dt-search { display: none !important; }

/* "Hide/Show Filters" toggle header (report filter cards) — JS wiring in
   dashcode.js's DOMContentLoaded handler, generic for any
   `[data-filters-toggle]` + its Bootstrap collapse target. */
[data-filters-toggle] {
    padding: 0.5rem 1rem;
    cursor: pointer;
}

/* Compact filter-card labels — every report's filter form is wrapped in a
   `#reportFiltersCollapse` (the toggle's target); combined with `px-3 pb-2`
   on the form's own container and `-sm` sized inputs/buttons, this keeps
   the whole filter bar to one short row instead of the app's normal
   (taller) `p-3 p-md-4` filter card padding. */
#reportFiltersCollapse .form-label {
    margin-bottom: 0.15rem;
    font-size: 0.78rem;
}

/* Green report theme — opt-in by wrapping a report page's whole body in
   `<div class="scr-green-theme">`. Redefines the app's primary-blue
   variables to the header Export button's green (#50c793), so every
   element that already reads them app-wide — focus rings, pagination
   hover/active — turns green here for free. Two things do NOT read these
   variables and need explicit overrides: Bootstrap's own `.btn-primary`
   (its colors are baked into Bootstrap's compiled CSS, not tied to this
   app's variables) and the DataTables header background (hardcoded navy
   with its own `!important`, so this has to be too). `:has(.dc-table-wrap)`
   targets only the table's own card — not the filters card or any KPI
   stat tiles — without needing to know each report's own `data-filters`
   value. First used on ItemStockComparisonReports, then reused everywhere. */
.scr-green-theme {
    --dc-primary: #50c793;
    --dc-primary-rgb: 80, 199, 147;
    --dc-primary-hover: #3dab7a;
    --dc-primary-soft: #e8f9f1;
}
.scr-green-theme .btn-primary {
    background-color: var(--dc-primary);
    border-color: var(--dc-primary);
}
.scr-green-theme .btn-primary:hover,
.scr-green-theme .btn-primary:focus,
.scr-green-theme .btn-primary:active {
    background-color: var(--dc-primary-hover) !important;
    border-color: var(--dc-primary-hover) !important;
}
.scr-green-theme .dc-card:has(.dc-table-wrap),
.scr-green-theme .dc-card:has(.dc-scroll-wrap) {
    border-top: 3px solid var(--dc-primary-hover);
}
.scr-green-theme .dt-container table.dataTable.dc-table thead th {
    background-color: var(--dc-primary-hover) !important;
}

.dc-card-header {
    padding: 0.5rem 0.85rem;
    border-bottom: 1px solid var(--dc-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}


.dc-card-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--dc-heading);
}

.dc-card-body {
    padding: 1.25rem;
}

.dc-stat {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.1rem 1.25rem;
    background-color: var(--dc-card-bg);
    border: 1px solid var(--dc-border);
    border-radius: var(--dc-radius);
    box-shadow: var(--dc-shadow-sm);
    transition: transform var(--dc-transition), box-shadow var(--dc-transition);
}

.dc-stat:hover {
    transform: translateY(-2px);
    box-shadow: var(--dc-shadow);
}

.dc-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.dc-stat-icon.primary { background-color: rgba(var(--dc-primary-rgb), 0.1); color: var(--dc-primary); }
.dc-stat-icon.success { background-color: rgba(80, 199, 147, 0.12); color: var(--dc-success); }
.dc-stat-icon.warning { background-color: rgba(250, 145, 107, 0.12); color: var(--dc-warning); }
.dc-stat-icon.info    { background-color: rgba(12, 231, 250, 0.12); color: #06b6d4; }

.dc-stat-label {
    font-size: 0.9rem;
    color: var(--dc-text-muted);
    margin-bottom: 0.15rem;
}

.dc-stat-value {
    font-size: 1.65rem;
    font-weight: 700;
    color: var(--dc-heading);
    line-height: 1.1;
}

.dc-stat-delta {
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 0.2rem;
}

.dc-stat-delta.up { color: var(--dc-success); }
.dc-stat-delta.down { color: var(--dc-danger); }

/* ==========================================================
   Report KPI tiles — the compact icon+label+value card every report's
   own filter/summary row uses above its table. Previously every report
   (CriticalSparesReports' .csr-tile, BinCardReports' .bcr-tile, 28+
   others) copy-pasted an identical rule set under its own prefix; this
   is that same rule set, centralized once so a NEW report just uses
   .dc-tile directly with no local <style> block (client, 2026-11-01:
   "the export pattern and report styling everything should be global I
   dont have to ask you to make changes again and again for every new
   report"). Existing reports' own prefixed copies are untouched — this
   is additive, not a rename.
========================================================== */
.dc-tile {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    min-width: 180px;
    background: #fff;
    border: 1px solid var(--dc-border);
    border-left: 4px solid var(--dc-primary);
    border-radius: var(--dc-radius);
    box-shadow: var(--dc-shadow-sm);
    padding: 0.35rem 0.65rem;
}

.dc-tile-icon {
    width: 26px;
    height: 26px;
    flex-shrink: 0;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    background: var(--dc-primary-soft);
    color: var(--dc-primary);
}

.dc-tile-label {
    font-size: 0.6rem;
    color: var(--dc-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.dc-tile-value {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--dc-heading);
    line-height: 1.2;
}

.dc-tile-danger { border-left-color: var(--dc-danger); }
.dc-tile-danger .dc-tile-icon { background: rgba(241, 89, 92, 0.12); color: var(--dc-danger); }

.dc-tile-success { border-left-color: var(--dc-success); }
.dc-tile-success .dc-tile-icon { background: rgba(80, 199, 147, 0.12); color: var(--dc-success); }

.dc-tile-warning { border-left-color: var(--dc-warning); }
.dc-tile-warning .dc-tile-icon { background: rgba(250, 145, 107, 0.12); color: var(--dc-warning); }

/* Faded, shrunk placeholder for a zero/blank numeric report cell — a bare
   "0" or "-" reads as real content on a grid that's mostly empty; this
   fades it down instead. Wrap the placeholder text/em-dash in a
   `<span class="rep-blank">`. Was copy-pasted identically into 8+ report
   templates' own <style> blocks; centralized here (additive, same values
   every copy already used). */
.rep-blank { font-size: 0.72em; color: #cbd5e1; font-weight: 400; }

/* ==========================================================
   Quick links list
========================================================== */
.dc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.dc-list li + li { margin-top: 0.25rem; }

.dc-list a {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.6rem;
    border-radius: var(--dc-radius-sm);
    color: var(--dc-text);
    font-size: 0.88rem;
    transition: background-color var(--dc-transition), color var(--dc-transition);
}

.dc-list a i { color: var(--dc-text-muted); width: 18px; }

.dc-list a:hover {
    background-color: var(--dc-primary-soft);
    color: var(--dc-primary);
}

.dc-list a:hover i { color: var(--dc-primary); }

/* ==========================================================
   Buttons (dashcode primary)
========================================================== */
.btn-dc {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    height: 38px;
    padding: 0 1rem;
    font-size: 0.88rem;
    font-weight: 500;
    border-radius: var(--dc-radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: background-color var(--dc-transition), border-color var(--dc-transition), color var(--dc-transition), box-shadow var(--dc-transition);
    text-decoration: none;
}

.btn-dc-primary {
    background-color: var(--dc-primary);
    color: #fff;
    box-shadow: 0 3px 8px rgba(var(--dc-primary-rgb), 0.25);
}

.btn-dc-primary:hover {
    background-color: var(--dc-primary-hover);
    color: #fff;
    box-shadow: 0 6px 14px rgba(var(--dc-primary-rgb), 0.35);
}

.btn-dc-outline {
    background-color: transparent;
    color: var(--dc-text);
    border-color: var(--dc-border);
}

.btn-dc-outline:hover {
    background-color: var(--dc-primary-soft);
    color: var(--dc-primary);
    border-color: var(--dc-primary-soft);
}

/* ==========================================================
   Sidebar collapsed
========================================================== */
.dc-app.sidebar-collapsed .dc-sidebar {
    width: var(--dc-sidebar-collapsed);
}

.dc-app.sidebar-collapsed .dc-main {
    margin-left: var(--dc-sidebar-collapsed);
}

.dc-app.sidebar-collapsed .brand-name,
.dc-app.sidebar-collapsed .dc-nav-link span,
.dc-app.sidebar-collapsed .dc-nav-link .dc-caret,
.dc-app.sidebar-collapsed .dc-nav-section-title {
    display: none;
}

.dc-app.sidebar-collapsed .dc-nav-link { justify-content: center; padding: 0.65rem 0.6rem; }
.dc-app.sidebar-collapsed .dc-submenu { display: none !important; }

/* ==========================================================
   Tables
========================================================== */
.dc-table-wrap {
    overflow-x: auto;
}

/* ---- Sticky scroll panel (opt-in via `data-scroll-sticky`, wired up in
   dashcode.js's `setupScrollStickyPanel`) --------------------------------
   `.dc-table-wrap` becomes the single, bounded scroll container for both
   axes — every other ancestor between it and `thead th`/the pagination bar
   has to stay `overflow: visible`, since `position: sticky`/`fixed` always
   resolve against the *nearest* non-visible-overflow ancestor. */
.dc-table-wrap.dc-scroll-sticky {
    overflow: auto;
    max-height: 60vh;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.dc-table-wrap.dc-scroll-sticky::-webkit-scrollbar {
    display: none;
}
.dc-table-wrap.dc-scroll-sticky .dt-container div.dt-layout-table > div {
    overflow-x: visible;
}
.dc-table-wrap.dc-scroll-sticky table.dc-table {
    overflow: visible;
}
.dc-table-wrap.dc-scroll-sticky table.dc-table thead th {
    position: sticky;
    z-index: 2;
}
/* `.dt-container`'s app-wide padding (breathing room for the search box/
   pagination on a normal card) leaves a visible gap between the card's
   rounded corners and the table itself here, and — since the top/bottom
   layout rows are empty (no search box, no action button) on most of these
   reports — a dead strip between the synced top scrollbar and the header
   row. Drop all of it so the header/table run edge-to-edge. */
.dc-table-wrap.dc-scroll-sticky .dt-container {
    padding: 0;
}

.dc-scroll-topscroll {
    overflow-x: auto;
    overflow-y: hidden;
    height: 14px;
}
.dc-scroll-topscroll > div {
    height: 1px;
}

.dc-pagination-fixed {
    position: fixed;
    bottom: 0;
    z-index: 1030;
    background-color: #fff;
    border-top: 1px solid var(--dc-border);
    border-radius: var(--dc-radius-sm) var(--dc-radius-sm) 0 0;
    padding: 0.5rem 0.75rem;
    box-shadow: 0 -2px 8px rgba(15, 23, 42, 0.06);
}

.dc-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.98rem;
    border: 1px solid var(--dc-border);
    border-radius: 6px;
    overflow: hidden;
}

.dc-table thead th {
    background-color: #1e3a8a;
    color: #ffffff;
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.85rem 1rem;
    text-align: center;
    border-bottom: 1px solid var(--dc-border);
    border-right: 1px solid rgba(255,255,255,0.15);
    white-space: nowrap;
}

.dc-table thead th:last-child { border-right: none; }

.dc-table thead th a { color: #ffffff !important; }
.dc-table thead th a:hover { color: #cbd5e1 !important; }

.dc-table thead th a {
    color: inherit;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.dc-table thead th a:hover { color: var(--dc-primary); }
.dc-table thead th.asc a::after  { content: "\2191"; opacity: 0.7; }
.dc-table thead th.desc a::after { content: "\2193"; opacity: 0.7; }

.dc-table tbody td {
    padding: 0.95rem 1rem;
    border-bottom: 1px solid var(--dc-border);
    border-right: 1px solid var(--dc-border);
    color: var(--dc-text);
    vertical-align: middle;
    /* App-wide convention: headers centered, body values left-aligned,
       only amount/money columns right-aligned (add class `num` or
       `text-end`), Actions + select-checkbox centered. */
    text-align: left;
}

.dc-table tbody td:last-child { border-right: none; }
.dc-table tbody tr:last-child td { border-bottom: 1px solid var(--dc-border); }
.dc-table tbody tr:hover td { background-color: #f8fafc; }

.dc-table td.actions { white-space: nowrap; text-align: center; }

.dc-table .cell-muted { color: var(--dc-text-muted); }

/* DataTables auto-classifies columns it thinks are numeric/date and
   right-aligns them via `dt-type-numeric`/`dt-type-date`. We don't want
   that auto-behaviour — body values follow the app convention (left),
   headers stay centered. Money columns opt into right-align explicitly
   via `num`/`text-end` (see the money rule below). */
.dc-table tbody td.dt-type-numeric,
.dc-table tbody td.dt-type-date,
.dc-table tbody td.dt-right {
    text-align: left;
}
.dc-table thead th.dt-type-numeric,
.dc-table thead th.dt-type-date,
.dc-table thead th.dt-right {
    text-align: center;
}

/* Amount/money columns: right-aligned body cells, app-wide. Tag money
   cells with Bootstrap's `text-end`. NOTE: the legacy `num` class in this
   app marks *quantity* columns (qty/hours/counts), which per convention
   stay LEFT — so `num` is intentionally NOT right-aligned here. Headers
   remain centered per convention unless the page overrides. */
.dc-table tbody td.text-end {
    text-align: right;
}
/* Select-checkbox column stays centered. Keep the horizontal padding small
   so the checkbox fits and centers even in a narrow (e.g. 32px) fixed-width
   column — the default 1rem cell padding would otherwise squeeze it against
   the left edge. */
.dc-table thead th.dc-select-col,
.dc-table tbody td.dc-select-col {
    text-align: center;
    padding-left: 0.25rem;
    padding-right: 0.25rem;
}
.dc-table thead th.dc-select-col .form-check-input,
.dc-table tbody td.dc-select-col .form-check-input {
    margin: 0 auto;
    float: none;
}

/* Long-text columns (names, titles, descriptions) — left-aligned and
   truncated to a uniform width so rows stay the same height regardless
   of how long the underlying value is. The truncation is done on an
   inner inline-block span (`.dc-text-trunc`) because dc-table uses
   table-layout:auto, where max-width on a <td> is silently ignored. */
.dc-table thead th.dc-text-cell,
.dc-table tbody td.dc-text-cell {
    text-align: left;
}
.dc-table .dc-text-trunc {
    display: inline-block;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}

/* Row action buttons */
.dc-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 6px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--dc-text-muted);
    font-size: 1rem;
    margin-left: 0.25rem;
    cursor: pointer;
    transition: background-color var(--dc-transition), color var(--dc-transition), border-color var(--dc-transition);
    text-decoration: none;
}

.dc-action:hover {
    background-color: var(--dc-primary-soft);
    color: var(--dc-primary);
    border-color: var(--dc-primary-soft);
}

.dc-action.dc-action-danger:hover {
    background-color: rgba(241, 89, 92, 0.12);
    color: var(--dc-danger);
    border-color: rgba(241, 89, 92, 0.12);
}

.dc-action form { display: inline; }
.dc-action a,
.dc-action form button {
    background: transparent;
    border: none;
    padding: 0;
    color: inherit;
    font-size: inherit;
    cursor: pointer;
    text-decoration: none;
}

/* ==========================================================
   Status badges
========================================================== */
.dc-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.2;
}

.dc-badge::before {
    display: none;
}

.dc-badge.success { background-color: rgba(80, 199, 147, 0.15); color: #16a34a; }
.dc-badge.danger  { background-color: rgba(241, 89, 92, 0.15);  color: #dc2626; }
.dc-badge.warning { background-color: rgba(250, 145, 107, 0.15); color: #d97706; }
.dc-badge.info    { background-color: rgba(var(--dc-primary-rgb), 0.12); color: var(--dc-primary); }
.dc-badge.muted   { background-color: #eef2f6; color: var(--dc-text-muted); }

/* ==========================================================
   Table toolbar
========================================================== */
.dc-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--dc-border);
    flex-wrap: wrap;
}

.dc-toolbar .dc-toolbar-search {
    position: relative;
    flex: 1;
    max-width: 320px;
}

.dc-toolbar .dc-toolbar-search i {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--dc-text-muted);
    font-size: 0.9rem;
}

.dc-toolbar .dc-toolbar-search input {
    height: 36px;
    width: 100%;
    border: 1px solid var(--dc-border);
    background-color: #fff;
    border-radius: var(--dc-radius-sm);
    padding: 0 0.85rem 0 2.2rem;
    font-size: 0.85rem;
    outline: none;
    transition: border-color var(--dc-transition), box-shadow var(--dc-transition);
}

.dc-toolbar .dc-toolbar-search input:focus {
    border-color: var(--dc-primary);
    box-shadow: 0 0 0 3px rgba(var(--dc-primary-rgb), 0.15);
}

.dc-toolbar .dc-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ==========================================================
   Pagination
========================================================== */
.dc-pagination-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.25rem;
    border-top: 1px solid var(--dc-border);
    flex-wrap: wrap;
    gap: 0.75rem;
}

.dc-pagination-wrap .counter {
    color: var(--dc-text-muted);
    font-size: 0.82rem;
    margin: 0;
}

.dc-pagination {
    list-style: none;
    padding: 0;
    margin: 0;
    display: inline-flex;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.dc-pagination li a,
.dc-pagination li span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 0.6rem;
    border-radius: var(--dc-radius-sm);
    border: 1px solid var(--dc-border);
    color: var(--dc-text);
    font-size: 0.82rem;
    font-weight: 500;
    background-color: #fff;
    transition: background-color var(--dc-transition), color var(--dc-transition), border-color var(--dc-transition);
    text-decoration: none;
}

.dc-pagination li a:hover {
    background-color: var(--dc-primary-soft);
    color: var(--dc-primary);
    border-color: var(--dc-primary-soft);
}

.dc-pagination li.active a,
.dc-pagination li.active span {
    background-color: var(--dc-primary);
    color: #fff;
    border-color: var(--dc-primary);
}

.dc-pagination li.disabled a,
.dc-pagination li.disabled span {
    color: var(--dc-text-muted);
    opacity: 0.55;
    pointer-events: none;
}

/* ==========================================================
   DataTables overrides (Bootstrap 5 integration)
========================================================== */
.dt-container {
    padding: 0.35rem 0.75rem 0.25rem;
}

.dt-container .dt-layout-row {
    margin: 0 -0.5rem 0.4rem;
}

/* Gap between the top action/search row (which contains the "+ New User"
   button — JS moves it into DataTables' topEnd slot) and the table headers
   that follow. */
.dt-container .dt-layout-row.dt-layout-start {
    margin-bottom: 1rem;
}

.dt-container .dt-layout-row.dt-layout-table {
    margin-bottom: 0;
}

/* Sit the table flush below whatever's above it (card header, search, etc.). */
div.dt-container div.dt-layout-table > div {
    display: block !important;
    margin-top: 0;
}

/* Collapse the empty top layout row that DataTables injects when the
   length-menu and built-in search are hidden — it was creating a gap. */
.dt-container .dt-layout-row.dt-layout-start:has(> .dt-layout-cell:empty) { display: none; }

.dt-container .dt-layout-cell { padding: 0 0.5rem; }

/* Hand-built "entries per page" picker (dashcode.js) sits as a sibling of
   `.dt-info` inside the same bottom-start cell — lay them out side by side
   instead of stacked, matching where DataTables' own pageLength feature
   would normally sit. */
.dt-layout-cell:has(> .dt-length) {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.9rem;
}

/* Not scoped under `.dt-container` — same reason as `.dt-paging` above:
   `.dt-length`/`.dt-info` live inside the bottom bar `moveBottomBar()` can
   relocate out of `.dt-container`, which would otherwise silently drop
   this styling too. */
.dt-length label,
.dt-search label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
    color: var(--dc-text-muted);
    margin: 0;
}

.dt-length select {
    height: 34px;
    border: 1px solid var(--dc-border);
    border-radius: var(--dc-radius-sm);
    padding: 0 2rem 0 0.75rem;
    background-color: #fff;
    font-size: 0.85rem;
    color: var(--dc-text);
    outline: none;
    min-width: 140px;
}

.dt-length select:focus {
    border-color: var(--dc-primary);
    box-shadow: 0 0 0 3px rgba(var(--dc-primary-rgb), 0.15);
}

.dt-search {
    text-align: right;
}

.dt-search input {
    height: 40px;
    border: 1px solid var(--dc-border);
    border-radius: var(--dc-radius-sm);
    padding: 0 0.95rem 0 2.3rem;
    font-size: 0.95rem;
    min-width: 280px;
    outline: none;
    background-color: #fff url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%2364748b'><path d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.868-3.834zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z'/></svg>") no-repeat 0.75rem center / 16px;
    margin-left: 0.5rem;
}

.dt-search input:focus {
    border-color: var(--dc-primary);
    box-shadow: 0 0 0 3px rgba(var(--dc-primary-rgb), 0.15);
    background-color: #fff;
}

.dt-info {
    color: var(--dc-text-muted);
    font-size: 0.9rem;
    padding-top: 0.25rem;
}

.dt-container table.dataTable {
    border-collapse: separate !important;
    border-spacing: 0;
    margin: 0 !important;
    width: 100% !important;
}

.dt-container table.dataTable.dc-table thead th,
table.dataTable.dc-table thead th {
    background-color: #1e3a8a !important;
    color: #ffffff !important;
    border-top: 1px solid var(--dc-border);
    text-align: center !important;
}

.dt-container table.dataTable.dc-table thead th a,
table.dataTable.dc-table thead th a { color: #ffffff !important; }

.dt-container table.dataTable.dc-table thead th .dt-column-header,
.dt-container table.dataTable.dc-table thead th .dt-column-title,
.dt-container table.dataTable.dc-table thead th > div {
    justify-content: center !important;
    text-align: center !important;
}

/* Not scoped under `.dt-container` — a `data-scroll-sticky` table's
   `moveBottomBar()` (dashcode.js) relocates this whole row out of
   `.dt-container` so `position: fixed` can pin it to the viewport bottom.
   Scoping these rules to `.dt-container .dt-paging` worked only for tables
   that never got moved; once moved, the rules silently stopped matching and
   the buttons fell back to Bootstrap's own default blue instead of this
   app's (or `.scr-green-theme`'s) primary color. `.dt-paging` alone is
   specific enough to DataTables that dropping the ancestor requirement is
   safe, and it now styles the bar correctly whether or not it was moved. */
.dt-paging {
    padding: 0.5rem 0 0.25rem;
}

.dt-paging .pagination {
    margin: 0;
    display: inline-flex;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.dt-paging .page-item .page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 0.6rem;
    border-radius: var(--dc-radius-sm);
    border: 1px solid var(--dc-border);
    background-color: #fff;
    color: var(--dc-text);
    font-size: 0.82rem;
    font-weight: 500;
    transition: background-color var(--dc-transition), color var(--dc-transition), border-color var(--dc-transition);
}

.dt-paging .page-item .page-link:hover {
    background-color: var(--dc-primary-soft);
    color: var(--dc-primary);
    border-color: var(--dc-primary-soft);
}

.dt-paging .page-item.active .page-link {
    background-color: var(--dc-primary);
    color: #fff;
    border-color: var(--dc-primary);
    box-shadow: 0 3px 8px rgba(var(--dc-primary-rgb), 0.25);
}

.dt-paging .page-item.disabled .page-link {
    color: var(--dc-text-muted);
    opacity: 0.55;
    background-color: #fff;
}

/* ---- Shared scrollable + paginated report table -------------------------
   Pairs with `setupReportTable()` in dashcode.js (opt-in via
   `data-report-table` on the <table>). `.dc-scroll-wrap` replaces the ~13
   near-identical `.pva-wrap`/`.dop-wrap`/etc a report used to define for
   itself; `.dc-hscroll` is the synced top-scrollbar proxy (was `.pva-
   hscroll`/etc). The pagination bar underneath reuses `.dt-length`/
   `.dt-info`/`.dt-paging` (above) rather than new classes, so it's pixel-
   identical to a DataTables report's pager with none of DataTables' own
   wrapper markup — that markup is what was leaving a dead gap between the
   synced scrollbar and the header on DataTables-based reports. */
.dc-scroll-wrap {
    overflow: auto;
    /* Rounded on all 4 corners, not just the bottom two: when the top
       scrollbar proxy below is hidden (table fits without horizontal
       overflow — see layout()'s `bar.style.display` in dashcode.js), this
       wrap is the card's first child, so its own top corners are what the
       sticky (often brightly-colored) header has to clip against. Bottom-
       only rounding left the header's square top corners poking past the
       card's rounded ones in that case. */
    border-radius: var(--dc-radius);
    background: #fff;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.dc-scroll-wrap::-webkit-scrollbar { display: none; }
.dc-hscroll {
    overflow-x: auto;
    overflow-y: hidden;
    height: 12px;
    margin-top: 2px;
    border-bottom: 1px solid var(--dc-border);
    /* When visible, this is the card's actual first child instead — same
       corner-matching reasoning as `.dc-scroll-wrap` above. */
    border-radius: var(--dc-radius) var(--dc-radius) 0 0;
}
.dc-hscroll > div { height: 1px; }

/* Base styling for a report table using this shared shell — a report can
   still layer its own prefixed class (e.g. `.pva-table`) alongside this one
   for anything report-specific (colored cells, sticky identity columns,
   multi-row grid headers), but every plain list report can use this alone. */
.dc-report-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.82rem;
    margin: 0;
}
.dc-report-table th,
.dc-report-table td {
    border-bottom: 1px solid var(--dc-border);
    border-right: 1px solid var(--dc-border);
    padding: 0.4rem 0.6rem;
    height: 34px;
    background-clip: padding-box;
}
.dc-report-table td:last-child,
.dc-report-table th:last-child { border-right: none; }
.dc-report-table thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    background-color: var(--dc-primary-hover);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: center;
    border-right-color: rgba(255, 255, 255, 0.2);
    border-bottom-color: rgba(255, 255, 255, 0.2);
}
.dc-report-table td.num { text-align: right; }

/* Sort indicators */
table.dataTable thead .dt-orderable-asc,
table.dataTable thead .dt-orderable-desc {
    cursor: pointer;
}

table.dataTable thead .dt-ordering-asc span.dt-column-order::before,
table.dataTable thead .dt-ordering-desc span.dt-column-order::after {
    color: var(--dc-primary) !important;
    opacity: 1 !important;
}

table.dataTable thead .dt-column-order::before,
table.dataTable thead .dt-column-order::after {
    opacity: 0.4;
}

/* Hide DataTables sort indicator (dot/arrow) before column titles */
table.dataTable thead .dt-column-order { display: none !important; }

/* Server-side pagination (data-server-side, see dashcode.js) sets
   `processing: true`, which DataTables shows as a text/box overlay while
   waiting for each page of rows — replaced here with a plain circular spin
   loader (perf rollout, 2026-11-05), no text, no box. */
.dt-processing {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
}
.dt-processing > * { display: none !important; }
.dt-processing::after {
    content: '';
    display: block;
    width: 2rem;
    height: 2rem;
    margin: 0 auto;
    border: 3px solid var(--dc-primary-soft);
    border-top-color: var(--dc-primary);
    border-radius: 50%;
    animation: dc-spin .7s linear infinite;
}
@keyframes dc-spin {
    to { transform: rotate(360deg); }
}

/* ==========================================================
   Cell truncation — long values (names, emails, addresses, etc.)
   are clipped with an ellipsis. Hover shows full value via title.
   Opt out per cell with class="no-truncate", or per column by
   not applying width constraints. The .actions column is excluded.
========================================================== */
.dc-table tbody td:not(.actions):not(.no-truncate):not(.dc-select-col) {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.dc-table tbody td.actions { white-space: nowrap; }

@media (max-width: 1199.98px) {
    .dc-table tbody td:not(.actions):not(.no-truncate):not(.dc-select-col) { max-width: 170px; }
}
@media (max-width: 991.98px) {
    .dc-table tbody td:not(.actions):not(.no-truncate):not(.dc-select-col) { max-width: 130px; }
}

/* Helper class — apply manually to a span/strong/element inside a cell when
   you want truncation on inline content (e.g. wrapped in <strong>). */
.dc-truncate {
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}

/* Remove stock DataTables borders so .dc-table styling wins */
table.dataTable.dc-table > tbody > tr > td,
table.dataTable.dc-table > thead > tr > th {
    border-top: none;
}

/* ==========================================================
   Empty state
========================================================== */
.dc-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--dc-text-muted);
}

.dc-empty i {
    font-size: 2.4rem;
    opacity: 0.55;
    margin-bottom: 0.5rem;
}

/* ==========================================================
   Index page filters (per-page logic, shared visuals)
========================================================== */
.dc-filters {
    background: #f8fafc;
    padding: 0.85rem 1.1rem;
    border-bottom: 1px solid #e5e7eb;
}
.dc-filters .form-label {
    font-size: .72rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .4px;
    margin-bottom: .25rem;
}
.dc-filters .form-control-sm,
.dc-filters .form-select-sm {
    font-size: .85rem;
    padding: .4rem .65rem;
    border-color: #e2e8f0;
    background-color: #fff;
}
.dc-filters .form-control-sm:focus,
.dc-filters .form-select-sm:focus {
    border-color: #1e3a8a;
    box-shadow: 0 0 0 .15rem rgba(30,58,138,.12);
}
.dc-filters .btn-sm {
    font-size: .8rem;
    padding: .4rem .85rem;
}
.dc-filters .dc-filter-actions {
    display: flex;
    gap: .35rem;
    justify-content: flex-end;
}
/* Search + Reset stay on one line: the column grows rather than clipping them. */
.dc-filters .row > :has(> .dc-filter-actions),
form[method="get" i] .row > .d-flex:has(> button[type="submit"]) {
    min-width: max-content;
    flex-wrap: nowrap !important;
}
/* Set by filter-actions.js when the buttons wrap below the first filter row. */
.dc-filter-actions-wrapped {
    margin-left: auto !important;
    justify-content: flex-end !important;
    text-align: right;
}
.dc-filter-actions-wrapped .d-flex { justify-content: flex-end; }
.dc-filter-actions-break {
    flex: 0 0 100% !important;
    height: 0;
    margin: 0 !important;
    padding: 0 !important;
}
.dc-filters .select2-container--bootstrap-5 .select2-selection {
    min-height: calc(1.5em + .8rem + 2px);
    padding: .25rem .65rem;
    font-size: .85rem;
    border-color: #e2e8f0;
}
/* Keep the Select2 dropdown caret clear of the selected text / placeholder in
   filter bars: reserve room on the right for the arrow and ellipsis-truncate
   long values instead of letting them run underneath it. Applies to every
   index filter bar app-wide. */
.dc-filters .select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered {
    padding-right: 28px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* "＋ Add new role…" entry in the Users role dropdown — tinted + italic so it
   reads as an action rather than a real role. Covers the native <option> and
   the Select2-rendered result item (id ends with the option value). */
select option.dc-add-role-option,
.select2-results__option[id$="-__add_role__"] {
    color: #2563eb;
    font-style: italic;
}

/* Horizontal scroll on the TABLE only — not the pagination/info row.
   For wide (data-no-responsive) tables, the inner DataTables table-layout
   cell becomes the horizontal scroller, so the wrapper (and the bottom
   info + paging row inside .dt-container) stay fixed at viewport width and
   do NOT scroll sideways with the table. Pages that need this also set the
   wrapper itself to overflow-x: visible so only this inner cell scrolls.
   Generic + app-wide; harmless on responsive/narrow tables (never overflows). */
.dc-table-wrap .dt-container div.dt-layout-table > div {
    overflow-x: auto;
    position: relative;
}

/* ==========================================================
   Sticky Actions column (app-wide)
   Keeps the right-most "Actions" column reachable while a wide table is
   scrolled horizontally, so row actions (view/edit/delete) never get
   pushed off-screen. The pin itself is driven by JS (scroll-linked
   translateX in dashcode.js, since native position:sticky is unreliable
   inside the DataTables wrapper chain). JS toggles `.dc-actions-pinned`
   on the table ONLY while it overflows its scroll container, so the
   shadow/opaque background appear only when the column is actually
   floating over other columns. Harmless on narrow tables that never
   overflow — nothing is pinned and no shadow shows.
========================================================== */
.dc-table th.actions,
.dc-table td.actions,
.dc-table th.dc-pin-with-actions,
.dc-table td.dc-pin-with-actions {
    position: relative;
    z-index: 2;
}
.dc-table.dc-actions-pinned thead th.actions,
.dc-table.dc-actions-pinned thead th.dc-pin-with-actions {
    z-index: 3;
}
.dc-table.dc-actions-pinned th.actions,
.dc-table.dc-actions-pinned td.actions,
.dc-table.dc-actions-pinned th.dc-pin-with-actions,
.dc-table.dc-actions-pinned td.dc-pin-with-actions {
    box-shadow: -6px 0 8px -6px rgba(0, 0, 0, 0.18);
}
/* ...except Actions itself when a `.dc-pin-with-actions` column is pinned
   directly before it (see dashcode.js) — that column is then the group's
   true left edge, so only IT keeps the shadow; otherwise there'd be a
   visible seam between the two pinned cells. */
.dc-table.dc-actions-pinned .dc-pin-with-actions + .actions {
    box-shadow: none;
}
/* Opaque backgrounds so columns scrolled underneath don't bleed through. */
.dc-table.dc-actions-pinned tbody td.actions,
.dc-table.dc-actions-pinned tbody td.dc-pin-with-actions { background-color: #ffffff; }
.dc-table.dc-actions-pinned tbody tr:hover td.actions,
.dc-table.dc-actions-pinned tbody tr:hover td.dc-pin-with-actions { background-color: #f8fafc; }

/* ==========================================================
   Responsive
========================================================== */
@media (max-width: 991.98px) {
    .dc-sidebar {
        transform: translateX(-100%);
    }

    .dc-main { margin-left: 0; }

    .dc-app.sidebar-mobile-open .dc-sidebar {
        transform: translateX(0);
        box-shadow: var(--dc-shadow);
    }

    .dc-app.sidebar-mobile-open::after {
        content: "";
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.4);
        z-index: 1025;
    }

    .dc-search { display: none; }
    .dc-user .user-meta { display: none; }
}

/* ==========================================================
   Hide DebugKit floating toolbar (the cake logo at bottom)
========================================================== */
#debug-kit,
#debug-kit-toolbar,
iframe#debug-kit-toolbar,
html > #debug-kit { display: none !important; }

/* ==========================================================
   Reports-section filter dropdowns — neutral grey instead of
   Bootstrap/select2-bootstrap-5-theme's default blue focus
   ring/selected-option highlight (2026-10 client: "change the blue
   color to grey like other reports use" / "this change I want only
   for reports not the module"). Gated on body.dc-reports-section,
   set by AppController::beforeRender() off the SAME "reports" vs.
   "hr"/other top-level section permissions_registry.php already
   defines — every Reports-group page gets this automatically, no
   HR/Production/other module page is affected. Select2's own open
   dropdown panel is appended to <body>, so it's still a descendant
   of body.dc-reports-section and reachable by plain nesting here —
   no per-report opt-in attribute needed.
========================================================== */
body.dc-reports-section .form-select,
body.dc-reports-section .form-control {
    accent-color: #94a3b8;
}
body.dc-reports-section .form-select:focus,
body.dc-reports-section .form-control:focus {
    border-color: #94a3b8;
    box-shadow: 0 0 0 0.2rem rgba(148, 163, 184, 0.25);
}
body.dc-reports-section .select2-results__option[aria-selected="true"],
body.dc-reports-section .select2-results__option--highlighted[aria-selected] {
    background-color: #94a3b8 !important;
    color: #fff !important;
}


/* Date / time inputs already show the browser's own picker icon at the right edge.
   Bootstrap's red "!" invalid-field icon was drawn on top of it, so the two icons
   collided. Keep the red border and the error message, drop the extra "!" icon and
   the padding that was reserved for it. */
.form-control.is-invalid[type="date"],
.form-control.is-invalid[type="datetime-local"],
.form-control.is-invalid[type="time"],
.form-control.is-invalid[type="month"],
.form-control.is-invalid[type="week"],
.was-validated .form-control[type="date"]:invalid,
.was-validated .form-control[type="datetime-local"]:invalid,
.was-validated .form-control[type="time"]:invalid,
.was-validated .form-control[type="month"]:invalid,
.was-validated .form-control[type="week"]:invalid {
    background-image: none;
    padding-right: 0.85rem;
}

/* Generic multi-select checkbox dropdown — shared by EVERY report filter
   bar that needs "pick several of these at once" (Department, Operation
   No., etc.), so no report has to paste its own copy of this widget's
   CSS/JS. Markup comes from templates/element/filters/multi_select_
   dropdown.php; behavior from the data-ms-* initializer in dashcode.js.
   First introduced 2026-11-17 for a Department multi-select filter
   (client: "I want a feature in all dept dropdowns in all reports that we
   can select multiple dept at a time ... implement that wise so that no
   duplicate code will be required for every report"), generalized from
   the one-off Operation No. checkbox dropdown PartLifecycleReports/
   index.php already had (2026-11-13). */
.dc-ms-toggle,
.dc-ms-toggle:hover,
.dc-ms-toggle:focus,
.dc-ms-toggle:active {
    -webkit-appearance: none; -moz-appearance: none; appearance: none;
    display: block; width: 100%; max-width: 100%;
    background-color: #fff !important; background-image: none !important;
    border: 1px solid #ced4da !important; border-radius: .35rem !important;
    padding: .25rem .5rem !important; font-size: .8rem !important; font-weight: 400 !important;
    line-height: 1.5 !important; height: calc(1.5em + .5rem + 2px) !important;
    color: #212529 !important; text-align: left; cursor: pointer;
    box-shadow: none !important; outline: none !important;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* NOT named "placeholder" — Bootstrap 5.3 reserves that exact class name
   for its own Placeholders loading-skeleton component (a solid gray bar
   with cursor:wait), which collided the first time this was tried under
   that name in PartLifecycleReports (2026-11-13). */
.dc-ms-label.dc-ms-empty { color: #000 !important; }
.dc-ms-menu { width: 230px; max-height: 220px; overflow-y: auto; padding: .5rem .75rem; }
.dc-ms-menu .form-check { margin-bottom: .3rem; }
.dc-ms-menu .form-check:last-child { margin-bottom: 0; }
