:root{
  --bg:#F5F6F3; --surface:#FFFFFF; --surface-2:#EEF1EE; --ink:#1B211E; --muted:#5E6B65; --border:#DCE1DC;
  --accent:#1F6F5C; --accent-ink:#0F3B31; --accent-soft:#E1EFEA; --accent-soft-ink:#12463B;
  --good:#2E8B57; --good-soft:#E3F3E9; --bad:#C1443B; --bad-soft:#FBE9E7; --warn:#C98A2D; --warn-soft:#FBF0DE;
  --shadow: 0 1px 2px rgba(20,30,26,.06), 0 6px 20px rgba(20,30,26,.06);
  --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){
    --bg:#101512; --surface:#182420; --surface-2:#1F2C27; --ink:#ECEFEA; --muted:#93A29C; --border:#2A3B34;
    --accent:#4FB99C; --accent-ink:#DFF5EC; --accent-soft:#1D3830; --accent-soft-ink:#BDEEDE;
    --good:#57C285; --good-soft:#173226; --bad:#E17167; --bad-soft:#3A1E1B; --warn:#E0A855; --warn-soft:#332412;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 28px rgba(0,0,0,.35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"]{
  --bg:#101512; --surface:#182420; --surface-2:#1F2C27; --ink:#ECEFEA; --muted:#93A29C; --border:#2A3B34;
  --accent:#4FB99C; --accent-ink:#DFF5EC; --accent-soft:#1D3830; --accent-soft-ink:#BDEEDE;
  --good:#57C285; --good-soft:#173226; --bad:#E17167; --bad-soft:#3A1E1B; --warn:#E0A855; --warn-soft:#332412;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 28px rgba(0,0,0,.35);
  color-scheme: dark;
}
*{box-sizing:border-box;}
html,body{margin:0;padding:0;}
body{
  background:var(--bg); color:var(--ink);
  font-family:"IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  font-size:15px; line-height:1.55;
  -webkit-font-smoothing:antialiased;
}
h1,h2,h3,h4{ font-family:"Manrope", ui-sans-serif, system-ui, sans-serif; font-weight:800; letter-spacing:-0.01em; text-wrap:balance; margin:0; }
.mono, .tabular, .score, .stat-num, td.num, th.num { font-family:"IBM Plex Mono", ui-monospace, monospace; font-variant-numeric: tabular-nums; }
a{color:var(--accent);}
button{ font-family:inherit; }
::selection{ background:var(--accent-soft); color:var(--accent-ink); }

.app-shell{ max-width:1080px; margin:0 auto; padding:0 16px 64px; min-height:100vh; }
.topbar{ display:flex; align-items:center; justify-content:space-between; gap:12px; padding:18px 0 14px; border-bottom:1px solid var(--border); margin-bottom:20px; flex-wrap:wrap;}
.brand{ display:flex; align-items:center; gap:10px; }
.brand-mark{ width:34px; height:34px; border-radius:10px; background:var(--accent); color:var(--bg); display:flex; align-items:center; justify-content:center; font-weight:800; font-family:"Manrope",sans-serif; font-size:15px; flex:none;}
.brand-name{ font-family:"Manrope",sans-serif; font-weight:800; font-size:17px; }
.brand-sub{ color:var(--muted); font-size:12.5px; margin-top:1px; }
.topbar-right{ display:flex; align-items:center; gap:10px; }
.pill{ display:inline-flex; align-items:center; gap:6px; padding:5px 11px; border-radius:999px; font-size:12.5px; font-weight:600; background:var(--surface-2); color:var(--muted); border:1px solid var(--border); }
.pill.accent{ background:var(--accent-soft); color:var(--accent-soft-ink); border-color:transparent;}

.btn{ appearance:none; border:1px solid var(--border); background:var(--surface); color:var(--ink); padding:9px 16px; border-radius:10px; font-size:14px; font-weight:600; cursor:pointer; display:inline-flex; align-items:center; gap:7px; transition:transform .08s ease, box-shadow .15s ease, background .15s ease; }
.btn:hover{ box-shadow:var(--shadow); }
.btn:active{ transform:translateY(1px); }
.btn:focus-visible{ outline:2px solid var(--accent); outline-offset:2px; }
.btn.primary{ background:var(--accent); border-color:var(--accent); color:var(--bg); }
.btn.primary:hover{ filter:brightness(1.05); }
.btn.ghost{ background:transparent; border-color:transparent; color:var(--muted); }
.btn.danger{ color:var(--bad); border-color:var(--bad-soft); }
.btn.sm{ padding:6px 11px; font-size:12.5px; border-radius:8px; }
.btn:disabled{ opacity:.5; cursor:not-allowed; }
.btn-row{ display:flex; gap:8px; flex-wrap:wrap; }

