/* =========================================================
   PG 7 ERP — SHARED general stylesheet
   ---------------------------------------------------------
   Loaded by BOTH systems (payroll + production), AFTER Bootstrap
   and BEFORE each system's own stylesheet.

   Put ONLY genuinely-general rules here (buttons, shared tokens,
   generic utilities). System-specific styling stays in each
   system's own CSS:
     - payroll/css/payroll.css, login.css
     - production/css/production.css, sidebar.css
   ========================================================= */

/* ---------------------------------------------------------
   Global button identity — typography/shape ONLY.
   Colour and width are intentionally left to each Bootstrap
   variant (btn-danger stays red, btn-white white, ...) and to
   the button's own layout, so nothing is clobbered.
   --------------------------------------------------------- */
.btn {
    font-family: "Fira Code", monospace;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border-radius: 5px;
}

/* =========================================================
   ERP SHELL — design tokens + dark sidebar (from Payroll)  2026-08-06
   Shared by both systems. System-specific sidebar extras
   (collapsible submenus, collapsed state, user profile) live
   in each system's own CSS, restyled for this dark theme.
   ========================================================= */
:root {
    --sidebar-width:        220px;
    --sidebar-bg:           #1a2535;
    --sidebar-hover:        rgba(255, 255, 255, 0.07);
    --sidebar-active:       rgba(255, 255, 255, 0.13);
    --sidebar-text:         rgba(255, 255, 255, 0.70);
    --sidebar-text-active:  #ffffff;
    --sidebar-group:        rgba(255, 255, 255, 0.30);
    --sidebar-accent:       #3b82f6;
    --sidebar-border:       rgba(255, 255, 255, 0.08);

    --surface-page:         #eef1f5;
    --surface-card:         #ffffff;
    --surface-topbar:       #ffffff;
    --topbar-h:             52px;

    --tab-text:             #64748b;
    --tab-hover:            #1e293b;
    --tab-active:           #2563eb;
    --tab-bar-border:       #e2e6ed;

    --card-hdr-bg:          #f8f9fa;
    --card-hdr-text:        #374151;
    --card-hdr-border:      #e5e7eb;

    --border:               #e2e6ed;
    --border-lt:            #eef1f5;
    --text:                 #1e293b;
    --text-secondary:       #64748b;
    --text-muted:           #94a3b8;
}

/* ---- Sidebar (dark) ---- */
#sidebar {
    width: var(--sidebar-width, 220px);
    flex-shrink: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--sidebar-bg, #1a2535);
    border-right: none;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.18);
    transition: width 0.25s ease-in-out;
    overflow: hidden;
    z-index: 100;
}
.sidebar-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 12px 12px;
    border-bottom: 1px solid var(--sidebar-border);
    flex-shrink: 0;
}
.sidebar-logo { width: 30px; height: 30px; object-fit: contain; flex-shrink: 0; border-radius: 4px; }
.sidebar-app-name {
    font-size: 0.75rem; font-weight: 700; color: var(--sidebar-text-active);
    text-transform: uppercase; letter-spacing: 0.08em; white-space: nowrap; overflow: hidden;
}
.sidebar-content { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 8px 6px 6px; scrollbar-width: none; }
.sidebar-content::-webkit-scrollbar { display: none; }
.sidebar-group-label {
    font-size: 0.6rem; font-weight: 700; color: var(--sidebar-group);
    text-transform: uppercase; letter-spacing: 0.14em; padding: 14px 10px 4px;
    pointer-events: none; user-select: none; list-style: none;
}
.sidebar-item { list-style: none; }
a.sidebar-link {
    display: flex; align-items: center; gap: 9px; padding: 7px 10px;
    color: var(--sidebar-text); font-size: 0.72rem; font-weight: 500; white-space: nowrap;
    text-transform: uppercase; letter-spacing: 0.04em; position: relative; border-radius: 5px;
    border-left: 2px solid transparent;
    transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease; margin-bottom: 1px;
}
a.sidebar-link:hover { background: var(--sidebar-hover); color: var(--sidebar-text-active); }
.sidebar-item.active > a.sidebar-link {
    background: var(--sidebar-active); color: var(--sidebar-text-active);
    border-left-color: var(--sidebar-accent); font-weight: 600; padding-left: 8px;
}
.sidebar-link .bi {
    font-size: 1.1rem; line-height: 1; flex: 0 0 1.4rem; width: 1.4rem;
    display: inline-flex; align-items: center; justify-content: center; opacity: 0.75;
}
.sidebar-item.active > a.sidebar-link .bi { opacity: 1; }
.sidebar-link label { margin: 0; display: block; line-height: 1.2; cursor: pointer; }

