/* ============================================================
   ZkBioCustom - application shell
   Layout: fixed top bar + fixed collapsible sidebar
   ============================================================ */

:root {
    /* sidebar */
    /* 250px -> 220px. The bar is narrower because nothing needed the extra 30px: measured in the
       browser, the widest single menu label on the whole site is "Application configuration" at
       158px of text, and the tightest row is a submenu leaf, which spends 41.6px of indent plus
       16px of right padding before the text even starts. 250 - 41.6 - 16 = 192px was available
       for a 158px label - 34px of slack for the widest string on the site. With the indent and
       padding below trimmed to 32px and 12px, 220 - 32 - 12 = 176px is available, so the widest
       label still fits. Re-run the clipped-count probe if any menu item is added; a label over
       roughly 170px will start to ellipsis. */
    --sidebar-w: 220px;
    --sidebar-w-collapsed: 68px;
    --sidebar-bg: #101828;
    --sidebar-bg-hover: #182234;
    --sidebar-bg-active: #132a4a;
    --sidebar-border: #1d2939;
    --sidebar-text: #aeb8c6;
    --sidebar-heading: #5d6b80;

    /* Parent (collapsible) rows are now visually their own thing rather than just another link in
       the same shade. Four variables drive that so it can be retuned in one place:
         parent-bg      a slightly lighter panel behind each parent, so a parent reads as a header
         parent-text    near-white against the children's muted grey
         parent-line    the brand-coloured bar down a parent's left edge
         chevron        the down arrow, in a light blue that stands off the near-black panel */
    --sidebar-parent-bg: #1a2434;
    --sidebar-parent-text: #f4f7fb;
    --sidebar-parent-hover: #24314a;
    --sidebar-parent-line: var(--brand);
    --sidebar-chevron: #8ab6ff;
    --sidebar-chevron-bg: rgba(31, 111, 235, .18);

    /* The scrollbar used to be #243043 on a #101828 panel - two greys a couple of steps apart,
       which is why it read as nothing at all. #46587a is a clear step lighter and #6f88b4 the
       hover, so scroll position is visible without hunting for it. */
    --sidebar-scroll: #46587a;
    --sidebar-scroll-hover: #6f88b4;

    /* brand / accent */
    --brand: #1f6feb;
    --brand-dark: #1a5fd0;

    /* top bar + page */
    /* 56px -> 44px. This single variable drives the bar's height and flex basis, the sidebar
       brand block's min-height, and the sidebar flyout's top offset, so all three stay aligned
       without any of them being restated. 44px is about as short as a bar can go and still hold
       a 26px avatar plus its own padding without looking clipped. */
    --topbar-h: 44px;
    --page-bg: #f4f6fa;
    --border: #e3e8ef;
    --text: #101828;
    --text-muted: #667085;
    --muted-bg: #f9fafb;

    --radius: 8px;
}

html,
body {
    height: 100%;
}

body {
    background: var(--page-bg);
    font-size: .93rem;
}

/* ---------------------------------------------------------
   Sidebar
   --------------------------------------------------------- */

.app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-w);
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    z-index: 1045;
    transition: width .18s ease, transform .18s ease;
    overflow: hidden;
}

/* ---- brand ---- */
/* The brand carries "ACI People Attendance", which was measured at 172px of text at the old 1rem
       bold. The 220px sidebar leaves 148px for it once the 1rem side padding, the 30px logo and the
       .6rem gap are taken off, so at 1rem the name was clipped outright - and .brand-text is
       overflow:hidden with text-overflow:clip, so it hard-cut mid-word with no ellipsis to warn you.
       Padding .7rem and gap .5rem give 159.6px, and .88rem brings the name to 151.4px. That leaves
       ~8px of slack, measured, not estimated. The ellipsis below is a safety net for a future
       rename that is longer still - it degrades visibly instead of silently cutting. */
.app-sidebar .brand {
    display: flex;
    align-items: center;
    gap: .5rem;
    min-height: var(--topbar-h);
    padding: 0 .7rem;
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    text-decoration: none;
    border-bottom: 1px solid var(--sidebar-border);
    flex: 0 0 auto;
}

.app-sidebar .brand .logo {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    border-radius: 7px;
    background: var(--brand);
    display: grid;
    place-items: center;
    font-size: .8rem;
    font-weight: 800;
    color: #fff;
}

/* The brand mark is the ACI logo image now, not the "AP" initials it replaced. The rule above it
   (site.css L114) was written for a text span: a blue --brand fill, a 7px radius, and a centred
   grid. None of that survives contact with an image whose corners are transparent - the blue would
   show through as four blue notches around the green disc. Same specificity as that rule, but
   later in the file, so it wins. */
.app-sidebar .brand .logo {
    background: none;
    border-radius: 50%;
    display: block;
    object-fit: contain;
    font-size: initial;
    font-weight: initial;
    color: initial;
}

