/* eTricks brand: black + neon lime (#A8FF5A) */
:root {
  --bg: #050706; --panel: #0e1210; --panel2: #141a17; --line: #1f2823; --line2: #2b3731;
  --text: #eef4ee; --muted: #8b9a91; --accent: #a8ff5a; --accent-ink: #0b1503; --accent-soft: rgba(168, 255, 90, .12);
  --danger: #ff5d6c; --warn: #ffc23d; --info: #4fb8ff; --radius: 12px;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.45; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
.boot { display: grid; place-items: center; height: 100vh; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.grow { flex: 1; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ---------- logo ---------- */
.logo { display: inline-flex; align-items: center; gap: 10px; }
.logo svg, .logo img { height: 52px; width: auto; display: block; }
.logo-img { display: none !important; }
.has-logo .logo-img { display: block !important; }
.has-logo .logo-svg { display: none !important; }
.logo.big svg, .logo.big img { height: 170px; }

/* ---------- buttons ---------- */
.btn { background: var(--panel2); border: 1px solid var(--line2); border-radius: 9px; padding: 8px 14px; cursor: pointer; font-weight: 600; transition: .15s; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--danger); border-color: rgba(255, 93, 108, .4); }
.btn.ghost { background: transparent; }
.btn.sm { padding: 4px 10px; font-size: 13px; border-radius: 7px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

/* ---------- landing ---------- */
.landing { min-height: 100vh; display: flex; flex-direction: column; background: radial-gradient(900px 400px at 50% -10%, rgba(168, 255, 90, .09), transparent 70%); }
.landing header { display: flex; align-items: center; justify-content: space-between; padding: 18px 28px; }
.landing main { flex: 1; max-width: 1100px; width: 100%; margin: 0 auto; padding: 10px 24px 40px; }
.hero { text-align: center; padding: 18px 0 30px; }
.hero h1 { font-size: clamp(26px, 4vw, 40px); margin-top: 6px; }
.hero p { color: var(--muted); max-width: 560px; margin: 10px auto 0; }
.dept-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 16px; }
.dept-card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 18px; position: relative; overflow: hidden; }
.dept-card::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--c, var(--accent)); }
.dept-card h3 { font-size: 18px; display: flex; align-items: center; gap: 12px; }
.dept-logo { flex: none; height: 48px; min-width: 48px; padding: 0 11px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: var(--panel2); background: color-mix(in srgb, var(--c, var(--accent)) 12%, var(--panel2)); border: 1px solid var(--line2); border-color: color-mix(in srgb, var(--c, var(--accent)) 40%, var(--line)); }
.dept-logo img { height: 28px; width: auto; max-width: 92px; object-fit: contain; display: block; }
.dept-card .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c, var(--accent)); box-shadow: 0 0 12px var(--c, var(--accent)); }
.dept-card .btns { display: grid; gap: 8px; margin-top: 14px; }
.dept-card .btn { justify-content: space-between; width: 100%; }
.landing footer { text-align: center; color: var(--muted); padding: 20px; font-size: 13px; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--panel); border-right: 1px solid var(--line); padding: 16px 12px; display: flex; flex-direction: column; gap: 6px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side .logo { padding: 4px 8px 12px; }
.side .logo svg, .side .logo img { height: 96px; }
.who { margin: 0 6px 10px; padding: 10px 12px; background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; font-size: 13px; }
.who b { display: block; color: var(--accent); font-size: 14px; }
.who.has-photo { display: flex; align-items: center; gap: 10px; }
.avatar { flex: none; width: 44px; height: 52px; border-radius: 9px; object-fit: cover; object-position: center top; border: 1px solid var(--line2); box-shadow: 0 3px 10px rgba(0, 0, 0, .45); background: var(--panel2); }
.hero-card { display: flex; align-items: center; gap: 22px; padding: 18px; margin-bottom: 18px; border-radius: 16px; border: 1px solid var(--line2); background: linear-gradient(120deg, rgba(168, 255, 90, .09), transparent 55%), var(--panel); }
.hero-card .portrait { flex: none; width: 112px; height: 140px; border-radius: 12px; object-fit: cover; object-position: center top; border: 1px solid var(--line2); box-shadow: 0 8px 24px rgba(0, 0, 0, .55), 0 0 0 4px var(--accent-soft); }
.hero-card h3 { font-size: 24px; margin: 2px 0 4px; }
.hero-card p { margin: 0 0 10px; }
.hero-card .chips { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 560px) { .hero-card { gap: 14px; padding: 14px; } .hero-card .portrait { width: 84px; height: 105px; } .hero-card h3 { font-size: 20px; } }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 9px; color: var(--text); text-decoration: none; cursor: pointer; font-weight: 500; }
.nav a:hover { background: var(--panel2); }
.nav a.active { background: var(--accent-soft); color: var(--accent); }
.nav .ico { width: 20px; text-align: center; }
.nav .grp { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 12px 12px 4px; }
.side .spacer { flex: 1; }
.main { padding: 24px 28px 60px; min-width: 0; }
.topbar { display: none; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h2 { font-size: 24px; }
.page-head p { margin: 4px 0 0; color: var(--muted); }

@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; z-index: 30; width: 270px; transform: translateX(-100%); transition: .2s; }
  .side.open { transform: none; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .6); }
  .topbar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; padding: 8px max(14px, env(safe-area-inset-left, 0px)) 8px max(14px, env(safe-area-inset-right, 0px)); border-bottom: 1px solid var(--line); background: var(--panel); position: sticky; top: 0; z-index: 20; }
  .topbar .logo { justify-self: center; padding: 0; }
  .topbar .logo svg, .topbar .logo img { height: 44px; }
  .topbar #burger { justify-self: start; }
  .topbar .bell { justify-self: end; width: auto; margin: 0; gap: 6px; }
  .main { padding: 18px 14px 60px; }
}