/* =========================================================
   ERP SHELL — layout wrapper + topbar + profile + hamburger
   (from Payroll). Shared by both systems.  2026-08-07
   ========================================================= */
.main-wrapper { display: flex; height: 100vh; overflow: hidden; }
.inner-wrapper { flex: 1; display: flex; flex-direction: column; background-color: var(--surface-page); overflow: hidden; }

.topbar {
    height: var(--topbar-h, 52px);
    background: var(--surface-topbar);
    border-bottom: 1px solid var(--border);
    padding: 0 1.25rem;
    display: flex; align-items: center; justify-content: space-between;
    flex-shrink: 0; gap: 1rem;
}
.topbar-title {
    font-size: 0.8125rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.07em; color: var(--text);
    display: flex; align-items: baseline; gap: .6rem;
}
.topbar-title .topbar-date { font-size: .65rem; font-weight: 500; color: var(--text-muted); letter-spacing: .03em; text-transform: none; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 1rem; }

.topbar-profile { display: flex; align-items: center; gap: 8px; }
.topbar-avatar { width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0; object-fit: cover; border: 1px solid var(--border); }
.topbar-profile-info { display: flex; flex-direction: column; align-items: flex-start; text-align: left; line-height: 1.15; overflow: hidden; }
.topbar-user-name { font-size: .72rem; font-weight: 700; color: var(--text); text-transform: uppercase; letter-spacing: .03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-user-role { font-size: .6rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .05em; }
.topbar-profile-toggle { display: flex; align-items: center; gap: 8px; background: transparent; border: 0; padding: 4px 8px; border-radius: 8px; cursor: pointer; transition: background .12s ease; }
.topbar-profile-toggle:hover,
.topbar-profile-toggle[aria-expanded="true"] { background: var(--surface-page); }
.topbar-profile-caret { font-size: .65rem; color: var(--text-secondary); transition: transform .12s ease; }
.topbar-profile-toggle[aria-expanded="true"] .topbar-profile-caret { transform: rotate(180deg); }
.topbar-profile .dropdown-menu { font-size: .8rem; min-width: 180px; }
.topbar-profile .dropdown-header { line-height: 1.25; }

/* Hamburger + mobile drawer backdrop */
#sidebarBackdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 1040; }
#sidebarBackdrop.active { display: block; }
#sidebarHamburger { display: none !important; background: none; border: none; padding: 4px 6px; color: var(--text); font-size: 1.25rem; line-height: 1; cursor: pointer; flex-shrink: 0; }

@media (max-width: 767.98px) {
    #sidebarHamburger { display: inline-flex !important; align-items: center; }
    .main-wrapper { display: block; height: auto; overflow: visible; }
    .inner-wrapper { height: auto; overflow: visible; }
    body { height: auto; overflow-y: auto; overflow-x: hidden; }
    .topbar { padding: 0 0.75rem; gap: 0.5rem; }
    .topbar-title { font-size: 0.75rem; }
    .topbar-profile-info { display: none; }
    #sidebar {
        position: fixed; top: 0; left: 0; height: 100%;
        width: var(--sidebar-width, 220px) !important;
        transform: translateX(-100%); transition: transform 0.25s ease-in-out; z-index: 1050;
    }
    #sidebar.mobile-open { transform: translateX(0); }
}

/* =========================================================
   ERP CARD SYSTEM (from Payroll). Shared by both systems.  2026-08-07
   Subtle bordered card + light uppercase header.
   ========================================================= */
.card {
    border: 0.5px solid var(--border) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
    overflow: hidden;
}
.card-header {
    background-color: var(--card-hdr-bg) !important;
    border-bottom: 1px solid var(--card-hdr-border) !important;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--card-hdr-text);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    padding: 0.6rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* =========================================================
   ERP TYPOGRAPHY + MODAL + sidebar footer (from Payroll)  2026-08-07
   ========================================================= */
:root { --tbl-row-height: 28px; --tbl-cell-padding-x: .5rem; --tbl-font-size: 0.78rem; --modal-font-size: 0.72rem; }

