/* ============================================================
   Laravel HR + QuickBooks Desktop 2010
   Enterprise Web UI Styles
   ============================================================ */

:root {
    --sidebar-width: 260px;
    --sidebar-bg: linear-gradient(180deg, #0a1628 0%, #0f2744 55%, #0b3db8 160%);
    --primary: #0b3db8;
    --primary-dark: #082f8a;
    --success: #166534;
    --warning: #b45309;
    --danger: #9f1239;
    --qb-green: #166534;
    --bg-body: #eef2f7;
    --card-shadow: 0 8px 24px rgba(10, 22, 40, 0.08);
    --card-shadow-hover: 0 16px 40px rgba(10, 22, 40, 0.12);
    --radius: 14px;
    --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --dash-blue: #0b3db8;
    --corp-navy: #0b3db8;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: var(--font-sans);
    background: var(--bg-body);
    color: #1e293b;
    min-height: 100vh;
    margin: 0;
    line-height: 1.5;
}

a { text-decoration: none; color: inherit; }

/* ---------- Sidebar (accordion navigation) ---------- */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
    background: var(--sidebar-bg);
    color: #fff;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform .25s ease;
    -webkit-overflow-scrolling: touch;
}

.sidebar .brand {
    flex: 0 0 auto;
    padding: 1.25rem 1.25rem 1rem;
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: -0.02em;
    border-bottom: 1px solid rgba(255,255,255,.1);
}

.sidebar .brand small {
    display: block;
    font-weight: 400;
    font-size: .72rem;
    opacity: .65;
    margin-top: .2rem;
}

.sidebar-nav {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: .6rem 0 .5rem;
    display: flex;
    flex-direction: column;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.35) transparent;
}
.sidebar-nav::-webkit-scrollbar { width: 6px; }
.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,.35);
    border-radius: 3px;
}

.sidebar .nav-link {
    color: rgba(255,255,255,.82);
    border-radius: .5rem;
    margin: .1rem .65rem;
    padding: .5rem .85rem;
    display: flex;
    align-items: center;
    gap: .65rem;
    font-size: .9rem;
    transition: background .15s ease, color .15s ease;
    white-space: nowrap;
}
.sidebar .nav-link i {
    width: 1.25rem;
    font-size: 1.05rem;
    opacity: .9;
    flex-shrink: 0;
}
.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    background: rgba(255,255,255,.12);
    color: #fff;
}
.sidebar .nav-link.active {
    background: rgba(37,99,235,.4);
    font-weight: 500;
}

/* Accordion group headers */
.nav-accordion {
    margin: .15rem 0;
}
.nav-accordion-btn {
    width: calc(100% - 1.3rem);
    margin: .1rem .65rem;
    padding: .55rem .85rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    border: 0;
    border-radius: .5rem;
    background: transparent;
    color: rgba(255,255,255,.9);
    font-size: .88rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: background .15s ease;
}
.nav-accordion-btn span {
    display: flex;
    align-items: center;
    gap: .65rem;
}
.nav-accordion-btn span i {
    width: 1.25rem;
    font-size: 1.05rem;
    opacity: .9;
}
.nav-accordion-btn .chev {
    font-size: .75rem;
    opacity: .7;
    transition: transform .2s ease;
}
.nav-accordion-btn:not(.collapsed) .chev {
    transform: rotate(180deg);
}
.nav-accordion-btn:hover,
.nav-accordion-btn:not(.collapsed) {
    background: rgba(255,255,255,.08);
    color: #fff;
}

.nav-sub {
    padding: .15rem 0 .35rem .35rem;
}
.nav-sub .nav-link {
    font-size: .86rem;
    padding: .42rem .75rem .42rem 1.15rem;
    margin-left: .85rem;
    color: rgba(255,255,255,.75);
}
.nav-sub .nav-link.active {
    background: rgba(37,99,235,.4);
    color: #fff;
}

.nav-footer {
    margin-top: auto;
    padding-top: .5rem;
    border-top: 1px solid rgba(255,255,255,.1);
}
.tenant-label, .user-label {
    color: rgba(255,255,255,.55);
}

/* legacy section labels (unused) */
.sidebar .nav-section { display: none; }
.sidebar hr {
    border-color: rgba(255,255,255,.1);
    margin: .5rem 1rem;
}

/* ---------- Main content ---------- */
.main-content {
    margin-left: var(--sidebar-width);
    padding: 1.5rem 1.75rem 0;
    /* block flow — footer always after content, never pinned mid-viewport */
    display: block;
    box-sizing: border-box;
    min-height: auto;
    overflow: visible;
}
.main-content-body {
    display: block;
    width: 100%;
    max-width: 100%;
    padding-bottom: 1.5rem;
    /* short pages only: push footer toward bottom without overlapping tall dashboards */
    min-height: calc(100dvh - 9rem);
    box-sizing: border-box;
    overflow: visible;
}
/* Version strip — document flow only, never sticky/fixed/mid-page */
.app-version-footer {
    display: block;
    clear: both;
    width: 100%;
    max-width: 100%;
    margin: 0;
    position: static !important;
    z-index: auto;
    text-align: center;
    background: #0b3db8;
    color: #ffffff !important;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.45rem 1rem;
    letter-spacing: 0.02em;
    line-height: 1.3;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: .75rem;
}

.page-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    color: #0f172a;
}

.page-header .subtitle {
    color: #64748b;
    font-size: .9rem;
    margin: .15rem 0 0;
}

/* ---------- Cards ---------- */
.stat-card,
.card {
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
    background: #fff;
    transition: box-shadow .2s ease;
}

.stat-card:hover {
    box-shadow: var(--card-shadow-hover);
}

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

.stat-value {
    font-size: 1.85rem;
    font-weight: 700;
    line-height: 1.2;
    color: #0f172a;
}

.stat-label {
    font-size: .8rem;
    color: #64748b;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.stat-icon {
    font-size: 1.75rem;
    opacity: .45;
}

/* ---------- Tables ---------- */
.table-card {
    border-radius: var(--radius);
    overflow: visible;
    box-shadow: var(--card-shadow);
    background: #fff;
}
.table-card > .table-responsive {
    border-radius: var(--radius);
}
/* Keep horizontal scroll without clipping action dropdowns */
.table-card .table-responsive {
    overflow-x: auto;
    overflow-y: visible;
}

.table-card .table {
    margin-bottom: 0;
}