/* ---------- notifications ---------- */
.bell { justify-content: space-between; width: calc(100% - 12px); margin: 0 6px 8px; }
.bell-count { background: var(--accent); color: var(--accent-ink); border-radius: 999px; font-size: 12px; font-weight: 800; padding: 0 7px; min-width: 20px; text-align: center; }
.bell-count[hidden] { display: none; }
.notifs { display: grid; gap: 6px; max-height: 60vh; overflow-y: auto; }
.notif { text-align: left; background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: grid; gap: 2px; cursor: pointer; }
.notif:hover { border-color: var(--accent); }
.notif.unread { border-left: 3px solid var(--accent); background: var(--accent-soft); }
.notif span { color: var(--muted); font-size: 13.5px; }
.notif small { color: var(--muted); font-size: 12px; }

.pushbox { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; margin-bottom: 10px; border: 1px solid var(--line2); border-radius: 10px; background: var(--panel2); font-size: 13.5px; }
.pushbox.on { border-color: rgba(168, 255, 90, .4); }
.pushbox.blocked, .pushbox.insecure, .pushbox.unsupported { border-color: rgba(255, 194, 61, .4); color: var(--muted); }
.push-banner { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 28px; background: var(--accent-soft); border-bottom: 1px solid rgba(168, 255, 90, .3); }
@media (max-width: 860px) { .push-banner { padding: 10px 14px; } }
.backupbar { display: flex; justify-content: space-between; align-items: center; gap: 10px 14px; flex-wrap: wrap; padding: 11px 28px; background: rgba(255, 194, 61, .14); border-bottom: 1px solid rgba(255, 194, 61, .5); font-size: 14px; }
.backupbar.urgent { background: rgba(255, 93, 108, .16); border-bottom-color: var(--danger); }
@media (max-width: 860px) { .backupbar { padding: 10px 14px; } }