.app-sidebar .brand .brand-text {
    /* "Universal Attendance System" is longer than the old company name; let it wrap
       to two short lines instead of clipping mid-word. */
    font-size: .74rem;
    line-height: 1.15;
    white-space: normal;
    overflow-wrap: anywhere;
}

/* ---- scrollable menu ---- */
.app-menu {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 1rem;
}

/* The scrollbar is the vertical bar down the right of the menu. It was 6px of #243043 sitting on
   a #101828 panel - too narrow and too close in tone to be seen. It is now 8px of #46587a, which
   is several steps lighter than the panel, with a track you can see and a hover shade. The two
   standard-property lines cover Firefox, which ignores the -webkit- pseudo-elements entirely and
   would otherwise fall back to the invisible default. */
.app-menu {
    scrollbar-width: thin;
    scrollbar-color: var(--sidebar-scroll) transparent;
}

.app-menu::-webkit-scrollbar {
    width: 8px;
}

.app-menu::-webkit-scrollbar-track {
    background: #0b111c;
    border-radius: 4px;
}

.app-menu::-webkit-scrollbar-thumb {
    background: var(--sidebar-scroll);
    border-radius: 4px;
}

.app-menu::-webkit-scrollbar-thumb:hover {
    background: var(--sidebar-scroll-hover);
}

/* ---- section heading (non clickable group title) ---- */
.app-menu .section {
    font-size: .66rem;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--sidebar-heading);
    padding: 1rem 1rem .3rem;
    white-space: nowrap;
}

/* ---- leaf links ---- */
.app-menu a.nav-link {
    display: flex;
    align-items: center;
    gap: .65rem;
    color: var(--sidebar-text);
    padding: .5rem 1rem;
    border-left: 3px solid transparent;
    font-size: .9rem;
    text-decoration: none;
    white-space: nowrap;
}

.app-menu a.nav-link:hover {
    background: var(--sidebar-bg-hover);
    color: #fff;
}

.app-menu a.nav-link.active {
    background: var(--sidebar-bg-active);
    color: #fff;
    border-left-color: var(--brand);
    font-weight: 600;
}

/* ---- monochrome SVG icons ---- */
.app-menu .ico {
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: .8;
}

.app-menu .ico svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.app-menu a.nav-link.active .ico,
.app-menu .nav-group.open > .nav-link .ico {
    opacity: 1;
}

