﻿/* ==========================================================================
   LehoraHR theme - "Navy & Indigo"
   Sits on top of Bootstrap 5 (load AFTER bootstrap.min.css).
   Bootstrap = grid, forms, buttons, dropdowns, JS.  This file = our look.
   To re-brand later, change the tokens in :root only.
   ========================================================================== */

:root {
    /* Brand (indigo) */
    --hr-brand: #4f52e6;
    --hr-brand-600: #4245cf;
    --hr-brand-700: #3336b0;
    --hr-brand-200: #c4c6fb;
    --hr-brand-100: #e1e2fe;
    --hr-brand-50: #f0f0ff;

    /* Navy (sidebar, auth panel, tooltips) */
    --hr-navy: #11134a;
    --hr-navy-900: #090a2c;

    /* Surfaces & ink */
    --hr-bg: #ffffff;           /* page background */
    --hr-tint: #f6f6ff;         /* light indigo tint for headers / hovers */
    --hr-surface: #ffffff;
    --hr-ink: #14163a;
    --hr-muted: #6b6e8f;
    --hr-line: #e8e9f4;

    /* Status (always paired with a text label) */
    --hr-success: #15803d;  --hr-success-bg: #e7f6ed;
    --hr-warning: #b45309;  --hr-warning-bg: #fdf2e1;
    --hr-danger:  #c42a3a;  --hr-danger-bg:  #fdebee;
    --hr-neutral: #5d6080;  --hr-neutral-bg: #eeeff6;

    --hr-radius: 18px;
    --hr-radius-sm: 12px;
    --hr-shadow: 0 0 0 1px rgba(0, 0, 0, .02), 0 1px 4px rgba(0, 0, 0, .05);   /* very light, sits close to the border */
    --hr-shadow-brand: 0 3px 10px rgba(79, 82, 230, .22);

    --hr-sidebar-w: 236px;
    --hr-sidebar-w-collapsed: 76px;

    /* Hand Bootstrap our values */
    --bs-body-font-family: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --bs-body-font-size: .8125rem;   /* 13px base */
    --bs-body-color: var(--hr-ink);
    --bs-body-bg: var(--hr-bg);
    --bs-border-color: var(--hr-line);
    --bs-primary: var(--hr-brand);
    --bs-primary-rgb: 79, 82, 230;
    --bs-link-color: var(--hr-brand);
    --bs-link-color-rgb: 79, 82, 230;
    --bs-link-hover-color: var(--hr-brand-700);
    --bs-secondary-color: var(--hr-muted);
}

body { background: var(--hr-bg); color: var(--hr-ink); }