/* ---------- printable member report ---------- */
@media print {
  body { background: #fff; color: #000; }
  body > :not(.overlay) { display: none !important; }
  .overlay { position: static; background: none; padding: 0; display: block; }
  .modal { max-width: none; border: 0; background: #fff; color: #000; padding: 0; }
  .modal .foot, .no-print { display: none !important; }
  .card, .stat, .tablewrap { background: #fff; border-color: #bbb; color: #000; }
  th { background: #eee; color: #000; position: static; }
  .muted, .stat .k, .stat .s { color: #444; }
  .badge { background: #fff; color: #000; border-color: #888; }
}

/* ---------- cards / stats ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.card h3 { font-size: 15px; margin-bottom: 12px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.grid { display: grid; gap: 14px; }
.cols-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat .k { color: var(--muted); font-size: 12.5px; }
.stat .v { font-size: 26px; font-weight: 700; margin-top: 2px; }
.stat .v.accent { color: var(--accent); }
.stat .v.bad { color: var(--danger); }
.stat .s { color: var(--muted); font-size: 12px; margin-top: 2px; }

/* ---------- tables ---------- */
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
td.wrap { white-space: normal; min-width: 220px; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--panel2); white-space: nowrap; position: sticky; top: 0; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(255, 255, 255, .02); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tablewrap th.right, .tablewrap td.right { position: sticky; right: 0; background: var(--panel); box-shadow: -12px 0 12px -12px rgba(0, 0, 0, .8); }
.tablewrap th.right { background: var(--panel2); }
.empty { padding: 34px; text-align: center; color: var(--muted); }
.actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }

/* ---------- badges ---------- */
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--panel2); border: 1px solid var(--line2); white-space: nowrap; }
.badge.ok { color: var(--accent); background: var(--accent-soft); border-color: rgba(168, 255, 90, .35); }
.badge.warn { color: var(--warn); background: rgba(255, 194, 61, .1); border-color: rgba(255, 194, 61, .35); }
.badge.bad { color: var(--danger); background: rgba(255, 93, 108, .1); border-color: rgba(255, 93, 108, .35); }
.badge.info { color: var(--info); background: rgba(79, 184, 255, .1); border-color: rgba(79, 184, 255, .35); }

/* ---------- filters / forms ---------- */
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 14px; }
.filters label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
input, select, textarea { background: var(--bg); border: 1px solid var(--line2); border-radius: 9px; padding: 9px 11px; width: 100%; min-width: 0; }
.filters input, .filters select { width: auto; min-width: 140px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { min-height: 80px; resize: vertical; }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); }
.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; align-items: start; }
.form .full { grid-column: 1 / -1; }
.form label { display: grid; gap: 5px; font-size: 13px; color: var(--muted); }
.form label.check { display: flex; align-items: center; gap: 8px; color: var(--text); }
.form .help { font-size: 12px; color: var(--muted); }
.form .sect { grid-column: 1 / -1; font-weight: 700; color: var(--accent); font-size: 12px; letter-spacing: .07em; text-transform: uppercase; padding-top: 6px; border-top: 1px solid var(--line); margin-top: 4px; }
@media (max-width: 600px) { .form { grid-template-columns: 1fr; } }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 10px 14px; cursor: pointer; color: var(--muted); font-weight: 600; white-space: nowrap; }
.tabs button.active { color: var(--accent); border-color: var(--accent); }

/* ---------- modal / toast ---------- */
.overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, .72); display: grid; place-items: start center; padding: 5vh 14px; overflow-y: auto; z-index: 100; }
.modal { background: var(--panel); border: 1px solid var(--line2); border-radius: 16px; width: 100%; max-width: 560px; padding: 22px; }
.modal.wide { max-width: 820px; }
.modal h3 { font-size: 19px; margin-bottom: 14px; }
.modal .foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.error { color: var(--danger); background: rgba(255, 93, 108, .1); border: 1px solid rgba(255, 93, 108, .3); border-radius: 9px; padding: 8px 12px; margin-top: 12px; font-size: 14px; }
#toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 8px; z-index: 200; }
.toast { background: var(--panel2); border: 1px solid var(--accent); padding: 10px 16px; border-radius: 10px; box-shadow: 0 8px 30px rgba(0, 0, 0, .5); }
.toast.bad { border-color: var(--danger); }
.pin-box { text-align: center; padding: 14px; background: var(--accent-soft); border: 1px dashed var(--accent); border-radius: 12px; margin: 10px 0; }
.pin-box b { font-size: 30px; letter-spacing: 6px; color: var(--accent); }

