/* =====================================================================
 *  manager.css  —  Manager mobile UI  ·  FRESH REBUILD (Indigo / 2026)
 *
 *  A brand-new, clean & modern LIGHT theme. Flatter than before — crisp
 *  hairline borders, soft-tinted icons, an indigo accent, capsule controls.
 *
 *  Re-skin only: every class name + CSS variable the PHP pages and the
 *  standalone login / change-password screens use is preserved, so NO
 *  functionality or logic changes.
 *
 *  Built-in correctness:
 *    • Native system font (no web-font @import) → instant first paint
 *    • No backdrop-filter blur → smooth scrolling on fixed bars
 *    • No content entrance animation → no "blink" on navigation
 *    • Root is never overflow:hidden → vertical scroll always works
 *    • No press ripple/scale; focus ring keyboard-only → no stuck "hover"
 * ===================================================================== */

/* ----------------------------- tokens ------------------------------ */
:root{
    /* brand (indigo) — keeps the legacy --accent* names the pages reference */
    --accent:#4f46e5;  --accent-ink:#4338ca;  --accent-50:#eef2ff;  --accent-100:#e0e7ff;
    --grad:linear-gradient(135deg,#6366f1 0%,#4f46e5 55%,#4338ca 100%);

    /* surfaces & text */
    --bg:#f6f7fb;  --surface:#ffffff;  --surface-2:#f3f4fa;
    --line:#ebecf3;  --line-2:#dee0ec;
    --ink:#1b2030;  --ink-2:#585f78;  --muted:#969db2;

    /* accent palette (icons / status) */
    --green:#16a34a;  --green-50:#ecfdf3;
    --red:#ef4444;    --red-50:#fef3f2;
    --amber:#f59e0b;  --amber-50:#fff8e8;  --amber-ink:#b54708;
    --sky:#0ea5e9;    --sky-50:#eef8fe;    --sky-ink:#0369a1;
    --violet:#8b5cf6; --violet-50:#f5f3ff;
    --indigo:#4f46e5; --indigo-50:#eef2ff;

    /* shape, depth, motion — flatter than the old build */
    --r:16px;  --r-sm:12px;  --r-xs:9px;
    --shadow:0 1px 2px rgba(27,32,48,.04), 0 4px 12px -6px rgba(27,32,48,.09);
    --shadow-pop:0 14px 30px -12px rgba(27,32,48,.22);
    --shadow-brand:0 10px 22px -10px rgba(79,70,229,.5);
    --ease:cubic-bezier(.4,0,.2,1);
    --ease-out:cubic-bezier(.16,1,.3,1);

    --tab-h:62px;  --bar-h:54px;
    --sb:env(safe-area-inset-bottom,0px);
    --st:env(safe-area-inset-top,0px);
}

/* ------------------------------ base ------------------------------- */
*{ box-sizing:border-box; -webkit-tap-highlight-color:transparent; }
html{ scroll-behavior:smooth; }
html,body{
    margin:0; padding:0; background:var(--bg); color:var(--ink);
    font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
    font-size:15px; line-height:1.5; -webkit-font-smoothing:antialiased; letter-spacing:-.006em;
}
body{ overflow-x:clip; }                       /* stop sideways drift; vertical scroll intact */
a{ color:var(--accent-ink); text-decoration:none; }
img{ max-width:100%; }
:focus{ outline:none; }
:focus-visible{ outline:2px solid var(--accent); outline-offset:2px; }

/* ----------------------------- app bar ----------------------------- */
.m-appbar{
    position:sticky; top:0; z-index:30; display:flex; align-items:center; gap:12px;
    padding:calc(var(--st) + 14px) 16px 14px;
    background:var(--surface); border-bottom:1px solid var(--line);
    transition:box-shadow .25s var(--ease), border-color .25s var(--ease);
}
.m-appbar.scrolled{ box-shadow:0 6px 18px -12px rgba(27,32,48,.3); border-bottom-color:var(--line-2); }
.m-appbar .grow{ flex:1; min-width:0; }
.m-appbar .m-title{ font-size:19px; font-weight:800; letter-spacing:-.02em; line-height:1.2; color:var(--ink); }
.m-appbar .m-sub{ font-size:12.5px; color:var(--muted); font-weight:500; margin-top:2px; }
.m-appbar .m-back,.m-appbar .m-act{
    width:40px; height:40px; flex:none; border-radius:12px; display:grid; place-items:center;
    color:var(--ink-2); background:var(--surface-2); border:1px solid var(--line);
    cursor:pointer; }

/* ------------------------------ page ------------------------------- */
.m-main{ max-width:560px; margin:0 auto; padding:18px 16px calc(var(--tab-h) + var(--sb) + 26px); }
.m-label{ font-size:12.5px; font-weight:700; color:var(--ink-2); margin:6px 2px 11px; }
.m-mt{ margin-top:14px; } .m-center{ text-align:center; }
.text-danger{ color:var(--red); } .text-ok,.text-success{ color:var(--green); } .text-muted{ color:var(--muted); }

/* ------------------------------ cards ------------------------------ */
.m-card{ background:var(--surface); border:1px solid var(--line); border-radius:var(--r);
    box-shadow:var(--shadow); margin-bottom:14px; overflow:hidden; }
.m-card-head{ padding:15px 16px 2px; font-size:11.5px; font-weight:700; color:var(--muted);
    letter-spacing:.04em; text-transform:uppercase; }
.m-card-body{ padding:16px; }
.m-card-body.flush,.m-card-body.tight{ padding:4px 0; }

/* ------------------------------ hero ------------------------------- */
.m-hero{ position:relative; overflow:hidden; margin-bottom:14px;
    background:var(--grad); border-radius:var(--r); padding:20px; color:#fff; box-shadow:var(--shadow-brand); }
.m-hero::after{ content:""; position:absolute; right:-50px; top:-50px; width:170px; height:170px;
    border-radius:50%; background:rgba(255,255,255,.12); }
.m-hero .cap{ font-size:12.5px; font-weight:600; color:rgba(255,255,255,.85); }
.m-hero .big{ font-size:32px; font-weight:800; letter-spacing:-.03em; margin:6px 0 0; }
.m-hero .big small{ font-size:15px; font-weight:500; color:rgba(255,255,255,.82); }
.m-hero .track{ height:8px; border-radius:99px; background:rgba(0,0,0,.16); margin-top:15px; overflow:hidden; }
.m-hero .track > span{ display:block; height:100%; min-width:0; border-radius:99px; background:#fff; transition:width .6s var(--ease-out); }
.m-hero .note{ margin-top:11px; font-size:13px; font-weight:500; color:rgba(255,255,255,.92); }

/* ---------------------------- stat tiles --------------------------- */
.m-stats{ display:grid; grid-template-columns:1fr 1fr; gap:12px; margin-bottom:14px; }
.m-stat{ background:var(--surface); border:1px solid var(--line); border-radius:var(--r); padding:16px; box-shadow:var(--shadow); }
.m-stat .ic{ width:38px; height:38px; border-radius:11px; display:grid; place-items:center;
    background:var(--accent-50); color:var(--accent-ink); margin-bottom:12px; }
.m-stat .v{ font-size:24px; font-weight:800; letter-spacing:-.02em; line-height:1; }
.m-stat .l{ font-size:12.5px; color:var(--muted); font-weight:500; margin-top:5px; }
.m-stats .m-stat:nth-child(2) .ic{ background:var(--amber-50); color:var(--amber-ink); }

/* --------------------------- quick actions ------------------------- */
.m-qa{ display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.m-qa a{ display:flex; flex-direction:column; gap:11px; padding:16px; color:var(--ink);
    background:var(--surface); border:1px solid var(--line); border-radius:var(--r);
    box-shadow:var(--shadow); }
.m-qa .ic{ width:44px; height:44px; border-radius:12px; display:grid; place-items:center;
    background:var(--accent-50); color:var(--accent-ink); }
.m-qa .t{ font-weight:700; font-size:15px; }
.m-qa .s{ font-size:12px; color:var(--muted); margin-top:-4px; }
.m-qa a:nth-child(2) .ic{ background:var(--violet-50); color:var(--violet); }
.m-qa a:nth-child(3) .ic{ background:var(--amber-50);  color:var(--amber-ink); }
.m-qa a:nth-child(4) .ic{ background:var(--sky-50);    color:var(--sky-ink); }

/* ----------------------------- buttons ----------------------------- */
.m-btn{ position:relative; overflow:hidden;
    display:inline-flex; align-items:center; justify-content:center; gap:8px; width:100%;
    min-height:52px; padding:0 20px; border:none; cursor:pointer; font-family:inherit;
    font-size:15.5px; font-weight:700; letter-spacing:-.01em; border-radius:14px;
    background:var(--grad); color:#fff; box-shadow:var(--shadow-brand); }
.m-btn.secondary{ background:var(--surface); color:var(--ink); border:1px solid var(--line-2); box-shadow:var(--shadow); }
.m-btn.ghost{ background:transparent; color:var(--accent-ink); box-shadow:none; }
.m-btn.danger{ background:linear-gradient(135deg,#fb7185,#ef4444); box-shadow:0 10px 22px -10px rgba(239,68,68,.5); }
.m-btn.sm{ width:auto; min-height:42px; padding:0 16px; font-size:14px; border-radius:11px; box-shadow:none; }
.m-btn.sm.secondary{ box-shadow:none; }
.m-btn-row{ display:flex; gap:10px; }
.m-btn-row .m-btn{ flex:1; }

/* -------------------------- search & chips ------------------------- */
.m-search{ position:relative; margin-bottom:14px; }
.m-search svg{ position:absolute; left:15px; top:50%; transform:translateY(-50%); color:var(--muted); }
.m-search input{ width:100%; min-height:48px; padding:11px 14px 11px 44px; font-size:15px;
    border:1px solid var(--line-2); border-radius:13px; background:var(--surface); color:var(--ink);
    box-shadow:var(--shadow); transition:border-color .12s, box-shadow .12s; }
.m-search input:focus{ outline:none; border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-50); }
.m-chips{ display:flex; gap:8px; margin-bottom:16px; overflow-x:auto; -webkit-overflow-scrolling:touch; }
.m-chips::-webkit-scrollbar{ display:none; }
.m-chips a{ flex:none; padding:9px 16px; border-radius:99px; font-size:13px; font-weight:600;
    background:var(--surface); color:var(--ink-2); border:1px solid var(--line-2); }
.m-chips a.on{ background:var(--accent); color:#fff; border-color:var(--accent); box-shadow:var(--shadow-brand); }

/* ------------------------ filter + sort row ------------------------ */
.m-filterrow{ display:flex; align-items:center; gap:10px; margin-bottom:16px; }
.m-filterrow .m-chips{ flex:1; margin-bottom:0; }
.m-sortbar{ position:relative; flex:none; display:flex; align-items:center; }
.m-sortbar .ic{ position:absolute; right:10px; top:50%; transform:translateY(-50%); color:var(--muted); pointer-events:none; display:grid; }
.m-sortbar select{ appearance:none; -webkit-appearance:none; -moz-appearance:none;
    min-height:40px; padding:10px 32px 10px 15px; font:inherit; font-size:13px; font-weight:600;
    border:1px solid var(--line-2); border-radius:99px; background:var(--surface); color:var(--ink-2);
    box-shadow:var(--shadow); cursor:pointer; }
.m-sortbar select:focus{ outline:none; border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-50); }

/* ----------------------------- list rows --------------------------- */
.m-list{ list-style:none; margin:0; padding:0; }
.m-row{ position:relative; overflow:hidden; display:flex; align-items:center; gap:13px; padding:14px 16px;
    background:var(--surface); color:var(--ink); border-bottom:1px solid var(--line); }
.m-row:last-child{ border-bottom:none; }
.m-avatar{ width:44px; height:44px; flex:none; border-radius:13px; display:grid; place-items:center;
    font-weight:700; font-size:16px; color:var(--accent-ink); background:var(--accent-50); }
.m-row .meta{ flex:1; min-width:0; }
.m-row .meta .name{ font-weight:700; font-size:15px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.m-row .meta .sub{ font-size:12.5px; color:var(--muted); margin-top:1px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.m-row .right{ flex:none; text-align:right; }
.m-row .right .amt{ font-weight:800; }
.m-row .chev{ flex:none; color:var(--line-2); }

/* ----------------------------- badges ------------------------------ */
.m-badge{ display:inline-flex; align-items:center; padding:4px 10px; border-radius:99px; font-size:11px; font-weight:700; }
.m-badge.active,.m-badge.ok{ background:var(--green-50); color:var(--green); }
.m-badge.left,.m-badge.danger{ background:var(--red-50); color:var(--red); }
.m-badge.salaried{ background:var(--indigo-50); color:var(--indigo); }
.m-badge.daily{ background:var(--amber-50); color:var(--amber-ink); }

/* ------------------------------ forms ------------------------------ */
.m-field{ margin-bottom:16px; }
.m-field > label{ display:block; font-size:13px; font-weight:600; color:var(--ink-2); margin-bottom:7px; }
.m-field .req{ color:var(--red); }
.m-field input[type=text],.m-field input[type=number],.m-field input[type=tel],
.m-field input[type=date],.m-field input[type=password],.m-field select,.m-field textarea{
    width:100%; min-height:50px; padding:13px 14px; font-family:inherit; font-size:16px;
    border:1px solid var(--line-2); border-radius:12px; background:var(--surface); color:var(--ink);
    transition:border-color .12s, box-shadow .12s; }
.m-field textarea{ min-height:86px; resize:vertical; }
.m-field input:focus,.m-field select:focus,.m-field textarea:focus{
    outline:none; border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-50); }
.m-field .err{ margin-top:6px; font-size:12.5px; font-weight:500; color:var(--red); }
.m-field .hint{ margin-top:6px; font-size:12px; color:var(--muted); }
.m-check{ display:flex; align-items:center; gap:11px; padding:13px 14px; font-size:15px; font-weight:500;
    border:1px solid var(--line-2); border-radius:12px; background:var(--surface); }
.m-check input{ width:20px; height:20px; accent-color:var(--accent); }

/* segmented control */
.m-seg{ display:flex; gap:4px; padding:4px; border-radius:13px; background:var(--surface-2); border:1px solid var(--line); }
.m-seg label{ flex:1; }
.m-seg input{ position:absolute; opacity:0; pointer-events:none; }
.m-seg .opt{ display:block; text-align:center; padding:12px; font-size:14px; font-weight:700; color:var(--ink-2);
    cursor:pointer; border-radius:10px; transition:color .12s, background .12s; }
.m-seg input:checked + .opt{ background:var(--surface); color:var(--accent-ink); box-shadow:var(--shadow); }

/* ------------------------------ flash ------------------------------ */
.m-flash{ display:flex; align-items:flex-start; gap:10px; padding:13px 15px; margin-bottom:14px;
    border-radius:13px; font-size:14px; font-weight:500; }
.m-flash svg{ flex:none; margin-top:1px; }
.m-flash.ok{ background:var(--green-50); color:#157f4a; }
.m-flash.err{ background:var(--red-50); color:#c4393d; }
.m-flash.warn{ background:var(--amber-50); color:#9a6a08; }

/* ---------------------------- attendance --------------------------- */
.m-att{ padding:15px 16px; border-bottom:1px solid var(--line); }
.m-att:last-child{ border-bottom:none; }
.m-att .top{ display:flex; align-items:center; gap:10px; margin-bottom:11px; }
.m-att .top .nm{ flex:1; min-width:0; font-weight:700; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.m-att .top .cd{ font-size:11.5px; color:var(--muted); font-weight:500; }
.m-seg5{ display:grid; grid-template-columns:repeat(5,1fr); gap:6px; }
.m-seg5 label{ position:relative; }
.m-seg5 input{ position:absolute; opacity:0; pointer-events:none; }
.m-seg5 .pill{ display:block; text-align:center; padding:12px 0; font-size:13.5px; font-weight:700; cursor:pointer;
    border:1px solid var(--line-2); border-radius:11px; background:var(--surface); color:var(--ink-2); }
.m-seg5 input:checked + .pill.P{ background:var(--green-50); border-color:var(--green); color:var(--green); }
.m-seg5 input:checked + .pill.A{ background:var(--red-50); border-color:var(--red); color:var(--red); }
.m-seg5 input:checked + .pill.HD{ background:var(--amber-50); border-color:var(--amber); color:var(--amber-ink); }
.m-seg5 input:checked + .pill.WO{ background:var(--sky-50); border-color:var(--sky); color:var(--sky-ink); }
.m-seg5 input:checked + .pill.H{ background:var(--violet-50); border-color:var(--violet); color:var(--violet); }
.m-ot{ display:flex; align-items:center; gap:9px; margin-top:11px; }
.m-ot label{ font-size:12.5px; color:var(--muted); font-weight:500; }
.m-ot input{ width:96px; min-height:42px; padding:8px 12px; font-size:15px;
    border:1px solid var(--line-2); border-radius:11px; background:var(--surface); color:var(--ink); }
.m-ot input:disabled{ background:var(--surface-2); color:var(--muted); }

/* sticky save bar */
.m-savebar{ position:fixed; left:0; right:0; bottom:calc(var(--tab-h) + var(--sb)); z-index:25;
    max-width:560px; margin:0 auto; padding:12px 16px; background:var(--surface);
    border-top:1px solid var(--line); box-shadow:0 -6px 18px -12px rgba(27,32,48,.28); }
#att-form{ padding-bottom:78px; }                  /* clear the fixed Save bar */

/* ---------------------------- key / value -------------------------- */
.m-kv{ width:100%; border-collapse:collapse; }
.m-kv td{ padding:13px 0; border-bottom:1px solid var(--line); font-size:14.5px; vertical-align:top; }
.m-kv tr:last-child td{ border-bottom:none; }
.m-kv td.k{ width:42%; color:var(--muted); font-weight:500; }
.m-kv td.v{ color:var(--ink); font-weight:700; text-align:right; }

/* attendance summary tiles */
.m-attsum{ display:grid; grid-template-columns:repeat(3,1fr); gap:9px; }
.m-attsum .c{ background:var(--surface-2); border:1px solid var(--line); border-radius:12px; padding:14px 6px; text-align:center; }
.m-attsum .c .n{ font-size:21px; font-weight:800; letter-spacing:-.02em; }
.m-attsum .c .t{ margin-top:3px; font-size:10.5px; font-weight:600; color:var(--muted); letter-spacing:.02em; }

/* --------------------------- empty state --------------------------- */
.m-empty{ text-align:center; padding:54px 28px; }
.m-empty .ic,.m-empty .ico{ width:64px; height:64px; margin:0 auto 16px; border-radius:20px; display:grid; place-items:center;
    background:var(--accent-50); color:var(--accent-ink); }
.m-empty h3{ margin:0 0 6px; font-size:16px; font-weight:800; color:var(--ink); }
.m-empty p{ margin:0 0 18px; font-size:14px; color:var(--muted); }

/* --------------------------- bottom tabs --------------------------- */
.m-tabbar{ position:fixed; left:0; right:0; bottom:0; z-index:40; display:flex;
    height:calc(var(--tab-h) + var(--sb)); padding-bottom:var(--sb);
    background:var(--surface); border-top:1px solid var(--line); }
.m-tabbar a{ flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:3px;
    min-height:48px; font-size:11px; font-weight:600; color:var(--muted);
    transition:color .15s var(--ease); }
.m-tabbar a .ic{ width:48px; height:30px; border-radius:99px; display:grid; place-items:center;
    transition:background .18s var(--ease), color .18s var(--ease); }
.m-tabbar a.on{ color:var(--accent-ink); }
.m-tabbar a.on .ic{ background:var(--accent-50); color:var(--accent-ink); }

/* ------------------------------- FAB ------------------------------- */
.m-fab{ position:fixed; right:18px; bottom:calc(var(--tab-h) + var(--sb) + 18px); z-index:35;
    width:56px; height:56px; border-radius:18px; border:none; overflow:hidden;
    background:var(--grad); color:#fff; display:grid; place-items:center; box-shadow:var(--shadow-brand); }

/* no text-selection / long-press callout on chrome & controls */
.m-appbar,.m-tabbar,.m-fab,.m-btn,.m-chips,.m-sortbar,.m-seg,.m-seg5,.m-avatar,.m-badge{
    -webkit-user-select:none; user-select:none; -webkit-touch-callout:none; }

/* --------------------------- reduced motion ------------------------ */
@media (prefers-reduced-motion: reduce){
    *,*::before,*::after{ animation-duration:.001ms !important; animation-iteration-count:1 !important;
        transition-duration:.001ms !important; scroll-behavior:auto !important; }
}