/* Form labels */
.form-label { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-secondary); margin-bottom: 0.25rem; }
.form-check-label { font-size: 0.8rem; font-weight: 500; }

/* =========================================================
   ERP filter bar + teleported DataTables search — shared
   alignment. Moved here from payroll.css (2026-08-12) so every
   app AND the central ERP console (admin.php) render the filter
   label + search box identically, regardless of the placeholder id.
   ========================================================= */
.erp-filter-bar {
    padding: 0.5rem 1rem;
    background: var(--surface-card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: nowrap;
    flex-shrink: 0;
    overflow: hidden;
}
.erp-filter-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-secondary);
    white-space: nowrap;
}
.erp-filter-bar .dt-search,
.erp-filter-bar .dataTables_filter { display: flex; align-items: center; padding: 0 !important; margin: 0 !important; }
.erp-filter-bar input[type="search"] {
    height: 30px !important;
    font-size: 0.75rem !important;
    border-color: var(--border) !important;
    border-radius: 4px !important;
    padding: 0 1.75rem 0 0.65rem !important;
    min-width: 0;
    width: 100%;
    flex: 1;
}
/* Compact filter-bar selects/inputs (moved from payroll.css 2026-08-15 so Production
   gets the same 30px height + small text as Payroll). */
.erp-filter-input {
    font-size: 0.75rem !important;
    height: 30px !important;
    border-color: var(--border) !important;
}

/* Modal — icon + uppercase title, light header/footer, unified body font */
.modal-header { padding: 0.65rem 1rem; border-bottom: 1px solid var(--border); background: var(--card-hdr-bg); align-items: center; }
.modal-title { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; color: var(--card-hdr-text); text-transform: uppercase; display: flex; align-items: center; gap: 0.45rem; line-height: 1.4; }
.modal-title .bi { font-size: 0.95rem; color: var(--text-secondary); flex-shrink: 0; }
.modal-footer { padding: 0.55rem 1rem; border-top: 1px solid var(--border); background: var(--card-hdr-bg); gap: 0.4rem; }
.modal-footer > * { margin: 0; }
.modal-body label,
.modal-body small,
.modal-body .form-text,
.modal-body .input-group-text,
.modal-body :is(input.form-control, select.form-select, textarea.form-control),
.modal-body .btn,
.modal-footer .btn { font-size: var(--modal-font-size, 0.72rem); }

/* =========================================================
   Modal open behaviour + loading state + spinner + entity badge.
   Moved here from payroll.css (2026-08-12) so the ERP console and
   every app share the same modal look/feel: the dialog scales up
   (0.95 → 1) and fades in on open, with a soft backdrop.
   ========================================================= */
.modal .modal-content { transition: filter 0.5s ease; }
.modal.loading .modal-content { position: relative; filter: brightness(0.8); pointer-events: none; }
.modal.loading .modal-content::after { content: ""; position: absolute; inset: 0; background: rgba(0, 0, 0, 0.3); backdrop-filter: blur(1px); z-index: 1000; }
.modal.fade .modal-dialog { transform: scale(0.95); opacity: 0; transition: transform 0.3s ease, opacity 0.3s ease; }
.modal.fade.show .modal-dialog { transform: scale(1); opacity: 1; }
.modal-backdrop.fade { opacity: 0; transition: opacity 0.3s ease; }
.modal-backdrop.fade.show { opacity: 0.5; }

/* Spinner overlay inside .modal-dialog (outside .modal-content) — shown by
   toggling display:flex (or adding .loading on the .modal). */
.modal-spinner { position: absolute; inset: 0; background: rgba(255, 255, 255, 0.72); display: none; flex-direction: column; align-items: center; justify-content: center; z-index: 1060; border-radius: inherit; pointer-events: all; }
.modal-spinner .spinner-border { width: 2rem; height: 2rem; border-width: 3px; color: var(--bs-secondary); }

/* ERP entity badge — the small bordered chip used in modal titles
   ("Set Password — <username>") and inline references. */
.erp-emp-id-badge { font-size: 0.65rem; font-weight: 700; color: var(--text-secondary); background: var(--surface-page); border: 1px solid var(--border); border-radius: 3px; padding: 1px 6px; letter-spacing: 0.04em; text-transform: uppercase; }

/* ERP version badge — the dark navy version chip on Patch Notes / Platform
   Updates. Pair with Bootstrap's .badge. Shared by all patch-note surfaces. */