/* ---------- attendance punch ---------- */
.punch { display: grid; gap: 14px; text-align: center; }
.punch .clock { font-size: 44px; font-weight: 700; font-variant-numeric: tabular-nums; }
.punch .state { font-size: 15px; }
.punch .btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.punch .btn { padding: 14px 22px; font-size: 16px; }
.timeline { display: grid; gap: 6px; text-align: left; font-size: 14px; }

/* ---------- charts ---------- */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 140px; padding-top: 10px; }
.bars .b { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; min-width: 0; }
.bars .track { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; min-height: 0; }
.bars .fill { width: 100%; max-width: 28px; background: linear-gradient(var(--accent), rgba(168, 255, 90, .35)); border-radius: 5px 5px 0 0; min-height: 2px; }
.bars .lab { font-size: 10.5px; color: var(--muted); }
.bars .val { font-size: 11px; }
.meter { height: 8px; background: var(--panel2); border-radius: 99px; overflow: hidden; min-width: 70px; }
.meter > i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.meter.warn > i { background: var(--warn); }
.meter.bad > i { background: var(--danger); }
.hist { display: grid; gap: 10px; }
.hist .item { border-left: 2px solid var(--accent); padding: 2px 0 2px 12px; }
.hist .item .d { color: var(--muted); font-size: 12.5px; }
.pos { color: var(--accent); }
.neg { color: var(--danger); }


/* ---------- smoothness ---------- */
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
button, a, select, label { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.btn:active { transform: translateY(1px) scale(.99); }
.btn.working { opacity: .6; pointer-events: none; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
#view > * { animation: fadeUp .22s ease backwards; }
.landing .hero, .landing .dept-card { animation: fadeUp .35s ease backwards; }
.landing .dept-card:nth-child(2) { animation-delay: .04s; } .landing .dept-card:nth-child(3) { animation-delay: .08s; }
.landing .dept-card:nth-child(4) { animation-delay: .12s; } .landing .dept-card:nth-child(5) { animation-delay: .16s; } .landing .dept-card:nth-child(6) { animation-delay: .2s; }
.overlay { animation: fadeIn .15s ease backwards; }
.modal { animation: popIn .2s cubic-bezier(.2, .8, .2, 1) backwards; }
.toast { animation: fadeUp .2s ease backwards; }
.card, .stat, .dept-card, .notif, .nav a { transition: border-color .15s, background-color .15s, transform .15s, box-shadow .15s; }
.dept-card:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(0, 0, 0, .35); }
#results { transition: opacity .15s; }
#results.busy { opacity: .55; pointer-events: none; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line2); border-top-color: var(--accent); animation: spin .7s linear infinite; display: block; }
.skel { display: grid; gap: 12px; }
.skel i { display: block; height: 54px; border-radius: 12px; background: linear-gradient(90deg, var(--panel) 25%, var(--panel2) 40%, var(--panel) 55%) 0 0 / 200% 100%; animation: shimmer 1.2s linear infinite; }
.skel i:first-child { height: 90px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; scroll-behavior: auto !important; } }

/* ---------- task review / complaint threads ---------- */
.feedback { margin-top: 6px; padding: 7px 10px; border-radius: 8px; border: 1px solid var(--line2); background: var(--panel2); font-size: 13px; white-space: normal; }
.feedback.warn { border-color: var(--warn); } .feedback.bad { border-color: var(--danger); }
.thread { display: grid; gap: 10px; margin: 12px 0; }
.msg { padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel2); max-width: 92%; }
.msg.mine { justify-self: end; border-color: rgba(168, 255, 90, .35); background: rgba(168, 255, 90, .07); }
.msg .who { font-size: 12px; color: var(--muted); margin-bottom: 3px; }
.msg .body { white-space: pre-wrap; word-break: break-word; }
.tabs { display: flex; gap: 6px; margin: 0 0 16px; flex-wrap: wrap; }
.tabs button { background: var(--panel2); border: 1px solid var(--line2); color: var(--muted); padding: 8px 14px; border-radius: 999px; cursor: pointer; font-weight: 600; }
.tabs button.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.attach { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.attach a { padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line2); background: var(--panel2); text-decoration: none; font-size: 13px; }

.actionbar { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 16px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.infobar { display: flex; gap: 8px 16px; flex-wrap: wrap; align-items: center; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel2); font-size: 13px; }

