:root{
  --bg:#f4f6f5; --card:#fff; --text:#1c2826; --muted:#6b7a77; --line:#e3e8e6;
  --primary:#473dd1; --primary-d:#372db5; --primary-l:#eceafd; --side:#1e1b4b;
  --green:#15803d; --green-l:#e8f6ec; --red:#c2410c; --red-l:#fdeee6; --orange:#b45309; --orange-l:#fef4e2;
  --blue:#1d4ed8; --blue-l:#e8eefc; --gray:#5b6664; --gray-l:#eef1f0;
  --radius:12px; --shadow:0 1px 2px rgba(16,40,38,.06),0 2px 8px rgba(16,40,38,.04);
}
*{box-sizing:border-box}
[hidden]{display:none!important}
html,body{margin:0}
body{font-family:system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;font-size:15px;line-height:1.5;color:var(--text);background:var(--bg);-webkit-text-size-adjust:100%}
a{color:var(--primary);text-decoration:none}
a:hover{text-decoration:underline}
h1,h2,h3{margin:0 0 .6rem;line-height:1.25}
h2{font-size:1.3rem} h3{font-size:1.05rem}
p{margin:.4rem 0}
.muted{color:var(--muted)} .small{font-size:.85rem} .center{text-align:center} .right{display:flex;justify-content:flex-end;margin-top:.75rem}
.t-green{color:var(--green)} .t-red{color:var(--red)} .t-orange{color:var(--orange)}
.ico{width:20px;height:20px;flex:none}