.erp-version-badge { background: var(--sidebar-bg); color: #fff; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.05em; }

/* ERP inner tab bar — secondary tabs inside a card (Payroll UM, Production UM).
   Shared so both surfaces get the same compact uppercase tabs. */
.erp-inner-tabbar { padding: 0 1rem; background: var(--surface-card); border-bottom: 1px solid var(--border); }
.erp-inner-tabbar .nav-tabs { border-bottom: none; gap: 0; }
.erp-inner-tabbar .nav-tabs .nav-link { font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--tab-text); border: none; border-bottom: 2px solid transparent; border-radius: 0; padding: 0.6rem 0.9rem; margin-bottom: -1px; transition: color 0.12s ease, border-color 0.12s ease; }
.erp-inner-tabbar .nav-tabs .nav-link:hover { color: var(--tab-hover); background: transparent; border-bottom-color: var(--border); }
.erp-inner-tabbar .nav-tabs .nav-link.active { color: var(--tab-active); background: transparent; border-bottom-color: var(--tab-active); font-weight: 700; }

/* ERP config-table styling (Payroll parity) — opt-in via an .erp-tables ancestor
   so admin/config tables get flat borderless cell inputs, compact uppercase
   headers, and small cell text WITHOUT touching an app's operational tables. */
.erp-tables .table { margin-bottom: 0; }
.erp-tables .table :is(th, td) { height: var(--tbl-row-height, 28px); padding: 0; vertical-align: middle !important; white-space: nowrap; }
.erp-tables .table td:not(:has(:is(input, select, button))),
.erp-tables .table th { padding-inline: var(--tbl-cell-padding-x, .5rem); }
.erp-tables .table thead th { background: var(--card-hdr-bg) !important; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--card-hdr-text); box-shadow: inset 0 -1px 0 var(--card-hdr-border); }
.erp-tables .table.table-sm,
.erp-tables .table.table-sm :is(input, select, button),
.erp-tables .table tbody td { font-size: var(--tbl-font-size, 0.78rem); }
.erp-tables .table tbody :is(input.form-control, select.form-select, button.btn) { height: calc(var(--tbl-row-height, 28px) - 2px); min-height: unset; padding: 0 var(--tbl-cell-padding-x, .5rem); border: 0; border-radius: 0; box-shadow: none !important; }

/* =========================================================
   ERP inline notices (info / warning / danger / success).
   Icon + text callout box. Moved here from payroll.css
   (2026-08-13) so the ERP console and every app share them.
   ========================================================= */