/* ---------- clients: chat, alerts, portal ---------- */
.client-btn { border-color: rgba(79, 184, 255, .55); color: var(--info); }
.navbadge { margin-left: auto; min-width: 20px; padding: 1px 7px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 12px; font-weight: 700; text-align: center; }
.nav a { display: flex; align-items: center; }
.alertbar { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 12px 18px; background: #5a0f18; border-bottom: 2px solid var(--danger); color: #fff; position: sticky; top: 0; z-index: 40; animation: alertpulse 1.2s ease-in-out infinite; }
@keyframes alertpulse { 50% { background: #7d1421; } }
.alertnote { padding: 10px 14px; border-radius: 10px; border: 1px solid var(--danger); background: rgba(255, 93, 108, .09); margin: 0 0 12px; font-size: 14px; }
.chatbox { border: 1px solid var(--line2); border-radius: 14px; background: var(--panel); overflow: hidden; }
.chatbox.alertbox { border-color: var(--danger); }
.chatlog { height: 340px; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: var(--bg); }
.chatbox.big .chatlog { height: min(55vh, 520px); }
.bubble { max-width: 82%; padding: 9px 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel2); align-self: flex-start; }
.bubble.mine { align-self: flex-end; background: rgba(168, 255, 90, .09); border-color: rgba(168, 255, 90, .35); }
.alertbox .bubble.mine { background: rgba(255, 93, 108, .1); border-color: rgba(255, 93, 108, .4); }
.bubble .who { font-size: 11.5px; color: var(--muted); margin-bottom: 2px; }
.bubble .body { white-space: pre-wrap; word-break: break-word; }
.bubble .seen { font-size: 11px; color: var(--muted); text-align: right; margin-top: 2px; }
.chatform { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); background: var(--panel); }
.chatform textarea { flex: 1; resize: none; min-height: 44px; }
.btn.danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.quick { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 10px 10px; background: var(--panel); }
.chip { border: 1px solid var(--line2); background: var(--panel2); color: var(--text); border-radius: 999px; padding: 4px 11px; font-size: 12.5px; cursor: pointer; }
.chip:hover { border-color: var(--accent); }
.center { text-align: center; }
.bubble .who, .msg .who { margin: 0 0 2px; padding: 0; background: none; border: 0; border-radius: 0; font-size: 11.5px; }
.stats.quad { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 760px) { .stats.quad { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* client team-member picker */
.people { border: 1px solid var(--line); border-radius: 12px; max-height: 260px; overflow: auto; }
.people label { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--line); cursor: pointer; }
.people label:last-child { border-bottom: 0; }
.people label:hover { background: rgba(127, 127, 127, .08); }
.people input { width: 18px; height: 18px; flex: none; }
.warnbox { margin-top: 8px; padding: 8px 12px; border-radius: 10px; background: rgba(217, 119, 6, .12); color: var(--warn, #b45309); }

/* who answers a client chat */
.ownernote { margin-bottom: 10px; padding: 9px 12px; border-radius: 10px; font-size: 13px; line-height: 1.6; background: rgba(34, 197, 94, .10); border: 1px solid rgba(34, 197, 94, .35); }
.ownernote.open { background: rgba(127, 127, 127, .10); border-color: var(--line); }
.ownernote .btn { margin-left: 6px; }

/* daily sheet (spreadsheet-like grid) */
.sheetwrap { overflow: auto; max-height: 68vh; border: 1px solid var(--line2); border-radius: 12px; background: var(--panel); }
table.sheet { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; font-size: 14px; }
table.sheet th { position: sticky; top: 0; z-index: 2; padding: 9px 10px; border-bottom: 1px solid var(--line2); border-right: 1px solid var(--line); text-align: left; }
table.sheet th.num, table.sheet td.num { text-align: right; }
table.sheet th.sortable { cursor: pointer; user-select: none; }
table.sheet th.sortable:hover, table.sheet th.col:hover { color: var(--accent); }
table.sheet th.col { cursor: pointer; }
table.sheet td { padding: 0; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); vertical-align: middle; min-width: 92px; }
table.sheet td.profit { padding: 0 10px; white-space: nowrap; min-width: 110px; }
table.sheet td.st { min-width: 34px; width: 34px; text-align: center; font-weight: 700; cursor: default; }
table.sheet td.st.ok { color: var(--accent); }
table.sheet td.st.wait { color: var(--warn); }
table.sheet td.st.bad { color: var(--danger); }
table.sheet td.x { min-width: 34px; width: 34px; text-align: center; }
table.sheet tbody tr:hover td { background: rgba(127, 127, 127, .06); }
table.sheet tr.locked td { opacity: .6; }
table.sheet tfoot td { padding: 9px 10px; font-weight: 700; background: var(--panel2); position: sticky; bottom: 0; border-top: 1px solid var(--line2); }
.cell { display: block; width: 100%; min-width: 92px; background: transparent; border: 0; border-radius: 0; padding: 9px 10px; outline: none; color: inherit; font: inherit; }
.cell.wide { min-width: 240px; }
.cell.num { text-align: right; }
select.cell { appearance: none; cursor: pointer; }
.cell:focus { outline: 2px solid var(--accent); outline-offset: -2px; background: rgba(168, 255, 90, .07); }
.cell.bad { outline: 2px solid var(--danger); outline-offset: -2px; }
.cell[readonly] { cursor: not-allowed; }
.iconbtn { background: transparent; border: 0; color: var(--muted); cursor: pointer; padding: 6px 8px; border-radius: 6px; font-size: 13px; }
.iconbtn:hover { color: var(--danger); background: rgba(255, 93, 108, .12); }

/* what the client sees of the sheet */
.pubstatus { margin: 0 0 12px; display: grid; gap: 6px; }
.pub { padding: 8px 12px; border-radius: 10px; font-size: 13px; background: rgba(127, 127, 127, .10); border: 1px solid var(--line); }
.pub.ok { background: rgba(34, 197, 94, .10); border-color: rgba(34, 197, 94, .35); }
.pub.warn { background: rgba(217, 119, 6, .12); border-color: rgba(217, 119, 6, .4); }

/* the website access password page */
.hero.gate { max-width: 420px; margin: 8vh auto 0; text-align: center; }
.hero.gate h1 { font-size: 26px; margin: 14px 0 6px; }
.gatebox { display: grid; gap: 10px; margin-top: 18px; text-align: left; }
.gatebox input { width: 100%; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line2); background: var(--panel2); font-size: 16px; }
.gatebox input:focus { outline: 2px solid var(--accent); outline-offset: -2px; }
.gatebox .btn { justify-content: center; padding: 12px; }
.gateerr { color: var(--danger); font-size: 14px; }

.people label.full { opacity: .55; cursor: not-allowed; }

/* the sheet looks like the team's Google Sheet: blue title band, yellow column headings */
table.sheet th { position: static; }
table.sheet thead { position: sticky; top: 0; z-index: 3; }
table.sheet th.hd { background: #ffe14d; color: #151515; text-transform: none; letter-spacing: 0; font-size: 14px; font-weight: 700; border-color: #c9b300; vertical-align: bottom; }
table.sheet th.hd small { display: block; font-weight: 500; font-size: 10px; opacity: .7; }
table.sheet th.hd.sortable:hover, table.sheet th.hd.col:hover { color: #7a4b00; }
table.sheet tr.band th { background: #3b78d8; color: #fff; text-transform: none; letter-spacing: 0; font-size: 20px; text-align: left; padding: 10px 12px; border-color: #2f64b8; }
table.sheet tr.band th small { font-size: 13px; font-weight: 500; opacity: .85; }
table.sheet tr.band th.tot { text-align: right; font-size: 15px; white-space: nowrap; }
table.sheet td.sr { min-width: 46px; width: 46px; text-align: center; color: var(--muted); padding: 0 6px; }
table.sheet.ro td { padding: 8px 10px; }
table.sheet.ro td.wrapcell { white-space: normal; min-width: 180px; max-width: 320px; }
table.sheet td.nowrap { white-space: nowrap; }
.sheetabs { align-items: center; }
.sheetabs button.active, .sheetabs button.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