/* Layout */
.app{display:flex;min-height:100vh}
.sidebar{width:260px;background:var(--side);color:#d4d3f0;display:flex;flex-direction:column;position:fixed;inset:0 auto 0 0;z-index:40;transition:transform .25s;overflow-y:auto}
.brand{display:flex;gap:.7rem;align-items:center;padding:1.1rem 1.1rem .8rem}
.brand strong{display:block;color:#fff;font-size:1rem}
.brand small{display:block;color:#a5a3d9;font-size:.78rem}
.brand.center{justify-content:center;margin-bottom:1rem}
.brand.center strong{color:var(--text)} .brand.center small{color:var(--muted)}
.brand-logo{width:38px;height:38px;border-radius:10px;background:linear-gradient(135deg,#5b50e6,#473dd1);color:#fff;display:grid;place-items:center;font-weight:800;font-size:1.2rem}
.me{display:flex;gap:.6rem;align-items:center;margin:0 .8rem .6rem;padding:.6rem;border-radius:10px;background:rgba(255,255,255,.06)}
.me img{width:38px;height:38px;border-radius:50%;object-fit:cover}
.me strong{display:block;color:#fff;font-size:.88rem;line-height:1.2}
.me small{color:#a5a3d9;font-size:.75rem}
.sidebar nav{padding:.2rem .6rem 1rem;flex:1}
.nav-head{font-size:.7rem;text-transform:uppercase;letter-spacing:.08em;color:#8b88c9;margin:.9rem .6rem .3rem}
.sidebar nav a,.nav-btn{display:flex;align-items:center;gap:.7rem;padding:.6rem .7rem;border-radius:8px;color:#e0dff7;font-size:.92rem;width:100%;background:none;border:0;cursor:pointer;font:inherit;text-align:left}
.sidebar nav a:hover,.nav-btn:hover{background:rgba(255,255,255,.07);text-decoration:none}
.sidebar nav a.active{background:#5b50e6;color:#fff}
.sidebar nav a span{flex:1}
.badge-count{background:#ef4444;color:#fff;border-radius:999px;font-size:.72rem;padding:0 .45rem;min-width:20px;text-align:center}
.sidebar-foot{padding:.7rem 1.2rem;font-size:.72rem;color:#8b88c9}
.main{flex:1;margin-left:260px;min-width:0}
.topbar{position:sticky;top:0;z-index:20;background:rgba(244,246,245,.92);backdrop-filter:blur(6px);display:flex;align-items:center;gap:.6rem;padding:.9rem 1.5rem;border-bottom:1px solid var(--line)}
.topbar h1{font-size:1.15rem;margin:0}
.menu-btn{display:none;background:none;border:0;padding:.3rem;color:var(--text);cursor:pointer}
.content{padding:1.3rem 1.5rem 3rem;max-width:1200px}
.backdrop{display:none}

@media (max-width:900px){
  .sidebar{transform:translateX(-100%)}
  body.nav-open .sidebar{transform:none}
  body.nav-open .backdrop{display:block;position:fixed;inset:0;background:rgba(0,0,0,.4);z-index:30}
  .main{margin-left:0}
  .menu-btn{display:block}
  .topbar{padding:.7rem 1rem}
  .content{padding:1rem .8rem 3rem}
}

/* Cards & grid */
.card{background:var(--card);border-radius:var(--radius);box-shadow:var(--shadow);padding:1.1rem 1.2rem;margin-bottom:1rem;border:1px solid var(--line)}
.card.narrow{max-width:760px}
.card-head{display:flex;justify-content:space-between;align-items:center;gap:.5rem;margin-bottom:.5rem}
.card-head h3{margin:0}
.grid-2,.grid-3,.grid-4{display:grid;gap:0 1rem}
.grid-2{grid-template-columns:repeat(2,minmax(0,1fr))}
.grid-3{grid-template-columns:repeat(3,minmax(0,1fr))}
.grid-4{grid-template-columns:repeat(4,minmax(0,1fr));align-items:end}
.grid-2.align-start{align-items:start}
.grid-2 > .card,.grid-2 > .cards-list{min-width:0}
@media (max-width:760px){.grid-2,.grid-3,.grid-4{grid-template-columns:1fr}}
.hello h2{margin:0}
.hello{margin-bottom:1rem}

.stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:.8rem;margin-bottom:1rem}
.stat{background:var(--card);border:1px solid var(--line);border-left:4px solid var(--primary);border-radius:var(--radius);padding:.8rem 1rem;color:var(--text);box-shadow:var(--shadow);display:flex;flex-direction:column}
.stat:hover{text-decoration:none}
.stat span{font-size:.8rem;color:var(--muted)} .stat b{font-size:1.6rem;line-height:1.2} .stat small{color:var(--muted);font-size:.78rem}
.stat.green{border-left-color:var(--green)} .stat.red{border-left-color:var(--red)} .stat.orange{border-left-color:var(--orange)} .stat.blue{border-left-color:var(--blue)} .stat.gray{border-left-color:var(--gray)}
.mini-stats{display:flex;gap:1rem;flex-wrap:wrap;margin-bottom:.5rem;font-size:.9rem}

/* Lists */
.list{list-style:none;margin:0;padding:0}
.list li{display:flex;justify-content:space-between;align-items:center;gap:.7rem;padding:.6rem 0;border-bottom:1px solid var(--line)}
.list li:last-child{border-bottom:0}
.list li > a,.list li > span:first-child{display:flex;flex-direction:column;min-width:0;color:var(--text)}
.list li small{color:var(--muted);font-size:.8rem}
.cards-list > .card{display:block}
.person{display:flex;align-items:center;gap:.6rem;color:var(--text);min-width:0}
.person img{width:36px;height:36px;border-radius:50%;object-fit:cover;flex:none}
.person strong{display:block;font-size:.9rem;line-height:1.2}
.person small{display:block;color:var(--muted);font-size:.78rem}
.list-card{padding:0;overflow:hidden}
.pad{padding:1rem}

/* Buttons & forms */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:.4rem;padding:.55rem 1rem;border-radius:9px;border:1px solid var(--line);background:#fff;color:var(--text);font:inherit;font-weight:600;font-size:.9rem;cursor:pointer;white-space:nowrap}
.btn:hover{background:#f6f8f7;text-decoration:none}
.btn-primary{background:var(--primary);border-color:var(--primary);color:#fff}
.btn-primary:hover{background:var(--primary-d)}
.btn-primary:disabled{background:#a9a3ec;border-color:#a9a3ec;cursor:not-allowed}
.btn-danger{color:#b91c1c;border-color:#f3c4c4}
.btn-danger:hover{background:#fdf0f0}
.btn-sm{padding:.3rem .65rem;font-size:.8rem}
.btn-lg{padding:.8rem 1.2rem;font-size:1rem}
.btn-block{width:100%}
.btn-row{display:flex;gap:.5rem;flex-wrap:wrap;align-items:center;margin-top:.6rem}
.btn-row form{margin:0}
.nowrap{flex-wrap:nowrap}
.icon-btn{background:none;border:0;color:#b91c1c;font-size:1.3rem;line-height:1;cursor:pointer;padding:.1rem .35rem;border-radius:6px}
.icon-btn:hover{background:#fdf0f0}
.form label{display:block;font-size:.85rem;font-weight:600;color:#3a4846;margin-bottom:.8rem}
.field-label{font-size:.85rem;font-weight:600;color:#3a4846;margin-bottom:.4rem}
input,select,textarea{display:block;width:100%;margin-top:.3rem;padding:.6rem .7rem;border:1px solid #cfd8d6;border-radius:9px;font:inherit;font-weight:400;background:#fff;color:var(--text)}
input:focus,select:focus,textarea:focus{outline:2px solid #c4bff7;border-color:var(--primary)}
input[type=checkbox],input[type=radio]{width:auto;display:inline;margin:0}
.form label.check{display:flex;gap:.6rem;align-items:flex-start;font-weight:400}
.form label.check input{margin-top:.25rem}
.radio-row{display:flex;gap:1rem;flex-wrap:wrap;margin-bottom:.8rem}
.radio{display:flex!important;gap:.4rem;align-items:center;font-weight:500!important}
.toolbar{display:flex;gap:.6rem;flex-wrap:wrap;align-items:center;margin-bottom:1rem}
.toolbar label{display:flex;gap:.4rem;align-items:center;font-size:.88rem;margin:0}
.toolbar input{margin:0;width:auto}
.toolbar form{margin:0}
.search input{margin:0;min-width:220px}
.sticky-actions{position:sticky;bottom:0;background:linear-gradient(transparent,var(--bg) 35%);padding:1rem 0 .5rem}
.chip{display:inline-block!important;margin:0 .3rem .4rem 0!important}
.chip input{position:absolute;opacity:0}
.chip span{display:inline-block;padding:.35rem .8rem;border:1px solid #cfd8d6;border-radius:999px;font-size:.85rem;cursor:pointer;background:#fff}
.chip input:checked + span{background:var(--primary);border-color:var(--primary);color:#fff}
.days,.status-pick{margin-bottom:.8rem}
.dl{display:grid;grid-template-columns:130px 1fr;gap:.35rem .8rem;margin:0}
.dl dt{color:var(--muted);font-size:.88rem} .dl dd{margin:0}
.profile-photo{display:flex;gap:1rem;align-items:center}
.profile-photo img{width:84px;height:84px;border-radius:50%;object-fit:cover;border:3px solid var(--primary-l)}
.dropzone{display:grid!important;place-items:center;border:2px dashed #b6c8c4;border-radius:12px;padding:1.6rem;text-align:center;cursor:pointer;background:#fafcfb}
.dropzone input{margin-bottom:.4rem}

/* Alerts & badges */
.alert{padding:.75rem 1rem;border-radius:10px;margin-bottom:1rem;font-size:.92rem;border:1px solid transparent}
.alert-success{background:var(--green-l);color:#14532d;border-color:#bfe5cb}
.alert-danger{background:#fdecec;color:#7f1d1d;border-color:#f5c2c2}
.alert-warning{background:var(--orange-l);color:#78350f;border-color:#f6dcae}
.alert-info{background:var(--blue-l);color:#1e3a8a}
.badge{display:inline-block;padding:.12rem .55rem;border-radius:999px;font-size:.74rem;font-weight:700;white-space:nowrap}
.badge-green{background:var(--green-l);color:var(--green)} .badge-red{background:var(--red-l);color:var(--red)}
.badge-orange{background:var(--orange-l);color:var(--orange)} .badge-blue{background:var(--blue-l);color:var(--blue)} .badge-gray{background:var(--gray-l);color:var(--gray)}
.badges{display:flex;gap:.3rem;flex-wrap:wrap;justify-content:flex-end}

/* Tables */
.table-wrap{overflow-x:auto;padding:0}
.table-wrap h3{padding:1rem 1.2rem 0}
.table{width:100%;border-collapse:collapse;font-size:.88rem}
.table th{text-align:left;font-size:.75rem;text-transform:uppercase;letter-spacing:.04em;color:var(--muted);font-weight:600;padding:.7rem .8rem;border-bottom:1px solid var(--line);white-space:nowrap;background:#fafcfb}
.table td{padding:.65rem .8rem;border-bottom:1px solid var(--line);vertical-align:top}
.table tr:last-child td{border-bottom:0}
.table tr.inactive{opacity:.55}
.cell-absen{display:flex;gap:.5rem;align-items:flex-start;min-width:180px}
.cell-absen form{margin-left:auto}
.thumb{width:44px;height:44px;border-radius:8px;object-fit:cover;cursor:zoom-in;flex:none;background:#eee}
.thumb.lg{width:72px;height:72px}
.ttd{height:56px;max-width:120px;object-fit:contain;background:#fff;border:1px solid var(--line);border-radius:8px;cursor:zoom-in}
.ttd.sm{height:30px;max-width:80px;margin-top:.2rem}

/* Tabs & pagination */
.tabs{display:flex;gap:.3rem;overflow-x:auto;margin-bottom:.8rem}
.tabs a{padding:.45rem .85rem;border-radius:999px;color:var(--text);background:#fff;border:1px solid var(--line);font-size:.86rem;white-space:nowrap}
.tabs a b{color:var(--muted);font-weight:600;margin-left:.2rem}
.tabs a.active{background:var(--side);color:#fff;border-color:var(--side)}
.tabs a.active b{color:#a5a3d9}
.tabs a:hover{text-decoration:none}
.pagination{display:flex;gap:.3rem;flex-wrap:wrap}
.pagination a{padding:.3rem .7rem;border:1px solid var(--line);border-radius:8px;background:#fff;color:var(--text)}
.pagination a.active{background:var(--primary);color:#fff;border-color:var(--primary)}

/* Komplain */
.komplain-row{display:flex;gap:.8rem;align-items:center;padding:.85rem 1.1rem;border-bottom:1px solid var(--line);color:var(--text)}
.komplain-row:hover{background:#fafcfb;text-decoration:none}
.komplain-row:last-child{border-bottom:0}
.komplain-row img{width:36px;height:36px;border-radius:50%;object-fit:cover}
.komplain-row .grow{min-width:0}
.komplain-row strong{display:block}
.grow{flex:1;min-width:0}
.komplain-head{display:flex;justify-content:space-between;gap:1rem;align-items:flex-start;flex-wrap:wrap}
.progress-steps{display:flex;margin:1rem 0 1.2rem;counter-reset:s}
.progress-steps span{flex:1;text-align:center;font-size:.8rem;color:var(--muted);position:relative;padding-top:1.8rem}
.progress-steps span::before{counter-increment:s;content:counter(s);position:absolute;top:0;left:50%;transform:translateX(-50%);width:26px;height:26px;border-radius:50%;background:var(--gray-l);display:grid;place-items:center;font-weight:700;z-index:1}
.progress-steps span::after{content:"";position:absolute;top:12px;left:-50%;width:100%;height:3px;background:var(--gray-l)}
.progress-steps span:first-child::after{display:none}
.progress-steps span.on{color:var(--text);font-weight:600}
.progress-steps span.on::before{background:var(--primary);color:#fff}
.progress-steps span.on::after{background:var(--primary)}
.progress-steps span.rejected::before{background:var(--gray)}
.thread{display:flex;flex-direction:column;gap:.9rem}
.msg{display:flex;gap:.6rem;align-items:flex-start}
.msg > img{width:34px;height:34px;border-radius:50%;object-fit:cover;flex:none}
.bubble{background:#f5f8f7;border:1px solid var(--line);border-radius:4px 12px 12px 12px;padding:.6rem .85rem;max-width:100%;min-width:0;flex:1}
.msg.from-boss .bubble{background:var(--primary-l);border-color:#d3cffa}
.bubble .text{white-space:normal;word-wrap:break-word;margin-top:.2rem}
.status-change{font-size:.85rem;margin:.2rem 0}
.attach{display:inline-block;margin-top:.5rem}
.attach-img{display:block;max-width:260px;max-height:220px;border-radius:8px;margin-top:.5rem;cursor:zoom-in;border:1px solid var(--line)}

/* Informasi */
.info-item{color:var(--text)}
.info-item:hover{text-decoration:none;border-color:#c4bff7}
.info-item.unread{border-left:4px solid var(--blue)}
.info-item p{margin:.3rem 0}
.article-body{margin-top:1rem;font-size:1rem;line-height:1.7}

/* Absensi */
.absen-head{display:flex;justify-content:space-between;gap:1rem;flex-wrap:wrap;align-items:center;background:linear-gradient(135deg,#1e1b4b,#473dd1);color:#fff;border:0}
.absen-head .muted{color:#c9c6f3}
.clock{font-size:2.4rem;font-weight:800;letter-spacing:.02em;font-variant-numeric:tabular-nums;line-height:1.1}
.shift-info{display:flex;flex-direction:column;font-size:.85rem;color:#dcdaf8}
.shift-info strong{color:#fff;font-size:1rem}
.steps{display:grid;grid-template-columns:repeat(3,1fr);gap:.6rem;margin-bottom:1rem}
.step{border:1px dashed #c7d3d0;border-radius:10px;padding:.7rem;display:flex;flex-direction:column;gap:.15rem;align-items:flex-start}
.step b{font-size:1.4rem;font-variant-numeric:tabular-nums}
.step small{font-size:.75rem;color:var(--muted);font-weight:600}
.step.done{border-style:solid;border-color:#c4bff7;background:var(--primary-l)}
@media (max-width:520px){.steps{grid-template-columns:1fr}.step{flex-direction:row;flex-wrap:wrap;align-items:center;gap:.5rem}.step b{font-size:1.1rem}}
.absen-form h3{font-size:1rem}
.jenis-grid{display:grid;gap:.5rem}
.jenis{display:flex!important;gap:.7rem;align-items:center;border:1px solid var(--line);border-radius:10px;padding:.7rem .8rem;cursor:pointer;margin:0!important}
.jenis span{display:flex;flex-direction:column}
.jenis small{font-weight:400;color:var(--muted)}
.jenis:has(input:checked){border-color:var(--primary);background:var(--primary-l)}
.jenis.disabled{opacity:.5;cursor:not-allowed}
.loc{display:flex;gap:.6rem;align-items:center;padding:.7rem .9rem;border-radius:10px;background:var(--gray-l);font-size:.92rem}
.loc .dot{width:12px;height:12px;border-radius:50%;background:#9aa7a4;flex:none;animation:pulse 1.4s infinite}
.loc.ok{background:var(--green-l);color:#14532d} .loc.ok .dot{background:var(--green);animation:none}
.loc.bad{background:#fdecec;color:#7f1d1d} .loc.bad .dot{background:#dc2626;animation:none}
@keyframes pulse{50%{opacity:.3}}
.camera{position:relative;background:#111;border-radius:12px;overflow:hidden;aspect-ratio:3/4;max-width:360px;margin:0 auto}
.camera video,.camera img{width:100%;height:100%;object-fit:cover;display:block}
.camera video{transform:scaleX(-1)}
.sign-wrap{position:relative;border:2px dashed #b6c8c4;border-radius:12px;background:#fff;touch-action:none}
.sign-wrap canvas{display:block;width:100%;height:190px;cursor:crosshair}
.sign-hint{position:absolute;inset:auto 0 .6rem;text-align:center;color:#b6c4c1;font-size:.85rem;pointer-events:none}
.sign-wrap.signed .sign-hint{display:none}
.absen-item{display:flex;gap:.9rem;align-items:center}
@media (max-width:520px){.absen-item{flex-wrap:wrap}}

/* Shift */
.timeline{display:grid;grid-template-columns:repeat(4,1fr);gap:.4rem;margin:.4rem 0 .6rem}
.timeline div{background:#f5f8f7;border-radius:8px;padding:.5rem;display:flex;flex-direction:column}
.timeline small{font-size:.72rem;color:var(--muted)}
.timeline b{font-size:1.1rem}

/* Lightbox */
.lightbox{position:fixed;inset:0;background:rgba(0,0,0,.85);display:grid;place-items:center;z-index:100;padding:1rem}
.lightbox[hidden]{display:none}
.lightbox img{max-width:100%;max-height:90vh;border-radius:10px;background:#fff}
.lightbox button{position:absolute;top:1rem;right:1rem;background:#fff;border:0;border-radius:50%;width:40px;height:40px;font-size:1.5rem;cursor:pointer}

/* Auth */
.auth-page{display:grid;place-items:center;min-height:100vh;padding:1rem;background:linear-gradient(160deg,#1e1b4b 0%,#473dd1 55%,#f4f6f5 55%)}
.auth-card{background:#fff;border-radius:16px;box-shadow:0 10px 40px rgba(0,0,0,.15);padding:2rem;width:100%;max-width:400px}
.auth-card.wide{max-width:640px}
.auth-card h3{margin-top:1.2rem;font-size:.95rem;color:var(--primary)}
.steps-text{padding-left:1.2rem}
details.card summary{cursor:pointer}
details.card[open] summary{margin-bottom:.8rem}
.loading{position:fixed;inset:0;background:rgba(255,255,255,.8);display:grid;place-items:center;z-index:200;font-weight:600}

/* ===== v1.1: logo & PIN ===== */
.brand-card{background:#fff;border-radius:12px;margin:1rem .9rem .8rem;padding:.65rem .8rem;display:flex;flex-direction:column;align-items:center;gap:.15rem}
.brand-card img{width:100%;max-width:190px;height:auto;display:block}
.brand-card small{color:#5b5a7a;font-size:.72rem;font-weight:600;letter-spacing:.06em;text-transform:uppercase}
.auth-logo{display:block;margin:0 auto .3rem;width:220px;max-width:80%}
.auth-sub{text-align:center;color:var(--muted);font-size:.9rem;margin-bottom:1.2rem}
.auth-user{display:flex;flex-direction:column;align-items:center;gap:.3rem;margin-bottom:.8rem}
.auth-user img{width:72px;height:72px;border-radius:50%;object-fit:cover;border:3px solid var(--primary-l)}
.auth-user strong{font-size:1.05rem}
.pin-dots{display:flex;justify-content:center;gap:.8rem;margin:1rem 0 1.2rem}
.pin-dots i{width:16px;height:16px;border-radius:50%;border:2px solid #b8b4ee;display:block;transition:.15s}
.pin-dots i.on{background:var(--primary);border-color:var(--primary);transform:scale(1.1)}
.pin-dots.shake{animation:shake .35s}
@keyframes shake{25%{transform:translateX(-8px)}75%{transform:translateX(8px)}}
.keypad{display:grid;grid-template-columns:repeat(3,1fr);gap:.6rem;max-width:280px;margin:0 auto}
.keypad button{height:58px;border-radius:14px;border:1px solid var(--line);background:#f7f7fc;font:inherit;font-size:1.45rem;font-weight:600;color:var(--text);cursor:pointer;touch-action:manipulation}
.keypad button:active{background:var(--primary-l)}
.keypad button.fn{font-size:.85rem;font-weight:600;color:var(--muted);background:#fff}
.auth-links{display:flex;flex-direction:column;gap:.5rem;align-items:center;margin-top:1.2rem;font-size:.88rem}
.auth-links a,.auth-links button{background:none;border:0;font:inherit;color:var(--primary);cursor:pointer;padding:0}
.choice{display:grid;gap:.7rem}
.choice a{display:flex;gap:.8rem;align-items:center;padding:.9rem 1rem;border:1px solid var(--line);border-radius:12px;color:var(--text)}
.choice a:hover{border-color:var(--primary);background:var(--primary-l);text-decoration:none}
.choice a b{display:block} .choice a small{color:var(--muted)}
.choice .ic{width:42px;height:42px;border-radius:12px;background:var(--primary-l);color:var(--primary);display:grid;place-items:center;font-size:1.3rem;flex:none}
.kode-input{text-transform:uppercase;text-align:center;font-size:1.3rem!important;letter-spacing:.15em;font-weight:700}
.kode-box{display:flex;align-items:center;gap:.8rem;flex-wrap:wrap;background:var(--primary-l);border:1px dashed #a9a3ec;border-radius:12px;padding:.8rem 1rem;margin:.6rem 0}
.kode-box code{font-size:1.5rem;font-weight:800;letter-spacing:.12em;color:var(--primary-d)}
.brand-card:hover{text-decoration:none}