.app-menu .nav-group > .nav-link .chevron svg {
    width: 13px;
    height: 13px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.app-menu a.nav-link .lbl {
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---- collapsible parent menu ---- */
.app-menu .nav-group {
    border: 0;
    margin: 0;
    padding: 0;
}

.app-menu .nav-group > .nav-link {
    display: flex;
    align-items: center;
    gap: .65rem;
    /* The parent is inset .4rem each side so its tinted panel reads as a separate block with the
       dark sidebar showing either side of it. That inset is why this is calc(100% - .8rem) and not
       the 100% the rule used to carry: width:100% plus a margin would push 8px past the menu's
       content box and trip its overflow-x:hidden, clipping the right-hand edge of every parent.
       Dropping width entirely is also wrong - .app-menu is display:block, so a button with no width
       shrink-wraps its label and the panel stops mid-sidebar at whatever the text happens to be. */
    width: calc(100% - .8rem);
    color: var(--sidebar-parent-text);
    background: var(--sidebar-parent-bg);
    border: 0;
    border-left: 3px solid transparent;
    border-radius: 6px;
    margin: .2rem .4rem 0;
    padding: .5rem .55rem .5rem calc(1rem - 3px);
    font-size: .9rem;
    font-weight: 600;
    letter-spacing: .01em;
    text-align: left;
    cursor: pointer;
    transition: background .15s ease, border-left-color .15s ease;
}

/* An open parent keeps its accent bar so you can see, at a glance, which of the two collapsible
   sections you are currently looking into. */
.app-menu .nav-group.open > .nav-link {
    border-left-color: var(--sidebar-parent-line);
}

.app-menu .nav-group > .nav-link:hover {
    background: var(--sidebar-parent-hover);
    color: #fff;
}

/* down arrow marks a parent menu that has a submenu */
/* The down arrow on a parent, pushed to the far right by margin-left:auto. It was a bare
   &#8964; text glyph at .75 opacity, which is what made it hard to see: it inherited the parent's
   near-white, had no shape of its own, and changed very little on hover. It is now a stroked SVG
   (the i-chevron-down symbol the layout already defines and never used) sitting in a small tinted
   rounded square, in a light blue that is visibly a different colour from both the parent's white
   text and the muted grey of the children. The square is what makes it findable; the colour is
   what makes it obviously a control. */
.app-menu .nav-group > .nav-link .chevron {
    margin-left: auto;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    color: var(--sidebar-chevron);
    background: var(--sidebar-chevron-bg);
    border-radius: 5px;
    opacity: 1;
    transition: transform .2s ease, background .15s ease, color .15s ease;
}

.app-menu .nav-group > .nav-link:hover .chevron {
    background: var(--sidebar-parent-line);
    color: #fff;
}

/* Open flips the arrow over, so the same control reads as "collapse" rather than "expand". */
.app-menu .nav-group.open > .nav-link .chevron {
    transform: rotate(180deg);
    color: #fff;
    background: var(--sidebar-parent-line);
}

/* submenu body - animated via max-height so we can use plain CSS */
.app-submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height .2s ease;
}

.app-submenu a.nav-link {
    /* Indent 2.6rem -> 2rem and right padding 1rem -> .75rem. This is where the narrower
       sidebar gets its room back: together they return ~15.6px to the label on every submenu
       leaf, which is the row that has the least space to spare. */
    padding-left: 2rem;
    padding-right: .75rem;
    font-size: .88rem;
}

.app-submenu a.nav-link.sub-active {
    background: var(--sidebar-bg-active);
    color: #fff;
    border-left-color: var(--brand);
    font-weight: 600;
}

/* A plain label splitting one submenu into sections. Only exists because the Attendance
   group now lists twenty-two screens; without a divider it is an undifferentiated wall. */
.app-submenu .nav-section {
    padding: .8rem 2.6rem .3rem;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--sidebar-text-dim, #7d8899);
}

body.sidebar-collapsed .app-submenu .nav-section {
    padding-left: .8rem;
    overflow: hidden;
    text-overflow: clip;
}

/* ---------------------------------------------------------
   Sidebar collapsed (icon rail)
   --------------------------------------------------------- */

body.sidebar-collapsed .app-sidebar {
    width: var(--sidebar-w-collapsed);
}

body.sidebar-collapsed .app-main {
    margin-left: var(--sidebar-w-collapsed);
}

body.sidebar-collapsed .app-sidebar .brand .brand-text,
body.sidebar-collapsed .app-menu .section,
body.sidebar-collapsed .app-menu a.nav-link .lbl,
body.sidebar-collapsed .app-menu .nav-group > .nav-link .chevron,
body.sidebar-collapsed .app-menu .nav-group > .nav-link .group-text {
    display: none;
}

body.sidebar-collapsed .app-menu a.nav-link,
body.sidebar-collapsed .app-menu .nav-group > .nav-link {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}

/* in rail mode the submenu is hidden - the group link flies out instead */
body.sidebar-collapsed .app-submenu {
    display: none;
}

/* fly-out submenu (only while collapsed) */
.app-flyout {
    position: fixed;
    left: var(--sidebar-w-collapsed);
    top: var(--topbar-h);
    min-width: 210px;
    background: var(--sidebar-bg);
    border: 1px solid var(--sidebar-border);
    border-radius: var(--radius);
    box-shadow: 0 10px 30px rgba(16, 24, 40, .18);
    padding: .35rem 0;
    display: none;
    z-index: 1046;
}

body.sidebar-collapsed .app-flyout.show {
    display: block;
}

.app-flyout a {
    display: block;
    padding: .45rem .9rem;
    color: var(--sidebar-text);
    font-size: .88rem;
    text-decoration: none;
    white-space: nowrap;
}

.app-flyout a:hover,
.app-flyout a.sub-active {
    background: var(--sidebar-bg-active);
    color: #fff;
}

/* ---------------------------------------------------------
   Top bar
   --------------------------------------------------------- */

.app-main {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left .18s ease;
}

.app-topbar {
    height: var(--topbar-h);
    flex: 0 0 var(--topbar-h);
    /* Black bar, white text. The sidebar is already near-black (#101828), so this reads as one
       continuous dark band down the left and across the top rather than two separate panels. */
    background: #0b0f17;
    color: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .28);
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: 0 .9rem;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.icon-btn {
    border: 0;
    background: transparent;
    color: rgba(255, 255, 255, .82);
    width: 30px;
    height: 30px;
    border-radius: 6px;
    display: grid;
    place-items: center;
    cursor: pointer;
    font-size: 1rem;
    flex: 0 0 auto;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, .12);
    color: #fff;
}

/* The three-dot user menu. Identical in size and colour to .icon-btn so the bar's right-hand
   end has one control size rather than two, but with a focus ring because this one opens
   something. */
.topbar-menu-btn {
    border: 0;
    background: transparent;
    color: rgba(255, 255, 255, .82);
    width: 30px;
    height: 30px;
    border-radius: 6px;
    display: grid;
    place-items: center;
    cursor: pointer;
    font-size: 1.05rem;
    line-height: 1;
    letter-spacing: 1px;
    flex: 0 0 auto;
}

.topbar-menu-btn:hover {
    background: rgba(255, 255, 255, .12);
    color: #fff;
}

.topbar-menu-btn:focus-visible {
    outline: 2px solid #60a5fa;
    outline-offset: 1px;
}

