/* Qivynex ERP — core styles */
:root {
    --sidebar-w: 260px;
    --sidebar-bg: #0f172a;
    --sidebar-fg: #cbd5e1;
    --sidebar-muted: #64748b;
    --accent: #2563eb;
    --page-bg: #f4f6fa;
    --border: #e5e8ef;
    --bs-primary: #2563eb;
    --bs-body-font-family: 'Inter', 'IBM Plex Sans Arabic', system-ui, sans-serif;
}
[dir="rtl"] { --bs-body-font-family: 'IBM Plex Sans Arabic', 'Inter', system-ui, sans-serif; }

body { font-family: var(--bs-body-font-family); background: var(--page-bg); color: #1e293b; }
.btn-primary { --bs-btn-bg: var(--accent); --bs-btn-border-color: var(--accent); --bs-btn-hover-bg: #1d4ed8; --bs-btn-hover-border-color: #1d4ed8; }
a { color: var(--accent); }

/* ---------- Shell ---------- */
.sidebar {
    position: fixed; inset-block: 0; inset-inline-start: 0; width: var(--sidebar-w);
    background: var(--sidebar-bg); color: var(--sidebar-fg); overflow-y: auto; z-index: 1040;
    padding: 1rem .75rem 2rem; transition: transform .2s ease;
}
.main { margin-inline-start: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: .75rem; padding: .25rem .5rem 1.25rem; text-decoration: none; color: #fff; }
.brand-logo { width: 38px; height: 38px; object-fit: contain; background: #fff; border-radius: 8px; padding: 3px; }
.brand-mark {
    width: 38px; height: 38px; border-radius: 10px; display: inline-grid; place-items: center;
    background: linear-gradient(135deg, #3b82f6, #6366f1); color: #fff; font-weight: 700; font-size: 1.1rem; flex-shrink: 0;
}
.brand-mark.lg { width: 56px; height: 56px; font-size: 1.6rem; border-radius: 14px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand-text strong { font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text small { color: var(--sidebar-muted); font-size: .72rem; }
.nav-label { text-transform: uppercase; letter-spacing: .06em; font-size: .68rem; color: var(--sidebar-muted); padding: 1rem .75rem .4rem; }
[dir="rtl"] .nav-label { letter-spacing: 0; }
.nav-section { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
    display: flex; align-items: center; gap: .7rem; padding: .55rem .75rem; border-radius: 8px;
    color: var(--sidebar-fg); text-decoration: none; font-size: .9rem;
}
.nav-item i { font-size: 1.05rem; width: 1.2rem; text-align: center; color: var(--mod, inherit); }
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active { background: rgba(59,130,246,.18); color: #fff; }

.topbar {
    position: sticky; top: 0; z-index: 1030; height: 60px; background: #fff; border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 1rem; padding: 0 1.5rem;
}
.topbar-title { font-weight: 600; color: #475569; }
.topbar-actions { margin-inline-start: auto; display: flex; align-items: center; gap: .5rem; }
.btn-icon { font-size: 1.4rem; padding: 0 .25rem; }
.user-btn { display: flex; align-items: center; gap: .5rem; border: 0; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: #e0e7ff; color: #3730a3; display: inline-grid; place-items: center; font-weight: 600; font-size: .8rem; }
.content { padding: 1.5rem; flex: 1; }

.nav-backdrop { display: none; }
@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); }
    [dir="rtl"] .sidebar { transform: translateX(100%); }
    .main { margin-inline-start: 0; }
    .nav-open .sidebar { transform: none; }
    .nav-open .nav-backdrop { display: block; position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 1035; }
    .content { padding: 1rem; }
    .topbar { padding: 0 1rem; }
}

/* ---------- Components ---------- */
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.section-title { font-size: .95rem; font-weight: 600; color: #475569; margin: 0 0 .75rem; }
.card { border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.card-header { background: #fff; border-bottom: 1px solid var(--border); font-weight: 600; font-size: .9rem; padding: .85rem 1rem; }
.card > .table-responsive > .table th, .card > .table th { font-size: .75rem; text-transform: uppercase; color: #64748b; font-weight: 600; background: #f8fafc; }
[dir="rtl"] .card .table th { text-transform: none; }

.stat-card {
    background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 1rem 1.1rem;
    display: flex; align-items: center; gap: .9rem; height: 100%;
}
.stat-icon { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; font-size: 1.25rem;
    color: var(--c); background: color-mix(in srgb, var(--c) 12%, white); flex-shrink: 0; }
.stat-value { font-size: 1.45rem; font-weight: 700; line-height: 1.1; }
.stat-label { font-size: .8rem; color: #64748b; }

.module-tile {
    display: flex; flex-direction: column; gap: .35rem; height: 100%; padding: 1.1rem; background: #fff;
    border: 1px solid var(--border); border-radius: 12px; text-decoration: none; color: inherit;
    border-top: 3px solid var(--mod); transition: transform .12s ease, box-shadow .12s ease;
}
.module-tile:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(16,24,40,.08); color: inherit; }
.module-icon { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; font-size: 1.2rem;
    color: var(--mod); background: color-mix(in srgb, var(--mod) 12%, white); flex-shrink: 0; }
.module-icon.lg { width: 56px; height: 56px; font-size: 1.6rem; border-radius: 14px; }
.module-name { font-weight: 600; margin-top: .35rem; }
.module-desc { font-size: .8rem; color: #64748b; }
.module-kpis { display: flex; gap: 1rem; font-size: .8rem; color: #475569; margin-top: auto; padding-top: .5rem; }
.module-hero { display: flex; align-items: center; gap: 1rem; background: #fff; border: 1px solid var(--border);
    border-inline-start: 4px solid var(--mod); border-radius: 12px; padding: 1.25rem; margin-bottom: 1.25rem; }
.module-toggle { display: flex; align-items: center; gap: .9rem; background: #fff; border: 1px solid var(--border);
    border-radius: 12px; padding: 1rem; cursor: pointer; height: 100%; }

.empty-box { background: #fff; border: 1px dashed #cbd5e1; border-radius: 12px; padding: 1.5rem; color: #64748b; text-align: center; justify-content: center; }
.activity-list { max-height: 330px; overflow-y: auto; }
.activity-list .list-group-item { font-size: .85rem; }

.error-page { text-align: center; padding: 5rem 1rem; }
.error-code { font-size: 4.5rem; font-weight: 700; color: #cbd5e1; line-height: 1; margin-bottom: 1rem; }

/* ---------- Login ---------- */
.blank { background: #fff; }
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.login-side {
    background: radial-gradient(circle at 20% 20%, #1e3a8a 0, #0f172a 60%); color: #e2e8f0;
    padding: 3.5rem; display: flex; flex-direction: column; justify-content: space-between;
}
.login-side h1 { font-size: 2rem; font-weight: 700; margin: 1.25rem 0 .25rem; color: #fff; }
.login-side p { color: #94a3b8; }
.login-mods { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: .6rem 1.5rem; font-size: .9rem; color: #cbd5e1; }
.login-mods i { color: #60a5fa; margin-inline-end: .4rem; }
.login-form { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 2rem; }
.login-card { width: 100%; max-width: 380px; }
.login-logo { max-height: 48px; }
@media (max-width: 991.98px) {
    .login-wrap { grid-template-columns: 1fr; }
    .login-side { display: none; }
}

/* ---------- Module sub-navigation ---------- */
.subnav { display: flex; gap: .25rem; overflow-x: auto; background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: .35rem; scrollbar-width: thin; }
.subnav a { white-space: nowrap; padding: .45rem .8rem; border-radius: 8px; color: #475569; text-decoration: none; font-size: .88rem; }
.subnav a:hover { background: #f1f5f9; }
.subnav a.active { background: #eff6ff; color: var(--accent); font-weight: 600; }

/* ---------- HR ---------- */
.emp-avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
.emp-photo { width: 72px; height: 72px; border-radius: 16px; object-fit: cover; flex-shrink: 0; }
.emp-photo-ph { display: grid; place-items: center; background: #e0e7ff; color: #3730a3; font-size: 1.8rem; font-weight: 700; }
.att-chip { text-decoration: none; display: inline-flex; align-items: center; gap: .35rem; background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: .3rem .6rem; color: inherit; }
.att-grid td, .att-grid th { padding: .3rem .35rem; font-size: .78rem; }
.att-grid .sticky-col { position: sticky; inset-inline-start: 0; background: #fff; z-index: 1; min-width: 170px; }
.att-present { background: #dcfce7; color: #166534; }
.att-late { background: #fef3c7; color: #92400e; font-weight: 600; }
.att-absent { background: #fee2e2; color: #991b1b; font-weight: 600; }
.att-leave { background: #e0f2fe; color: #075985; }
.att-holiday { background: #e0e7ff; color: #3730a3; }
.att-weekend { background: #f8fafc; color: #94a3b8; }
.att-future, .att-na { background: #fff; color: #cbd5e1; }
.att-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(30px, 1fr)); gap: 4px; }
.att-strip span { text-align: center; border-radius: 6px; padding: .3rem 0; font-size: .75rem; border: 1px solid #eef1f5; }
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(240px, 1fr); gap: .75rem; overflow-x: auto; padding-bottom: .5rem; }
.kanban-col { background: #f1f5f9; border-radius: 12px; padding: .6rem; border-top: 3px solid var(--mod); min-height: 200px; }
.kanban-head { font-weight: 600; font-size: .85rem; margin-bottom: .6rem; display: flex; justify-content: space-between; align-items: center; }
.kanban-card { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: .65rem; margin-bottom: .5rem; }
.kanban-card select { width: auto; font-size: .75rem; }

/* ---------- Accordion module menu ---------- */
.nav-mod-btn, .nav-grp-btn { width: 100%; background: none; border: 0; text-align: start; cursor: pointer; }
.nav-mod-btn .chev, .nav-grp-btn .chev { margin-inline-start: auto; font-size: .7rem; transition: transform .15s ease; opacity: .6; width: auto; }
.nav-mod.open > .nav-mod-btn .chev, .nav-grp.open > .nav-grp-btn .chev { transform: rotate(180deg); }
.nav-mod.open > .nav-mod-btn { color: #fff; }
.nav-mod-body, .nav-grp-body { display: none; }
.nav-mod.open > .nav-mod-body, .nav-grp.open > .nav-grp-body { display: block; }
.nav-mod-body { padding: .2rem 0 .4rem; margin-inline-start: 1.05rem; border-inline-start: 1px solid rgba(255,255,255,.08); }
.nav-grp-btn { display: flex; align-items: center; gap: .55rem; color: #94a3b8; font-size: .82rem; padding: .45rem .7rem; border-radius: 6px; }
.nav-grp-btn:hover { color: #fff; background: rgba(255,255,255,.04); }
.nav-grp-btn i:first-child { font-size: .9rem; width: 1rem; text-align: center; }
.nav-grp.open > .nav-grp-btn { color: #e2e8f0; }
.nav-sub { display: flex; align-items: center; gap: .5rem; color: #94a3b8; text-decoration: none; font-size: .8rem; padding: .38rem .7rem; border-radius: 6px; line-height: 1.3; }
.nav-sub:hover { color: #fff; background: rgba(255,255,255,.05); }
.nav-sub.active { color: #fff; background: rgba(59,130,246,.22); }
.nav-leaf { padding-inline-start: 2.3rem; }
.subnav { display: none; }
@media print {
  .sidebar, .topbar, .no-print, .nav-backdrop { display: none !important; }
  .main { margin: 0 !important; }
  .content { padding: 0 !important; }
  body { background: #fff; }
  .card { border: 0; box-shadow: none; }
}
.alert-menu { width: 320px; max-height: 420px; overflow-y: auto; }
.alert-badge { font-size: .62rem; }

/* ---------- Card Studio ---------- */
.studio-body { display: grid; grid-template-columns: 220px 1fr 260px; gap: .75rem; align-items: start; }
@media (max-width: 1199.98px) { .studio-body { grid-template-columns: 1fr; } }
.tool-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: #64748b; margin: .6rem 0 .3rem; }
.tool-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.tool-grid button { border: 1px solid var(--border); background: #fff; border-radius: 8px; padding: .4rem .2rem; font-size: .68rem; display: flex; flex-direction: column; align-items: center; gap: 2px; color: #334155; }
.tool-grid button i { font-size: 1rem; color: var(--accent); }
.tool-grid button:hover { background: #eff6ff; }
.layer-list { list-style: none; padding: 0; margin: 0; max-height: 260px; overflow-y: auto; font-size: .78rem; }
.layer-list li { padding: .3rem .5rem; border-radius: 6px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.layer-list li:hover { background: #f1f5f9; }
.layer-list li.active { background: #eff6ff; color: var(--accent); font-weight: 600; }
.studio-stage { padding: 2rem; overflow: auto; display: flex; justify-content: center; align-items: center; min-height: 460px; background: repeating-conic-gradient(#f1f5f9 0% 25%, #fff 0% 50%) 50% / 16px 16px; }
.stage { position: relative; box-shadow: 0 6px 24px rgba(15,23,42,.18); border-radius: 3mm; flex-shrink: 0; }
.stage canvas { display: block; border-radius: inherit; }
.stage.grid::after { content: ''; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
    background-image: linear-gradient(rgba(37,99,235,.08) 1px, transparent 1px), linear-gradient(90deg, rgba(37,99,235,.08) 1px, transparent 1px); background-size: inherit; }
.overlay { position: absolute; inset: 0; z-index: 2; }
.el-box { position: absolute; cursor: move; outline: 1px dashed transparent; }
.el-box:hover { outline-color: rgba(37,99,235,.5); }
.el-box.selected { outline: 1.5px solid #2563eb; background: rgba(37,99,235,.04); }
.el-box .rs { position: absolute; right: -5px; bottom: -5px; width: 10px; height: 10px; background: #2563eb; border: 2px solid #fff; border-radius: 50%; cursor: nwse-resize; }
.studio-props .form-control-color { height: 31px; }

/* Live search / quick filters for tables */
.table-tools { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding: .6rem .75rem; border-bottom: 1px solid var(--bs-border-color); background: var(--bs-tertiary-bg, #f8fafc); }
.card > .table-tools:first-child { border-top-left-radius: inherit; border-top-right-radius: inherit; }
.table-tools .tt-search-wrap { position: relative; flex: 1 1 220px; max-width: 340px; }
.table-tools .tt-search-wrap i { position: absolute; inset-inline-start: .6rem; top: 50%; transform: translateY(-50%); color: var(--bs-secondary-color); font-size: .8rem; }
.table-tools .tt-search { padding-inline-start: 1.8rem; }
.table-tools .tt-select { width: auto; max-width: 220px; }
.table-tools.tt-active { background: #eff6ff; }
th.tt-sortable { cursor: pointer; user-select: none; white-space: nowrap; }
th.tt-sortable::after { content: '\2195'; opacity: .25; margin-inline-start: .3rem; font-size: .75em; }
th.tt-sortable[data-sort="asc"]::after { content: '\2191'; opacity: .8; }
th.tt-sortable[data-sort="desc"]::after { content: '\2193'; opacity: .8; }
@media print { .table-tools { display: none !important; } tr.d-none { display: none !important; } }

/* Searchable dropdowns */
.ss { position: relative; min-width: 0; }
.ss .ss-native { position: absolute; inset: auto 0 0 0; width: 100%; height: 1px; opacity: 0; pointer-events: none; padding: 0; border: 0; }
.ss-btn { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background-color: var(--bs-body-bg); }
.ss-btn.is-invalid { border-color: var(--bs-danger); }
.ss-panel { display: none; position: absolute; z-index: 1060; inset-inline-start: 0; top: calc(100% + 2px); min-width: 100%; width: max-content; max-width: min(460px, 92vw);
    background: var(--bs-body-bg); border: 1px solid var(--bs-border-color); border-radius: .5rem; padding: .4rem; }
.ss.open .ss-panel { display: block; }
.ss-list { max-height: 280px; overflow: auto; margin-top: .35rem; }
.ss-item { padding: .3rem .55rem; border-radius: .35rem; cursor: pointer; font-size: .875rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ss-item.active { background: var(--bs-primary-bg-subtle, #e0e7ff); }
.ss-item.sel { font-weight: 600; }
.ss-item.disabled { opacity: .45; cursor: default; }
.ss-group { font-size: .72rem; text-transform: uppercase; letter-spacing: .03em; color: var(--bs-secondary-color); padding: .4rem .55rem .15rem; }
.ss-empty { padding: .4rem .55rem; color: var(--bs-secondary-color); font-size: .85rem; }
.d-flex > .ss { flex: 0 1 auto; }
@media print { .ss-panel { display: none !important; } }

/* =====================================================================
   ERP theme v2 — denser, calmer, consistent (overrides the rules above)
   ===================================================================== */
html { font-size: 14px; }
:root {
    --sidebar-w: 248px;
    --page-bg: #f5f7fb;
    --border: #e4e7ee;
    --text: #1e293b;
    --muted: #64748b;
    --head-bg: #f8fafc;
    --radius: 10px;
    --bs-border-color: #e4e7ee;
    --bs-link-color-rgb: 37, 99, 235;
}
body { color: var(--text); -webkit-font-smoothing: antialiased; }

/* Links: no underline except on hover */
a { text-decoration: none; }
a:hover { text-decoration: underline; }
.btn:hover, .nav-item:hover, .dropdown-item:hover, .module-tile:hover, .nav-link:hover, .list-group-item-action:hover, .subnav a:hover { text-decoration: none; }

/* Shell */
.sidebar { padding: .85rem .6rem 2rem; }
.brand { padding: .2rem .45rem 1rem; }
.nav-item { padding: .45rem .7rem; font-size: .93rem; border-radius: 7px; }
.nav-label { padding: .9rem .7rem .35rem; }
.topbar { height: 52px; padding: 0 1.25rem; box-shadow: 0 1px 0 rgba(15, 23, 42, .02); }
.topbar-title { font-size: 1rem; }
.topbar-crumbs { display: flex; align-items: center; gap: .45rem; min-width: 0; font-size: .93rem; color: var(--muted); overflow: hidden; white-space: nowrap; }
.topbar-crumbs a { color: var(--muted); }
.topbar-crumbs a:hover { color: var(--accent); }
.topbar-crumbs .sep { font-size: .7rem; opacity: .6; }
.topbar-crumbs .current { color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 767.98px) { .topbar-crumbs > :not(.current):not(:last-child), .topbar-crumbs .sep { display: none; } }
.content { padding: 1.25rem 1.5rem 2rem; }
@media (max-width: 991.98px) { .content { padding: .9rem; } }

/* Page header */
.page-head { margin-bottom: 1rem; gap: .75rem; }
.page-head h1, .page-head .h4 { font-size: 1.36rem; font-weight: 650; letter-spacing: -.01em; margin: 0; }
.page-head .btn { white-space: nowrap; }

/* Cards */
.card { border-radius: var(--radius); border-color: var(--border); box-shadow: 0 1px 2px rgba(16, 24, 40, .035); }
.card-header { padding: .7rem 1rem; font-size: .93rem; background: #fff; border-top-left-radius: var(--radius) !important; border-top-right-radius: var(--radius) !important; }
.card-body { padding: 1rem; }
.card-footer { background: #fff; border-color: var(--border); }
.stat-card { border-radius: var(--radius); padding: .85rem 1rem; }
.stat-value { font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.stat-label { font-size: .82rem; }

/* Tables: compact, readable, numeric alignment */
.table { --bs-table-hover-bg: #f6f8fc; margin-bottom: 0; font-variant-numeric: tabular-nums; }
.table > :not(caption) > * > * { padding: .5rem .75rem; border-bottom-color: #eef0f5; }
.table-sm > :not(caption) > * > * { padding: .38rem .6rem; }
.table thead th, .card .table th { font-size: .74rem; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; color: var(--muted); background: var(--head-bg); white-space: nowrap; vertical-align: middle; }
[dir="rtl"] .table thead th { letter-spacing: 0; text-transform: none; font-size: .82rem; }
.table td { vertical-align: middle; }
.table td > a:first-child:not(.btn), .table td > strong { white-space: nowrap; }
.table td > a:not(.btn):not(.badge) { color: #0f172a; font-weight: 500; }
.table td > a:not(.btn):not(.badge):hover { color: var(--accent); }
.table td .small, .table td small { line-height: 1.35; }
.table tfoot th, .table tfoot td { background: var(--head-bg); font-weight: 600; }
.table-sticky-first th:first-child, .table-sticky-first td:first-child { position: sticky; inset-inline-start: 0; z-index: 1; background: #fff; box-shadow: inset -1px 0 0 var(--border); }
[dir="rtl"] .table-sticky-first th:first-child, [dir="rtl"] .table-sticky-first td:first-child { box-shadow: inset 1px 0 0 var(--border); }
.table-sticky-first thead th:first-child { background: var(--head-bg); z-index: 2; }
.table-hover.table-sticky-first > tbody > tr:hover > td:first-child { background: #f6f8fc; }
td.col-status { min-width: 190px; max-width: 280px; }
.card > .table-responsive:last-child, .card > .table-responsive:last-child .table { border-bottom-left-radius: var(--radius); border-bottom-right-radius: var(--radius); }

/* Forms */
.form-label { font-size: .86rem; font-weight: 500; color: #475569; margin-bottom: .3rem; }
.form-control, .form-select { border-color: #d7dce5; }
.form-control:focus, .form-select:focus { border-color: #93b4f6; box-shadow: 0 0 0 .2rem rgba(37, 99, 235, .12); }
.form-text { font-size: .8rem; }
.btn { font-weight: 500; }
.btn-light { --bs-btn-bg: #fff; --bs-btn-border-color: #d7dce5; --bs-btn-hover-bg: #f3f5f9; --bs-btn-hover-border-color: #cbd2de; }

/* Soft status badges (ERP style) */
.badge { font-weight: 600; letter-spacing: .01em; padding: .32em .6em; border-radius: 6px; }
.badge.text-bg-success { background: #dcfce7 !important; color: #166534 !important; }
.badge.text-bg-warning { background: #fef3c7 !important; color: #92400e !important; }
.badge.text-bg-danger { background: #fee2e2 !important; color: #991b1b !important; }
.badge.text-bg-info { background: #e0f2fe !important; color: #075985 !important; }
.badge.text-bg-primary { background: #dbeafe !important; color: #1e40af !important; }
.badge.text-bg-secondary { background: #eef0f4 !important; color: #475569 !important; }
.badge.text-bg-light { background: #f8fafc !important; color: #475569 !important; }
.badge.bg-danger.alert-badge { background: #ef4444 !important; color: #fff !important; }

/* Tabs & pills */
.nav-tabs { border-bottom-color: var(--border); gap: .15rem; }
.nav-tabs .nav-link { color: var(--muted); border: 0; border-bottom: 2px solid transparent; padding: .55rem .9rem; font-weight: 500; }
.nav-tabs .nav-link:hover { color: var(--text); border-bottom-color: #cbd5e1; }
.nav-tabs .nav-link.active { color: var(--accent); background: transparent; border-bottom-color: var(--accent); }
.nav-pills .nav-link { color: var(--muted); font-weight: 500; padding: .35rem .8rem; }
.nav-pills .nav-link.active { background: var(--accent); color: #fff; }

/* Alerts / flash */
.alert { border-radius: var(--radius); padding: .7rem 1rem; font-size: .95rem; }

/* Live search toolbar & quick filters */
.table-tools { padding: .5rem .75rem; background: #fff; }
.card > .table-tools:first-child { border-radius: var(--radius) var(--radius) 0 0; }
.table-tools .tt-search { height: 32px; }

/* Lists inside cards */
.list-group-item { border-color: #eef0f5; padding: .6rem 1rem; }

/* Empty states */
.empty-box { padding: 2rem 1rem; font-size: .95rem; }

/* Header action groups wrap on small screens */
@media (max-width: 767.98px) { .page-head > div, .page-head > form { flex-wrap: wrap; } }
@media (max-width: 575.98px) {
    .page-head { align-items: stretch; }
    .page-head .nav-pills { flex-wrap: wrap; }
    .topbar-actions .lang-btn { padding-inline: .45rem; }
}
.topbar-actions .lang-btn { white-space: nowrap; }

/* Print: clean sheet */
@media print {
    .sidebar, .topbar, .table-tools, .no-print { display: none !important; }
    .main { margin: 0 !important; }
    .content { padding: 0 !important; }
    .card { border: 0; box-shadow: none; }
}
.onleave-strip { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .5rem; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: .5rem .75rem; }
.onleave-chip { font-size: .85rem; background: #f1f5f9; border-radius: 999px; padding: .15rem .65rem; color: var(--text); }
.onleave-chip:hover { background: #e2e8f0; text-decoration: none; }
