/* Mizan ERP - Copyright (c) 2026 Sameh Abuallaban. All rights reserved. */
:root{
  --bg:#f3f4f7;--surface:#ffffff;--surface2:#f7f8fb;--text:#1b1f2a;--muted:#667085;--line:#e4e7ec;--line2:#d0d5dd;
  --accent:#1e7fc0;--accent-d:#176aa3;--accent-l:rgba(30,127,192,.12);--navy:#312e5f;--red:#d41f35;--green:#107c41;--amber:#b25e09;--gold:#d99a00;
  --ok-bg:#e3f5ea;--warn-bg:#fff3d6;--bad-bg:#fde7ea;--info-bg:#e3f1fb;--mute-bg:#eceff3;
  --shadow:0 1px 2px rgba(16,24,40,.05),0 6px 20px rgba(16,24,40,.06);--r:12px;--nav:#ffffffcc;
  --font:"Segoe UI Variable Text","Segoe UI Variable","Segoe UI",system-ui,-apple-system,Roboto,"Helvetica Neue",Arial,sans-serif;
}
[data-theme=dark]{
  --bg:#1c1d22;--surface:#2a2b31;--surface2:#24252b;--text:#f1f2f6;--muted:#a1a6b3;--line:#3a3c45;--line2:#4a4d58;
  --accent:#4aa8ea;--accent-d:#6ebcf0;--accent-l:rgba(74,168,234,.16);--navy:#b9b6f0;--red:#ff6b7d;--green:#4cd08a;--amber:#f0a248;--gold:#f2b81f;
  --ok-bg:#1d3a2b;--warn-bg:#40331a;--bad-bg:#432127;--info-bg:#1d3347;--mute-bg:#33353d;
  --shadow:0 1px 2px rgba(0,0,0,.3),0 6px 22px rgba(0,0,0,.28);--nav:#25262cd9;
}
*{box-sizing:border-box}
html,body{height:100%;margin:0}
body{font-family:var(--font);font-size:14px;color:var(--text);background:
  radial-gradient(1100px 520px at 8% -8%,rgba(30,127,192,.13),transparent 60%),
  radial-gradient(900px 480px at 102% 0%,rgba(212,31,53,.07),transparent 55%),var(--bg);background-attachment:fixed;-webkit-font-smoothing:antialiased}
[data-theme=dark] body{background:radial-gradient(1000px 500px at 5% -10%,rgba(74,168,234,.16),transparent 60%),radial-gradient(800px 420px at 100% 0%,rgba(255,107,125,.08),transparent 55%),var(--bg)}
h1,h2,h3,h4{margin:0;font-weight:600;letter-spacing:-.01em}
a{color:var(--accent);text-decoration:none}
button{font-family:inherit}
::-webkit-scrollbar{width:11px;height:11px}::-webkit-scrollbar-thumb{background:var(--line2);border-radius:8px;border:3px solid transparent;background-clip:content-box}::-webkit-scrollbar-thumb:hover{background:var(--muted);background-clip:content-box;border:3px solid transparent}