/* Live punch readout, rendered by the dashboard's TopbarLive section. A translucent green pill
   rather than a button - it reports status, it does not open anything. The dashboard's card
   chip colours are built for a white surface and have no contrast on this bar, so the bar gets
   its own. */
.topbar-live {
    display: inline-flex;
    align-items: center;
    gap: .38rem;
    padding: .18rem .55rem;
    border-radius: 999px;
    background: rgba(16, 185, 129, .13);
    border: 1px solid rgba(16, 185, 129, .3);
    color: #d1fae5;
    font-size: .72rem;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
}

.topbar-live .pulse-dot { width: 6px; height: 6px; }

.topbar-live-label {
    font-size: .58rem;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: #34d399;
}

/* dashboard-live.js writes the count and age into #rtStatus and marks failures with Bootstrap's
   .text-warning-emphasis, which is a dark amber built for light surfaces. */
.topbar-live .rt-status {
    font-size: .72rem;
    color: #e5e7eb;
}

.topbar-live .text-warning-emphasis { color: #fbbf24 !important; }
.topbar-live a { color: #93c5fd; }

/* First thing to give up on a phone: the bar has to keep the menu and breadcrumb readable.
   Same breakpoint the read-only badge already uses. */
@media (max-width: 575.98px) {
    .topbar-live { display: none; }
}

/* allows flex children to shrink and ellipsis properly */
.min-w-0 {
    min-width: 0;
}

.topbar-title {
    font-weight: 600;
    color: var(--text);
    font-size: .98rem;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* breadcrumb trail - on the black bar, so both levels are light, with the current page brighter
   than the trail leading to it. Two steps, not three: the trail stays quiet, the page does not. */
.topbar-crumbs {
    font-size: .78rem;
    color: rgba(255, 255, 255, .62);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar-crumbs .sep {
    margin: 0 .3rem;
    opacity: .5;
}

.topbar-crumbs .current {
    color: #fff;
    font-weight: 600;
}

/* Identity block at the head of the dropdown. It used to sit in the bar as a chip showing the
   avatar, name and role on every screen; moving it in here is what lets the bar drop to 44px,
   since nothing in it needs two lines of height any more. */
.user-menu-head {
    display: flex;
    align-items: center;
    gap: .55rem;
    padding: .6rem .85rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: .25rem;
}

.user-menu-head .avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--brand);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: .76rem;
    font-weight: 700;
    flex: 0 0 auto;
}

.user-menu-head .who {
    min-width: 0;
    line-height: 1.15;
}

.user-menu-head .who .name {
    display: block;
    font-size: .84rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-menu-head .who .role {
    display: block;
    font-size: .7rem;
    color: var(--text-muted);
}

/* The .user-chip rules that used to live here were removed when the identity moved into the
   three-dot dropdown. The bar no longer renders an avatar/name/role chip, and leaving the
   styles behind would be dead CSS that later looks like something still in use. */

.dropdown-menu {
    border-color: var(--border);
    box-shadow: 0 8px 24px rgba(16, 24, 40, .1);
    font-size: .89rem;
}

.dropdown-item {
    padding: .45rem .9rem;
}

.dropdown-item.text-danger:hover {
    background: #fef3f2;
}

/* mobile backdrop */
.app-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(16, 24, 40, .45);
    z-index: 1044;
    display: none;
}

.app-backdrop.show {
    display: block;
}

/* ---------------------------------------------------------
   Page content
   --------------------------------------------------------- */

.app-content {
    /* A 1px hairline on all four sides.

       Zero was structurally correct - the topbar's bottom edge sits on this element and
       .app-main's margin-left already butts it against the sidebar, so no padding was ever
       needed to close either gap. But zero leaves content hard against the dark sidebar and
       the sticky header, which reads as cramped rather than flush. 1px is enough to let the
       edges breathe and to stop a card's border merging with the sidebar's, without reopening
       a gap worth naming. */
    padding: 1px;
    flex: 1 1 auto;
}

.page-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.page-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    margin: 0;
}

.breadcrumb-page {
    font-size: .78rem;
    color: var(--text-muted);
    margin: 0;
}

/* ---------------------------------------------------------
   Dashboard - mirrors the ZKBio Time dashboard
   --------------------------------------------------------- */

.dash-card .card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
}

.dash-card-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--brand);
}

.dash-hint {
    font-size: .76rem;
    color: var(--text-muted);
    font-weight: 400;
}

.dash-panel-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #344054;
    margin-bottom: .35rem;
}

/* ---- donut charts (inline SVG, no chart library needed) ---- */
.donut-wrap {
    position: relative;
    display: grid;
    place-items: center;
    padding: .25rem 0 .5rem;
}

.donut {
    width: 175px;
    height: 175px;
    transform: rotate(-90deg);
}

.donut circle {
    fill: none;
    stroke-width: 9;
}

.donut-track {
    stroke: #e4e7ec;
}

.donut-arc {
    stroke-linecap: butt;
}