.table-card thead th {
    background: #f8fafc;
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #64748b;
    font-weight: 600;
    border-bottom: 1px solid #e2e8f0;
    padding: .85rem 1rem;
    white-space: nowrap;
}

.table-card tbody td {
    padding: .8rem 1rem;
    vertical-align: middle;
    border-color: #f1f5f9;
    font-size: .9rem;
}

.table-card tbody tr:hover {
    background: #f8fafc;
}

/* ---------- Buttons ---------- */
.btn {
    border-radius: .5rem;
    font-weight: 500;
    font-size: .875rem;
    padding: .45rem 1rem;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
}

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-qb {
    background: var(--qb-green);
    border-color: var(--qb-green);
    color: #fff;
}

.btn-qb:hover {
    background: #249017;
    border-color: #249017;
    color: #fff;
}

.btn-sm {
    padding: .3rem .7rem;
    font-size: .8rem;
}

/* ---------- Badges / Status ---------- */
.badge {
    font-weight: 500;
    font-size: .72rem;
    padding: .35em .65em;
    border-radius: .35rem;
}

.badge-status-open { background: #dbeafe; color: #1e40af; }
.badge-status-draft { background: #f1f5f9; color: #475569; }
.badge-status-exported { background: #fef3c7; color: #92400e; }
.badge-status-imported { background: #d1fae5; color: #065f46; }
.badge-status-approved { background: #dcfce7; color: #166534; }
.badge-status-closed { background: #e2e8f0; color: #334155; }
.badge-status-pending { background: #fef9c3; color: #854d0e; }
.badge-status-active { background: #dcfce7; color: #166534; }
.badge-qb { background: var(--qb-green); color: #fff; }

/* ---------- Forms ---------- */
.form-control, .form-select {
    border-radius: .5rem;
    border-color: #cbd5e1;
    font-size: .9rem;
    padding: .5rem .85rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}

.form-label {
    font-weight: 500;
    font-size: .85rem;
    color: #334155;
    margin-bottom: .35rem;
}

/* ---------- Alerts ---------- */
.alert {
    border-radius: .6rem;
    border: none;
    font-size: .9rem;
}

/* ---------- Workflow steps ---------- */
.workflow-steps {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.workflow-steps li {
    background: #f1f5f9;
    border-radius: 2rem;
    padding: .4rem 1rem;
    font-size: .82rem;
    color: #475569;
    display: flex;
    align-items: center;
    gap: .4rem;
}

.workflow-steps li.active {
    background: #dbeafe;
    color: #1e40af;
    font-weight: 600;
}

.workflow-steps li.done {
    background: #dcfce7;
    color: #166534;
}

/* ---------- Login / Auth pages ---------- */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1E3A5F;
    padding: 1.5rem;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 20px 50px rgba(0,0,0,.25);
    overflow: hidden;
}

.auth-card .auth-header {
    background: #1E3A5F;
    color: #fff;
    padding: 1.75rem 1.5rem;
    text-align: center;
}

.auth-card .auth-header h1 {
    font-size: 1.35rem;
    margin: 0 0 .25rem;
    font-weight: 700;
}

.auth-card .auth-header p {
    margin: 0;
    opacity: .8;
    font-size: .85rem;
}

.auth-card .auth-body {
    padding: 1.75rem 1.5rem;
}

/* ---------- Installer ---------- */
.install-page {
    min-height: 100vh;
    background: var(--bg-body);
    padding: 2rem 1rem;
}

.install-card {
    max-width: 720px;
    margin: 0 auto;
    background: #fff;
    border-radius: 1rem;
    box-shadow: var(--card-shadow-hover);
    overflow: hidden;
}

.install-header {
    background: #1E3A5F;
    color: #fff;
    padding: 1.75rem 2rem;
}

.install-body {
    padding: 2rem;
}

.install-step {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid #f1f5f9;
}

.install-step:last-child { border-bottom: none; }

.install-step .step-num {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: #e2e8f0;
    color: #475569;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .85rem;
    flex-shrink: 0;
}

.install-step.done .step-num {
    background: var(--success);
    color: #fff;
}

.install-step.active .step-num {
    background: var(--primary);
    color: #fff;
}

/* ---------- Empty state ---------- */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: #94a3b8;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: .5;
}

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.show {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
    .sidebar-toggle {
        display: inline-flex !important;
    }
}

.sidebar-toggle {
    display: none;
}

/* ---------- Utility ---------- */
.text-qb { color: var(--qb-green); }
.bg-qb-soft { background: rgba(44,160,28,.1); }
.border-qb { border-color: var(--qb-green) !important; }

.avatar-sm {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: #e2e8f0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .75rem;
    font-weight: 600;
    color: #475569;
}

.action-btns {
    display: flex;
    gap: .35rem;
    flex-wrap: wrap;
}

/* Sidebar overlay (mobile) */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 1035;
}
.sidebar-overlay.show { display: block; }
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform .2s ease;
        height: 100vh;
        height: 100dvh;
        max-height: 100dvh;
    }
    .sidebar.show { transform: translateX(0); }
    .main-content { margin-left: 0 !important; }
}
.sidebar .nav-link { cursor: pointer; position: relative; z-index: 1; }

.org-instance-bar { font-size: 0.8rem; }
.sidebar .brand small { display: block; font-size: 0.7rem; opacity: 0.85; margin-top: 2px; font-weight: 400; }

/* Org code + profile in page header center */
.page-header.page-header-with-org {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.75rem;
}
.page-header-with-org > div:first-child { justify-self: start; }
.page-header-center { justify-self: center; text-align: center; }
.page-header-actions { justify-self: end; }
.org-meta-chips .org-code-badge { font-weight: 600; letter-spacing: 0.03em; }
.org-meta-chips .org-profile-badge { font-weight: 500; }
@media (max-width: 768px) {
  .page-header.page-header-with-org {
    grid-template-columns: 1fr;
  }
  .page-header-center, .page-header-actions { justify-self: start; }
}


/* App top bar — org code + profile (all modules) */
.app-topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 1rem;
  padding: 0.55rem 0.85rem;
  background: #fff;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 0.5rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.app-topbar-left { justify-self: start; display: flex; align-items: center; gap: 0.5rem; }
.app-topbar-center { justify-self: center; }
.app-topbar-right { justify-self: end; display: flex; align-items: center; gap: 0.5rem; }
.app-topbar .org-meta-chips { margin: 0; }
.app-topbar .org-code-badge,
.app-topbar .org-profile-badge {
  font-weight: 600;
  letter-spacing: 0.02em;
  font-size: 0.78rem;
  padding: 0.35em 0.65em;
}
/* Page headers stay simple — no org chips injected into content */
.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.page-header.page-header-with-org {
  display: flex;
  grid-template-columns: unset;
}
.page-header-center { display: none !important; } /* legacy inject removed */
@media (max-width: 768px) {
  .app-topbar {
    grid-template-columns: auto 1fr auto;
  }
  .app-topbar-center { justify-self: end; }
  .app-topbar-right { display: none; }
}



/* ---------- Accent dashlets ---------- */
/*
 * Dashlet / portal solid hex palette
 * ---------------------------------
 * blue     #2563EB
 * cyan     #0891B2
 * teal     #0F766E
 * emerald  #059669
 * violet   #7C3AED
 * indigo   #4F46E5
 * amber    #D97706
 * rose     #E11D48
 * orange   #EA580C
 * slate    #475569
 * pink     #DB2777
 * sky      #0284C7
 * lime     #65A30D
 * fuchsia  #C026D3
 *
 * Portal heroes:
 * admin #5B21B6 · hr #1D4ED8 · finance #047857 · manager #3730A3
 * employee #0E7490 · logistics #C2410C · default #1E3A5F
 */
:root {
    --dash-blue: #2563EB;
    --dash-cyan: #0891B2;
    --dash-teal: #0F766E;
    --dash-emerald: #059669;
    --dash-violet: #7C3AED;
    --dash-indigo: #4F46E5;
    --dash-amber: #D97706;
    --dash-rose: #E11D48;
    --dash-orange: #EA580C;
    --dash-slate: #475569;
    --dash-pink: #DB2777;
    --dash-sky: #0284C7;
    --dash-lime: #65A30D;
    --dash-fuchsia: #C026D3;
    --hero-admin: #5B21B6;
    --hero-hr: #1D4ED8;
    --hero-finance: #047857;
    --hero-manager: #3730A3;
    --hero-employee: #0E7490;
    --hero-logistics: #C2410C;
    --hero-default: #1E3A5F;
}

.stat-card {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(15, 23, 42, 0.08);
}
.stat-card::before {
    content: "";
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
    background: var(--dash-blue);
    border-radius: 4px 0 0 4px;
}
.stat-card .stat-value { color: var(--dash-blue); }
.stat-card.accent-blue::before { background: var(--dash-blue); }
.stat-card.accent-blue .stat-value { color: var(--dash-blue); }
.stat-card.accent-cyan::before { background: var(--dash-cyan); }
.stat-card.accent-cyan .stat-value { color: var(--dash-cyan); }
.stat-card.accent-teal::before { background: var(--dash-teal); }
.stat-card.accent-teal .stat-value { color: var(--dash-teal); }
.stat-card.accent-violet::before { background: var(--dash-violet); }
.stat-card.accent-violet .stat-value { color: var(--dash-violet); }
.stat-card.accent-indigo::before { background: var(--dash-indigo); }
.stat-card.accent-indigo .stat-value { color: var(--dash-indigo); }
.stat-card.accent-amber::before { background: var(--dash-amber); }
.stat-card.accent-amber .stat-value { color: var(--dash-amber); }
.stat-card.accent-emerald::before { background: var(--dash-emerald); }
.stat-card.accent-emerald .stat-value { color: var(--dash-emerald); }
.stat-card.accent-rose::before { background: var(--dash-rose); }
.stat-card.accent-rose .stat-value { color: var(--dash-rose); }
.stat-card.accent-orange::before { background: var(--dash-orange); }
.stat-card.accent-orange .stat-value { color: var(--dash-orange); }
.stat-card.accent-slate::before { background: var(--dash-slate); }
.stat-card.accent-slate .stat-value { color: var(--dash-slate); }
.stat-card.accent-pink::before { background: var(--dash-pink); }
.stat-card.accent-pink .stat-value { color: var(--dash-pink); }
.stat-card.accent-sky::before { background: var(--dash-sky); }
.stat-card.accent-sky .stat-value { color: var(--dash-sky); }
.stat-card .stat-icon { color: var(--dash-blue); opacity: .55; }
.module-dashlets .stat-card,
.row.g-3 > [class*="col"] > .stat-card {
    border-left: none;
}
.card.module-panel .card-header {
    border-bottom-color: rgba(37, 99, 235, 0.12);
}
.card.module-panel .card-header::after {
    content: none;
}


/* ── Portal heroes & solid dashlets (role portals) ─────────────── */
.portal-hero {
    border-radius: 1rem;
    padding: 1.25rem 1.5rem;
    color: #fff;
    position: relative;
    overflow: hidden;
    margin-bottom: 1.25rem;
    box-shadow: 0 4px 14px rgba(15, 23, 42, .1);
}
.portal-hero::after { content: none; }
.portal-hero-admin { background: var(--hero-admin); }         /* #5B21B6 */
.portal-hero-hr { background: var(--hero-hr); }               /* #1D4ED8 */
.portal-hero-finance { background: var(--hero-finance); }     /* #047857 */
.portal-hero-manager { background: var(--hero-manager); }     /* #3730A3 */
.portal-hero-employee { background: var(--hero-employee); }   /* #0E7490 */
.portal-hero-logistics { background: var(--hero-logistics); } /* #C2410C */
.portal-hero-default { background: var(--hero-default); }     /* #1E3A5F */

.module-scheme-badge {
    display: inline-flex;
    align-items: center;
    padding: .2rem .55rem;
    border-radius: 999px;
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    background: rgba(255,255,255,.18);
    border: 1px solid rgba(255,255,255,.28);
    color: #fff;
}

/* Solid colour KPI dashlets — explicit hex via CSS variables */
.dashlet-gradient,
.dashlet-solid {
    border: 0;
    border-radius: .9rem;
    color: #fff;
    box-shadow: 0 2px 10px rgba(15, 23, 42, .1);
    transition: transform .15s ease, box-shadow .15s ease;
}
.dashlet-gradient:hover,
.dashlet-solid:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(15, 23, 42, .14);
}
.dashlet-gradient .card-body,
.dashlet-solid .card-body { padding: 1rem 1.1rem; }
.dashlet-gradient .dash-value,
.dashlet-solid .dash-value { font-size: 1.65rem; font-weight: 700; line-height: 1.15; }
.dashlet-gradient .dash-label,
.dashlet-solid .dash-label { font-size: .8rem; opacity: .95; font-weight: 600; }
.dashlet-gradient .dash-sub,
.dashlet-solid .dash-sub { font-size: .7rem; opacity: .8; }
.dashlet-gradient a.stretched-link::after,
.dashlet-solid a.stretched-link::after { z-index: 1; }

.dash-blue { background: var(--dash-blue); }       /* #2563EB */
.dash-cyan { background: var(--dash-cyan); }       /* #0891B2 */
.dash-teal { background: var(--dash-teal); }       /* #0F766E */
.dash-emerald { background: var(--dash-emerald); } /* #059669 */
.dash-violet { background: var(--dash-violet); }   /* #7C3AED */
.dash-indigo { background: var(--dash-indigo); }   /* #4F46E5 */
.dash-amber { background: var(--dash-amber); }     /* #D97706 */
.dash-rose { background: var(--dash-rose); }       /* #E11D48 */
.dash-orange { background: var(--dash-orange); }   /* #EA580C */
.dash-slate { background: var(--dash-slate); }     /* #475569 */
.dash-pink { background: var(--dash-pink); }       /* #DB2777 */
.dash-sky { background: var(--dash-sky); }         /* #0284C7 */
.dash-lime { background: var(--dash-lime); }       /* #65A30D */
.dash-fuchsia { background: var(--dash-fuchsia); } /* #C026D3 */

.tool-tile {
    display: flex;
    align-items: center;
    gap: .55rem;
    padding: .55rem .7rem;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: .75rem;
    text-decoration: none;
    color: inherit;
    background: #fff;
    transition: border-color .15s, background .15s, box-shadow .15s;
    height: 100%;
}
.tool-tile:hover {
    border-color: rgba(37, 99, 235, .35);
    background: #f8fafc;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .06);
    color: inherit;
}
.tool-tile .tool-icon {
    width: 2rem;
    height: 2rem;
    border-radius: .55rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: .95rem;
}
.tool-icon.blue { background: #2563EB; color: #fff; }
.tool-icon.cyan { background: #0891B2; color: #fff; }
.tool-icon.teal { background: #0F766E; color: #fff; }
.tool-icon.emerald { background: #059669; color: #fff; }
.tool-icon.violet { background: #7C3AED; color: #fff; }
.tool-icon.indigo { background: #4F46E5; color: #fff; }
.tool-icon.amber { background: #D97706; color: #fff; }
.tool-icon.rose { background: #E11D48; color: #fff; }
.tool-icon.orange { background: #EA580C; color: #fff; }
.tool-icon.slate { background: #475569; color: #fff; }
.tool-icon.pink { background: #DB2777; color: #fff; }
.tool-icon.sky { background: #0284C7; color: #fff; }
.tool-tile .tool-label { font-size: .8rem; font-weight: 600; }

.module-scheme-badge {
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    padding: .2rem .55rem;
    border-radius: 999px;
    background: rgba(255,255,255,.2);
    border: 1px solid rgba(255,255,255,.3);
}


/* footer styles owned by .main-content block above */


/* —— Material dashboard charts —— */
.mui-card {
  background: #fff;
  border-radius: 16px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: 0 1px 2px rgba(15,23,42,.04), 0 8px 24px rgba(15,23,42,.06);
  overflow: hidden;
  height: 100%;
}
.mui-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.15rem 0.25rem;
}
.mui-card-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: #0f172a;
  letter-spacing: -0.01em;
}
.mui-card-sub {
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 0.1rem;
}
.mui-card-icon {
  font-size: 1.25rem;
  opacity: 0.85;
}
.mui-card-body { padding: 0.5rem 1rem 1.1rem; }
.mui-chart-wrap { position: relative; width: 100%; height: 240px; }
.mui-chart-square { height: 220px; }
.mui-kpi {
  border-radius: 16px;
  padding: 1rem 1.1rem;
  color: #fff;
  box-shadow: 0 8px 20px rgba(15,23,42,.12);
  min-height: 110px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform .15s ease, box-shadow .15s ease;
}
.mui-kpi:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(15,23,42,.16); }
.mui-kpi a { color: inherit; text-decoration: none; }
.mui-kpi .kpi-value { font-size: 1.75rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.mui-kpi .kpi-label { font-size: 0.8rem; font-weight: 600; opacity: 0.95; }
.mui-kpi .kpi-sub { font-size: 0.7rem; opacity: 0.8; }
.mui-kpi .kpi-icon { font-size: 1.35rem; opacity: 0.9; }
.mui-kpi-blue { background: #2563EB; }
.mui-kpi-teal { background: #0F766E; }
.mui-kpi-amber { background: #D97706; }
.mui-kpi-violet { background: #7C3AED; }
.mui-kpi-rose { background: #E11D48; }
.mui-kpi-emerald { background: #059669; }
.mui-kpi-indigo { background: #4F46E5; }
.mui-kpi-cyan { background: #0891B2; }
.mui-kpi-slate { background: #475569; }
.mui-kpi-orange { background: #EA580C; }
.mui-section-title {
  font-weight: 800;
  font-size: 1rem;
  color: #0f172a;
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}


/* ---- Mobile menu reliability ---- */
body.sidebar-open {
    overflow: hidden;
    touch-action: none;
}
.sidebar-toggle {
    align-items: center;
    gap: 0.35rem;
    min-height: 38px;
    z-index: 1050;
    position: relative;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
@media (max-width: 991.98px) {
    .sidebar-toggle {
        display: inline-flex !important;
        visibility: visible !important;
        pointer-events: auto !important;
    }
    .sidebar {
        z-index: 1040;
        box-shadow: 4px 0 24px rgba(0,0,0,.25);
    }
    .sidebar-overlay {
        z-index: 1035;
    }
    .app-topbar {
        position: sticky;
        top: 0;
        z-index: 1020;
        background: #fff;
    }
}
@media (min-width: 992px) {
    .sidebar-toggle { display: none !important; }
    body.sidebar-open { overflow: auto; touch-action: auto; }
}

/* ——— Universal sidebar search ——— */
.sidebar-search {
    padding: 0.5rem 0.75rem 0.65rem;
    position: relative;
    z-index: 20;
    flex-shrink: 0;
}
.sidebar-search-box {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 10px;
    padding: 0.35rem 0.6rem;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.sidebar-search-box:focus-within {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.35);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}
.sidebar-search-box > i {
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.9rem;
    flex-shrink: 0;
}
.sidebar-search-box input,
.sidebar-search-box input.form-control {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    color: #fff !important;
    font-size: 0.84rem;
    padding: 0.2rem 0 !important;
    height: auto !important;
    min-height: 0 !important;
    line-height: 1.35;
    width: 100%;
}
.sidebar-search-box input::placeholder {
    color: rgba(255, 255, 255, 0.42);
}
.sidebar-search-box input::-webkit-search-cancel-button {
    filter: invert(1);
    cursor: pointer;
}

.sidebar-search-results {
    position: absolute;
    left: 0.6rem;
    right: 0.6rem;
    top: calc(100% + 4px);
    z-index: 50;
    background: #0f2744;
    color: #e8eef7;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
    max-height: min(360px, 55vh);
    overflow-y: auto;
    padding: 0.35rem 0;
}
.sidebar-search-results .usr-group {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #8fb0d6;
    padding: 0.5rem 0.85rem 0.2rem;
    font-weight: 700;
}
.sidebar-search-results a.usr-item {
    display: flex !important;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.85rem !important;
    margin: 0 0.3rem;
    border-radius: 8px;
    text-decoration: none !important;
    color: #e8eef7 !important;
    background: transparent !important;
    border: 0 !important;
    font-size: 0.84rem;
    line-height: 1.25;
    width: auto !important;
}
.sidebar-search-results a.usr-item:hover,
.sidebar-search-results a.usr-item.active {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
}
.sidebar-search-results a.usr-item i,
.sidebar-search-results .usr-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #93c5fd;
    font-size: 0.9rem;
}
.sidebar-search-results .usr-body {
    min-width: 0;
    flex: 1;
}
.sidebar-search-results .usr-body strong {
    display: block;
    font-weight: 600;
    font-size: 0.84rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar-search-results .usr-meta {
    font-size: 0.7rem;
    color: #94a3b8;
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar-search-results .usr-empty {
    padding: 0.85rem 1rem;
    color: #94a3b8;
    font-size: 0.8rem;
    text-align: center;
}
.sidebar-search-results .usr-type {
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    background: rgba(255,255,255,0.06);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    flex-shrink: 0;
}

/* —— Dashboard auto-refresh bar —— */
.dash-refresh-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 0.5rem 0.85rem;
  margin-bottom: 1rem;
  box-shadow: 0 1px 3px rgba(15,23,42,.04);
}
.dash-refresh-left, .dash-refresh-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.dash-refresh-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: #334155;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.dash-refresh-select {
  width: auto;
  min-width: 4.5rem;
  font-weight: 600;
  font-size: 0.8rem;
  border-radius: 8px;
}
.dash-refresh-ago {
  font-size: 0.75rem;
  min-width: 4rem;
  text-align: right;
}
.dash-refresh-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #94a3b8;
  display: inline-block;
  box-shadow: 0 0 0 3px rgba(148,163,184,.25);
}
.dash-refresh-dot.ok {
  background: #16a34a;
  box-shadow: 0 0 0 3px rgba(22,163,74,.2);
  animation: dashPulse 1.6s ease infinite;
}
.dash-refresh-dot.busy {
  background: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,.25);
  animation: dashPulse 0.9s ease infinite;
}
.dash-refresh-dot.err {
  background: #dc2626;
  box-shadow: 0 0 0 3px rgba(220,38,38,.2);
}
@keyframes dashPulse {
  0%,100% { opacity: 1; }
  50% { opacity: 0.45; }
}

/* Strong solid KPI tiles — no gradients */
.mui-kpi {
  border-radius: 14px;
  color: #fff;
  padding: 1rem 1.1rem;
  min-height: 112px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 6px 16px rgba(15,23,42,.12);
  transition: transform .15s ease, box-shadow .15s ease;
  border: 0;
  background-image: none !important;
}
.mui-kpi:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(15,23,42,.18);
}
.mui-kpi a { color: inherit; text-decoration: none; }
.mui-kpi .kpi-value { font-size: 1.85rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.mui-kpi .kpi-label { font-size: 0.78rem; font-weight: 700; opacity: 0.95; text-transform: uppercase; letter-spacing: 0.03em; }
.mui-kpi .kpi-sub { font-size: 0.7rem; opacity: 0.85; font-weight: 500; }
.mui-kpi .kpi-icon { font-size: 1.4rem; opacity: 0.95; }
.mui-kpi-blue { background: #2563EB !important; }
.mui-kpi-teal { background: #0F766E !important; }
.mui-kpi-amber { background: #D97706 !important; }
.mui-kpi-violet { background: #7C3AED !important; }
.mui-kpi-rose { background: #E11D48 !important; }
.mui-kpi-emerald { background: #059669 !important; }
.mui-kpi-indigo { background: #4F46E5 !important; }
.mui-kpi-cyan { background: #0891B2 !important; }
.mui-kpi-slate { background: #475569 !important; }
.mui-kpi-orange { background: #EA580C !important; }

.dashlet-solid, .dashlet-gradient {
  color: #fff !important;
  border: 0 !important;
  border-radius: 14px !important;
  box-shadow: 0 6px 16px rgba(15,23,42,.12);
  background-image: none !important;
}
.dashlet-solid:hover, .dashlet-gradient:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(15,23,42,.16);
}

.mui-card {
  border-radius: 14px !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 2px 8px rgba(15,23,42,.05) !important;
}
.mui-card-header {
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 0.65rem !important;
}
.mui-section-title {
  font-weight: 800;
  font-size: 0.95rem;
  color: #0f172a;
  margin: 0.5rem 0 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.mui-kpi-pink { background: #DB2777 !important; }
.mui-kpi-lime { background: #65A30D !important; }
.dash-csv-btn {
  font-weight: 700;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.mui-kpi {
  animation: dashletIn 0.35s ease both;
}
#dashKpiRow .col-6:nth-child(1) .mui-kpi { animation-delay: 0.02s; }
#dashKpiRow .col-6:nth-child(2) .mui-kpi { animation-delay: 0.05s; }
#dashKpiRow .col-6:nth-child(3) .mui-kpi { animation-delay: 0.08s; }
#dashKpiRow .col-6:nth-child(4) .mui-kpi { animation-delay: 0.11s; }
#dashKpiRow .col-6:nth-child(5) .mui-kpi { animation-delay: 0.14s; }
#dashKpiRow .col-6:nth-child(6) .mui-kpi { animation-delay: 0.17s; }
#dashKpiRow2 .col-6:nth-child(1) .mui-kpi { animation-delay: 0.2s; }
#dashKpiRow2 .col-6:nth-child(2) .mui-kpi { animation-delay: 0.23s; }
#dashKpiRow2 .col-6:nth-child(3) .mui-kpi { animation-delay: 0.26s; }
#dashKpiRow2 .col-6:nth-child(4) .mui-kpi { animation-delay: 0.29s; }
#dashKpiRow2 .col-6:nth-child(5) .mui-kpi { animation-delay: 0.32s; }
#dashKpiRow2 .col-6:nth-child(6) .mui-kpi { animation-delay: 0.35s; }
@keyframes dashletIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.mui-card { transition: box-shadow .2s ease, transform .2s ease; }
.mui-card:hover { box-shadow: 0 8px 28px rgba(15,23,42,.1) !important; }
.text-indigo { color: #4F46E5 !important; }
.text-cyan { color: #0891B2 !important; }

#dashKpiRow3 .col-6:nth-child(1) .mui-kpi { animation-delay: 0.38s; }
#dashKpiRow3 .col-6:nth-child(2) .mui-kpi { animation-delay: 0.41s; }
#dashKpiRow3 .col-6:nth-child(3) .mui-kpi { animation-delay: 0.44s; }
#dashKpiRow3 .col-6:nth-child(4) .mui-kpi { animation-delay: 0.47s; }
#dashKpiRow3 .col-6:nth-child(5) .mui-kpi { animation-delay: 0.50s; }
#dashKpiRow3 .col-6:nth-child(6) .mui-kpi { animation-delay: 0.53s; }

/* ── Listing row actions: prevent 3-dot menus from clipping/scrolling ── */
.table-responsive {
  overflow-x: auto;
  overflow-y: visible;
}
.table-responsive > .table {
  margin-bottom: 0;
}
/* Bootstrap 5.3: allow dropdown to escape scroll containers */
.table-responsive .dropdown,
td .dropdown,
th .dropdown {
  position: static;
}
.dropdown-menu.dropdown-menu-fixed,
body > .dropdown-menu {
  z-index: 1080 !important;
}
/* Compact action column */
.col-actions {
  width: 1%;
  white-space: nowrap;
  text-align: end;
  vertical-align: middle !important;
}
.btn-actions {
  width: 2rem;
  height: 2rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #334155;
}
.btn-actions:hover, .btn-actions:focus, .btn-actions.show {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #0f172a;
}
.dropdown-menu-actions {
  min-width: 11rem;
  padding: .35rem;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(15,23,42,.14);
  font-size: .875rem;
}
.dropdown-menu-actions .dropdown-item {
  border-radius: 6px;
  padding: .4rem .65rem;
  display: flex;
  align-items: center;
  gap: .45rem;
}
.dropdown-menu-actions .dropdown-item i {
  width: 1.1rem;
  opacity: .85;
}
.dropdown-menu-actions form { margin: 0; }
.dropdown-menu-actions .dropdown-item.text-danger:hover {
  background: #fef2f2;
}

/* Leave form column compact */
.leave-form-cell {
  min-width: 11rem;
  max-width: 16rem;
}
.leave-form-cell .form-control {
  font-size: .75rem;
  padding: .2rem .4rem;
}
.leave-form-cell .btn {
  font-size: .75rem;
}

/* Guided tour (driver.js theme overrides) */
.hcmerp-tour-popover {
  max-width: 340px !important;
}
.hcmerp-tour-popover .driver-popover-title {
  font-weight: 700;
  font-size: 1rem;
}
.hcmerp-tour-popover .driver-popover-description {
  font-size: .875rem;
  color: #475569;
}
.hcmerp-tour-footer-btns {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: .5rem;
}

/* Setup nudge */
.setup-nudge {
  background: linear-gradient(120deg, #fff7ed 0%, #ffedd5 45%, #fef3c7 100%) !important;
  border-left: 4px solid #f59e0b !important;
  border-radius: 12px !important;
}

/* Themed sidebar fallbacks */
.sidebar {
  background: var(--hc-nav-bg, #0f172a);
  color: var(--hc-nav-text, #e2e8f0);
}

/* Fancy guided tour */
.hcmerp-tour-popover.driver-popover,
.driver-popover.hcmerp-tour-popover {
  background: linear-gradient(165deg, #0b1e3a 0%, #1e3a5f 55%, #0f2744 100%) !important;
  color: #f1f5f9 !important;
  border: 1px solid rgba(255,255,255,.12) !important;
  border-radius: 16px !important;
  box-shadow: 0 24px 48px rgba(15,23,42,.45), 0 0 0 1px rgba(59,130,246,.25) !important;
  max-width: 360px !important;
  padding: 1rem 1.1rem 0.85rem !important;
}
.hcmerp-tour-popover .driver-popover-title {
  font-weight: 800 !important;
  font-size: 1.05rem !important;
  color: #fff !important;
  letter-spacing: -0.01em;
}
.hcmerp-tour-popover .driver-popover-description {
  font-size: .875rem !important;
  color: #cbd5e1 !important;
  line-height: 1.5 !important;
}
.hcmerp-tour-popover .driver-popover-progress-text {
  color: #93c5fd !important;
  font-weight: 600 !important;
  font-size: .75rem !important;
}
.hcmerp-tour-popover .driver-popover-navigation-btns {
  gap: .4rem !important;
}
.hcmerp-tour-popover .driver-popover-prev-btn,
.hcmerp-tour-popover .driver-popover-next-btn,
.hcmerp-tour-popover .driver-popover-close-btn {
  border-radius: 999px !important;
  font-weight: 700 !important;
  font-size: .8rem !important;
  padding: .4rem .9rem !important;
  border: none !important;
  text-shadow: none !important;
}
.hcmerp-tour-popover .driver-popover-next-btn {
  background: linear-gradient(135deg, #3b82f6, #6366f1) !important;
  color: #fff !important;
  box-shadow: 0 4px 14px rgba(59,130,246,.4);
}
.hcmerp-tour-popover .driver-popover-prev-btn {
  background: rgba(255,255,255,.1) !important;
  color: #e2e8f0 !important;
}
.hcmerp-tour-popover .driver-popover-close-btn {
  background: transparent !important;
  color: #94a3b8 !important;
}
.driver-overlay {
  background: radial-gradient(ellipse at center, rgba(15,23,42,.45), rgba(15,23,42,.72)) !important;
}

/* (crm styles moved below) */


/* ========== CRM Material shell ========== */
.crm-shell {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  min-height: calc(100vh - 120px);
}
.crm-shell__nav {
  flex: 0 0 240px;
  max-width: 240px;
  position: sticky;
  top: 1rem;
  align-self: flex-start;
  height: calc(100vh - 2rem);
  max-height: calc(100vh - 2rem);
}
.crm-shell__main {
  flex: 1 1 auto;
  min-width: 0;
}
.crm-side-nav {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 100%;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(15,23,42,.06), 0 8px 24px rgba(15,23,42,.04);
  border: 1px solid rgba(15,23,42,.06);
  overflow: hidden;
}
.crm-side-nav__head {
  flex: 0 0 auto;
  padding: 1rem 1rem .75rem;
  background: linear-gradient(135deg, #1e3a5f 0%, #0f2744 100%);
  color: #fff;
}
.crm-side-nav__title {
  display: flex;
  align-items: center;
  gap: .75rem;
}
.crm-side-nav__icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255,255,255,.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}
.crm-side-nav__name {
  font-weight: 700;
  font-size: .95rem;
  letter-spacing: .02em;
  line-height: 1.2;
}
.crm-side-nav__sub {
  font-size: .7rem;
  opacity: .75;
  margin-top: 2px;
}
.crm-side-nav__scroll {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  padding: .5rem 0 .75rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(15,23,42,.2) transparent;
}
.crm-side-nav__scroll::-webkit-scrollbar { width: 5px; }
.crm-side-nav__scroll::-webkit-scrollbar-thumb {
  background: rgba(15,23,42,.18);
  border-radius: 999px;
}
.crm-side-nav__group {
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #94a3b8;
  padding: .65rem 1rem .25rem;
}
.crm-side-nav__link {
  display: flex;
  align-items: center;
  gap: .65rem;
  margin: 1px .5rem;
  padding: .45rem .7rem;
  border-radius: 10px;
  color: #334155;
  text-decoration: none;
  font-size: .875rem;
  font-weight: 500;
  transition: background .15s, color .15s, box-shadow .15s;
}
.crm-side-nav__link i {
  font-size: 1rem;
  width: 1.15rem;
  text-align: center;
  color: #64748b;
  transition: color .15s;
}
.crm-side-nav__link:hover {
  background: #f1f5f9;
  color: #0f172a;
}
.crm-side-nav__link:hover i { color: #1e3a5f; }
.crm-side-nav__link.is-active {
  background: linear-gradient(135deg, rgba(59,130,246,.12), rgba(99,102,241,.1));
  color: #1d4ed8;
  box-shadow: inset 3px 0 0 #3b82f6;
  font-weight: 600;
}
.crm-side-nav__link.is-active i { color: #2563eb; }

/* Material cards / tables inside CRM */
.crm-page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.15rem;
  flex-wrap: wrap;
}
.crm-page-head h1 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -.01em;
}
.crm-card {
  background: #fff;
  border-radius: 16px;
  border: 1px solid rgba(15,23,42,.06);
  box-shadow: 0 2px 8px rgba(15,23,42,.05), 0 6px 20px rgba(15,23,42,.04);
  overflow: hidden;
}
.crm-card .table {
  margin-bottom: 0;
}
.crm-card .table thead th {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #64748b;
  font-weight: 600;
  border-bottom-width: 1px;
  background: #f8fafc !important;
  padding-top: .75rem;
  padding-bottom: .75rem;
}
.crm-card .table td {
  vertical-align: middle;
  border-color: #f1f5f9;
  padding-top: .7rem;
  padding-bottom: .7rem;
}
.crm-card .table tbody tr:hover {
  background: #f8fafc;
}
.crm-card .card-footer {
  background: #fafbfc;
  border-top: 1px solid #f1f5f9;
}
.crm-btn-primary {
  border-radius: 10px;
  font-weight: 600;
  padding: .4rem .9rem;
  box-shadow: 0 4px 12px rgba(37,99,235,.25);
}
.crm-kpi {
  border-radius: 14px;
  padding: 1rem 1.1rem;
  color: #fff;
  min-height: 84px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(15,23,42,.12);
  transition: transform .15s, box-shadow .15s;
}
.crm-kpi:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(15,23,42,.16);
}
.crm-kpi .l {
  font-size: .7rem;
  opacity: .9;
  text-transform: uppercase;
  letter-spacing: .04em;
  font-weight: 600;
}
.crm-kpi .v {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.25;
  margin-top: .15rem;
}

@media (max-width: 991.98px) {
  .crm-shell {
    flex-direction: column;
  }
  .crm-shell__nav {
    flex: none;
    max-width: none;
    width: 100%;
    position: relative;
    top: 0;
    height: auto;
    max-height: none;
  }
  .crm-side-nav {
    max-height: none;
  }
  .crm-side-nav__scroll {
    display: block;
    max-height: 280px;
    overflow-y: auto;
    padding: .4rem 0 .75rem;
  }
  .crm-side-nav__group {
    width: 100%;
  }
  .crm-side-nav__link {
    display: flex;
    white-space: nowrap;
  }
}


/* modal-backdrop visibility */
.modal-backdrop {
  background-color: #0f172a;
}
.modal-backdrop.show {
  opacity: 0.55;
}
.modal.show .modal-dialog {
  transform: none;
}


/* Employee register + generic table action menus (fixed strategy) */
.employees-table-wrap,
.table-card > .table-responsive.employees-table-wrap {
  overflow: visible !important;
}
#employees-table td.col-actions { overflow: visible !important; }
.dropdown-menu.dropdown-menu-actions {
  position: absolute;
  z-index: 1080 !important;
}
body > .dropdown-menu.dropdown-menu-actions,
.dropdown-menu.dropdown-menu-fixed {
  position: fixed !important;
  z-index: 2000 !important;
}





/* ===== System-wide responsive action sheet + tables ===== */
body.hcm-as-open { overflow: hidden; }
.hcm-as-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.48);
  z-index: 3000;
  -webkit-tap-highlight-color: transparent;
}
.hcm-as-backdrop.show { display: block; }
.hcm-as-sheet {
  display: none;
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 3001;
  width: min(24rem, calc(100vw - 1.5rem));
  max-height: min(85vh, 36rem);
  overflow: auto;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.3);
  border: 1px solid #e2e8f0;
  -webkit-overflow-scrolling: touch;
}
.hcm-as-sheet.show { display: block; }
.hcm-as-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .9rem 1rem;
  border-bottom: 1px solid #e2e8f0;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
}
.hcm-as-close {
  border: 0;
  background: #f1f5f9;
  border-radius: 8px;
  width: 2.25rem;
  height: 2.25rem;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  color: #334155;
}
.hcm-as-body { padding: .5rem .65rem .85rem; }
.hcm-as-menu .dropdown-item,
.hcm-as-item {
  display: flex !important;
  align-items: center;
  gap: .5rem;
  width: 100% !important;
  padding: .7rem .8rem !important;
  border-radius: 10px !important;
  border: 0 !important;
  background: transparent !important;
  text-align: left !important;
  color: #0f172a !important;
  font-size: .925rem !important;
  white-space: normal !important;
  text-decoration: none !important;
}
.hcm-as-menu .dropdown-item:hover,
.hcm-as-item:hover { background: #f1f5f9 !important; }
.hcm-as-menu .dropdown-item.text-danger:hover { background: #fef2f2 !important; }
.hcm-as-menu .dropdown-item i { flex-shrink: 0; }
.hcm-as-menu li { list-style: none; }
.hcm-as-menu form { margin: 0; }
.hcm-as-menu label { display: block; margin-top: .35rem; font-size: .8rem; color: #64748b; }
.hcm-as-menu input,
.hcm-as-menu select,
.hcm-as-menu textarea {
  width: 100% !important;
  margin-bottom: .4rem;
  font-size: .875rem !important;
}
.hcm-as-menu .btn { width: 100%; margin-top: .25rem; }

/* Tables: always allow horizontal scroll; keep action column usable */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overflow-y: visible;
}
.table-responsive .table { margin-bottom: 0; min-width: 640px; }
@media (max-width: 767.98px) {
  .table-responsive .table { min-width: 520px; }
  .col-actions { position: sticky; right: 0; background: #fff; z-index: 2; box-shadow: -6px 0 8px rgba(15,23,42,.06); }
  .btn-actions { width: 2.25rem; height: 2.25rem; }
  .hcm-as-sheet {
    left: 0;
    right: 0;
    top: auto;
    bottom: 0;
    transform: none;
    width: 100%;
    max-width: 100%;
    max-height: 88vh;
    border-radius: 16px 16px 0 0;
  }
  .page-header h1 { font-size: 1.25rem; }
  .card-body { padding: .85rem; }
}

.btn-actions {
  width: 2rem;
  height: 2rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #334155;
  flex-shrink: 0;
}
.btn-actions:hover, .btn-actions:focus {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #0f172a;
}


/* Action sheet must never cover Bootstrap modals */
.modal { z-index: 3100 !important; }
.modal-backdrop { z-index: 3090 !important; }
.modal-backdrop.show { z-index: 3090 !important; }
body.hcm-as-open .modal { z-index: 3100 !important; }


/* Minimal live indicator — green blink only */
.dash-refresh-bar--minimal {
  padding: 0.35rem 0.65rem;
  border: none;
  background: transparent;
  box-shadow: none;
  margin-bottom: 0.5rem;
}
.dash-refresh-bar--minimal .dash-refresh-left {
  gap: 0;
}
.dash-refresh-dot.ok {
  animation: dashPulse 1.6s ease infinite;
}


/* v2 enterprise shell — Font Awesome + human-grade UI */
:root {
  --hc-font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --hc-radius: 12px;
  --hc-shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 8px 24px rgba(15, 23, 42, 0.06);
}
html { font-size: 15px; }
body {
  font-family: var(--hc-font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  color: #0f172a;
}
.sidebar .brand {
  letter-spacing: -0.02em;
  font-weight: 800;
}
.sidebar .nav-link {
  border-radius: 10px;
  transition: background .15s ease, color .15s ease, transform .12s ease;
}
.sidebar .nav-link:hover {
  transform: translateX(2px);
}
.sidebar .nav-link i.fa-solid,
.sidebar .nav-link i.fa-regular {
  width: 1.15rem;
  text-align: center;
  opacity: 0.92;
}
.card, .mui-card, .crm-card, .att-filter-card {
  border-radius: var(--hc-radius);
  box-shadow: var(--hc-shadow);
  border-color: #e2e8f0;
}
.btn {
  border-radius: 10px;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.btn:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible,
.nav-link:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}
.table thead th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  font-weight: 700;
}
.page-header h1, .crm-page-head h1, h1.h3 {
  letter-spacing: -0.025em;
  font-weight: 800;
}
.mui-kpi, .crm-kpi, .att-report-kpi {
  border-radius: 14px;
  transition: transform .15s ease, box-shadow .15s ease;
}
.mui-kpi:hover, .crm-kpi:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
}
.empty-state, .text-muted.py-4, .text-muted.py-5 {
  font-size: 0.92rem;
}
/* Prefer FA sizing parity with BI */
.fa-solid, .fa-regular, .fa-brands {
  line-height: 1;
}


/* logistics enterprise cards */
.crm-kpi {
  border-radius: 14px;
  color: #fff;
  padding: 1rem 1.1rem;
  box-shadow: 0 8px 24px rgba(15,23,42,.12);
}
.crm-kpi .l { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; opacity: .9; font-weight: 600; }
.crm-kpi .v { font-size: 1.45rem; font-weight: 800; letter-spacing: -0.03em; margin-top: .2rem; }


/* Portal hero solid colours (explicit — do not rely only on CSS vars) */
.portal-hero { color: #fff !important; }
.portal-hero-admin { background: linear-gradient(135deg, #5B21B6 0%, #4c1d95 100%) !important; }
.portal-hero-hr { background: linear-gradient(135deg, #1D4ED8 0%, #0b3db8 100%) !important; }
.portal-hero-finance { background: linear-gradient(135deg, #047857 0%, #065f46 100%) !important; }
.portal-hero-manager { background: linear-gradient(135deg, #3730A3 0%, #312e81 100%) !important; }
.portal-hero-employee { background: linear-gradient(135deg, #0E7490 0%, #155e75 100%) !important; }
.portal-hero-logistics { background: linear-gradient(135deg, #C2410C 0%, #9a3412 100%) !important; }
.portal-hero-default { background: linear-gradient(135deg, #1E3A5F 0%, #0f172a 100%) !important; }
.portal-hero h1, .portal-hero h2, .portal-hero .h4, .portal-hero .h5 { color: #fff !important; }
.portal-hero .btn-light { color: #0f172a !important; }