.erp-info-notice,
.erp-warning-notice,
.erp-danger-notice,
.erp-success-notice {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.65rem 0.9rem;
    border: 1px solid;
    border-radius: 5px;
    font-size: 0.72rem;
    line-height: 1.5;
}
.erp-info-notice .bi,
.erp-warning-notice .bi,
.erp-danger-notice .bi,
.erp-success-notice .bi {
    font-size: 0.9rem;
    flex-shrink: 0;
    margin-top: 0.1rem;
}
.erp-info-notice code,
.erp-warning-notice code,
.erp-danger-notice code,
.erp-success-notice code {
    border-radius: 3px;
    padding: 0 0.3em;
    font-size: 0.9em;
}
/* Variant colours */
.erp-info-notice    { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }
.erp-warning-notice { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.erp-danger-notice  { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.erp-success-notice { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.erp-info-notice code    { background: rgba(30,  64, 175, 0.10); }
.erp-warning-notice code { background: rgba(146, 64,  14, 0.10); }
.erp-danger-notice code  { background: rgba(153, 27,  27, 0.10); }
.erp-success-notice code { background: rgba(22,  101, 52, 0.10); }

.btn-dark { background: var(--sidebar-bg) !important; border-color: var(--sidebar-bg) !important; color: #fff !important; }
.btn-dark:hover { filter: brightness(1.15); }

/* Sidebar footer / app-version (Payroll structure) */
.sidebar-footer { padding: 10px 12px; border-top: 1px solid var(--sidebar-border); flex-shrink: 0; }
.sidebar-app-version { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; }
.sidebar-app-version-name { font-size: 0.62rem; font-weight: 700; color: var(--sidebar-text); text-transform: uppercase; letter-spacing: 0.08em; }
.sidebar-app-version-num { font-size: 0.58rem; color: var(--sidebar-group); }

/* =========================================================
   ERP DASHBOARD — hero banner + KPI cards (from Payroll)  2026-08-07
   ========================================================= */
.db-hero {
    background: linear-gradient(135deg, var(--sidebar-bg) 0%, #243650 55%, var(--tab-active) 130%);
    color: #fff;
    border-radius: var(--bs-border-radius, .5rem);
    padding: 1.25rem 1.5rem;
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    box-shadow: 0 6px 18px rgba(26, 37, 53, .18);
}
.db-hero-greeting { font-size: 1.15rem; font-weight: 600; line-height: 1.25; }
.db-hero-sub { font-size: .8rem; color: rgba(255,255,255,.72); margin-top: .15rem; }
.db-hero-date {
    display: inline-flex; align-items: center; gap: .45rem;
    background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.18);
    border-radius: 999px; padding: .4rem .85rem; font-size: .82rem; font-weight: 500; white-space: nowrap;
}
.db-kpi {
    border: 1px solid var(--border); border-radius: var(--bs-border-radius, .5rem);
    background: var(--surface-card); padding: 1rem 1.1rem; height: 100%;
    display: flex; align-items: center; justify-content: space-between; gap: .75rem;
    position: relative; overflow: hidden; transition: transform .15s ease, box-shadow .15s ease;
}
.db-kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--db-accent, var(--tab-active)); }
.db-kpi:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(30,41,59,.08); }
.db-kpi-label { font-size: .68rem; letter-spacing: .04em; text-transform: uppercase; color: var(--text-secondary); font-weight: 600; }
.db-kpi-value { font-size: 1.75rem; font-weight: 700; color: var(--text); line-height: 1.1; margin-top: .15rem; }
.db-kpi-icon { flex: 0 0 auto; width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-size: 1.4rem; color: var(--db-accent, var(--tab-active)); background: var(--db-accent-soft, rgba(37,99,235,.1)); }
.db-kpi--amber  { --db-accent: #d97706; --db-accent-soft: rgba(217,119,6,.12); }
.db-kpi--violet { --db-accent: #7c3aed; --db-accent-soft: rgba(124,58,237,.12); }
.db-kpi--teal   { --db-accent: #0d9488; --db-accent-soft: rgba(13,148,136,.12); }
.db-kpi--blue   { --db-accent: var(--tab-active); --db-accent-soft: rgba(37,99,235,.1); }

/* =========================================================
   ERP ACTION BUTTONS — btn-icon-mode (from Payroll)  2026-08-07
   Icon → spinner (processing) → checkmark (success), + label
   typography + subtle vertical divider. Shared by both systems.
   ========================================================= */
.btn-icon-mode .btn-spinner,
.btn-icon-mode .btn-checkmark { display: none; }
.btn-icon-mode.is-processing .btn-icon { display: none; }
.btn-icon-mode.is-processing .btn-spinner { display: inline-block; }
.btn-icon-mode.is-success .btn-icon { display: none; }
.btn-icon-mode.is-success .btn-checkmark { display: inline-block; }
/* Fixed-size slot: the icon (line box 1.5em), spinner (1rem) and checkmark all
   occupy the same box, so swapping states on click doesn't reflow the button.
   Height matters as much as width — the Bootstrap icon's 1.5em line box is
   taller than the 1rem spinner, so without a fixed height the button shrinks
   ~4px vertically (and re-centers) during the processing state. */
button.btn-icon-mode .btn-icon-slot { display: inline-flex; align-items: center; justify-content: center; width: 1rem; height: 1.5em; flex: 0 0 auto; }
.btn-icon-mode .btn-spinner { width: 1rem; height: 1rem; }
.btn.btn-icon-mode .btn-label { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.btn.btn-icon-mode .vr { opacity: 0.25; margin-inline: 0.1rem; }

/* Topbar profile avatar badge — role-abbreviation chip shared by every ERP
   surface (Payroll, Production, launchpad) so the profile "icon" is identical
   everywhere. Color is set per-user via an inline background. */
.topbar-avatar-badge {
	width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
	background: var(--sidebar-accent, #3b82f6); color: #fff;
	font-size: .55rem; font-weight: 700; letter-spacing: .04em;
	display: inline-flex; align-items: center; justify-content: center;
}

/* =========================================================
   ERP Button — Override btn-secondary with flat light style
   (from Payroll). Uses Bootstrap 5.3 CSS variable API so no
   !important needed. Shared by both systems.  2026-08-07
   ========================================================= */
.btn-secondary {
    --bs-btn-bg:                  #f1f5f9;
    --bs-btn-color:               #1e293b;
    --bs-btn-border-color:        #dde2e8;
    --bs-btn-hover-bg:            #e2e8f0;
    --bs-btn-hover-color:         #1e293b;
    --bs-btn-hover-border-color:  #c8d3de;
    --bs-btn-focus-shadow-rgb:    203, 213, 225;
    --bs-btn-active-bg:           #d5e0ec;
    --bs-btn-active-color:        #1e293b;
    --bs-btn-active-border-color: #c8d3de;
    --bs-btn-disabled-bg:         #f1f5f9;
    --bs-btn-disabled-color:      #94a3b8;
    --bs-btn-disabled-border-color: #dde2e8;
}

/* =========================================================
   ERP Button — btn-white (minimal text+icon button used in table
   OPT columns, the launchpad Settings button, etc.). Bootstrap has
   NO .btn-white variant, so without these tokens its :active/:focus
   border-color falls back to currentColor (dark) — that was the
   black outline on click. Keep the border transparent in every
   state; only a soft tinted background on hover/active.  2026-08-13
   ========================================================= */
.btn-white {
    --bs-btn-bg:                    transparent;
    --bs-btn-color:                 #1e293b;
    --bs-btn-border-color:          transparent;
    --bs-btn-hover-bg:              #f1f5f9;
    --bs-btn-hover-color:           #1e293b;
    --bs-btn-hover-border-color:    transparent;
    --bs-btn-focus-shadow-rgb:      203, 213, 225;
    --bs-btn-active-bg:             #e2e8f0;
    --bs-btn-active-color:          #1e293b;
    --bs-btn-active-border-color:   transparent;
    --bs-btn-disabled-bg:           transparent;
    --bs-btn-disabled-color:        #94a3b8;
    --bs-btn-disabled-border-color: transparent;
}

/* =========================================================
   ERP TABLES — DataTables active-page color (from Payroll).
   Generic (not scoped to .table-container) so it applies to
   BOTH systems' DT 2.x pagination.  2026-08-07
   ========================================================= */
.dt-paging .pagination .page-item.active .page-link,
.dt-paging .pagination .page-item.current .page-link,
.dt-paging .pagination .dt-paging-button.current .page-link,
.dt-paging .pagination .dt-paging-button.current button.page-link {
    background-color: var(--tab-active) !important;
    border-color:     var(--tab-active) !important;
    color: #fff !important;
    font-weight: 700;
    box-shadow: none !important;
}
.dt-paging .pagination .page-item:not(.disabled):not(.active):not(.current) .page-link:hover {
    background-color: var(--surface-page) !important;
    color:            var(--text) !important;
}

/* =========================================================
   MODULE TAB BAR — per-page sub-navigation (from Payroll).
   Sits below the topbar; renderNavButton() produces the tabs.
   Shared by both systems.  2026-08-07
   ========================================================= */
.content-button-group {
    padding: 0 1.25rem;
    background: var(--surface-topbar);
    border-bottom: 1px solid var(--tab-bar-border);
    flex-shrink: 0;
    display: flex;
    justify-content: flex-start;   /* tabs always left-aligned */
    align-items: stretch;
}
.content-button-group .btn-group {
    display: flex;
    gap: 0;
    border: none;
    border-radius: 0;
    margin-top: 0;
    width: auto;
}
.content-button-group .mt-3 { margin-top: 0; }
.content-button-group .btn-group > .btn.btn-outline-dark {
    border: none !important;
    border-bottom: 2px solid transparent !important;
    border-radius: 0 !important;
    margin-bottom: -1px;
    padding: 0.75rem 1.1rem;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--tab-text);
    background: transparent;
    box-shadow: none !important;
    white-space: nowrap;
    transition: color 0.15s ease, border-color 0.15s ease;
}
.content-button-group .btn-group > .btn.btn-outline-dark:hover {
    color: var(--tab-hover);
    background: transparent;
    border-bottom-color: var(--border) !important;
}
.content-button-group .btn-group > .btn.btn-outline-dark.active {
    color: var(--tab-active);
    border-bottom-color: var(--tab-active) !important;
    background: transparent;
    font-weight: 700;
}