/* layout */
.shell{display:flex;height:100vh}
.nav{width:268px;flex:none;background:var(--nav);backdrop-filter:blur(24px) saturate(1.4);-webkit-backdrop-filter:blur(24px) saturate(1.4);border-right:1px solid var(--line);display:flex;flex-direction:column;padding:14px 10px;transition:width .2s ease;overflow:hidden}
.nav.collapsed{width:64px}
.brand{display:flex;align-items:center;gap:10px;padding:4px 8px 14px;min-height:56px}
.brand img{width:40px;height:30px;object-fit:contain;flex:none}
.brand b{font-size:15px;line-height:1.15;white-space:nowrap}.brand small{display:block;color:var(--muted);font-weight:400;font-size:11px}
.nav-scroll{flex:1;overflow-y:auto;overflow-x:hidden;padding-right:2px}
.nav-group{font-size:11px;text-transform:uppercase;letter-spacing:.08em;color:var(--muted);padding:14px 12px 6px;white-space:nowrap}
.nav.collapsed .nav-group{visibility:hidden;height:10px;padding:0}
.nav a.item{display:flex;align-items:center;gap:12px;height:40px;padding:0 12px;border-radius:8px;color:var(--text);cursor:pointer;position:relative;white-space:nowrap;margin:2px 0;transition:background .12s}
.nav a.item:hover{background:rgba(120,130,150,.14)}
.nav a.item.active{background:var(--accent-l);font-weight:600}
.nav a.item.active::before{content:"";position:absolute;left:0;top:10px;bottom:10px;width:3px;border-radius:3px;background:var(--accent)}
.nav a.item svg{width:20px;height:20px;flex:none;stroke:currentColor;fill:none;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.nav a.item.active svg{stroke:var(--accent)}
.nav.collapsed a.item span.t,.nav.collapsed .brand div,.nav.collapsed .me .who{display:none}
.me{display:flex;align-items:center;gap:10px;padding:10px;border-radius:10px;background:var(--surface2);border:1px solid var(--line);cursor:pointer;margin-top:8px;overflow:hidden}
.avatar{width:34px;height:34px;border-radius:50%;background:linear-gradient(135deg,var(--accent),var(--navy));color:#fff;display:grid;place-items:center;font-weight:600;font-size:13px;flex:none}
.me .who{min-width:0}.me .who b{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.me .who small{color:var(--muted)}
.main{flex:1;min-width:0;display:flex;flex-direction:column}
.topbar{height:60px;display:flex;align-items:center;gap:12px;padding:0 24px;flex:none}
.topbar h1{font-size:22px}
.topbar .sp{flex:1}
.crumb{color:var(--muted);font-size:13px}
.content{flex:1;overflow:auto;padding:4px 24px 28px}
.page{max-width:1500px;margin:0 auto;animation:rise .25s ease}
@keyframes rise{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}

/* controls */
.btn{display:inline-flex;align-items:center;gap:8px;height:34px;padding:0 14px;border-radius:7px;border:1px solid var(--line2);background:var(--surface);color:var(--text);font-size:13.5px;cursor:pointer;transition:background .12s,border-color .12s,transform .05s;white-space:nowrap}
.btn:hover{background:var(--surface2);border-color:var(--muted)}.btn:active{transform:scale(.98)}
.btn svg{width:16px;height:16px;stroke:currentColor;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.btn.primary{background:var(--accent);border-color:var(--accent);color:#fff}.btn.primary:hover{background:var(--accent-d);border-color:var(--accent-d)}
.btn.danger{color:var(--red);border-color:var(--red);background:transparent}.btn.danger:hover{background:var(--bad-bg)}
.btn.ghost{border-color:transparent;background:transparent}.btn.ghost:hover{background:rgba(120,130,150,.14)}
.btn.sm{height:28px;padding:0 10px;font-size:12.5px}.btn.icon{width:34px;padding:0;justify-content:center}.btn.sm.icon{width:28px}
.btn[disabled]{opacity:.5;pointer-events:none}
.input,.select,textarea.input{height:36px;padding:0 11px;border-radius:7px;border:1px solid var(--line2);border-bottom:2px solid var(--line2);background:var(--surface);color:var(--text);font:inherit;width:100%;outline:none;transition:border-color .12s}
textarea.input{height:auto;min-height:84px;padding:9px 11px;resize:vertical}
.input:focus,.select:focus{border-bottom-color:var(--accent)}
.input::placeholder{color:var(--muted)}
.select{appearance:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='3'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 10px center;padding-right:30px}
.row{display:flex;gap:12px;align-items:center;flex-wrap:wrap}.row.sp{justify-content:space-between}
.grid{display:grid;gap:16px}
.g2{grid-template-columns:repeat(2,minmax(0,1fr))}.g3{grid-template-columns:repeat(3,minmax(0,1fr))}.g4{grid-template-columns:repeat(4,minmax(0,1fr))}
@media(max-width:1100px){.g3,.g4{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:760px){.g2,.g3,.g4{grid-template-columns:1fr}.nav{width:64px}.nav a.item span.t,.brand div,.me .who{display:none}}
.card{background:var(--surface);border:1px solid var(--line);border-radius:var(--r);box-shadow:var(--shadow);padding:18px}
.card h3{font-size:15px;margin-bottom:12px;display:flex;align-items:center;gap:8px}
.card h3 small{color:var(--muted);font-weight:400;font-size:12px;margin-left:auto}
.kpi{display:flex;gap:14px;align-items:center}
.kpi .ico{width:44px;height:44px;border-radius:12px;display:grid;place-items:center;background:var(--accent-l);color:var(--accent);flex:none}
.kpi .ico svg{width:22px;height:22px;stroke:currentColor;fill:none;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.kpi .v{font-size:28px;font-weight:600;line-height:1.1;font-variant-numeric:tabular-nums}.kpi .l{color:var(--muted);font-size:12.5px;margin-top:2px}
.kpi.red .ico{background:var(--bad-bg);color:var(--red)}.kpi.amber .ico{background:var(--warn-bg);color:var(--amber)}.kpi.green .ico{background:var(--ok-bg);color:var(--green)}
.kpi.big .v{font-size:40px}
.chip{display:inline-flex;align-items:center;gap:5px;height:22px;padding:0 9px;border-radius:11px;font-size:12px;font-weight:600;white-space:nowrap}
.chip.ok{background:var(--ok-bg);color:var(--green)}.chip.warn{background:var(--warn-bg);color:var(--amber)}.chip.bad{background:var(--bad-bg);color:var(--red)}.chip.info{background:var(--info-bg);color:var(--accent)}.chip.mute{background:var(--mute-bg);color:var(--muted)}
.stars{color:var(--gold);letter-spacing:1px;white-space:nowrap}.stars .off{color:var(--line2)}
.muted{color:var(--muted)}.right{text-align:right}.center{text-align:center}.nowrap{white-space:nowrap}
.tabs{display:flex;gap:4px;border-bottom:1px solid var(--line);margin:0 0 16px}
.tab{padding:9px 14px;cursor:pointer;color:var(--muted);border-bottom:2px solid transparent;margin-bottom:-1px;font-weight:500}.tab:hover{color:var(--text)}.tab.active{color:var(--accent);border-color:var(--accent);font-weight:600}

/* tables */
.tbl-wrap{overflow:auto;border:1px solid var(--line);border-radius:var(--r);background:var(--surface);box-shadow:var(--shadow);max-height:calc(100vh - 230px)}
table.tbl{border-collapse:separate;border-spacing:0;width:100%;font-size:13.5px}
.tbl th{position:sticky;top:0;background:var(--surface2);text-align:left;font-weight:600;font-size:12px;color:var(--muted);text-transform:uppercase;letter-spacing:.04em;padding:10px 12px;border-bottom:1px solid var(--line);white-space:nowrap;cursor:pointer;user-select:none;z-index:1}
.tbl th.nosort{cursor:default}
.tbl td{padding:9px 12px;border-bottom:1px solid var(--line);vertical-align:middle}
.tbl tr:last-child td{border-bottom:none}.tbl tbody tr:hover td{background:var(--surface2)}
.tbl tr.click{cursor:pointer}
.tbl tr.sun td{background:var(--surface2);color:var(--muted)}
.tbl .num{text-align:right;font-variant-numeric:tabular-nums}
.thumb{width:34px;height:34px;border-radius:50%;object-fit:cover;background:var(--mute-bg);display:inline-grid;place-items:center;color:var(--muted);font-size:12px;font-weight:600;flex:none}
.who2{display:flex;align-items:center;gap:10px}
.toolbar{display:flex;gap:10px;align-items:center;margin:4px 0 14px;flex-wrap:wrap}
.toolbar .grow{flex:1;min-width:180px;max-width:360px}
.search{position:relative}.search svg{position:absolute;left:10px;top:9px;width:18px;height:18px;stroke:var(--muted);fill:none;stroke-width:1.8}.search .input{padding-left:34px}

/* bars / donut */
.bar{display:flex;align-items:center;gap:10px;margin:7px 0}
.bar .n{width:130px;flex:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.bar .track{display:block;flex:1;height:10px;border-radius:6px;background:var(--mute-bg);overflow:hidden}
.bar .fill{display:block;height:100%;border-radius:6px;background:linear-gradient(90deg,var(--accent),#56b4e9);transition:width .5s ease}
.bar .c{width:78px;text-align:right;font-variant-numeric:tabular-nums;color:var(--muted);flex:none}.bar .c b{color:var(--text)}
.donut{width:150px;height:150px;border-radius:50%;position:relative;flex:none}
.donut::after{content:"";position:absolute;inset:26px;border-radius:50%;background:var(--surface)}
.donut .mid{position:absolute;inset:0;display:grid;place-items:center;z-index:1;text-align:center;font-size:26px;font-weight:600}.donut .mid small{display:block;font-size:11px;color:var(--muted);font-weight:400}
.legend{display:flex;flex-direction:column;gap:7px}.legend i{display:inline-block;width:10px;height:10px;border-radius:3px;margin-right:8px}
.rate{display:flex;align-items:center;gap:10px;margin:9px 0}.rate .n{width:210px}.rate .track{display:block;flex:1;height:8px;border-radius:5px;background:var(--mute-bg);overflow:hidden}.rate .fill{display:block;height:100%;background:var(--gold)}.rate .v{width:70px;text-align:right}

/* modal & toast */
.backdrop{position:fixed;inset:0;background:rgba(15,18,28,.45);backdrop-filter:blur(3px);-webkit-backdrop-filter:blur(3px);display:flex;align-items:center;justify-content:center;z-index:50;animation:fade .15s}
.modal{width:min(640px,94vw);max-height:92vh;display:flex;flex-direction:column;background:var(--surface);border-radius:14px;border:1px solid var(--line);box-shadow:0 20px 60px rgba(0,0,0,.35);animation:pop .18s ease}
.modal.wide{width:min(900px,95vw)}
.modal header{padding:18px 22px 6px;display:flex;align-items:center;justify-content:space-between}.modal header h3{font-size:18px}
.modal .body{padding:8px 22px 6px;overflow:auto}.modal footer{padding:14px 22px 18px;display:flex;justify-content:flex-end;gap:10px}
@keyframes fade{from{opacity:0}}@keyframes pop{from{opacity:0;transform:scale(.96) translateY(8px)}}
.field{margin:0 0 13px}.field label{display:block;font-size:12.5px;color:var(--muted);margin-bottom:5px;font-weight:600}.field .hint{font-size:12px;color:var(--muted);margin-top:4px}
.fgrid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 16px}.fgrid .wide{grid-column:1/-1}
.err{color:var(--red);background:var(--bad-bg);border-radius:8px;padding:9px 12px;margin:6px 0 10px;font-size:13px}
#toasts{position:fixed;right:20px;bottom:20px;display:flex;flex-direction:column;gap:10px;z-index:80}
.toast{min-width:260px;max-width:420px;padding:12px 16px;border-radius:10px;background:var(--surface);border:1px solid var(--line);box-shadow:var(--shadow);border-left:4px solid var(--accent);animation:pop .2s}
.toast.ok{border-left-color:var(--green)}.toast.err{border-left-color:var(--red)}

/* login */
.login{min-height:100vh;display:grid;place-items:center;padding:24px}
.login .box{width:min(430px,94vw);padding:34px 34px 28px;background:var(--surface);border:1px solid var(--line);border-radius:18px;box-shadow:0 24px 70px rgba(16,24,40,.18);animation:pop .3s}
.login img{display:block;width:170px;margin:0 auto 18px}
.login h2{text-align:center;font-size:21px}.login p.sub{text-align:center;color:var(--muted);margin:4px 0 22px}

/* employee page */
.hero{display:flex;gap:22px;align-items:center;flex-wrap:wrap}
.photo{width:128px;height:150px;border-radius:14px;object-fit:cover;background:var(--mute-bg);display:grid;place-items:center;color:var(--muted);font-size:34px;font-weight:600;border:1px solid var(--line);flex:none}
.kv{display:grid;grid-template-columns:150px 1fr;gap:8px 12px;font-size:13.5px}.kv dt{color:var(--muted)}.kv dd{margin:0;font-weight:500;word-break:break-word}
.score{font-size:34px;font-weight:700;font-variant-numeric:tabular-nums}
.perm-grid{width:100%;border-collapse:collapse}.perm-grid td,.perm-grid th{padding:7px 8px;border-bottom:1px solid var(--line);text-align:center}.perm-grid td:first-child,.perm-grid th:first-child{text-align:left}
.perm-grid input{width:17px;height:17px;accent-color:var(--accent)}
.diff{font-size:12.5px;background:var(--surface2);border:1px solid var(--line);border-radius:8px;padding:10px 12px;margin:2px 0 6px}.diff .o{color:var(--red);text-decoration:line-through}.diff .nw{color:var(--green);font-weight:600}
.empty{padding:40px;text-align:center;color:var(--muted)}
.skel{height:14px;border-radius:7px;background:linear-gradient(90deg,var(--mute-bg),var(--surface2),var(--mute-bg));background-size:200% 100%;animation:sh 1.2s infinite;margin:10px 0}@keyframes sh{to{background-position:-200% 0}}
.drop{border:2px dashed var(--line2);border-radius:12px;padding:26px;text-align:center;color:var(--muted);cursor:pointer;transition:all .15s}.drop:hover,.drop.on{border-color:var(--accent);background:var(--accent-l);color:var(--accent)}
.card h3 svg,h4 svg{width:19px;height:19px;stroke:var(--accent);fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;flex:none}
.drop svg{width:30px;height:30px;stroke:currentColor;fill:none;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}

/* ============================================================ v1.1 additions */
a.card,a.kpi{color:inherit}a.card:hover{border-color:var(--line2);transform:translateY(-1px)}a.card{transition:transform .12s,border-color .12s}
.col{display:flex;flex-direction:column}
.logo-badge{width:84px;height:84px;border-radius:20px;background:linear-gradient(135deg,var(--accent),var(--navy));color:#fff;display:grid;place-items:center;font-size:30px;font-weight:700;margin:0 auto 18px}
.logo-badge.sm{width:38px;height:38px;border-radius:10px;font-size:14px;margin:0;flex:none}
.bell{position:relative}
.badge{position:absolute;top:1px;right:1px;min-width:17px;height:17px;padding:0 4px;border-radius:9px;background:var(--amber);color:#fff;font-size:10.5px;font-weight:700;display:grid;place-items:center;line-height:1}
.badge.red{background:var(--red)}
kbd{font:inherit;font-size:11px;padding:1px 6px;border:1px solid var(--line2);border-radius:5px;background:var(--surface2);color:var(--muted)}
.alert-row{display:flex;gap:12px;align-items:flex-start;padding:11px 12px;border-radius:10px;margin:0 0 8px;color:var(--text);border:1px solid var(--line);background:var(--surface2)}
.alert-row:hover{border-color:var(--line2)}
.alert-row svg{width:20px;height:20px;flex:none;stroke:currentColor;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;margin-top:1px}
.alert-row.bad svg{color:var(--red)}.alert-row.warn svg{color:var(--amber)}.alert-row.ok svg{color:var(--green)}
.alert-row.bad{background:var(--bad-bg)}.alert-row.warn{background:var(--warn-bg)}.alert-row.ok{background:var(--ok-bg)}
.sr{display:block;padding:8px 10px;border-radius:9px;color:var(--text)}.sr:hover{background:var(--surface2)}
.modal.top{align-self:flex-start;margin-top:12vh}
.modal.xl{width:min(1340px,97vw);height:94vh;max-height:94vh}
.modal.xl .body{flex:1;min-height:0;overflow:hidden;padding-bottom:0}
.modal .body .banner:first-child{margin-top:0}

/* banners */
.banner{display:flex;gap:14px;align-items:flex-start;padding:14px 16px;border-radius:var(--r);border:1px solid var(--line);background:var(--surface);margin:0 0 16px}
.banner .bi{width:38px;height:38px;border-radius:50%;display:grid;place-items:center;flex:none}
.banner .bi svg{width:22px;height:22px;stroke:currentColor;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.banner.red{background:var(--bad-bg);border-color:rgba(212,31,53,.45);border-left:5px solid var(--red)}.banner.red .bi{background:var(--red);color:#fff;animation:pulse 2.2s infinite}
.banner.amber{background:var(--warn-bg);border-color:rgba(178,94,9,.35)}.banner.amber .bi{background:var(--amber);color:#fff}
.banner.green{background:var(--ok-bg);border-color:rgba(16,124,65,.35)}.banner.green .bi{background:var(--green);color:#fff}
@keyframes pulse{0%{box-shadow:0 0 0 0 rgba(212,31,53,.45)}70%{box-shadow:0 0 0 10px rgba(212,31,53,0)}100%{box-shadow:0 0 0 0 rgba(212,31,53,0)}}
.exp-list{display:flex;flex-direction:column;gap:3px;margin-top:6px;font-size:13px}.exp-list a{color:var(--text)}.exp-list a:hover{text-decoration:underline}
.toast.red{border-left-color:var(--red);background:var(--bad-bg);display:flex;gap:12px;align-items:flex-start;min-width:320px}
.toast.red svg{width:22px;height:22px;stroke:var(--red);fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;flex:none;margin-top:1px}
.toast.red .tx{flex:1}.toast.red .acts{display:flex;gap:8px;margin-top:8px}

/* dashboard */
.dash-top{grid-template-columns:minmax(320px,400px) 1fr;margin-bottom:16px;align-items:stretch}
.kpis{align-content:start}
.dash-grid{grid-template-columns:repeat(auto-fill,minmax(380px,1fr));align-items:start}
.span2{grid-column:span 2}
@media(max-width:1100px){.dash-top{grid-template-columns:1fr}.span2{grid-column:auto}}
.bd-row{padding:7px 0;border-bottom:1px solid var(--line);color:var(--text)}.bd-row:last-child{border-bottom:0}.bd-row:hover{background:var(--surface2)}
tr.dt td{background:var(--surface2)}
.tbl tfoot td{position:sticky;bottom:0;background:var(--surface2);font-weight:600;border-top:2px solid var(--line2)}
.tbl tr.dim td{opacity:.6}
.kv dd.wrap{word-break:break-all}

/* report dialog */
.rep-grid{display:grid;grid-template-columns:370px minmax(0,1fr);gap:18px;height:100%;min-height:0}
.rep-form{overflow:auto;padding:0 8px 14px 0;min-height:0}
.rep-pv{position:relative;border:1px solid var(--line);border-radius:12px;background:var(--surface2);overflow:hidden;min-height:300px;margin-bottom:12px}
.pv-frame{position:absolute;inset:0;width:100%;height:100%;border:0;background:#525659}
.rep-pv.loading .pv-frame:last-of-type{visibility:hidden}
.pv-spin{display:none;position:absolute;top:14px;left:50%;transform:translateX(-50%);z-index:3;background:var(--surface);border:1px solid var(--line);border-radius:20px;padding:6px 14px;box-shadow:var(--shadow);align-items:center;gap:10px;font-size:13px;color:var(--muted)}
.rep-pv.loading .pv-spin{display:flex}
.pv-spin span{width:14px;height:14px;border-radius:50%;border:2px solid var(--line2);border-top-color:var(--accent);animation:spin .8s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}
.pv-msg{height:100%;display:grid;place-content:center;justify-items:center;text-align:center;color:var(--muted);padding:30px;gap:8px}
.pv-msg svg{width:44px;height:44px;stroke:var(--accent);fill:none;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}.pv-msg h4{font-size:16px;color:var(--text)}.pv-msg p{margin:0;max-width:340px;line-height:1.5}
.seg{display:flex;border:1px solid var(--line2);border-radius:9px;overflow:hidden;margin-bottom:12px}
.seg button{flex:1;display:flex;gap:8px;align-items:center;justify-content:center;height:36px;border:0;background:var(--surface);color:var(--muted);cursor:pointer;font-weight:600;font-size:13.5px}
.seg button.on{background:var(--accent);color:#fff}.seg button+button{border-left:1px solid var(--line2)}
.seg svg{width:16px;height:16px;stroke:currentColor;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.rp-desc{font-size:13px;margin:0 0 14px;line-height:1.5}
.rf{margin:0 0 12px}
.per-in{margin-top:8px}
.two{display:grid;grid-template-columns:1fr 1fr;gap:10px}.two label{font-size:12px;color:var(--muted);font-weight:600;display:block}.two .input{margin-top:4px}
.chk{display:flex;align-items:center;gap:8px;font-weight:400;color:var(--text);cursor:pointer}
.chk input{width:16px;height:16px;accent-color:var(--accent);flex:none}
.field label.chk{display:flex;font-size:13.5px;color:var(--text);font-weight:400;margin:0}
.chk-grid{display:grid;grid-template-columns:1fr 1fr;gap:6px 12px;border:1px solid var(--line);border-radius:9px;padding:10px 12px;background:var(--surface2)}
.chk-row{display:flex;gap:8px 18px;flex-wrap:wrap}
.quick{display:flex;gap:6px;margin-bottom:8px;flex-wrap:wrap}
.grp{margin:24px 0 10px;font-size:12px;color:var(--muted);text-transform:uppercase;letter-spacing:.07em}
.rep-card .ico{width:38px;height:38px;border-radius:10px;background:var(--accent-l);color:var(--accent);display:grid;place-items:center;flex:none}
.rep-card .ico svg{width:20px;height:20px;stroke:currentColor;fill:none;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
@media(max-width:900px){.rep-grid{grid-template-columns:1fr;grid-template-rows:auto 1fr}.rep-form{max-height:34vh}}

/* payroll / attendance */
.seg2{display:inline-flex;align-items:center;border:1px solid var(--line2);border-radius:9px;background:var(--surface);overflow:hidden}
.seg2 .btn{border:0;border-radius:0;height:34px}
.mlabel{min-width:170px;text-align:center;font-weight:600;font-size:15px}
.kpi-net{display:flex;align-items:baseline;gap:12px;padding:14px 18px;border-radius:12px;background:linear-gradient(135deg,var(--navy-solid,#312e5f),var(--accent-solid,#1e7fc0));color:#fff;margin:0 0 14px}
.kpi-net b{font-size:28px;font-variant-numeric:tabular-nums}.kpi-net .muted{color:rgba(255,255,255,.78)}
.netpay{color:var(--green);font-variant-numeric:tabular-nums}.neg{color:var(--red)}
.stat-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px 16px;padding:12px 14px;border:1px solid var(--line);border-radius:10px;background:var(--surface2)}
.warnico svg{width:18px;height:18px;stroke:var(--amber);fill:none;stroke-width:1.8}
.eff-note{font-size:12.5px;color:var(--muted);background:var(--info-bg);border-radius:8px;padding:8px 10px;min-height:20px;line-height:1.45}
.steps{margin:0;padding-left:20px;display:flex;flex-direction:column;gap:8px;line-height:1.5}
.live-list{display:flex;flex-direction:column;max-height:430px;overflow:auto}
.live-row{display:flex;align-items:center;gap:10px;padding:8px 6px;border-bottom:1px solid var(--line)}
.live-row .t{font-variant-numeric:tabular-nums;font-weight:700;width:68px;flex:none}
.live-row.new{animation:flash 2s}@keyframes flash{from{background:var(--ok-bg)}to{background:transparent}}
.ipbox{display:inline-block;padding:3px 10px;border-radius:7px;background:var(--surface2);border:1px solid var(--line);font-family:Consolas,"Cascadia Mono",monospace;font-size:13px}

/* settings */
.slayout{display:grid;grid-template-columns:250px minmax(0,1fr);gap:20px;align-items:start}
.snav{position:sticky;top:0;display:flex;flex-direction:column;gap:2px;background:var(--surface);border:1px solid var(--line);border-radius:var(--r);padding:8px;box-shadow:var(--shadow)}
.snav a{display:flex;gap:10px;align-items:center;padding:9px 11px;border-radius:8px;color:var(--text);font-weight:500;white-space:nowrap}
.snav a svg{width:18px;height:18px;stroke:var(--muted);fill:none;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;flex:none}
.snav .sgrp{font-size:11px;text-transform:uppercase;letter-spacing:.07em;color:var(--muted);font-weight:600;padding:10px 11px 3px}.snav .sgrp:first-child{padding-top:3px}
.snav a:hover{background:var(--surface2)}.snav a.active{background:var(--accent-l);color:var(--accent);font-weight:600}.snav a.active svg{stroke:var(--accent)}
.spane{min-width:0}.spane fieldset{border:0;padding:0;margin:0;min-width:0}
.scard{margin-bottom:16px}
.srow{display:grid;grid-template-columns:minmax(200px,1fr) minmax(240px,1.4fr);gap:8px 24px;padding:12px 0;border-bottom:1px solid var(--line);align-items:center}
.srow:last-child{border-bottom:0;padding-bottom:2px}.srow:first-of-type{padding-top:2px}
.srow .sl label{font-weight:600;font-size:13.5px;color:var(--text)}.srow .hint{font-size:12px;color:var(--muted);margin-top:3px;line-height:1.45}
.srow .sc{min-width:0}
@media(max-width:1000px){.slayout{grid-template-columns:1fr}.snav{flex-direction:row;overflow:auto;position:static}.srow{grid-template-columns:1fr}}
.switch{display:inline-flex;align-items:center;gap:10px;cursor:pointer;font-weight:400;color:var(--text);position:relative}
.switch input{position:absolute;opacity:0;width:0;height:0}
.switch .knob{width:38px;height:22px;border-radius:12px;background:var(--line2);position:relative;flex:none;transition:background .15s}
.switch .knob::after{content:"";position:absolute;left:3px;top:3px;width:16px;height:16px;border-radius:50%;background:#fff;transition:transform .15s;box-shadow:0 1px 2px rgba(0,0,0,.3)}
.switch input:checked+.knob{background:var(--accent)}.switch input:checked+.knob::after{transform:translateX(16px)}
.switch input:focus-visible+.knob{outline:2px solid var(--accent);outline-offset:2px}
.colorbox{width:46px;height:34px;padding:2px;border-radius:7px;border:1px solid var(--line2);background:var(--surface);cursor:pointer}
.input.mini{width:92px}
.led{display:flex;flex-direction:column;gap:6px}
.lrow{display:flex;align-items:center;gap:6px}
.lrow .lk{width:18px;flex:none;color:var(--muted);display:grid;place-items:center}.lrow .lk svg{width:14px;height:14px;stroke:currentColor;fill:none;stroke-width:1.8}
.lrow .input{flex:1;min-width:0}.lrow .input[readonly]{background:var(--surface2);color:var(--muted)}
.ladd{margin-top:6px;padding-top:8px;border-top:1px dashed var(--line)}
.lbl-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px 24px}.lbl-row{display:flex;flex-direction:column;gap:4px}.lbl-row span{font-size:12px}
.brand-grid{display:grid;grid-template-columns:minmax(220px,300px) minmax(0,1fr);gap:24px}
.bl{font-weight:600;margin-bottom:8px}.bl small{font-weight:400;color:var(--muted);margin-left:6px;font-size:12px}
.logo-prev,.hdr-prev{border:1px dashed var(--line2);border-radius:12px;background:#fff;display:grid;place-items:center;padding:12px;margin-bottom:10px;min-height:96px}
.logo-prev img{max-width:100%;max-height:130px;object-fit:contain}.hdr-prev img{max-width:100%;display:block}
.mults{display:inline-flex;border:1px solid var(--line2);border-radius:8px;overflow:hidden;flex:none}
.mbtn{border:0;border-right:1px solid var(--line2);background:var(--surface);color:var(--text);height:30px;padding:0 11px;cursor:pointer;font-weight:600;font-size:13px}
.mbtn:last-child{border-right:0}.mbtn:hover{background:var(--surface2)}.mbtn.on{background:var(--accent);color:#fff}
.ex{font-size:13px;color:var(--muted)}.ex b{color:var(--text)}
.wt-grid{display:grid;grid-template-columns:1fr 100px;gap:8px 12px;align-items:center}
.wgl .wrow{display:flex;align-items:center;gap:6px;padding:6px 10px;border:1px solid var(--line);border-radius:9px;margin-bottom:6px;background:var(--surface2)}
.wgl input[type=checkbox]{width:17px;height:17px;accent-color:var(--accent)}
.hol-list{max-height:300px;overflow:auto;border:1px solid var(--line);border-radius:10px}
.savebar{position:sticky;bottom:12px;display:none;align-items:center;gap:10px;margin-top:14px;padding:12px 16px;background:var(--surface);border:1px solid var(--accent);border-radius:12px;box-shadow:0 10px 30px rgba(16,24,40,.22);z-index:5}
.savebar.show{display:flex;animation:pop .18s}
.savebar svg{width:18px;height:18px;stroke:var(--accent);fill:none;stroke-width:1.8}
@media print{.nav,.topbar,#toasts{display:none!important}}

/* v1.1 table refinements */
.tscroll{overflow-x:auto}
.atbl td,.atbl th{white-space:nowrap}
.input.mini{width:84px}
.compact .tbl th{padding:8px 7px;font-size:11px;white-space:normal;line-height:1.25;vertical-align:bottom}
.compact .tbl td{padding:7px 7px;font-size:13px}
.compact .who2>div{min-width:0;max-width:200px}
.compact .who2 b{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tbl .stick{position:sticky;right:0;background:var(--surface);box-shadow:-8px 0 8px -8px rgba(16,24,40,.25)}
.tbl th.stick{z-index:3;background:var(--surface2)}
.tbl tbody tr:hover td.stick,.tbl tfoot td.stick{background:var(--surface2)}
.dev{padding:12px 0;border-bottom:1px solid var(--line)}.dev:first-child{padding-top:2px}.dev:last-child{border-bottom:0;padding-bottom:2px}
.has-modal .toast.sticky{display:none}
.compact .who2>div{min-width:150px}
.names2 .who2 b{white-space:normal;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;line-height:1.25}
.atbl th,.atbl td{padding-left:8px;padding-right:8px}
.atbl .input.mini{width:66px}

/* ---- direct device connection (v1.2) */
.devnote{font-size:12.5px;line-height:1.45;border-radius:8px;padding:7px 10px;margin:0 0 8px}
.devnote.bad{background:var(--bad-bg);color:var(--red)}
.probe{border-radius:10px;padding:10px 12px;margin-top:12px;font-size:13px;line-height:1.5;white-space:pre-line}
.probe.ok{background:var(--ok-bg)}.probe.bad{background:var(--bad-bg);color:var(--red)}.probe.wait{background:var(--surface2);color:var(--muted)}
.probe-grid{display:grid;grid-template-columns:auto 1fr;gap:3px 16px;margin-top:8px}.probe-grid span{color:var(--muted)}
.probe svg{width:16px;height:16px;stroke:currentColor;fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;vertical-align:-3px;margin-right:3px}
.probe.ok>b:first-child{color:var(--green)}
.probe-warn{margin-top:8px;padding:7px 10px;border-radius:8px;background:var(--warn-bg);color:var(--text)}.probe-warn svg{color:var(--amber)}
.card h3 .btn svg{stroke:currentColor}
.mspin{display:inline-block;width:12px;height:12px;border:2px solid var(--line2);border-top-color:var(--accent);border-radius:50%;animation:spin .8s linear infinite;vertical-align:-2px}
.err{white-space:pre-line}
.found{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}

/* ================= version 1.3: live punches on the dashboard, IN / OUT labels, ownership notice ================= */
.dash-top.with-live{grid-template-columns:minmax(300px,380px) minmax(0,1fr)}
.kpis.six{grid-template-columns:repeat(6,minmax(0,1fr));margin-bottom:16px}
.kpis.six .kpi{flex-direction:column;align-items:flex-start;gap:10px;padding:14px 16px}
.kpis.six .kpi .ico{width:38px;height:38px;border-radius:10px}
.kpis.six .kpi .v{font-size:26px}
@media(max-width:1280px){.kpis.six{grid-template-columns:repeat(3,minmax(0,1fr))}.kpis.six .kpi{flex-direction:row;align-items:center}}
@media(max-width:1100px){.dash-top.with-live{grid-template-columns:1fr}}
@media(max-width:760px){.kpis.six{grid-template-columns:1fr}}
.wslot{display:contents}
.live-card{display:flex;flex-direction:column;min-height:0}
.live-card h3{margin-bottom:10px}
.live-dot{width:8px;height:8px;border-radius:50%;background:var(--green);animation:livepulse 2s infinite;flex:none}
@keyframes livepulse{0%{box-shadow:0 0 0 0 rgba(16,124,65,.45)}70%{box-shadow:0 0 0 7px rgba(16,124,65,0)}100%{box-shadow:0 0 0 0 rgba(16,124,65,0)}}
.live-stats{display:flex;gap:10px;flex-wrap:wrap;margin:0 0 10px}
.live-stats:empty{display:none}
.ls{display:flex;align-items:center;gap:9px;padding:7px 12px;border-radius:10px;background:var(--mute-bg);min-width:0}
.ls b{font-size:20px;font-variant-numeric:tabular-nums;line-height:1}
.ls span{font-size:12.5px;font-weight:600;line-height:1.25}
.ls small{display:block;font-weight:400;color:var(--muted);font-size:11px}
.ls.ok{background:var(--ok-bg)}.ls.ok b{color:var(--green)}
.ls.bad{background:var(--bad-bg)}.ls.bad b{color:var(--red)}
.ls.warn{background:var(--warn-bg)}.ls.warn b{color:var(--amber)}
.ls.info{background:var(--info-bg)}.ls.info b{color:var(--accent)}
.ls.click{cursor:pointer}.ls.click:hover{box-shadow:inset 0 0 0 1.5px var(--line)}
.live-list.mini{max-height:232px;min-height:116px;flex:1;border-top:1px solid var(--line)}
.live-list.mini .live-row{padding:7px 4px;gap:9px}
.live-list.mini .live-row .t{width:44px}
.live-row .io{font-size:11px;font-weight:700;letter-spacing:.04em;width:38px;height:20px;border-radius:6px;display:grid;place-items:center;flex:none}
.live-row .io.in{background:var(--ok-bg);color:var(--green)}
.live-row .io.out{background:var(--info-bg);color:var(--accent)}
.live-row .nm{flex:0 1 auto;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.live-row .late{color:var(--amber);font-size:12px;font-weight:600;white-space:nowrap;flex:none}
.live-row .gap{flex:1}
.live-row .sec{font-size:12px;flex:none}
.live-empty{padding:16px 8px}
.live-foot{display:flex;align-items:center;gap:10px;justify-content:space-between;margin-top:10px;flex-wrap:wrap}
.dv{display:inline-flex;align-items:center;gap:6px;font-size:12.5px;color:var(--muted);margin-right:12px}
.dv i{width:8px;height:8px;border-radius:50%;background:var(--muted);flex:none}
.dv.ok i{background:var(--green)}.dv.warn i{background:var(--amber)}.dv.bad i{background:var(--red)}
.err-text{color:var(--red)}
.login-in{display:flex;flex-direction:column;align-items:center;gap:18px}
.login-foot{display:flex;align-items:center;gap:10px;color:var(--muted);font-size:12px;line-height:1.5;text-align:left}
.login .login-foot img{width:30px;height:30px;margin:0;border-radius:7px;flex:none}
.nav-copy{all:unset;display:block;box-sizing:border-box;width:100%;padding:8px 4px 0;font-size:10.5px;line-height:1.35;color:var(--muted);text-align:center;cursor:pointer;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.nav-copy:hover{color:var(--text)}
.nav-copy:focus-visible{outline:2px solid var(--accent);outline-offset:2px;border-radius:6px}
.nav.collapsed .nav-copy{display:none}
@media(max-width:760px){.nav-copy{display:none}}
.about{display:flex;gap:16px;align-items:center;margin:2px 0 14px}
.about img{width:68px;height:68px;border-radius:15px;flex:none}
.about h2{font-size:20px}
.about-c{font-weight:600;margin:0 0 12px;padding:10px 12px;border-radius:9px;background:var(--surface2);border:1px solid var(--line)}
@media print{.live-card,.nav-copy{display:none!important}}

/* leave applications (1.4) */
.lv-grid{display:grid;grid-template-columns:minmax(0,1.05fr) minmax(0,1fr);gap:22px;align-items:start}
@media (max-width:900px){.lv-grid{grid-template-columns:1fr}}
.lv-side{background:var(--surface2);border-radius:12px;padding:14px 16px}
.lv-cards{display:flex;gap:10px;flex-wrap:wrap;margin-bottom:10px}
.lv-big{flex:1;min-width:110px;background:var(--surface);border-radius:10px;padding:10px 12px;box-shadow:inset 0 0 0 1px var(--line)}
.lv-big b{display:block;font-size:24px;line-height:1.1}.lv-big span{font-size:12px;color:var(--muted)}.lv-big.bad b{color:var(--red)}
.lv-req{margin:6px 0 4px;font-size:13.5px}
.lv-kv{grid-template-columns:150px 1fr;margin-top:10px;font-size:13px}
.probe.warnp{background:var(--warn-bg,#fff4e0);color:var(--amber,#b25e09)}
.tbl.compact td,.tbl.compact th{padding:5px 8px;font-size:12.5px}
.lv-status{border-radius:10px;padding:10px 12px;margin-bottom:12px;font-size:13.5px;line-height:1.5;background:var(--ok-bg)}.lv-status.warn{background:var(--warn-bg,#fff4e0)}.lv-status.bad{background:var(--bad-bg)}
.lv-steps{margin:0;padding-left:0;list-style:none}.lv-steps li{border-left:3px solid var(--line);padding:4px 0 8px 12px;margin-left:4px}
.lv-steps li.approved{border-color:var(--green)}.lv-steps li.rejected{border-color:var(--red)}.lv-steps li.now{border-color:var(--amber,#b25e09)}
.lv-decide{margin-top:12px}.lv-decide label{font-size:12.5px;color:var(--muted)}
.lv-inbox{padding:8px 12px;margin-bottom:12px}.lv-todo{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:8px 2px;border-bottom:1px solid var(--line);font-size:13.5px}.lv-todo:last-child{border:0}
.lv-todo svg{width:16px;height:16px;vertical-align:-3px;stroke:currentColor;fill:none;stroke-width:2}.lv-todo.bad>span:first-child{color:var(--red)}
.lv-appr{grid-column:1/-1}

.cloudbar{display:flex;gap:10px;align-items:center;margin:0 22px 0;padding:9px 14px;border-radius:10px;border:1px solid var(--line);background:var(--accent-l);font-size:13.5px}
.cloudbar svg{width:18px;height:18px;stroke:currentColor;fill:none;stroke-width:1.8;flex:none}.cloudbar span{flex:1}
.cloudbar.warn{background:var(--warn-bg);border-color:rgba(178,94,9,.35)}.cloudbar.bad{background:var(--bad-bg);border-color:rgba(212,31,53,.45)}
.kvgrid{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:14px}.kvgrid>div{display:flex;flex-direction:column;gap:4px}