.card{ background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:20px; box-shadow:var(--shadow); }
.card + .card{ margin-top:16px; }
.card-head{ display:flex; align-items:baseline; justify-content:space-between; gap:12px; margin-bottom:14px; flex-wrap:wrap; }
.card-title{ font-size:16px; }
.card-desc{ color:var(--muted); font-size:13px; margin-top:2px; }
.stack{ display:flex; flex-direction:column; gap:14px; }
.grid{ display:grid; gap:16px; }
.grid-2{ grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); }
.grid-3{ grid-template-columns:repeat(auto-fit,minmax(160px,1fr)); }

.center-wrap{ min-height:80vh; display:flex; align-items:center; justify-content:center; padding:24px 0; }
.landing-card{ max-width:440px; width:100%; text-align:center; }
.role-grid{ display:grid; grid-template-columns:1fr 1fr; gap:12px; margin-top:18px; }
.role-btn{ border:1px solid var(--border); background:var(--surface-2); border-radius:12px; padding:20px 14px; cursor:pointer; text-align:center; display:flex; flex-direction:column; align-items:center; gap:8px; transition:border-color .15s, background .15s; }
.role-btn:hover{ border-color:var(--accent); background:var(--accent-soft); }
.role-emoji{ font-size:26px; }
.role-label{ font-weight:700; font-size:14px; }
.role-sub{ font-size:12px; color:var(--muted); }

label{ font-size:12.5px; font-weight:600; color:var(--muted); text-transform:uppercase; letter-spacing:.04em; display:block; margin-bottom:6px; }
input[type=text],input[type=password],input[type=number],input[type=date],select,textarea{
  width:100%; padding:10px 12px; border-radius:9px; border:1px solid var(--border); background:var(--surface); color:var(--ink); font-size:14px; font-family:inherit;
}
textarea{ resize:vertical; min-height:70px; }
input:focus,select:focus,textarea:focus{ outline:2px solid var(--accent); outline-offset:1px; }
.field{ margin-bottom:12px; }
.field:last-child{ margin-bottom:0; }
.hint{ font-size:12px; color:var(--muted); margin-top:5px; }
.error-text{ font-size:12.5px; color:var(--bad); margin-top:6px; }

.checklist{ display:flex; flex-direction:column; gap:0; border:1px solid var(--border); border-radius:12px; overflow:hidden; }
.check-row{ display:flex; align-items:center; gap:12px; padding:13px 14px; border-bottom:1px solid var(--border); background:var(--surface); cursor:pointer; }
.check-row:last-child{ border-bottom:none; }
.check-row:hover{ background:var(--surface-2); }
.check-row input[type=checkbox]{ width:19px; height:19px; accent-color:var(--accent); flex:none; }
.check-label{ flex:1; font-size:14px; }
.check-weight{ font-size:12px; color:var(--muted); flex:none; }

.score-badge{ display:inline-flex; align-items:baseline; gap:3px; font-weight:800; }
.score-badge .num{ font-size:22px; }
.score-badge .max{ font-size:12px; color:var(--muted); }
.trend{ display:inline-flex; align-items:center; gap:4px; font-size:12.5px; font-weight:700; padding:3px 8px; border-radius:999px; }
.trend.up{ color:var(--good); background:var(--good-soft); }
.trend.down{ color:var(--bad); background:var(--bad-soft); }
.trend.flat{ color:var(--muted); background:var(--surface-2); }