/* Thin rounded scrollbars everywhere (same style as the sidebar), no arrow buttons */
* { scrollbar-width: thin; scrollbar-color: #c9cbe3 transparent; }
*:hover { scrollbar-color: #a9acd6 transparent; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c9cbe3; border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: #a9acd6; }
::-webkit-scrollbar-button { display: none; }
h1, h2, h3, h4, h5, h6 { color: var(--hr-ink); font-weight: 600; letter-spacing: -.01em; }
.text-muted { color: var(--hr-muted) !important; }
.text-warning { color: var(--hr-warning) !important; }   /* readable amber instead of Bootstrap's light yellow */
.text-brand { color: var(--hr-brand) !important; }
.fs-7 { font-size: .78rem; }
.min-w-0 { min-width: 0; }
.tabular { font-variant-numeric: tabular-nums; }
a { text-decoration: none; }

/* ---------- Buttons ---------- */
.btn { border-radius: 10px; font-weight: 500; font-size: .8rem; padding: .45rem .9rem; }
.btn-sm { padding: .3rem .65rem; font-size: .78rem; border-radius: 9px; }
.btn-lg { padding: .75rem 1.2rem; font-size: .95rem; }
.btn-primary {
    --bs-btn-bg: var(--hr-brand); --bs-btn-border-color: var(--hr-brand);
    --bs-btn-hover-bg: var(--hr-brand-600); --bs-btn-hover-border-color: var(--hr-brand-600);
    --bs-btn-active-bg: var(--hr-brand-700); --bs-btn-active-border-color: var(--hr-brand-700);
    --bs-btn-disabled-bg: var(--hr-brand); --bs-btn-disabled-border-color: var(--hr-brand);
    box-shadow: 0 2px 6px rgba(79, 82, 230, .2);
}
.btn-light { --bs-btn-bg: var(--hr-surface); --bs-btn-border-color: var(--hr-line); --bs-btn-hover-bg: var(--hr-brand-50); --bs-btn-hover-border-color: var(--hr-brand-100); --bs-btn-color: var(--hr-ink); --bs-btn-active-bg: var(--hr-brand-100); }
.btn-soft { background: var(--hr-brand-50); color: var(--hr-brand); border: 1px solid transparent; }
.btn-soft:hover { background: var(--hr-brand-100); color: var(--hr-brand-700); }
.btn-link-brand { color: var(--hr-brand); font-weight: 600; padding: 0; background: none; border: 0; display: inline-flex; align-items: center; gap: .35rem; }
.btn-link-brand:hover { color: var(--hr-brand-700); }
.btn-icon { width: 36px; height: 36px; padding: 0; display: inline-grid; place-items: center; }
.btn-icon.btn-sm { width: 30px; height: 30px; }
.chev { width: 26px; height: 26px; border-radius: 8px; display: inline-grid; place-items: center; background: var(--hr-surface); border: 1px solid var(--hr-brand-100) !important; color: var(--hr-ink); border: 0; flex: none; }
.chev:hover { background: var(--hr-brand-100); color: var(--hr-brand); }

/* ==========================================================================
   App shell: floating navy sidebar + content
   ========================================================================== */
.app-sidebar {
    position: fixed; top: 0; bottom: 0; left: 0;
    width: var(--hr-sidebar-w); z-index: 1040;
    color: #fff; overflow: hidden;
    background:
        radial-gradient(120% 45% at 50% 105%, rgba(79, 82, 230, .55), transparent 70%),
        linear-gradient(180deg, var(--hr-navy) 0%, var(--hr-navy-900) 100%);
    display: flex; flex-direction: column;
    transition: width .25s ease, transform .25s ease;
}
.sb-brand { display: flex; align-items: center; gap: .65rem; padding: 1rem 1.2rem .75rem; color: #fff; white-space: nowrap; }
.sb-brand:hover { color: #fff; }
.sb-logo { width: 34px; height: 34px; border-radius: 12px; background: var(--hr-brand); display: grid; place-items: center; font-weight: 700; font-size: 1.05rem; flex: none; box-shadow: var(--hr-shadow-brand); }
.sb-brand-name { font-weight: 700; font-size: .95rem; line-height: 1.1; }
.sb-brand-name small { display: block; font-weight: 400; font-size: .68rem; opacity: .6; }

.sb-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; padding: .25rem .9rem 1rem; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.2) transparent; }
.sb-section { font-size: .64rem; text-transform: uppercase; letter-spacing: .1em; opacity: .45; padding: 1rem .6rem .45rem; font-weight: 600; white-space: nowrap; }
.sb-nav { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.sb-link {
    display: flex; align-items: center; gap: .75rem; padding: .52rem .75rem; font-size: .82rem;
    color: rgba(255,255,255,.66); font-weight: 500; border-radius: 12px; white-space: nowrap;
    transition: background .15s, color .15s;
}
.sb-link i { font-size: 1rem; width: 1.3rem; text-align: center; flex: none; }
.sb-link:hover { color: #fff; background: rgba(255,255,255,.08); border-radius: 0; }
.sb-link { border: 1px solid transparent; }
/* Active menu item: white block, square corners, text and icon in the theme colour */
.sb-link.active {
    color: var(--hr-brand);
    background: #fff;
    border-color: #fff;
    border-radius: 0;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.sb-link.active i { color: var(--hr-brand); }
.sb-link .badge { margin-left: auto; background: rgba(255,255,255,.14); font-weight: 600; }
.sb-link.active .badge { background: var(--hr-brand); color: #fff; }

/* Sub menu (e.g. Masters): full width like the main menu, text lined up with the main menu labels */
.sb-sub { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 4px; }
.sb-sub a {
    display: flex; align-items: center; gap: .6rem;
    padding: .52rem .75rem .52rem 2.8rem;          /* 2.8rem = icon width + gap, so text starts under the parent label */
    color: rgba(255,255,255,.6); font-size: .82rem; font-weight: 500; white-space: nowrap;
    border: 1px solid transparent; border-radius: 0; transition: background .15s, color .15s;
}
.sb-sub a::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .55; flex: none; }
.sb-sub a:hover { color: #fff; background: rgba(255,255,255,.08); }
/* Selected sub item: same white block as an active main menu item */
.sb-sub a.active {
    color: var(--hr-brand); background: #fff; border-color: #fff; font-weight: 600;
    box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.sb-sub a.active::before { opacity: 1; }
/* Opened group parent: no grey block, just brighter text */
.sb-link[data-bs-toggle="collapse"]:not(.collapsed) { color: #fff; background: transparent; }
.sb-link[data-bs-toggle="collapse"]:not(.collapsed):hover { background: rgba(255,255,255,.08); }
.sb-link:focus-visible { outline: 0; box-shadow: inset 0 0 0 1px rgba(255,255,255,.35); }
.sb-link[data-bs-toggle="collapse"] .bi-chevron-down { margin-left: auto; font-size: .7rem; width: auto; transition: transform .2s; }
.sb-link[data-bs-toggle="collapse"]:not(.collapsed) .bi-chevron-down { transform: rotate(180deg); }

.sb-footer { padding: .75rem .9rem 1rem; display: grid; gap: .5rem; }

/* Tooltip shown next to sidebar icons when the menu is collapsed */
.sb-tip { --bs-tooltip-bg: var(--hr-navy); --bs-tooltip-font-size: .78rem; --bs-tooltip-padding-x: .7rem; --bs-tooltip-padding-y: .4rem; --bs-tooltip-border-radius: 8px; }
.sb-collapse-btn { display: flex; align-items: center; gap: .8rem; padding: .5rem .75rem; border: 0; border-radius: 12px; background: transparent; color: rgba(255,255,255,.55); font-size: .78rem; white-space: nowrap; }
.sb-collapse-btn:hover { color: #fff; background: rgba(255,255,255,.07); }
.sb-collapse-btn i { font-size: 1.05rem; width: 1.3rem; text-align: center; transition: transform .25s; }

.app-main { margin-left: var(--hr-sidebar-w); min-height: 100vh; display: flex; flex-direction: column; transition: margin-left .25s ease; }
.app-topbar { position: sticky; top: 0; z-index: 1020; display: flex; align-items: center; gap: 1rem; padding: .55rem 1.5rem; min-height: 62px; background: rgba(255,255,255,.95); backdrop-filter: blur(8px); box-shadow: 0 1px 4px rgba(0, 0, 0, .06); margin-bottom: 1.25rem; }
.page-title { font-size: 1.05rem; font-weight: 600; margin: 0; line-height: 1.3; letter-spacing: -.01em; }
.page-title strong { font-weight: 600; color: var(--hr-brand); }
.page-subtitle { color: var(--hr-muted); font-size: .72rem; margin: .1rem 0 0; display: flex; align-items: center; gap: .15rem; flex-wrap: wrap; }
.page-subtitle .sep { margin: 0 .35rem; opacity: .5; }
.page-subtitle .text-brand { font-weight: 600; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: .45rem; }
.topbar-divider { width: 1px; height: 22px; background: var(--hr-line); margin: 0 .3rem; }
.topbar-branch { position: relative; }
.topbar-branch > i { position: absolute; left: .7rem; top: 50%; transform: translateY(-50%); z-index: 3; color: var(--hr-brand); font-size: .85rem; pointer-events: none; }
.topbar-branch .ts-wrapper.form-select { min-width: 170px; height: 36px; border-radius: 10px; background-color: var(--hr-tint); border-color: var(--hr-brand-100); }
.topbar-branch .ts-wrapper.form-select .ts-control { padding: 0 2rem 0 2rem; height: 34px; font-size: .78rem; font-weight: 600; }
.topbar-branch .ts-wrapper .ts-control .item { color: var(--hr-brand-700); }
.icon-btn { position: relative; width: 36px; height: 36px; border-radius: 10px; border: 1px solid transparent; background: transparent; display: grid; place-items: center; color: var(--hr-ink); }
.icon-btn:hover { background: var(--hr-tint); border-color: var(--hr-brand-100); color: var(--hr-brand); }
.user-chip { display: flex; align-items: center; gap: .55rem; height: 40px; padding: 0 .5rem 0 .2rem; border-radius: 12px; border: 1px solid transparent; color: var(--hr-ink); }
.user-chip .avatar { width: 32px; height: 32px; border-radius: 10px; background: var(--hr-brand); color: #fff; }
.user-chip:hover { background: var(--hr-tint); border-color: var(--hr-brand-100); color: var(--hr-ink); }
.user-chip .meta { line-height: 1.15; font-size: .74rem; font-weight: 600; white-space: nowrap; }
.user-chip .meta span { display: block; color: var(--hr-muted); font-size: .66rem; font-weight: 400; }
.icon-btn .dot { position: absolute; top: 7px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: #22c3ee; border: 2px solid var(--hr-surface); }

.app-content { flex: 1; padding: 0 1.5rem 1.5rem; }
/* Page card (list / form screens): fills the screen down to the footer; grows taller when content is longer.
   Usage: <div class="card card-page"> */
.app-content:has(> .card-page) { display: flex; flex-direction: column; }
.card-page { flex: 1 0 auto; }
/* Theme colour line under the header: page cards only (not dashboard cards) */
.card-page > .card-header { border-bottom: 2px solid var(--hr-brand); }
/* List inside a page card: table area grows, pager stays at the bottom of the card */
.card-page > .card-body { flex: 1; }
/* Report page: the filter box keeps its own height (the table area below it is the part that matters) */
.card-page.report-page > .card-body { flex: 0 0 auto; }
.pager-size label { font-size: .76rem; color: var(--hr-muted); }
.pager-size .form-select { width: auto; min-width: 72px; }
/* Form inside a page card: Save / Cancel bar stays at the bottom of the card */
.card-page > form { flex: 1; display: flex; flex-direction: column; }
.card-page > form > .card-body { flex: 1; }
.app-footer { padding: 0 1.5rem 1rem; color: var(--hr-muted); font-size: .75rem; }
.sidebar-backdrop { display: none; }

/* Collapsed sidebar (desktop): icons only. Toggled by the button at the bottom. */
@media (min-width: 992px) {
    body.sb-collapsed .app-sidebar { width: var(--hr-sidebar-w-collapsed); }
    body.sb-collapsed .app-main { margin-left: var(--hr-sidebar-w-collapsed); }
    body.sb-collapsed .sb-brand-name,
    body.sb-collapsed .sb-section,
    body.sb-collapsed .sb-link span,
    body.sb-collapsed .sb-link .badge,
    body.sb-collapsed .sb-link .bi-chevron-down,
    body.sb-collapsed .sb-sub,
    body.sb-collapsed .sb-collapse-btn span { display: none; }
    body.sb-collapsed .sb-brand { justify-content: center; padding-inline: 0; }
    body.sb-collapsed .sb-scroll { padding-inline: 14px; scrollbar-width: none; }
    body.sb-collapsed .sb-scroll::-webkit-scrollbar { display: none; }
    body.sb-collapsed .sb-section { display: block; height: 10px; padding: 0; font-size: 0; }
    body.sb-collapsed .sb-link { justify-content: center; padding: .7rem 0; }
    body.sb-collapsed .sb-collapse-btn { justify-content: center; }
    body.sb-collapsed .sb-collapse-btn i { transform: rotate(180deg); }
}

/* Phones & tablets: sidebar slides in */
@media (max-width: 991.98px) {
    .app-sidebar { transform: translateX(-105%); }
    body.sidebar-open .app-sidebar { transform: none; }
    body.sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(9, 10, 44, .45); z-index: 1035; }
    .sb-collapse-btn { display: none; }
    .app-main { margin-left: 0; }
    .app-topbar { padding: .5rem 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
    .page-head { order: 3; width: 100%; }
    .page-title { font-size: 1rem; }
    .app-content { padding: 0 1rem 1.25rem; }
    .app-footer { padding: 0 1rem 1rem; }
    .branch-select { min-width: 0; }
}

/* ==========================================================================
   Cards, KPI cards, avatars, status pills
   ========================================================================== */
.card { --bs-card-border-color: #e9eaf3; overflow: hidden; --bs-card-border-radius: var(--hr-radius); --bs-card-inner-border-radius: var(--hr-radius); box-shadow: var(--hr-shadow); background: var(--hr-surface); }
.card-header { background: #fff; border-bottom: 1px solid var(--hr-line); padding: .55rem 1.1rem; min-height: 46px; display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.card-title { font-size: .85rem; font-weight: 600; margin: 0; }
/* Small icon box in front of a card title: <span class="card-icon"><i class="bi bi-..."></i></span> */
.card-icon { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--hr-brand-100); color: var(--hr-brand); font-size: .95rem; }
/* Form card footer: Cancel / Save buttons on the right */
.form-actions { display: flex; justify-content: flex-end; gap: .5rem; padding: .85rem 1.1rem; border-top: 1px solid var(--hr-line); background: #fff; }
.card-body { padding: 1rem 1.1rem; }

.kpi .card-header { justify-content: space-between; font-weight: 600; font-size: .8rem; min-height: 0; padding: .5rem 1rem; }
.kpi .card-body { display: flex; flex-direction: column; gap: .85rem; padding: 1rem 1.1rem 1.15rem; }
.kpi-value { display: flex; align-items: baseline; gap: .4rem; }
.kpi-value .num { font-size: 1.5rem; font-weight: 600; line-height: 1; color: var(--hr-brand); font-variant-numeric: tabular-nums; }
.kpi-value .of { font-size: .78rem; color: var(--hr-muted); }
.kpi-value .pct { margin-left: auto; font-size: .78rem; color: var(--hr-muted); font-variant-numeric: tabular-nums; }
.kpi .meter { height: 8px; border-radius: 99px; background: var(--hr-brand-50); overflow: hidden; }
.kpi .meter span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #7c7ff0, var(--hr-brand)); }
.kpi .meter.warn span { background: linear-gradient(90deg, #f0b35a, #d97706); }

.kpi.kpi-primary { color: #fff; border-color: transparent; background: linear-gradient(140deg, #5b5ef0 0%, var(--hr-brand-700) 100%); box-shadow: var(--hr-shadow-brand); }
.kpi.kpi-primary .card-header { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.15); color: #fff; }
.kpi.kpi-primary .kpi-value .num { color: #fff; }
.kpi.kpi-primary .of, .kpi.kpi-primary .pct { color: rgba(255,255,255,.75); }
.kpi.kpi-primary .meter { background: rgba(255,255,255,.22); }
.kpi.kpi-primary .meter span { background: #fff; }
.kpi.kpi-primary .chev { background: rgba(255,255,255,.18); color: #fff; }

.avatar { width: 36px; height: 36px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 600; font-size: .75rem; flex: none; background: var(--hr-brand-50); color: var(--hr-brand); }
.avatar-sm { width: 30px; height: 30px; font-size: .68rem; }
.avatar.a2 { background: #e6effc; color: #1f5fae; }
.avatar.a3 { background: #efe9fe; color: #6340c7; }
.avatar.a4 { background: #e4f5f1; color: #18735f; }
.avatar.a5 { background: #fcefe6; color: #a24a16; }

.status { display: inline-flex; align-items: center; gap: .35rem; font-size: .72rem; font-weight: 600; padding: .25rem .6rem; border-radius: 999px; white-space: nowrap; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-success { background: var(--hr-success-bg); color: var(--hr-success); }
.status-warning { background: var(--hr-warning-bg); color: var(--hr-warning); }
.status-danger  { background: var(--hr-danger-bg); color: var(--hr-danger); }
.status-neutral { background: var(--hr-neutral-bg); color: var(--hr-neutral); }
.status-brand   { background: var(--hr-brand-50); color: var(--hr-brand); }

.list-row { display: flex; align-items: center; gap: .8rem; padding: .75rem 1.35rem; border-bottom: 1px solid var(--hr-line); }
.list-row:last-child { border-bottom: 0; }
/* My dashboard updates: small round icon per update */
.upd-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; flex: none; font-size: .85rem; }
.upd-ok { background: var(--hr-success-bg); color: var(--hr-success); }
.upd-bad { background: var(--hr-danger-bg); color: var(--hr-danger); }
.upd-info { background: var(--hr-brand-50); color: var(--hr-brand); }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .name { font-weight: 600; font-size: .8rem; }
.list-row .sub { color: var(--hr-muted); font-size: .74rem; }

.progress { height: 6px; background: var(--hr-brand-50); border-radius: 99px; }
.progress-bar { background: var(--hr-brand); border-radius: 99px; }

/* Fixed-size list cards: every list shows max 5 items, then "View all (N)".
   Same height on every row, so the dashboard never jumps around. */
.card-fixed { height: 372px; display: flex; flex-direction: column; }
/* Too many rows for the fixed height -> the card body scrolls (never cut off half-way) */
.card-fixed > .card-body { flex: 1; overflow-y: auto; min-height: 0; scrollbar-width: thin; }
.card-fixed > .card-body::-webkit-scrollbar { width: 6px; }
.card-fixed > .card-body::-webkit-scrollbar-thumb { background: var(--hr-line); border-radius: 6px; }
.card-fixed .list-row { padding-top: .45rem; padding-bottom: .45rem; }   /* 5 rows must fit the fixed height */
.card-fixed > .table-responsive { flex: 1; overflow-x: auto; overflow-y: hidden; }
.chart-box { position: relative; height: 100%; min-height: 240px; }
/* Phones & tablets: cards stack, so let them take their natural height */
@media (max-width: 1199.98px) { .card-fixed { height: auto; } }
.card-foot { border-top: 1px solid var(--hr-line); padding: .55rem 1.1rem; display: flex; align-items: center; gap: .5rem; font-size: .76rem; color: var(--hr-muted); }
.card-foot a { margin-left: auto; font-weight: 600; display: inline-flex; align-items: center; gap: .3rem; }
.empty-state { height: 100%; display: grid; place-items: center; text-align: center; color: var(--hr-muted); font-size: .8rem; padding: 1rem; }
.empty-state i { font-size: 1.6rem; color: var(--hr-brand-200); display: block; margin-bottom: .3rem; }

/* Count tiles (today's attendance summary) */
.count-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 1fr; gap: .65rem; flex: 1; }   /* tiles stretch to fill the card */
.count-tile { display: flex; align-items: center; gap: .7rem; padding: .65rem .8rem; border: 1px solid var(--hr-line); border-radius: 12px; color: var(--hr-ink); transition: background .15s, border-color .15s; }
.count-tile:hover { background: var(--hr-tint); border-color: var(--hr-brand-100); color: var(--hr-ink); }
.count-tile .ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.count-tile .meta { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.count-tile .lbl { font-size: .74rem; color: var(--hr-muted); }
.count-tile .n { font-size: 1.3rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.count-tile .sub { margin-left: auto; font-size: .7rem; color: var(--hr-muted); text-align: right; }
.tone-neutral { background: var(--hr-neutral-bg); color: var(--hr-neutral); }
/* Leave colours (CL blue, SL orange, EL green, LOP red ...): --lc = main colour, --lc-bg = light tint */
.lc-blue   { --lc: #2563eb; --lc-bg: #dbeafe; }
.lc-orange { --lc: #ea580c; --lc-bg: #ffedd5; }
.lc-green  { --lc: #16a34a; --lc-bg: #dcfce7; }
.lc-red    { --lc: #dc2626; --lc-bg: #fee2e2; }
.lc-purple { --lc: #7c3aed; --lc-bg: #ede9fe; }
.lc-teal   { --lc: #0d9488; --lc-bg: #ccfbf1; }
.lc-sky    { --lc: #0284c7; --lc-bg: #e0f2fe; }

/* My attendance: colour per day code (--ma main, --ma-bg tint) */
.ma-ok    { --ma: #16a34a; --ma-bg: #dcfce7; }
.ma-half  { --ma: #ea580c; --ma-bg: #ffedd5; }
.ma-bad   { --ma: #dc2626; --ma-bg: #fee2e2; }
.ma-leave { --ma: #7c3aed; --ma-bg: #ede9fe; }
.ma-off   { --ma: #1d4ed8; --ma-bg: #dbeafe; }
.ma-wait  { --ma: #b45309; --ma-bg: #fef3c7; }
.ma-none  { --ma: #6b7280; --ma-bg: #f3f4f6; }
.ma-nav { display: flex; align-items: center; gap: .5rem; }
.ma-month { font-weight: 600; min-width: 120px; text-align: center; }
.ma-stats { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .5rem; }
.ma-stats > div { background: var(--ma-bg); border-radius: 10px; padding: .5rem .6rem; }
.ma-stats b { display: block; font-size: 1.15rem; color: var(--ma); font-variant-numeric: tabular-nums; }
.ma-stats span { font-size: .7rem; color: var(--hr-muted); }
@media (max-width: 991.98px) { .ma-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 575.98px) { .ma-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.ma-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.ma-dow { font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; color: var(--hr-muted); text-align: center; }
.ma-cell { min-height: 88px; border-radius: 10px; border: 1px solid var(--hr-line); border-top: 3px solid var(--ma); padding: .35rem .45rem; background: #fff; }
.ma-cell.is-today { outline: 2px solid var(--hr-brand); outline-offset: 1px; }
.ma-day { font-weight: 600; font-size: .85rem; }
.ma-code { font-size: .66rem; font-weight: 700; padding: .05rem .4rem; border-radius: 6px; background: var(--ma-bg); color: var(--ma); }
.ma-time { font-size: .74rem; margin-top: .3rem; font-variant-numeric: tabular-nums; }
.ma-hrs, .ma-note { font-size: .68rem; color: var(--hr-muted); }
.ma-note { margin-top: .3rem; color: var(--ma); }
.ma-list { display: flex; flex-direction: column; gap: .55rem; }
.ma-card { display: flex; gap: .75rem; align-items: center; border-left: 5px solid var(--ma); border-radius: 10px; background: #fff;
           box-shadow: 0 1px 4px rgba(20, 22, 60, .08); padding: .65rem .8rem; }
.ma-date { font-weight: 600; }
.ma-sub { font-size: .78rem; color: var(--hr-muted); }
.ma-pill { display: inline-block; min-width: 56px; text-align: center; font-weight: 700; font-size: .8rem; padding: .25rem .6rem;
           border-radius: 99px; background: var(--ma); color: #fff; }
.ma-key { display: inline-block; width: 12px; height: 12px; border-radius: 3px; background: var(--ma); margin-left: .6rem; }

/* Salary: split tables, totals, payroll steps, payslip */
.sal-table th { font-size: .72rem; color: var(--hr-muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.sal-table td { font-variant-numeric: tabular-nums; }
.sal-net { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; }
.sal-net > div { border-left: 4px solid var(--hr-brand); background: #fff; box-shadow: 0 1px 4px rgba(20, 22, 60, .10); border-radius: 10px; padding: .5rem .7rem; }
.sal-net > div:first-child { border-color: #16a34a; }
.sal-net span { display: block; font-size: .7rem; color: var(--hr-muted); }
.sal-net b { font-variant-numeric: tabular-nums; }
@media (max-width: 767.98px) { .sal-net { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pay-steps { display: flex; flex-wrap: wrap; gap: 1.2rem; font-size: .82rem; color: var(--hr-muted); }
.pay-steps .done { color: #16a34a; font-weight: 600; }
.pay-steps i { margin-right: .35rem; }
/* Number tile (payroll, reports, payslip card): soft shadow card, small coloured dot before the label (--k) */
.pay-kpi { --k: var(--hr-brand); background: #fff; border: 1px solid var(--hr-line); border-radius: 12px; padding: .7rem .9rem;
    box-shadow: 0 1px 2px rgba(20, 22, 60, .04), 0 4px 14px rgba(20, 22, 60, .06); }
.pay-kpi span { display: flex; align-items: center; gap: .4rem; font-size: .72rem; color: var(--hr-muted); }
.pay-kpi span::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--k); flex: none; }
.pay-kpi b { display: block; margin-top: .15rem; font-size: 1.2rem; font-variant-numeric: tabular-nums; color: var(--hr-ink); }
.pay-kpi.pay-net { --k: #16a34a; }
.pay-kpi.pay-net b { color: #16a34a; }
.payslip { background: #fff; border: 1px solid var(--hr-line); border-radius: 12px; padding: 1.5rem; max-width: 900px; }
.ps-head { display: flex; justify-content: space-between; border-bottom: 2px solid var(--hr-brand); padding-bottom: .8rem; margin-bottom: 1rem; }
.ps-company { font-size: 1.3rem; font-weight: 700; color: var(--hr-brand); }
.ps-title { font-size: 1.1rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.ps-logo { max-height: 56px; max-width: 160px; object-fit: contain; }
/* Draft payslip: light "DRAFT" mark across the page (also when printed) */
.ps-draft { position: relative; }
.ps-draft::after { content: "DRAFT"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 6rem; font-weight: 800;
    color: rgba(220, 38, 38, .07); transform: rotate(-20deg); pointer-events: none; }
/* Payslip details: label and value on the SAME row ("Employee   Nesamani S"), two columns */
/* Left column first (employee details), then right (statutory + days): 6 rows x 2 columns */
.ps-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(6, auto);
           grid-auto-flow: column; gap: 0 2rem; margin-bottom: 1rem; }
.ps-grid > div { display: flex; align-items: baseline; gap: .75rem; padding: .3rem 0; border-bottom: 1px dashed var(--hr-line); }
.ps-grid span { flex: 0 0 8.5rem; font-size: .74rem; color: var(--hr-muted); }
.ps-grid b { flex: 1; min-width: 0; font-size: .85rem; font-weight: 600; overflow-wrap: anywhere; }
@media screen and (max-width: 767.98px) { .ps-grid { grid-template-columns: 1fr; grid-template-rows: none; grid-auto-flow: row; } }
.ps-tables { border: 1px solid var(--hr-line); border-radius: 10px; overflow: hidden; }
.ps-tables .col-sm-6 + .col-sm-6 { border-left: 1px solid var(--hr-line); }
.ps-tables td, .ps-tables th { padding: .45rem .7rem; font-variant-numeric: tabular-nums; }
.ps-net { margin-top: 1rem; border-left: 4px solid #16a34a; background: #f0fdf4; border-radius: 10px; padding: .7rem 1rem; }
.ps-net > div { display: flex; justify-content: space-between; align-items: baseline; }
.ps-net span { font-weight: 600; }
.ps-net b { font-size: 1.4rem; color: #16a34a; }
@media print {
    .app-sidebar, .app-topbar, .app-footer, .no-print { display: none !important; }
    .app-content, .app-main, body { margin: 0 !important; padding: 0 !important; background: #fff !important; }
    .payslip { border: 0; max-width: none; }
    /* A4 is narrower than the tablet breakpoint: keep two columns on paper */
    .ps-tables > .col-sm-6 { flex: 0 0 50%; max-width: 50%; }
}

/* Apply leave: small balance list on the right */
.lb-panel { border: 1px solid var(--hr-line); border-radius: 12px; padding: .8rem; background: #fff; }
.lb-head { font-size: .8rem; font-weight: 600; margin-bottom: .55rem; }
.lb-row { border: 1px solid var(--hr-line); border-left: 3px solid var(--lc); background: #fff; border-radius: 8px; padding: .45rem .6rem; margin-bottom: .45rem; }
.lb-row:last-child { margin-bottom: 0; }
.lb-name { font-size: .78rem; font-weight: 600; color: var(--lc); }
.lb-num { font-size: .95rem; font-weight: 700; color: var(--lc); font-variant-numeric: tabular-nums; }
.lb-num .text-muted { font-size: .72rem; }
.lb-sub { font-size: .7rem; color: var(--hr-muted); }
.lb-low { color: #c2610c; font-weight: 600; }

/* Dashboard switch: Company | Branch | My  (top bar, right side) */
.topbar-tools { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 767.98px) { .topbar-tools .dash-switch span { display: none; } }   /* phone: icons only */
.dash-switch { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--hr-neutral-bg); }
.dash-switch a { display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .75rem; border-radius: 8px; font-size: .78rem; font-weight: 500; color: var(--hr-muted); text-decoration: none; }
.dash-switch a:hover { color: var(--hr-brand); }
.dash-switch a.active { background: #fff; color: var(--hr-brand); box-shadow: 0 1px 3px rgba(20, 22, 60, .12); }
.dash-switch .dropdown-toggle::after { margin-left: .15rem; vertical-align: .15em; }
.dash-switch .dropdown-toggle span { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-branch-menu { max-height: 320px; overflow-y: auto; min-width: 200px; font-size: .82rem; }   /* many branches: scroll */
.dash-branch-menu .dropdown-item.active { background: var(--hr-brand-50); color: var(--hr-brand); }
.c-ok { background: #22a35a; } .c-late { background: #e0a030; } .c-bad { background: #d9434f; } .c-off { background: #b8bacb; }
@media (max-width: 575.98px) { .count-grid { grid-template-columns: 1fr; } }

/* ---------- My dashboard (employee) ---------- */
.profile-head { display: flex; align-items: center; gap: .9rem; }
.profile-head .avatar-lg { width: 60px; height: 60px; border-radius: 16px; background: var(--hr-brand); color: #fff; display: grid; place-items: center; font-size: 1.2rem; font-weight: 600; flex: none; }
.profile-head .nm { font-size: 1rem; font-weight: 600; line-height: 1.2; }
.profile-head .rl { color: var(--hr-muted); font-size: .76rem; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: .45rem 1rem; font-size: .78rem; }
.kv dt { color: var(--hr-muted); font-weight: 400; }
.kv dd { margin: 0; font-weight: 500; text-align: right; }

.punch-pair { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.punch-box { border: 1px solid var(--hr-line); border-radius: 12px; padding: .7rem .8rem; }
.punch-box .lbl { font-size: .72rem; color: var(--hr-muted); }
.punch-box .t { font-size: 1.35rem; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.25; }

/* Month calendar */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal .dow { font-size: .68rem; color: var(--hr-muted); text-align: center; text-transform: uppercase; letter-spacing: .05em; padding-bottom: 2px; }
.cal .d { position: relative; height: 40px; border-radius: 10px; border: 1px solid var(--hr-line); display: grid; place-items: center; font-size: .8rem; font-weight: 500; font-variant-numeric: tabular-nums; }
.cal .d.empty { border: 0; }
.cal .d.p  { background: var(--hr-success-bg); border-color: transparent; color: var(--hr-success); }
.cal .d.lt { background: var(--hr-warning-bg); border-color: transparent; color: var(--hr-warning); }
.cal .d.lv { background: var(--hr-brand-50); border-color: transparent; color: var(--hr-brand); }
.cal .d.hd { background: #f3e9ff; border-color: transparent; color: #7a3fc4; }
.cal .d.wo { background: var(--hr-neutral-bg); border-color: transparent; color: var(--hr-neutral); }
.cal .d.ab { background: var(--hr-danger-bg); border-color: transparent; color: var(--hr-danger); }
.cal .d.today { outline: 2px solid var(--hr-brand); outline-offset: 1px; }
.cal .d.future { color: #b8bacb; }
.cal .d.wt { border-style: dashed; border-color: var(--hr-warning); color: var(--hr-warning); }   /* waiting for approval / not calculated */
.cal .d small { position: absolute; bottom: 1px; left: 0; right: 0; text-align: center; font-size: .55rem; font-weight: 600; line-height: 1; opacity: .85; }
.cal .d.has-code { place-items: start center; padding-top: 5px; }
.cal-legend { display: flex; flex-wrap: wrap; gap: .4rem .9rem; font-size: .72rem; color: var(--hr-muted); }
.cal-legend span { display: inline-flex; align-items: center; gap: .35rem; }
.cal-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.cal-legend .cal-p  { background: var(--hr-success); }
.cal-legend .cal-lt { background: var(--hr-warning); }
.cal-legend .cal-lv { background: var(--hr-brand); }
.cal-legend .cal-hd { background: #7a3fc4; }
.cal-legend .cal-wo { background: var(--hr-neutral); }
.cal-legend .cal-ab { background: var(--hr-danger); }
.cal-legend .cal-wt { background: transparent; border: 1px dashed var(--hr-warning); }
.cal-sum { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: .5rem; }
.cal-sum div { text-align: center; border: 1px solid var(--hr-line); border-radius: 10px; padding: .45rem .3rem; }
/* Same look as the number tiles (.pay-kpi): soft shadow card, coloured dot before the label (--ma) */
.cal-sum div[class^="ma-"] { border: 1px solid var(--hr-line); background: #fff;
    box-shadow: 0 1px 2px rgba(20, 22, 60, .04), 0 4px 14px rgba(20, 22, 60, .06); }
.cal-sum div[class^="ma-"] b { color: var(--hr-ink); }
.cal-sum div[class^="ma-"] span { display: inline-flex; align-items: center; gap: .3rem; }
.cal-sum div[class^="ma-"] span::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ma); flex: none; }
.cal-sum b { display: block; font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.cal-sum span { font-size: .68rem; color: var(--hr-muted); }

.pay-net { font-size: 1.6rem; font-weight: 600; color: var(--hr-brand); font-variant-numeric: tabular-nums; line-height: 1.1; }

/* Alert rows (company dashboard) */
.alert-row { display: flex; gap: .7rem; align-items: flex-start; padding: .62rem 0; border-bottom: 1px dashed var(--hr-line); }
.alert-row:first-child { padding-top: 0; }
.alert-row:last-child { border-bottom: 0; }
.alert-row .ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none; font-size: .9rem; }
.alert-row .txt { flex: 1; min-width: 0; line-height: 1.35; }
.alert-row .txt b { font-weight: 600; display: block; font-size: .8rem; }
.alert-row .txt span { color: var(--hr-muted); font-size: .72rem; }
.alert-row .go { color: var(--hr-muted); align-self: center; }
.alert-row:hover .go { color: var(--hr-brand); }
.tone-brand   { background: var(--hr-brand-50); color: var(--hr-brand); }
.tone-success { background: var(--hr-success-bg); color: var(--hr-success); }
.tone-warning { background: var(--hr-warning-bg); color: var(--hr-warning); }
.tone-danger  { background: var(--hr-danger-bg); color: var(--hr-danger); }

/* Small stat tiles inside a card */
.mini-stats { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.mini-stat { border: 1px solid var(--hr-brand-100); border-radius: 12px; padding: .7rem .8rem; background: var(--hr-surface); }
.mini-stat .lbl { font-size: .72rem; color: var(--hr-muted); display: flex; align-items: center; gap: .35rem; }
.mini-stat .val { font-size: 1.3rem; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.2; margin-top: .15rem; }

/* Horizontal bar list (e.g. approvals by type) */
.bar-list { display: grid; gap: .8rem; }
.bar-list .row-top { display: flex; justify-content: space-between; font-size: .78rem; margin-bottom: .3rem; }
.bar-list .row-top b { font-weight: 600; font-variant-numeric: tabular-nums; }

/* Clickable table rows */
.table-hr tbody tr.row-link { cursor: pointer; }
.table-hr tbody tr.row-link td:first-child .bi-chevron-right { opacity: 0; transition: opacity .15s; }
.progress.warn .progress-bar { background: #d97706; }

/* KPI tile, compact variant (6 in a row) */
.kpi.kpi-sm .kpi-value .num { font-size: 1.35rem; }
.kpi.kpi-sm .card-header { font-size: .76rem; }
.kpi.kpi-sm .card-body { gap: .55rem; }
.kpi-foot { font-size: .7rem; color: var(--hr-muted); }
.kpi.kpi-primary .kpi-foot { color: rgba(255,255,255,.75); }

/* Stacked share bar (e.g. employees by status) */
.share-legend { display: flex; flex-wrap: wrap; gap: 1rem; font-size: .76rem; color: var(--hr-muted); }
.share-legend span { display: inline-flex; align-items: center; gap: .4rem; }
.share-legend i { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }
.share-bar { display: flex; gap: 3px; height: 10px; }
.share-bar span { border-radius: 99px; }
.share-labels { display: flex; gap: 3px; margin-bottom: .45rem; }
.share-labels span { font-size: .7rem; color: var(--hr-muted); border: 1px solid var(--hr-line); border-radius: 7px; padding: .1rem .45rem; white-space: nowrap; }
.c-1 { background: var(--hr-brand-200); }
.c-2 { background: #7f82ef; }
.c-3 { background: var(--hr-brand-700); }

/* Range picker in card headers ("30 days ▾") */
.range-btn { border: 0; background: none; color: var(--hr-brand); font-weight: 600; padding: 0; display: inline-flex; gap: .25rem; align-items: center; }
.big-stat { margin-left: auto; font-size: 1.35rem; font-weight: 500; color: var(--hr-brand); font-variant-numeric: tabular-nums; }

/* ==========================================================================
   Right-hand panel on the dashboard (date strip + timeline)
   ========================================================================== */
.date-strip { display: flex; gap: .45rem; overflow-x: auto; padding: 0 0 .4rem; scrollbar-width: none; }
.date-strip button { flex: none; width: 50px; padding: .45rem 0; border-radius: 12px; border: 1px solid var(--hr-line); background: var(--hr-surface); color: var(--hr-ink); line-height: 1.15; }
.date-strip button b { display: block; font-size: 1rem; font-weight: 600; }
.date-strip button small { font-size: .65rem; color: var(--hr-muted); }
.date-strip button:hover { border-color: var(--hr-brand-200); }
.date-strip button.active { background: var(--hr-brand); border-color: var(--hr-brand); color: #fff; box-shadow: var(--hr-shadow-brand); }
.date-strip button.active small { color: rgba(255,255,255,.8); }

.timeline { position: relative; margin-top: .75rem; }
.tl-row { display: grid; grid-template-columns: 46px 1fr; gap: .6rem; align-items: start; }
.tl-time { font-size: .72rem; color: var(--hr-muted); padding-top: .55rem; font-variant-numeric: tabular-nums; }
.tl-items { display: grid; gap: .45rem; padding-bottom: .65rem; border-top: 1px dashed var(--hr-line); padding-top: .55rem; }
.tl-item { display: flex; align-items: center; gap: .55rem; padding: .55rem .7rem; border-radius: 12px; background: #f7f7fe; border: 1px solid #ecedfb; font-size: .78rem; }
.tl-item i.kind { color: var(--hr-brand); }
.tl-item .who { font-weight: 600; }
.tl-item .meta { margin-left: auto; color: var(--hr-brand); font-size: .72rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tl-item .bi-chevron-right { color: var(--hr-muted); font-size: .7rem; }
.tl-item.done { background: #fafafd; border-color: var(--hr-line); color: var(--hr-muted); }
.tl-item.done .who { text-decoration: line-through; font-weight: 500; }
.tl-item.done i.kind, .tl-item.done .meta { color: var(--hr-muted); }
.tl-item.current { background: var(--hr-surface); border-color: var(--hr-brand); box-shadow: 0 1px 4px rgba(0,0,0,.05); }
.tl-item.late .meta { color: var(--hr-warning); }

/* ==========================================================================
   Tables
   ========================================================================== */
.hr-tabs { display: flex; gap: 1.6rem; border-bottom: 1px solid var(--hr-line); overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.hr-tabs::-webkit-scrollbar { display: none; }
.hr-tabs a { padding: .65rem 0 .55rem; color: var(--hr-muted); font-weight: 500; border-bottom: 2px solid transparent; white-space: nowrap; margin-bottom: -1px; }
.hr-tabs a:hover { color: var(--hr-ink); }
.hr-tabs a.active { color: var(--hr-brand); border-color: var(--hr-brand); font-weight: 600; }
.hr-tabs a .count { font-size: .7rem; background: var(--hr-neutral-bg); color: var(--hr-neutral); padding: .05rem .45rem; border-radius: 999px; margin-left: .3rem; }
.hr-tabs a.active .count { background: var(--hr-brand-50); color: var(--hr-brand); }

.table-hr { --bs-table-bg: transparent; margin: 0; }
.table-hr thead th { font-size: .66rem; text-transform: uppercase; letter-spacing: .06em; color: var(--hr-muted); font-weight: 600; background: var(--hr-surface); border-bottom: 1px solid var(--hr-line); padding: .6rem .8rem; white-space: nowrap; }
.table-hr tbody td { padding: .6rem .8rem; vertical-align: middle; border-color: var(--hr-line); }
.table-hr tbody tr { transition: background .15s; }
.table-hr tbody tr:hover { background: #f8f8ff; }
.table-hr tbody tr.is-selected { background: var(--hr-brand-50); box-shadow: inset 3px 0 0 var(--hr-brand); }
.table-hr .emp { display: flex; align-items: center; gap: .7rem; min-width: 180px; }
.table-hr .emp .name { font-weight: 600; }
.table-hr .emp .mail { color: var(--hr-muted); font-size: .74rem; }
.table-hr .code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .78rem; color: var(--hr-muted); }
.table-footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: .9rem 1.35rem; color: var(--hr-muted); font-size: .78rem; }
.pagination { --bs-pagination-border-radius: 9px; --bs-pagination-color: var(--hr-ink); --bs-pagination-border-color: var(--hr-line); --bs-pagination-active-bg: var(--hr-brand); --bs-pagination-active-border-color: var(--hr-brand); --bs-pagination-font-size: .78rem; gap: 4px; }
.pagination .page-link { border-radius: 9px !important; min-width: 32px; text-align: center; }

/* ==========================================================================
   Forms
   ========================================================================== */
.form-label { font-weight: 500; font-size: .76rem; margin-bottom: .35rem; }
.form-label .req { color: var(--hr-danger); margin-left: 2px; }
.form-control, .form-select { border-radius: var(--hr-radius-sm); border-color: var(--hr-line); background-color: var(--hr-surface); padding: .48rem .75rem; font-size: .8125rem; }
.form-select { padding-right: 2.25rem; }
.form-select-sm { padding-top: .38rem; padding-bottom: .38rem; font-size: .8rem; }
.form-control:focus, .form-select:focus, .form-check-input:focus { border-color: var(--hr-brand); box-shadow: 0 0 0 .22rem rgba(79,82,230,.14); }
.form-check-input:checked { background-color: var(--hr-brand); border-color: var(--hr-brand); }
.form-text { color: var(--hr-muted); font-size: .74rem; }

/* ---------- Styled dropdowns (Tom Select) ----------
   The wrapper keeps the .form-select look (border, radius, arrow); the inner control is transparent. */
.ts-wrapper.form-select { cursor: pointer; }
/* Dropdown in a flex row (filters, card headers, toolbars): keeps the width of its text + arrow and never shrinks,
   so the text never runs under the arrow. Long names end with "..." instead. */
.d-flex > .ts-wrapper.form-select { flex: 0 0 auto; width: auto; min-width: 11rem; max-width: 100%; }
.ts-wrapper.form-select.w-auto { width: auto; min-width: 9rem; }
.ts-wrapper.form-select .ts-control { flex-wrap: nowrap; }
.ts-wrapper.form-select .ts-control > .item { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ts-wrapper.form-select .ts-control { padding: .48rem 2.25rem .48rem .75rem; font-size: .8125rem; color: var(--hr-ink); min-height: 0; cursor: pointer; }
.ts-wrapper.form-select-sm .ts-control { padding-top: .36rem; padding-bottom: .36rem; font-size: .8rem; }
.ts-wrapper.form-select:hover { border-color: var(--hr-brand-200); }
.ts-wrapper.form-select.focus { border-color: var(--hr-brand); box-shadow: 0 0 0 .22rem rgba(79,82,230,.14); }
.ts-wrapper .focus .ts-control, .focus .ts-control { box-shadow: none; }
.ts-wrapper.form-select.dropdown-active { background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%234f52e6' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 11 6-6 6 6'/%3e%3c/svg%3e"); }
.ts-control .item[data-value=""] { color: var(--hr-muted); }          /* "Select ..." placeholder text */

.ts-dropdown {
    margin-top: 6px; padding: 5px; border: 1px solid var(--hr-brand-100); border-radius: 12px;
    background: var(--hr-surface); box-shadow: 0 4px 14px rgba(0, 0, 0, .08); font-size: .8125rem; z-index: 1060;
}
.ts-dropdown .ts-dropdown-content { max-height: 260px; }
.ts-dropdown .option[data-value=""] { display: none; }                /* hide the placeholder in the list */
.ts-dropdown .option { position: relative; padding: .5rem .75rem; border-radius: 8px; color: var(--hr-ink); }
.ts-dropdown .option.active { background: var(--hr-tint); color: var(--hr-brand); }
.ts-dropdown .option.selected { background: var(--hr-brand-50); color: var(--hr-brand); font-weight: 600; padding-right: 2rem; }
.ts-dropdown .option.selected::after { content: "\F272"; font-family: "bootstrap-icons"; position: absolute; right: .7rem; top: 50%; transform: translateY(-50%); font-size: 1rem; }
.ts-dropdown .dropdown-input-wrap { padding: 2px 2px 6px; }
.ts-dropdown .dropdown-input { border: 1px solid var(--hr-line); border-radius: 8px; padding: .4rem .65rem; font-size: .8rem; }
.ts-dropdown .no-results { color: var(--hr-muted); padding: .5rem .75rem; }
.input-group-text { background: #f8f8fd; border-color: var(--hr-line); border-radius: var(--hr-radius-sm); color: var(--hr-muted); }

.form-steps { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none;
    padding: 5px; background: var(--hr-surface); border: 1px solid var(--hr-brand-100); border-radius: var(--hr-radius-sm); box-shadow: var(--hr-shadow); }
.form-steps::-webkit-scrollbar { display: none; }
.form-steps button { position: relative; flex: 1 0 auto; display: flex; align-items: center; justify-content: center; gap: .55rem; padding: .5rem .9rem; border: 0; background: transparent; border-radius: 9px; color: var(--hr-muted); font-weight: 500; white-space: nowrap; }
.form-steps .num { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; background: var(--hr-tint); border: 1px solid var(--hr-brand-100); font-size: .7rem; }
.form-steps button:hover { color: var(--hr-ink); background: var(--hr-tint); }
.form-steps button.active { background: var(--hr-brand); color: #fff; box-shadow: 0 2px 6px rgba(79,82,230,.2); }
.form-steps button.active .num { background: rgba(255,255,255,.2); border-color: transparent; color: #fff; }
.form-steps button.has-error::after { content: "!"; position: absolute; top: 4px; right: 6px; width: 15px; height: 15px; border-radius: 50%; background: var(--hr-danger); color: #fff; font-size: .62rem; font-weight: 700; display: grid; place-items: center; }
.form-section .card-header i { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--hr-brand-50); color: var(--hr-brand); }

.action-bar { padding: .25rem 0 .5rem; display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; justify-content: flex-end; }

.photo-drop { border: 1.5px dashed var(--hr-brand-200); border-radius: var(--hr-radius); padding: 1rem; display: flex; align-items: center; gap: 1rem; background: #fafaff; }
.photo-drop .ph { width: 60px; height: 60px; border-radius: 16px; background: var(--hr-brand-50); color: var(--hr-brand); display: grid; place-items: center; font-size: 1.4rem; }

.day-pick { display: flex; gap: .4rem; flex-wrap: wrap; }
.day-pick input { display: none; }
.day-pick label { width: 46px; text-align: center; padding: .45rem 0; border: 1px solid var(--hr-line); border-radius: 10px; font-weight: 500; font-size: .76rem; cursor: pointer; background: var(--hr-surface); }
.day-pick input:checked + label { background: var(--hr-brand); border-color: var(--hr-brand); color: #fff; }

/* ==========================================================================
   Auth pages (login / register)
   ========================================================================== */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 16px; background: var(--hr-bg); }
.auth-brand {
    position: relative; overflow: hidden; border-radius: 28px; color: #fff;
    padding: 2.5rem 3rem; display: flex; flex-direction: column;
    background:
        radial-gradient(80% 50% at 85% 100%, rgba(79, 82, 230, .7), transparent 70%),
        radial-gradient(60% 40% at 0% 0%, rgba(79, 82, 230, .35), transparent 70%),
        linear-gradient(180deg, var(--hr-navy) 0%, var(--hr-navy-900) 100%);
}
.auth-brand .sb-brand { padding: 0; }
.auth-brand h1 { color: #fff; font-size: 2.1rem; font-weight: 600; line-height: 1.25; max-width: 470px; text-wrap: balance; margin-top: auto; padding-top: 2rem; }
.auth-brand p.lead { color: rgba(255,255,255,.72); max-width: 440px; font-size: .95rem; font-weight: 300; }
.auth-points { list-style: none; padding: 0; margin: 1.4rem 0 auto; display: grid; gap: .7rem; }
.auth-points li { display: flex; gap: .75rem; align-items: center; font-weight: 500; font-size: .88rem; }
.auth-points i { width: 32px; height: 32px; border-radius: 10px; background: rgba(255,255,255,.1); display: grid; place-items: center; }
.auth-mock { margin-top: 2rem; margin-bottom: auto; background: #fff; color: var(--hr-ink); border-radius: var(--hr-radius); padding: 1rem 1.1rem; max-width: 380px; box-shadow: 0 24px 50px rgba(9, 10, 44, .4); }
.auth-mock .row-line { display: flex; align-items: center; gap: .7rem; padding: .45rem 0; border-bottom: 1px solid var(--hr-line); font-size: .8rem; }
.auth-mock .row-line:last-child { border-bottom: 0; }
.auth-brand .copy { font-size: .72rem; opacity: .55; margin-top: 2rem; }

.auth-form { display: flex; align-items: center; justify-content: center; padding: 2rem 1.5rem; background: var(--hr-surface); }
.auth-card { width: 100%; max-width: 420px; }
.auth-card h2 { font-size: 1.6rem; font-weight: 600; margin-bottom: .3rem; }
.auth-card .form-control { padding: .7rem .9rem; }
.pw-toggle { border-left: 0 !important; background: var(--hr-surface) !important; cursor: pointer; }

@media (max-width: 991.98px) {
    .auth { grid-template-columns: 1fr; }
    .auth-brand { padding: 1.5rem; border-radius: 22px; }
    .auth-brand h1 { font-size: 1.4rem; margin-top: 1.25rem; }
    .auth-mock, .auth-points, .auth-brand p.lead, .auth-brand .copy { display: none; }
    .auth-form { border-radius: 22px; }
}

/* Option cards (radio): Settings → Employee code */
.code-mode { display: flex; gap: .65rem; align-items: flex-start; padding: .85rem 1rem; border: 1px solid var(--hr-line); border-radius: var(--hr-radius-sm); cursor: pointer; transition: border-color .15s, background .15s; }
.code-mode:hover { border-color: var(--hr-brand-200); }
.code-mode:has(input:checked) { border-color: var(--hr-brand); background: var(--hr-brand-50); box-shadow: 0 0 0 1px var(--hr-brand); }
.code-mode .form-check-input { margin-top: .2rem; flex: none; }
.code-mode i { color: var(--hr-brand); }
.code-mode code { color: var(--hr-ink); font-size: .75rem; }

/* ==========================================================================
   List filters (search + dropdowns above a table) and form section titles
   ========================================================================== */
.list-filters { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; padding: 1rem 1rem .25rem; }
.list-filters .search { flex: 1 1 260px; max-width: 360px; }
.list-filters .form-select, .list-filters .ts-wrapper { flex: 0 1 200px; min-width: 160px; }
/* Payroll branch filter: Tom Select builds its own wrapper, so the width must be set on the wrapper */
.pay-filter .form-select, .pay-filter .ts-wrapper.form-select { width: 240px; min-width: 240px; }
.report-filter .form-select, .report-filter .ts-wrapper.form-select { width: 240px; min-width: 240px; }

/* Reports list: one tile per report, left border in the report's colour (--rt) */
.report-tile { display: flex; flex-direction: column; gap: .35rem; height: 100%; padding: 1.1rem 1.2rem; border-radius: 14px;
    background: #fff; border: 1px solid var(--hr-line); box-shadow: 0 1px 2px rgba(20, 22, 60, .04), 0 4px 14px rgba(20, 22, 60, .06);
    color: var(--hr-ink); text-decoration: none; transition: box-shadow .15s, transform .15s, border-color .15s; }
.report-tile:hover { box-shadow: 0 8px 24px rgba(20, 22, 60, .12); transform: translateY(-2px); border-color: var(--rt); color: var(--hr-ink); }
/* Icon in a soft tinted square (colour of the report) */
.report-tile i { display: grid; place-items: center; width: 42px; height: 42px; margin-bottom: .35rem; border-radius: 11px; font-size: 1.25rem;
    color: var(--rt); background: color-mix(in srgb, var(--rt) 12%, #fff); }
.report-tile b { font-size: .95rem; }
.report-tile span { font-size: .78rem; color: var(--hr-muted); }
@media (min-width: 768px) { .list-filters { padding: 1rem 1.5rem .25rem; } }

.form-sec-title { display: flex; align-items: center; gap: .5rem; font-size: .82rem; font-weight: 600; color: var(--hr-ink);
    text-transform: uppercase; letter-spacing: .04em; margin: 1.6rem 0 .9rem; padding-bottom: .5rem; border-bottom: 1px dashed var(--hr-line); }
.form-sec-title:first-of-type { margin-top: .25rem; }
.form-sec-title i { color: var(--hr-brand); font-size: 1rem; }

/* Edge / IE show their own "eye" inside password boxes. We already have our own show/hide button,
   so hide the browser one (otherwise two eye icons appear). */
input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear { display: none; }

/* Role rights grid: group heading rows (Masters, Attendance, ...) */
.rights-grid .rights-group td { background: var(--hr-tint); color: var(--hr-muted); font-size: .72rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: .05em; padding-top: .45rem; padding-bottom: .45rem; }
.rights-grid td, .rights-grid th { vertical-align: middle; }
.rights-grid .form-check-input { width: 1.1rem; height: 1.1rem; cursor: pointer; }

/* Shift roster grid: one small coloured box per day */
.roster-grid th, .roster-grid td { vertical-align: middle; }
.roster-grid .rg-check { width: 36px; }
.roster-grid .rg-emp { min-width: 180px; }
.roster-grid .rg-sun { color: var(--hr-danger); }
.roster-cell { display: inline-flex; align-items: center; justify-content: center; min-width: 64px; height: 30px; padding: 0 .5rem;
    border-radius: 8px; border: 1px solid transparent; font-size: .74rem; font-weight: 600; white-space: nowrap; position: relative; }
button.roster-cell { cursor: pointer; }
button.roster-cell:hover { filter: brightness(.96); border-color: var(--hr-brand-200); }
.rc-work    { background: var(--hr-brand-50);   color: var(--hr-brand); }
.rc-off     { background: var(--hr-neutral-bg); color: var(--hr-neutral); }
.rc-holiday { background: var(--hr-success-bg); color: var(--hr-success); }
.rc-noshift { background: var(--hr-warning-bg); color: var(--hr-warning); }
.rc-none    { background: repeating-linear-gradient(45deg, #f4f4f8, #f4f4f8 4px, #fff 4px, #fff 8px); color: transparent; }
.rc-changed { border-color: var(--hr-brand); }
.rc-changed::after { content: ""; position: absolute; top: 3px; right: 3px; width: 6px; height: 6px; border-radius: 50%; background: var(--hr-brand); }
.roster-legend { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1rem; padding: .75rem 1.5rem; color: var(--hr-muted); font-size: .74rem; }
.roster-legend .roster-cell { min-width: 44px; height: 22px; margin-right: -.6rem; }

/* Daily attendance: small source tag next to a time (Reg / Guess / HR), review flags, short reason */
.att-src { display: inline-block; margin-left: .25rem; padding: 0 .35rem; border-radius: 6px; font-size: .66rem; font-weight: 600;
    background: var(--hr-warning-bg); color: var(--hr-warning); vertical-align: middle; }
.att-flag { display: inline-block; margin: 0 .25rem .2rem 0; padding: .05rem .45rem; border-radius: 6px; font-size: .68rem; font-weight: 600;
    background: var(--hr-danger-bg); color: var(--hr-danger); }
.att-word { display: inline-block; padding: .05rem .45rem; border-radius: 6px; font-size: .68rem; font-weight: 600; background: var(--hr-brand-50); color: var(--hr-brand); }
.att-reason { max-width: 360px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Attendance date history: vertical timeline */
.att-timeline { list-style: none; margin: 0; padding: 0; }
.att-timeline li { display: flex; gap: .75rem; padding: .55rem 0; border-bottom: 1px dashed var(--hr-line); }
.att-timeline li:last-child { border-bottom: 0; }
.att-tl-icon { flex: 0 0 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
    background: var(--hr-brand-50); color: var(--hr-brand); }

/* Roster: branch holiday in the day header */
.roster-grid .rg-hol { display: flex; align-items: center; justify-content: center; gap: .2rem; margin-top: .2rem; }
.roster-grid .rg-hol .badge { max-width: 92px; font-weight: 500; font-size: .7rem; }

/* Monthly attendance grid: employee column stays on the left while scrolling the days */
.monthly-grid { font-size: .8rem; }
.monthly-grid th, .monthly-grid td { padding: .35rem .25rem; vertical-align: middle; }
.monthly-grid .mg-emp { position: sticky; left: 0; z-index: 2; background: var(--hr-surface, #fff); min-width: 170px; box-shadow: 1px 0 0 var(--hr-line); }
.monthly-grid thead .mg-emp { z-index: 3; }
.monthly-grid .mg-day { text-align: center; min-width: 34px; font-weight: 600; }
.monthly-grid thead .mg-day div { font-size: .65rem; color: var(--hr-muted); }
.monthly-grid .mg-sun { color: var(--hr-danger); }
.monthly-grid .mg-tot { text-align: center; white-space: nowrap; min-width: 46px; border-left: 1px solid var(--hr-line); }
.monthly-grid .mg-lop { color: var(--hr-danger); }
.monthly-grid .mg-paid { background: var(--hr-brand-50); }
.mc { display: inline-block; min-width: 26px; padding: .1rem .2rem; border-radius: 4px; font-size: .7rem; font-weight: 600; text-align: center; }
.mc-p { background: var(--hr-success-bg); color: var(--hr-success); }
.mc-ha { background: var(--hr-warning-bg); color: var(--hr-warning); }
.mc-a { background: var(--hr-danger-bg); color: var(--hr-danger); }
.mc-w { background: var(--hr-warning-bg); color: var(--hr-danger); border: 1px dashed var(--hr-danger); }
/* Manual attendance: date + time side by side in one cell */
.dt-pair { display: flex; gap: 4px; min-width: 250px; }
.dt-pair input[type=date] { flex: 0 0 140px; }
.dt-pair input[type=time] { flex: 1 1 100px; }

/* Monthly: day not ready for payroll (wrong / missing punch) - orange ring + dot */
.mc-flag { position: relative; box-shadow: inset 0 0 0 1.5px #f59e0b; cursor: help; }
.mc-flag::after { content: ""; position: absolute; top: -3px; right: -3px; width: 7px; height: 7px; border-radius: 50%;
                  background: #f59e0b; border: 1px solid #fff; }
.mc-leave { background: var(--hr-brand-50); color: var(--hr-brand); }
.mc-off { background: var(--hr-neutral-bg); color: var(--hr-neutral); }
.mc-hw { background: #e8f0ff; color: #2b5cd8; }
.mc-none { color: var(--hr-muted); }

/* Devices > Details: 4 status tiles */
.cal-sum.dev-sum { grid-template-columns: repeat(4, minmax(0,1fr)); max-width: 760px; }
@media (max-width: 576px) { .cal-sum.dev-sum { grid-template-columns: repeat(2, minmax(0,1fr)); } }

/* Manual attendance: toolbar on top of the grid, time-only boxes, selected rows highlighted */
.ma-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding: .75rem 1rem;
    border-top: 1px solid var(--hr-line); border-bottom: 1px solid var(--hr-line); background: #f8f9fd;
    position: sticky; top: 0; z-index: 3; }
.ma-toolbar .form-control { flex: 1 1 280px; max-width: 460px; }
.ma-toolbar .ma-count { font-size: .8rem; font-weight: 600; color: var(--hr-muted); min-width: 120px; }
.ma-grid td { vertical-align: middle; }
.ma-grid .ma-emp { min-width: 170px; }
.ma-grid .ma-time { width: 118px; }
.ma-grid .ma-next { font-size: .75rem; color: var(--hr-muted); display: inline-flex; align-items: center; gap: .3rem; cursor: pointer; }
.ma-grid .ma-entry { min-width: 150px; }
.ma-grid .ma-entry .att-reason { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ma-grid tr.ma-selected > td { background: #f2f1ff; }

/* Punches: a punch HR ignored (kept, but not used for attendance) */
.punch-ignored > td { background: #fbfbfd; color: var(--hr-muted); }
.punch-ignored > td:first-child .fw-semibold { text-decoration: line-through; }
.punch-why { max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Device info + checks */
.dev-info { display:grid; grid-template-columns: minmax(150px, 40%) 1fr; gap:.45rem 1rem; font-size:.875rem; }
.dev-info dt { font-weight:500; color:var(--bs-secondary-color, #64748b); }
.dev-info dd { margin:0; word-break:break-word; }
.dev-checks { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:.5rem; }
.dev-checks li { display:flex; gap:.6rem; align-items:flex-start; padding:.55rem .7rem; border-radius:.5rem; background:var(--chk-bg); font-size:.875rem; }
.dev-checks li > i { color:var(--chk); font-size:1rem; line-height:1.3; }
.chk-problem { --chk:#dc2626; --chk-bg:#fef2f2; }
.chk-warning { --chk:#d97706; --chk-bg:#fffbeb; }
.chk-info    { --chk:#2563eb; --chk-bg:#eff6ff; }
.chk-ok      { --chk:#16a34a; --chk-bg:#f0fdf4; }
@media (max-width: 576px) { .dev-info { grid-template-columns: 1fr; gap:.1rem; } .dev-info dd { margin-bottom:.4rem; } }

/* Payroll lock: year overview chips + month list */
.lock-grid th, .lock-grid td { padding:.45rem .35rem; }
.lock-grid th a { color:inherit; text-decoration:none; }
.lock-grid th a:hover { color:var(--bs-primary); }
.lock-grid .lock-sel { background:#eef2ff; }
.lk { display:inline-flex; align-items:center; justify-content:center; min-width:30px; height:26px; padding:0 .35rem;
      border-radius:.45rem; font-size:.78rem; font-weight:600; text-decoration:none; background:var(--lk-bg); color:var(--lk); }
a.lk:hover { outline:2px solid var(--lk); outline-offset:1px; }
.lk-locked     { --lk:#15803d; --lk-bg:#dcfce7; }
.lk-locked-all { --lk:#475569; --lk-bg:#e2e8f0; }
.lk-ready      { --lk:#b45309; --lk-bg:#fef3c7; }
.lk-review     { --lk:#b91c1c; --lk-bg:#fee2e2; }
.lk-future     { --lk:#94a3b8; --lk-bg:transparent; }
.lock-legend { display:flex; flex-wrap:wrap; gap:.4rem 1.2rem; align-items:center; padding:.7rem 1rem; font-size:.8rem; border-top:1px solid var(--bs-border-color, #e5e7eb); }
.lock-legend > span { display:inline-flex; align-items:center; gap:.4rem; }
.lock-toolbar { display:flex; align-items:center; gap:1rem; padding:.65rem 1rem; border-bottom:1px solid var(--bs-border-color, #e5e7eb); }

/* Salary generation: Generate / Finalize icon buttons at the right of the filter row */
.pay-actions .btn-icon { width: 38px; height: 38px; padding: 0; display: inline-flex; align-items: center; justify-content: center; font-size: 1.05rem; }