.donut-present,
.sw-present { stroke: #6fcf7f; background: #6fcf7f; }

.donut-absent,
.sw-absent { stroke: #f0685f; background: #f0685f; }

.donut-online,
.sw-online { stroke: #6fcf7f; background: #6fcf7f; }

.donut-offline,
.sw-offline { stroke: #f0685f; background: #f0685f; }

.sw-unauth { background: #ffd24d; }

.donut-centre {
    position: absolute;
    text-align: center;
    line-height: 1.15;
}

.donut-value {
    font-size: 1.15rem;
    font-weight: 700;
    color: #344054;
}

.donut-sub {
    font-size: .72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .05em;
}

/* ---- legends ---- */
.legend {
    list-style: none;
    margin: .25rem 0 0;
    padding: 0;
    font-size: .86rem;
}

.legend li {
    display: flex;
    align-items: center;
    gap: .45rem;
    padding: .1rem 0;
}

.legend b {
    font-weight: 600;
    color: #344054;
}

.legend em {
    font-style: normal;
    color: var(--text-muted);
    font-size: .8rem;
}

.swatch {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    display: inline-block;
    flex: 0 0 12px;
}

/* ---- department bars ---- */
.bars {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    height: 220px;
    padding: .5rem .25rem 0;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
}

.bar-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    min-width: 90px;
    height: 100%;
    flex: 1 1 0;
}

.bar-value {
    font-size: .78rem;
    color: var(--text-muted);
    margin-bottom: .25rem;
}

.bar-track {
    flex: 1 1 auto;
    width: 46px;
    display: flex;
    align-items: flex-end;
    background: #f2f4f7;
    border-radius: 4px 4px 0 0;
}

.bar-fill {
    width: 100%;
    background: linear-gradient(180deg, #7fd18f, #6fcf7f);
    border-radius: 4px 4px 0 0;
    min-height: 2px;
}

.bar-fill.zero {
    background: #d0d5dd;
}

.bar-label {
    font-size: .74rem;
    color: #475467;
    text-align: center;
    padding: .4rem .15rem 0;
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---- real-time punch feed ---- */
.rt-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 430px;
    overflow-y: auto;
}

.rt-row {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .55rem .85rem;
    border-bottom: 1px solid var(--border);
}

.rt-row:hover {
    background: var(--muted-bg);
}

.rt-avatar {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border-radius: 50%;
    object-fit: cover;
    background: #eaecf0;
}

.rt-initials {
    display: grid;
    place-items: center;
    font-size: .78rem;
    font-weight: 700;
    color: #667085;
    text-transform: uppercase;
}

.rt-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1 1 auto;
}

.rt-code {
    font-size: .74rem;
    color: var(--text-muted);
}

.rt-name {
    font-size: .88rem;
    color: #344054;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rt-device {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    flex: 0 0 auto;
}

.rt-device-name {
    font-size: .76rem;
    color: #475467;
    display: flex;
    align-items: center;
    gap: .25rem;
}

.rt-time {
    font-size: .74rem;
    color: var(--text-muted);
}

.rt-state {
    flex: 0 0 auto;
    font-size: .76rem;
    color: var(--text-muted);
    min-width: 62px;
    text-align: right;
}

/* ---------------------------------------------------------
   /* ---------------------------------------------------------
   Sign-in screen: black stage + water-gradient wordmark
   ---------------------------------------------------------

   Scope is deliberate. The black stops at the stage and does not run under the sidebar or the
   top bar, which keep the colours they have everywhere else in the application. The card stays
   white, because every control inside it - Bootstrap form labels, the muted plant panel, the
   danger alert - is styled for a white surface, and darkening the card as well would mean
   re-styling the whole form. White card on black is the contrast, not black on black.

   The wordmark paints the glyphs with a gradient instead of filling them, which is what makes it
   read as water rather than as a coloured heading. Two things had to be got right for that:

   1. `color: transparent` is declared INSIDE @supports, after a solid fallback colour. The
      unsupported-browser case is "invisible text" otherwise, not "plain text" - the classic way
      to ship this effect and end up with a blank heading on one browser.
   2. The animation moves `background-position`, never the element. Animating position on the
      text itself would reflow the wordmark on every frame. `prefers-reduced-motion` stops it
      outright rather than merely shortening it. */

/* Full 100vh, and deliberately NOT 100vh-minus-the-topbar.

   _Layout renders the sidebar and top bar only for a signed-in viewer; signed out - the normal
   case on this page - it renders a bare centred <main class="app-content"> with no bar at all. So
   reserving --topbar-h left a 44px band of page background below the stage: a grey strip under a
   black screen, with no scrollbar to explain it.

   A signed-in user who lands here anyway does get the 44px bar and therefore a 44px scroll, which
   is the behaviour this page had before it was restyled and is the right trade: the strip is seen
   every time, the scroll is seen only by someone who had no reason to be on the sign-in page. */
.zk-signin-stage {
    min-height: 100vh;
    /* Cancels the 1px padding .app-content carries, which otherwise made the document 3px taller
       than the viewport and put a scrollbar down the side of a black page. A -1px margin, not a
       smaller min-height, so it stays correct if that padding is ever changed. */
    margin: -1px;
    /* Full-bleed brand gradient rather than flat black.

       Three layers, all dark enough that the white sign-in card keeps its contrast:
         1. a deep navy-to-ink vertical base, so the page has depth top to bottom,
         2. a wide, very soft cyan bloom behind the card, which is what stops the middle
            from reading as a dead void,
         3. a faint diagonal sheen, which gives the surface a direction instead of a
            perfectly uniform wash.

       The first two are fixed-attachment so they stay put against the viewport when the page
       scrolls, rather than sliding and leaving the bloom off-centre. `background-attachment`
       is ignored by some mobile browsers, where the layers simply scroll - which still looks
       correct, just less anchored. */
    background-color: #050b14;
    background-image:
        radial-gradient(120% 90% at 50% 42%, rgba(23, 162, 224, .22) 0%, rgba(11, 61, 145, .10) 45%, rgba(5, 11, 20, 0) 72%),
        linear-gradient(135deg, rgba(255, 255, 255, .035) 0%, rgba(255, 255, 255, 0) 38%),
        linear-gradient(170deg, #0a2544 0%, #071b31 42%, #050f1c 74%, #03080f 100%);
    background-attachment: fixed, fixed, fixed;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding: 2rem 1rem;
}

/* The card has to sit above the background layers, or a positioned ::before over it. The stage
   is now the gradient itself, so this only needs to guarantee the card wins the paint order. */
.zk-signin-stage > .row {
    position: relative;
    z-index: 1;
}

/* On black the 1px card border and the small shadow are invisible, so the white panel needs its
   own edge and a shadow with enough spread to read at 44px from the topbar.

   The selector is two classes, not one, on purpose. A plain `.zk-signin-card` is specificity
   0-1-0 and ties with `.card` (0-1-0) - and `.card` is declared LATER in this file, in the
   "Cards / tables / forms / buttons" section that follows. So the single-class version silently
   lost: measured border came back `0.8px rgb(227,232,239)` radius `8px`, Bootstrap's defaults,
   and my 14px / translucent-white edge never applied. Two classes beats one regardless of order. */
.zk-signin-stage .zk-signin-card {
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, .14);
    box-shadow:
        0 18px 50px rgba(0, 0, 0, .55),
        0 2px 8px rgba(0, 0, 0, .4);
}

/* Fallback first: a solid cyan that reads correctly even with no gradient support at all. */
.zk-water {
    color: #35d6e8;
    font-weight: 700;
    letter-spacing: .01em;
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
    .zk-water {
        background-image: linear-gradient(100deg,
            #0b3d91 0%,
            #1266b8 12%,
            #17a2e0 26%,
            #35d6e8 40%,
            #6ff0e0 50%,
            #2bb6d8 62%,
            #1273c4 78%,
            #0b3d91 100%);
        /* Wider than the element so the sweep has somewhere to travel - a gradient at exactly
           100% width has no room to move and the animation would look frozen. */
        background-size: 220% 100%;
        -webkit-background-clip: text;
        background-clip: text;
        color: transparent;
        -webkit-text-fill-color: transparent;
        /* Follows the glyph outline, so the glow hugs the letters instead of sitting behind the
           word as a rectangle. drop-shadow, not box-shadow, for exactly that reason. */
        filter: drop-shadow(0 0 16px rgba(53, 214, 232, .34));
        animation: zk-water-sweep 16s ease-in-out infinite alternate;
    }
}

@keyframes zk-water-sweep {
    from { background-position: 0% 50%; }
    to   { background-position: 100% 50%; }
}

@media (prefers-reduced-motion: reduce) {
    .zk-water {
        animation: none;
        background-position: 22% 50%;
    }
}

/* ---------------------------------------------------------
   Cards / tables / forms / buttons
   --------------------------------------------------------- */

.card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}

.card-header {
    background: #fff;
    font-weight: 600;
    border-bottom: 1px solid var(--border);
}

.table thead th {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-muted);
    background: var(--muted-bg);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.table tbody tr:hover {
    background: #fcfdff;
}

.table td {
    vertical-align: middle;
}

.form-label {
    font-weight: 600;
    font-size: .84rem;
    color: #344054;
}

.form-control,
.form-select {
    font-size: .92rem;
}

.required::after {
    content: " *";
    color: #d92d20;
}

.btn-primary {
    background: var(--brand);
    border-color: var(--brand);
}

.btn-primary:hover,
.btn-primary:focus {
    background: var(--brand-dark);
    border-color: var(--brand-dark);
}

.stat-card .stat-value {
    font-size: 1.7rem;
    font-weight: 700;
    line-height: 1.1;
}

.stat-card .stat-label {
    font-size: .74rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-muted);
}

.ro-badge {
    background: #fff3e0;
    color: #b26a00;
    border: 1px solid #ffd699;
}

/* compact toolbars above tables */
.toolbar {
    display: flex;
    gap: .5rem;
    align-items: center;
    flex-wrap: wrap;
}

/* ---------------------------------------------------------
   Responsive: sidebar becomes an off-canvas drawer
   --------------------------------------------------------- */

@media (max-width: 991.98px) {
    .app-sidebar {
        transform: translateX(-100%);
        width: var(--sidebar-w);
        box-shadow: 0 0 40px rgba(16, 24, 40, .3);
    }

    body.sidebar-open .app-sidebar {
        transform: translateX(0);
    }

    /* the rail/collapse concept does not apply on small screens */
    body.sidebar-collapsed .app-sidebar {
        width: var(--sidebar-w);
    }

    body.sidebar-collapsed .app-sidebar .brand .brand-text,
    body.sidebar-collapsed .app-menu .section,
    body.sidebar-collapsed .app-menu a.nav-link .lbl,
    body.sidebar-collapsed .app-menu .nav-group > .nav-link .group-text {
        display: revert;
    }

    .app-main,
    body.sidebar-collapsed .app-main {
        margin-left: 0;
    }

    .app-flyout {
        display: none !important;
    }

    /* Same 1px hairline at narrow widths. Anything larger here would reopen a gap on exactly
       the smallest screens, where there is least room to spend it. */
    .app-content {
        padding: 1px;
    }
}
/* ---------------------------------------------------------
   Self-service page content lives in css/self-service.css, next
   to the Employee and Daily attendance sheets it now follows.
   Only the standalone sign-in/denied screens remain below, because
   they render outside the application shell.
   --------------------------------------------------------- */

:root {
    --ss-green: #6fcf7f;
}

/* ---- login ---- */
.ss-login-body {
    background: var(--ss-green);
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1.5rem;
}

.ss-login-card {
    background: #fff;
    border-radius: 12px;
    padding: 1.75rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .18);
}

.ss-login-head { text-align: center; margin-bottom: 1.25rem; }

.ss-login-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    color: #2e9e50;
}

.ss-login-sub {
    color: #667085;
    font-size: .88rem;
    margin: .3rem 0 0;
}

.ss-login-foot {
    text-align: center;
    margin-top: 1.25rem;
    font-size: .84rem;
}
/* ---------------------------------------------------------
   Roles - read-only badges and the locked nav item
   --------------------------------------------------------- */

/* A menu row that exists only to say "you cannot have this". */
.nav-locked {
    cursor: default;
    opacity: .55;
    font-style: italic;
    pointer-events: none;
}

.nav-locked .lbl {
    font-size: .82rem;
}

/* An empty validation summary still renders its alert box unless something hides it.
   ASP.NET Core's tag helper marks that state with `validation-summary-valid` but does not
   hide it on its own, so every form in this application showed a blank coloured bar on a
   clean page load. One rule fixes all of them. */
.validation-summary-valid {
    display: none !important;
}

@media (max-width: 991.98px) {
    .app-flyout { display: none; }
}
.menu-search label { color: #cbd5e1; margin-bottom: .3rem; }
#menu-search-results { max-height: 320px; overflow-y: auto; }
.sidebar-collapsed .menu-search { display: none; }
@media (max-width: 991.98px) { .sidebar-collapsed .menu-search { display: block; } }

/* The .native-menu-heading rule that was here styled the ORGANIZATION / EMPLOYEE captions
   above each group of submenu links. Those captions were plain <div>s with no link and no
   handler, so they have been removed from the markup; the rule goes with them rather than
   sitting in the file looking like something still rendered. */
.app-flyout {max-height: 80vh; overflow-y: auto;}

/* ---------------------------------------------------------
   FILTER BAR

   A borderless row of filters and buttons above a list.

   This replaces a bordered .card whose own title line plus a
   separate right-aligned button row made three visual bands out
   of two rows of content. The card's border and its mb-3 gap are
   what made the page feel padded-out, so neither is reproduced
   here - only a hairline underneath, which separates the filters
   from the table without boxing them in.
   --------------------------------------------------------- */

.filter-bar {
    padding: .55rem .7rem .6rem;
    margin-bottom: .7rem;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.filter-bar > form { margin-bottom: 0; }

/* Each field is a flex item whose basis the view sets inline, so the button group keeps its
   natural width instead of being squeezed onto a second line. min-width:0 stops a long
   placeholder forcing the row wider than the window. */
.fb-field { min-width: 0; }

/* The button group sits flush with the inputs' baseline rather than dropping below them,
   so Search / Clear / Excel / Add Employee all read as one row. */
.filter-bar .btn { white-space: nowrap; }
/* -----------------------------------------------------------
   INFO TIP

   Page-level explanatory text used to sit in a full-width
   paragraph or alert above the content, costing a band of
   vertical space on every visit. The same text now hangs off a
   small "i" beside the heading: visible on hover, on keyboard
   focus, or on tap (site.js toggles .open).

   The bubble is plain text on purpose - a tooltip that needs a
   click to read a link is worse than the paragraph it replaced,
   so anything with an action in it stays on the page.
   --------------------------------------------------------- */
.info-tip { position: relative; display: inline-flex; align-items: center; vertical-align: middle; }
.info-tip-btn {
    width: 18px; height: 18px; padding: 0; cursor: help;
    border: 1px solid #94a3b8; border-radius: 50%; background: #fff; color: #475569;
    font-size: 11px; font-weight: 700; line-height: 1;
    display: inline-flex; align-items: center; justify-content: center;
}
.info-tip-btn:hover, .info-tip-btn:focus-visible {
    border-color: #142d4e; background: #eef4fb; color: #142d4e; outline: none;
}
.info-tip-bubble {
    position: absolute; z-index: 1060; top: calc(100% + 8px); left: 0;
    width: max-content; max-width: min(380px, 86vw); padding: 8px 10px;
    border-radius: 6px; background: #142d4e; color: #fff;
    font-size: 12px; font-weight: 400; line-height: 1.5; text-align: left;
    white-space: normal; box-shadow: 0 10px 24px rgba(15, 23, 42, .22);
    opacity: 0; visibility: hidden; transform: translateY(-3px);
    transition: opacity .12s ease, transform .12s ease; pointer-events: none;
}
.info-tip-bubble::before {
    content: ""; position: absolute; bottom: 100%; left: 9px;
    border: 6px solid transparent; border-bottom-color: #142d4e;
}
.info-tip:hover .info-tip-bubble,
.info-tip:focus-within .info-tip-bubble,
.info-tip.open .info-tip-bubble { opacity: 1; visibility: visible; transform: translateY(0); }

/* Rich help content inherits the tooltip's readable colors, not the muted form styling. */
.info-tip-help { margin: 0 4px 4px 0; }
.info-tip-bubble .info-tip-content {
    display: block; margin: 0 !important; padding: 0 !important; border: 0 !important;
    background: transparent !important; color: inherit !important;
    font-size: inherit !important; line-height: inherit !important; width: auto !important;
}
.info-tip-bubble code, .info-tip-bubble a { color: #c4e5ff; }
.info-tip-bubble { max-height: min(420px, 65vh); overflow-y: auto; }
.info-tip.open .info-tip-bubble, .info-tip:hover .info-tip-bubble,
.info-tip:focus-within .info-tip-bubble { pointer-events: auto; }
@media print { .info-tip { display: none !important; } }
.info-tip.dismissed .info-tip-bubble {
    opacity: 0; visibility: hidden; pointer-events: none;
}

/* Searchable combo (js/searchable-select.js): a text box and a listbox stand in front of a long
   <select>. The select is moved out of the way rather than removed, so it still posts its value
   under its own name. Global because both the employee form and the hard-copy leave form use it. */
.zk-combo-native { position:absolute; width:1px; height:1px; padding:0; opacity:0; pointer-events:none; }
.zk-combo-input { background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%2364748b' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3E%3C/svg%3E"); background-repeat:no-repeat; background-position:right .6rem center; background-size:12px; }
/* Room for the chevron. Written on the element so it also beats the per-page field padding rules,
   which are two-class selectors declared after this file. */
input.zk-combo-input { padding-right:1.9rem !important; }
.zk-combo-list { position:absolute; left:0; right:0; top:calc(100% + .15rem); z-index:1080; max-height:16rem; overflow:auto; margin:0; padding:.25rem; list-style:none; background:#fff; border:1px solid #cbd5e1; border-radius:.5rem; box-shadow:0 10px 24px #17315326; }
.zk-combo-option { padding:.35rem .55rem; border-radius:.35rem; cursor:pointer; font-size:.8rem; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.zk-combo-option:hover,.zk-combo-option.active { background:#e8f0fe; color:#1d4ed8; }
.zk-combo-option[aria-selected="true"] { font-weight:600; }
.zk-combo-empty { padding:.35rem .55rem; color:#64748b; font-size:.8rem; }
.name-combo-wrap { position:relative; }
.name-combo-list { position:absolute; left:0; right:0; top:calc(100% + .15rem); z-index:1090; max-height:14rem; overflow:auto; padding:.25rem; background:#fff; border:1px solid #cbd5e1; border-radius:.4rem; box-shadow:0 10px 24px #17315326; }
.name-combo-item { display:block; width:100%; text-align:left; border:0; background:transparent; padding:.35rem .55rem; border-radius:.3rem; cursor:pointer; font-size:.8rem; color:#334155; }
.name-combo-item:hover,.name-combo-item:focus { background:#e8f0fe; color:#1d4ed8; outline:none; }