.media-grid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(88px,1fr)); gap:10px; margin-top:10px; }
.media-tile{ position:relative; border-radius:10px; overflow:hidden; border:1px solid var(--border); background:var(--surface-2); aspect-ratio:1/1; }
.media-tile img,.media-tile video{ width:100%; height:100%; object-fit:cover; display:block; }
.media-tile .rm{ position:absolute; top:4px; right:4px; width:22px; height:22px; border-radius:999px; background:rgba(20,20,20,.65); color:#fff; border:none; font-size:13px; line-height:1; cursor:pointer; display:flex; align-items:center; justify-content:center;}
.media-tile .kind{ position:absolute; bottom:4px; left:4px; font-size:10px; background:rgba(20,20,20,.55); color:#fff; padding:1px 6px; border-radius:999px;}
.upload-box{ border:1.5px dashed var(--border); border-radius:12px; padding:22px 14px; text-align:center; color:var(--muted); cursor:pointer; background:var(--surface-2); }
.upload-box:hover{ border-color:var(--accent); color:var(--accent-ink); }
.upload-box input{ display:none; }

table{ width:100%; border-collapse:collapse; font-size:13.5px; }
th,td{ text-align:left; padding:9px 10px; border-bottom:1px solid var(--border); white-space:nowrap; }
th{ color:var(--muted); font-weight:600; font-size:11.5px; text-transform:uppercase; letter-spacing:.04em; }
tr:last-child td{ border-bottom:none; }
.table-wrap{ overflow-x:auto; border:1px solid var(--border); border-radius:12px; }
.table-wrap table{ min-width:560px; }

.tabbar{ display:flex; gap:6px; margin-bottom:18px; flex-wrap:wrap; border-bottom:1px solid var(--border); padding-bottom:0;}
.tab{ padding:9px 14px; border-radius:9px 9px 0 0; font-size:13.5px; font-weight:600; color:var(--muted); cursor:pointer; border:1px solid transparent; margin-bottom:-1px;}
.tab.active{ color:var(--accent-ink); background:var(--accent-soft); border-color:var(--border); border-bottom-color:var(--accent-soft); }

.stat-tile{ padding:14px 16px; border-radius:12px; background:var(--surface-2); border:1px solid var(--border); }
.stat-tile .label{ font-size:11.5px; color:var(--muted); text-transform:uppercase; letter-spacing:.04em; font-weight:700; }
.stat-num{ font-size:26px; font-weight:700; margin-top:4px; }

.emp-row{ display:flex; align-items:center; gap:12px; padding:12px 0; border-bottom:1px solid var(--border); }
.emp-row:last-child{ border-bottom:none; }
.avatar{ width:36px; height:36px; border-radius:999px; background:var(--accent-soft); color:var(--accent-soft-ink); display:flex; align-items:center; justify-content:center; font-weight:700; font-size:13px; flex:none; }
.emp-name{ font-weight:700; font-size:14px; }
.emp-sub{ font-size:12px; color:var(--muted); }

.toast{ position:fixed; bottom:20px; left:50%; transform:translateX(-50%); background:var(--ink); color:var(--bg); padding:10px 18px; border-radius:999px; font-size:13px; font-weight:600; box-shadow:var(--shadow); z-index:50; opacity:0; pointer-events:none; transition:opacity .2s, transform .2s; }
.toast.show{ opacity:1; transform:translateX(-50%) translateY(-4px); }
.toast.err{ background:var(--bad); color:#fff; }

.storage-bar{ height:8px; border-radius:999px; background:var(--surface-2); overflow:hidden; border:1px solid var(--border); }
.storage-bar > div{ height:100%; background:var(--accent); }
.storage-bar.warn > div{ background:var(--warn); }
.storage-bar.crit > div{ background:var(--bad); }

.modal-backdrop{ position:fixed; inset:0; background:rgba(10,15,12,.5); display:flex; align-items:center; justify-content:center; padding:20px; z-index:40; }
.modal{ background:var(--surface); border-radius:16px; padding:22px; max-width:440px; width:100%; box-shadow:var(--shadow); max-height:86vh; overflow:auto; }

.link-btn{ background:none; border:none; color:var(--accent); font-weight:600; font-size:13px; cursor:pointer; padding:0; }
.muted{ color:var(--muted); }
.small{ font-size:12.5px; }
.right{ margin-left:auto; }
.flex{ display:flex; align-items:center; }
.gap8{ gap:8px; } .gap12{ gap:12px; } .gap16{ gap:16px; }
.wrap{ flex-wrap:wrap; }
.hidden{ display:none !important; }
hr.sep{ border:none; border-top:1px solid var(--border); margin:16px 0; }

@media (max-width:640px){
  .app-shell{ padding:0 12px 48px; }
  .role-grid{ grid-template-columns:1fr; }
}
@media (prefers-reduced-motion:reduce){
  *{ transition:none !important; animation:none !important; }
}
.landing-logo{display:block;width:min(100%,320px);height:auto;margin:0 auto 18px;}
.topbar-logo{width:38px;height:38px;object-fit:contain;margin-right:10px;} .brand{display:flex;align-items:center;} .admin-login-logo{width:min(100%,220px);margin-bottom:10px;}
.topbar-logo{width:64px;height:64px;object-fit:contain;margin-right:10px;}
.topbar-logo{width:88px;height:88px;object-fit:contain;margin-right:12px;}
