:root {
  --bg: #f4f6f5; --panel: #ffffff; --side: #0b1f17; --text: #0f1a15; --sub: #64746c; --line: #e3e9e6;
  --green: #1b8a55; --green2: #2ecc71; --red: #e0435d; --blue: #2f7be0; --gold: #c8962e; --purple: #7c4dd8; --teal: #0e9aa7;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(16,40,30,.06);
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0a0f0d; --panel: #121916; --side: #070c0a; --text: #eef3f0; --sub: #93a39b; --line: #1f2925; --shadow: 0 8px 24px rgba(0,0,0,.35); }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 Inter, system-ui, -apple-system, Segoe UI, sans-serif; }
button { font: inherit; color: inherit; cursor: pointer; }
.hidden { display: none !important; }
.muted { color: var(--sub); } .tiny { font-size: 12px; } .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; word-break: break-all; }
.red-t { color: var(--red); }

.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.side { background: var(--side); color: #dfe9e4; display: flex; flex-direction: column; padding: 20px 14px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 22px; }
.brand b { display: block; font-size: 16px; letter-spacing: .2px; } .brand small { color: #8fb3a2; font-size: 12px; }
.logo { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-size: 20px; color: #fff; background: linear-gradient(160deg, #34d17c, #0f8a55); box-shadow: 0 6px 16px rgba(46,204,113,.35); }
.side nav { display: grid; gap: 4px; }
.side nav a { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 12px; color: #c8d8d0; text-decoration: none; font-weight: 600; }
.side nav a i { font-style: normal; width: 20px; text-align: center; }
.side nav a:hover { background: rgba(255,255,255,.06); }
.side nav a.active { background: linear-gradient(90deg, rgba(46,204,113,.22), rgba(46,204,113,.06)); color: #fff; box-shadow: inset 3px 0 0 var(--green2); }
.side-foot { margin-top: auto; display: grid; gap: 10px; }
.me { display: grid; grid-template-columns: 10px 1fr; column-gap: 8px; align-items: center; padding: 10px 12px; background: rgba(255,255,255,.05); border-radius: 12px; }
.me .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green2); } .me em { grid-column: 2; font-style: normal; font-size: 11px; color: #8fb3a2; }

.main { padding: 20px 28px 40px; min-width: 0; }
.top { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.top h2 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -.3px; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.live { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; font-size: 12px; color: var(--green); background: rgba(46,204,113,.12); padding: 5px 10px; border-radius: 99px; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--green2); box-shadow: 0 0 0 0 rgba(46,204,113,.6); animation: pulse 1.6s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(46,204,113,0); } 100% { box-shadow: 0 0 0 0 rgba(46,204,113,0); } }
.menu { display: none; }

.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { text-align: left; border: 1px solid var(--line); background: var(--panel); border-radius: 18px; padding: 16px; display: grid; gap: 4px; box-shadow: var(--shadow); transition: transform .15s; position: relative; overflow: hidden; }
.kpi:hover { transform: translateY(-2px); }
.kpi::after { content: ''; position: absolute; inset: auto -30px -30px auto; width: 90px; height: 90px; border-radius: 50%; opacity: .12; background: currentColor; }
.kpi-i { font-size: 18px; } .kpi-v { font-size: 28px; font-weight: 800; letter-spacing: -.5px; color: var(--text); } .kpi-l { font-size: 12.5px; color: var(--sub); font-weight: 600; }
.kpi.green { color: var(--green2); } .kpi.red { color: var(--red); } .kpi.blue { color: var(--blue); } .kpi.gold { color: var(--gold); } .kpi.purple { color: var(--purple); } .kpi.teal { color: var(--teal); }

.grid2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 18px; box-shadow: var(--shadow); min-width: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.card-h h3 { margin: 0; font-size: 15px; }
.link { color: var(--green); font-weight: 600; text-decoration: none; background: none; border: 0; padding: 0; }
.chart svg { width: 100%; height: 200px; }
.bar { fill: var(--green2); opacity: .85; } .bar:hover { opacity: 1; }
.bar-v { font-size: 10px; fill: var(--sub); text-anchor: middle; font-weight: 700; } .bar-l { font-size: 9.5px; fill: var(--sub); text-anchor: middle; }
.list { display: grid; gap: 2px; max-height: 260px; overflow: auto; }
.row { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; border: 0; background: none; text-align: left; width: 100%; }
.row:hover { background: rgba(46,204,113,.07); }
.row-t { flex: 1; min-width: 0; } .row-t b, .row-t small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .row-t small { color: var(--sub); }
.empty { color: var(--sub); text-align: center; padding: 24px; }

.av { position: relative; display: inline-grid; place-items: center; border-radius: 50%; background: linear-gradient(160deg, #34d17c, #0f8a55); color: #fff; font-weight: 800; flex: none; }
.av img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.av .on { position: absolute; right: 0; bottom: 0; width: 28%; height: 28%; min-width: 9px; min-height: 9px; border-radius: 50%; background: var(--green2); border: 2px solid var(--panel); }
.vbadge { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: var(--blue); color: #fff; font-size: 10px; font-weight: 900; vertical-align: 1px; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.search { flex: 1 1 280px; height: 42px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); color: var(--text); padding: 0 14px; font: inherit; }
.search:focus, textarea:focus, input:focus, .select:focus { outline: 2px solid rgba(46,204,113,.45); border-color: transparent; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--panel); border-radius: 99px; padding: 8px 14px; font-weight: 600; font-size: 13px; }
.chip.on { background: var(--green); color: #fff; border-color: var(--green); }
.select { height: 42px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); color: var(--text); padding: 0 10px; font: inherit; }

.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--sub); padding: 12px 16px; background: rgba(127,127,127,.04); border-bottom: 1px solid var(--line); }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr { cursor: pointer; } .table tbody tr:hover { background: rgba(46,204,113,.05); }
.table .r { text-align: right; }
.user { display: flex; align-items: center; gap: 10px; } .user b, .user small { display: block; } .user small { color: var(--sub); }
.pager { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; }
.pager .btn { margin-left: 6px; }

.pill { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 99px; }
.pill.green { background: rgba(46,204,113,.14); color: var(--green); } .pill.red { background: rgba(224,67,93,.13); color: var(--red); }
.pill.gray { background: rgba(127,127,127,.12); color: var(--sub); } .pill.blue { background: rgba(47,123,224,.13); color: var(--blue); }

.btn { border: 1px solid transparent; border-radius: 12px; padding: 10px 16px; font-weight: 700; background: var(--panel); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.sm { padding: 6px 10px; font-size: 12.5px; }
.btn.wide { width: 100%; }
.btn.primary { background: linear-gradient(180deg, #34d17c, #0f8a55); color: #fff; box-shadow: 0 6px 16px rgba(27,138,85,.3); }
.btn.danger { background: linear-gradient(180deg, #ff7a95, #e0435d); color: #fff; box-shadow: 0 6px 16px rgba(224,67,93,.28); }
.btn.blue { background: linear-gradient(180deg, #5aa0f2, #2f7be0); color: #fff; }
.btn.ghost { background: transparent; border-color: var(--line); }
.side .btn.ghost { color: #dfe9e4; border-color: rgba(255,255,255,.12); }

.drawer-bg, .modal-bg { position: fixed; inset: 0; background: rgba(5,12,9,.45); backdrop-filter: blur(2px); z-index: 20; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100vw); background: var(--panel); z-index: 21; overflow: auto; padding: 20px 22px 30px; box-shadow: -10px 0 40px rgba(0,0,0,.2); animation: slide .2s ease-out; }
@keyframes slide { from { transform: translateX(30px); opacity: 0; } }
.d-head { text-align: center; position: relative; } .d-head #d-close { position: absolute; right: 0; top: 0; }
.d-head h3 { margin: 10px 0 0; font-size: 20px; } .d-head p { margin: 2px 0 8px; }
.d-pills { display: flex; gap: 6px; justify-content: center; }
.d-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 18px 0; }
.d-stats div { background: rgba(127,127,127,.06); border-radius: 14px; padding: 10px 6px; text-align: center; } .d-stats b { display: block; font-size: 18px; } .d-stats small { color: var(--sub); font-size: 11.5px; }
.d-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.note { margin-top: 12px; padding: 10px 12px; border-radius: 12px; font-size: 13px; } .note.red { background: rgba(224,67,93,.1); color: var(--red); }
.d-info { display: grid; grid-template-columns: 110px 1fr; gap: 8px 12px; margin: 18px 0; } .d-info dt { color: var(--sub); font-weight: 600; } .d-info dd { margin: 0; }
.drawer h4 { margin: 18px 0 8px; }
.timeline { display: grid; gap: 8px; } .timeline > div { border-left: 3px solid var(--line); padding: 2px 0 2px 10px; } .timeline p { margin: 2px 0 0; color: var(--sub); }

.modal-bg { display: grid; place-items: center; }
.modal { background: var(--panel); border-radius: 20px; padding: 22px; width: min(420px, 92vw); box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal h3 { margin: 0 0 6px; }
.modal textarea, .login-card input { width: 100%; border: 1px solid var(--line); background: transparent; color: var(--text); border-radius: 12px; padding: 10px 12px; font: inherit; margin-top: 10px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: #0f1a15; color: #fff; padding: 11px 18px; border-radius: 12px; font-weight: 600; z-index: 40; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.toast.bad { background: var(--red); }

.login-body { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: radial-gradient(circle at 20% 10%, rgba(46,204,113,.18), transparent 40%), var(--bg); }
.login-card { width: min(400px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 24px; padding: 28px; box-shadow: var(--shadow); }
.brand.big { padding: 0 0 18px; } .brand.big small { color: var(--sub); }
.login-card h1 { margin: 0; font-size: 24px; } .login-card label { display: block; font-weight: 600; margin-top: 14px; }
.login-card .btn { margin-top: 18px; }
.err { color: var(--red); min-height: 1.2em; font-weight: 600; }

.mt { margin-top: 16px; } .mx { margin: 12px 20px 0; } .pad { padding: 0 16px 14px; }
.pill.gold { background: rgba(200,150,46,.15); color: var(--gold); }
.danger-t { color: var(--red); }
.phead { overflow: hidden; }
.pcover { height: 110px; background: radial-gradient(circle at 15% 20%, rgba(255,224,138,.35), transparent 40%), linear-gradient(120deg, #0b4a2f, #1b8a55 55%, #2fae6e); }
.pmain { display: flex; gap: 18px; align-items: flex-end; padding: 0 20px; margin-top: -44px; flex-wrap: wrap; }
.pmain > .av { border: 4px solid var(--panel); font-size: 34px; box-shadow: var(--shadow); }
.pid { flex: 1; min-width: 220px; padding-bottom: 4px; } .pid h2 { margin: 0; font-size: 24px; letter-spacing: -.3px; } .pid p { margin: 2px 0 8px; } .pid .d-pills { justify-content: flex-start; }
.pact { display: flex; gap: 8px; flex-wrap: wrap; padding-bottom: 6px; }
.pkpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; padding: 18px 20px 20px; }
.pk { background: rgba(127,127,127,.06); border-radius: 14px; padding: 12px; } .pk b { display: block; font-size: 18px; } .pk small { color: var(--sub); font-size: 11.5px; font-weight: 600; }
.pk.teal b { color: var(--teal); } .pk.red b { color: var(--red); } .pk.green b { color: var(--green); }
.ptabs { display: flex; gap: 6px; overflow-x: auto; margin: 16px 0 12px; padding-bottom: 2px; }
.ptab { border: 1px solid var(--line); background: var(--panel); border-radius: 12px; padding: 9px 14px; font-weight: 700; white-space: nowrap; }
.ptab span { margin-left: 6px; font-size: 11px; background: rgba(127,127,127,.12); border-radius: 99px; padding: 1px 7px; }
.ptab.on { background: var(--green); color: #fff; border-color: var(--green); } .ptab.on span { background: rgba(255,255,255,.25); }
.bar.today { fill: var(--gold); }
.tl { display: grid; gap: 2px; max-height: 520px; overflow: auto; }
.tli { display: flex; gap: 12px; padding: 10px 6px; border-bottom: 1px solid var(--line); } .tli > span { font-size: 18px; width: 26px; text-align: center; }
.tli p { margin: 0; } .tli.reported p { color: var(--red); }
.reels { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.reel { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.rv { position: relative; aspect-ratio: 9 / 14; background: #000; } .rv video { width: 100%; height: 100%; object-fit: cover; display: block; }
.rvis { position: absolute; top: 8px; left: 8px; }
.rb { padding: 10px 12px 12px; display: grid; gap: 6px; } .rc { margin: 0; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; } .rb p { margin: 0; }
.rs { display: flex; gap: 10px; font-size: 12.5px; color: var(--sub); flex-wrap: wrap; }
.li { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.li > div { flex: 1; min-width: 0; } .li p { margin: 0 0 2px; word-break: break-word; } .li small { display: block; } .ci { font-size: 18px; }
.people { display: grid; gap: 2px; max-height: 480px; overflow: auto; }
h4.sub { margin: 18px 0 10px; }

.nbadge { margin-left: auto; background: var(--red); color: #fff; font-size: 11px; font-style: normal; border-radius: 99px; padding: 1px 7px; }
.rq { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.rq-card { display: grid; gap: 8px; align-content: start; } .rq-card.hot { border-color: rgba(224,67,93,.5); box-shadow: 0 0 0 1px rgba(224,67,93,.25), var(--shadow); }
.rqh { display: flex; gap: 6px; align-items: center; } .rqh .muted { margin-left: auto; }
.rqr { margin: 0; font-size: 15px; font-weight: 600; }
.rqt .reel { box-shadow: none; } .rqt .rv { aspect-ratio: 16 / 12; }
.rqa { display: flex; gap: 6px; flex-wrap: wrap; padding-top: 4px; }
.form { display: grid; gap: 12px; } .form label { display: grid; gap: 6px; font-weight: 600; }
.form input { height: 42px; border-radius: 12px; border: 1px solid var(--line); background: transparent; color: var(--text); padding: 0 12px; font: inherit; }
.form input:disabled { opacity: .6; }
.roles { margin-top: 16px; font-size: 13px; color: var(--sub); } .roles p { margin: 6px 0; } .roles b { color: var(--text); }
.btn.danger.sm, .btn.ghost.sm { padding: 6px 10px; }

.steps { margin: 0; padding-left: 20px; display: grid; gap: 12px; } .steps li { line-height: 1.6; }
code { background: rgba(127,127,127,.12); padding: 1px 6px; border-radius: 6px; font-size: 12.5px; }

.qr { margin: 10px 0; } .qr img { width: 180px; height: 180px; background: #fff; border-radius: 12px; padding: 6px; }
.codes { background: rgba(127,127,127,.1); border-radius: 12px; padding: 12px 16px; font: 15px/1.8 ui-monospace, Menlo, monospace; column-count: 2; }
.switch { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; }
.switch input { width: 18px; height: 18px; accent-color: var(--green); }
.scroll { max-height: 420px; overflow: auto; }
.idle { position: fixed; bottom: 22px; right: 22px; background: var(--panel); border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(0,0,0,.25); border-radius: 14px; padding: 12px 16px; z-index: 45; display: flex; gap: 10px; align-items: center; }

.enf { display: grid; gap: 10px; padding: 12px 14px; border-radius: 14px; background: rgba(200,150,46,.08); border: 1px solid rgba(200,150,46,.25); }
.enf .wl { margin-top: 6px; } .x { border: 0; background: none; color: inherit; padding: 0 0 0 4px; font-weight: 800; }
.form.inline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; } .num { width: 70px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: transparent; color: var(--text); padding: 0 8px; }
#m-what { margin: 10px 0 4px; } #m-days { width: 100%; margin-top: 10px; }

tr.undone td { opacity: .55; }
.hb { display: grid; grid-template-columns: 150px 1fr 40px; gap: 10px; align-items: center; padding: 5px 0; font-size: 13px; }
.hb > div { height: 10px; background: rgba(127,127,127,.12); border-radius: 99px; overflow: hidden; } .hb i { display: block; height: 100%; background: var(--green2); border-radius: 99px; }
.hb b { text-align: right; } .hb span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
input[type=date].select { padding: 0 10px; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 30; left: 0; width: 260px; transform: translateX(-100%); transition: transform .2s; }
  body.nav-open .side { transform: none; }
  .menu { display: inline-block; }
  .main { padding: 14px 16px 40px; }
  .grid2 { grid-template-columns: 1fr; }
  .table th:nth-child(2), .table td:nth-child(2), .table th:nth-child(5), .table td:nth-child(5) { display: none; }
}
