/* AADI TEAM — design based on the HeroUI design system (colours, radius, shadows, motion) */
:root {
  --bg: #f4f4f5; --panel: #ffffff; --panel-2: #fafafa; --text: #11181c; --muted: #71717a; --line: #e4e4e7;
  --d100: #f4f4f5; --d200: #e4e4e7; --d300: #d4d4d8;
  --brand: #006fee; --brand-2: #7828c8; --brand-soft: #e6f1fe; --brand-ink: #005bc4;
  --green: #12a150; --green-soft: #e8faf0; --red: #f31260; --red-soft: #fee7ef;
  --orange: #c4841d; --orange-soft: #fefce8; --blue: #006fee; --blue-soft: #e6f1fe; --purple: #7828c8; --purple-soft: #f2eafa; --gray-soft: #f4f4f5;
  --shadow-sm: 0 0 5px rgba(0,0,0,.02), 0 2px 10px rgba(0,0,0,.06), 0 0 1px rgba(0,0,0,.3);
  --shadow: 0 0 15px rgba(0,0,0,.03), 0 2px 30px rgba(0,0,0,.08), 0 0 1px rgba(0,0,0,.3);
  --shadow-lg: 0 0 30px rgba(0,0,0,.04), 0 30px 60px rgba(0,0,0,.12), 0 0 1px rgba(0,0,0,.3);
  --radius: 14px; --radius-md: 12px; --radius-sm: 8px;
  --grad: linear-gradient(135deg, #006fee 0%, #7828c8 100%);
  --ease: cubic-bezier(.36, .66, .04, 1); --spring: cubic-bezier(.34, 1.56, .64, 1);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000; --panel: #18181b; --panel-2: #1f1f23; --text: #ecedee; --muted: #a1a1aa; --line: #27272a;
    --d100: #27272a; --d200: #3f3f46; --d300: #52525b;
    --brand-soft: #001731; --brand-ink: #66aaf9;
    --green-soft: #072d17; --red-soft: #310413; --orange-soft: #312107; --blue-soft: #001731; --purple-soft: #180828; --gray-soft: #27272a;
    --shadow-sm: 0 0 5px rgba(0,0,0,.05), 0 2px 10px rgba(0,0,0,.2), inset 0 0 1px rgba(255,255,255,.15);
    --shadow: 0 0 15px rgba(0,0,0,.06), 0 2px 30px rgba(0,0,0,.22), inset 0 0 1px rgba(255,255,255,.15);
    --shadow-lg: 0 0 30px rgba(0,0,0,.07), 0 30px 60px rgba(0,0,0,.26), inset 0 0 1px rgba(255,255,255,.15);
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
body { font: 14px/1.5 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
body.offline::before {
  content: 'Connection to the server lost — reconnecting…'; position: fixed; top: 0; left: 0; right: 0; z-index: 3000;
  background: #f5a524; color: #000; text-align: center; padding: 5px; font-size: 12px; font-weight: 600; animation: slideDown .3s var(--ease);
}
a { color: var(--brand); text-decoration: none; }
a:hover { opacity: .8; }
h1, h2, h3 { margin: 0 0 8px; line-height: 1.25; letter-spacing: -.015em; }
h2 { font-size: 24px; font-weight: 700; } h3 { font-size: 15px; font-weight: 600; }
.muted { color: var(--muted); } .small { font-size: 12px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.hidden { display: none !important; }

/* ---------- Motion ---------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.94) translateY(16px); } }
@keyframes slideIn { from { opacity: 0; transform: translateX(40px) scale(.96); } }
@keyframes slideDown { from { transform: translateY(-100%); } }
@keyframes ripple { to { transform: scale(4); opacity: 0; } }
@keyframes shimmer { 100% { transform: translateX(100%); } }
@keyframes ring { 0%, 100% { transform: rotate(0); } 15% { transform: rotate(14deg); } 30% { transform: rotate(-12deg); } 45% { transform: rotate(8deg); } 60% { transform: rotate(-6deg); } 75% { transform: rotate(3deg); } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(23, 201, 100, .55); } 70% { box-shadow: 0 0 0 18px rgba(23, 201, 100, 0); } 100% { box-shadow: 0 0 0 0 rgba(23, 201, 100, 0); } }
@keyframes bump { 50% { transform: scale(1.25); } }
.page-enter { animation: fadeUp .4s var(--ease) both; }
.stagger > * { animation: fadeUp .45s var(--ease) both; animation-delay: calc(var(--i, 0) * 35ms); }
.ripple { position: absolute; border-radius: 50%; pointer-events: none; background: currentColor; opacity: .18; transform: scale(0); animation: ripple .6s ease-out forwards; }
.skeleton { position: relative; overflow: hidden; background: var(--d100); border-radius: var(--radius-md); min-height: 16px; }
.skeleton::after { content: ''; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent); animation: shimmer 1.3s infinite; }
@media (prefers-color-scheme: dark) { .skeleton::after { background: linear-gradient(90deg, transparent, rgba(255,255,255,.06), transparent); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; transition-duration: .01ms !important; } }

/* ---------- Inputs (HeroUI "flat") ---------- */
input, select, textarea {
  font: inherit; color: inherit; background: var(--d100); border: 2px solid transparent; border-radius: var(--radius-md);
  padding: 9px 12px; width: 100%; transition: background .2s var(--ease), border-color .2s var(--ease), box-shadow .2s;
}
input:hover, select:hover, textarea:hover { background: var(--d200); }
textarea { resize: vertical; min-height: 80px; }
input:focus, select:focus, textarea:focus { outline: none; background: var(--d100); border-color: var(--brand); }
input[type=checkbox], input[type=range] { background: none; }
label { display: block; font-size: 12px; font-weight: 500; color: var(--muted); margin-bottom: 14px; }
label > input, label > select, label > textarea { margin-top: 6px; color: var(--text); font-size: 14px; font-weight: 400; }
/* checkbox inside .check = HeroUI Switch */
.check { display: flex; gap: 12px; align-items: center; color: var(--text); font-size: 14px; font-weight: 500; padding: 5px 0; cursor: pointer; }
.check input[type=checkbox] {
  appearance: none; -webkit-appearance: none; width: 42px; height: 24px; border-radius: 99px; background: var(--d200); margin: 0; flex: none;
  position: relative; cursor: pointer; transition: background .25s var(--ease); padding: 0; border: none;
}
.check input[type=checkbox]::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.25); transition: transform .3s var(--spring), width .2s;
}
.check input[type=checkbox]:checked { background: var(--brand); }
.check input[type=checkbox]:checked::after { transform: translateX(18px); }
.check input[type=checkbox]:active::after { width: 22px; }
/* task staff picker keeps normal checkboxes */
#staffPick .check input[type=checkbox] { appearance: auto; -webkit-appearance: auto; width: 18px; height: 18px; background: none; accent-color: var(--brand); }
#staffPick .check input[type=checkbox]::after { display: none; }
input[type=range] { accent-color: var(--brand); padding: 0; height: 28px; border: none; }

/* ---------- Buttons ---------- */
.btn {
  font: inherit; font-weight: 500; border: none; background: var(--d100); color: var(--text); border-radius: var(--radius-md);
  height: 40px; padding: 0 16px; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  position: relative; overflow: hidden; isolation: isolate; text-decoration: none !important;
  transition: transform .25s var(--ease), background .2s, box-shadow .25s, opacity .2s;
}
.btn:hover { background: var(--d200); }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--brand); color: #fff; box-shadow: 0 8px 18px -6px rgba(0, 111, 238, .55); }
.btn.primary:hover { background: #338ef7; box-shadow: 0 10px 22px -6px rgba(0, 111, 238, .65); }
.btn.green { background: #17c964; color: #000; box-shadow: 0 8px 18px -6px rgba(23, 201, 100, .55); }
.btn.green:hover { background: #45d483; }
.btn.red { background: var(--red-soft); color: var(--red); }
.btn.red:hover { background: #fdd0df; }
.btn.small { height: 32px; padding: 0 12px; font-size: 12px; border-radius: var(--radius-sm); }
.btn.wide { width: 100%; height: 48px; font-size: 15px; font-weight: 600; }
.btn:disabled { opacity: .45; cursor: default; transform: none; box-shadow: none; }
.err { color: var(--red); min-height: 18px; font-size: 13px; margin-bottom: 6px; font-weight: 500; }
.err:not(:empty) { animation: fadeUp .3s var(--ease); }

/* ---------- Login ---------- */
body:has(.login-card) {
  min-height: 100vh;
  background: radial-gradient(800px 500px at 15% 10%, rgba(0,111,238,.35), transparent 60%),
              radial-gradient(700px 500px at 90% 90%, rgba(120,40,200,.35), transparent 60%), var(--bg);
}
.login-card {
  max-width: 400px; margin: 0 auto; position: relative; top: 12vh; background: var(--panel); padding: 34px 30px 26px;
  border-radius: 24px; box-shadow: var(--shadow-lg); animation: pop .5s var(--ease) both;
}
.login-card h2 { font-size: 20px; margin-bottom: 20px; }
.brand { font-weight: 800; letter-spacing: .3px; display: flex; align-items: center; gap: 10px; }
.brand::before {
  content: 'E'; display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; background: var(--grad);
  color: #fff; font-size: 17px; box-shadow: 0 8px 18px -6px rgba(0, 111, 238, .6);
}
.brand.big { font-size: 22px; margin-bottom: 18px; }
.brand > span { display: flex; flex-direction: column; line-height: 1.2; }
.brand small { font-size: 12px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.brand.big::before { width: 46px; height: 46px; font-size: 22px; border-radius: 14px; }

/* ---------- Admin layout ---------- */
.layout { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.side {
  background: var(--panel); padding: 18px 12px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px;
  box-shadow: var(--shadow-sm); z-index: 5;
}
.side .brand { padding: 4px 10px 24px; font-size: 17px; }
.nav {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-md); color: var(--muted); font-weight: 500;
  text-decoration: none !important; cursor: pointer; position: relative; overflow: hidden; transition: background .2s var(--ease), color .2s, transform .2s var(--ease);
}
.nav span:first-child { width: 22px; text-align: center; font-size: 17px; transition: transform .3s var(--spring); }
.nav:hover { background: var(--d100); color: var(--text); opacity: 1; }
.nav:hover span:first-child { transform: scale(1.15); }
.nav:active { transform: scale(.98); }
.nav.active { background: var(--brand-soft); color: var(--brand-ink); font-weight: 600; }
.nav .count { margin-left: auto; background: var(--red); color: #fff; border-radius: 99px; font-size: 11px; font-weight: 600; padding: 0 7px; line-height: 19px; animation: bump .4s var(--spring); }
.side .me { margin-top: auto; padding: 12px 14px; border-radius: var(--radius); background: var(--d100); font-size: 12px; line-height: 1.6; }
.side .me b { font-size: 13px; }
.main { padding: 24px 30px 40px; min-width: 0; max-width: 1500px; }
.topbar { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; flex-wrap: wrap; }
.topbar h2 { margin: 0; }
.bell {
  position: relative; font-size: 18px; background: var(--panel); border: none; border-radius: var(--radius-md); cursor: pointer;
  width: 40px; height: 40px; display: grid; place-items: center; box-shadow: var(--shadow-sm); transition: transform .2s var(--ease);
}
.bell:active { transform: scale(.94); }
.bell.ring { animation: ring .9s ease; }
.bell .dot { position: absolute; top: -5px; right: -5px; background: var(--red); color: #fff; border-radius: 99px; font-size: 10px; font-weight: 600; padding: 0 6px; line-height: 18px; border: 2px solid var(--bg); }
.notif-panel {
  position: absolute; right: 30px; top: 70px; width: 400px; max-height: 72vh; overflow: auto; background: var(--panel);
  border-radius: var(--radius); box-shadow: var(--shadow-lg); z-index: 1500; animation: pop .3s var(--ease); transform-origin: top right;
}
.notif-panel .n { padding: 12px 16px; border-bottom: 1px solid var(--line); cursor: pointer; transition: background .15s; }
.notif-panel .n:hover { background: var(--d100); }
.notif-panel .n.unread { background: var(--brand-soft); }
.notif-panel .n b { display: block; font-weight: 600; }

/* ---------- Cards & stats ---------- */
.card { background: var(--panel); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; box-shadow: var(--shadow); }
.card.table-wrap { padding: 8px !important; overflow: auto; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat {
  background: var(--panel); border-radius: var(--radius); padding: 16px; cursor: pointer; display: flex; align-items: center; gap: 14px;
  box-shadow: var(--shadow); position: relative; overflow: hidden; border: 2px solid transparent;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .2s;
}
.stat:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.stat:active { transform: translateY(-1px) scale(.98); }
.stat .ico { width: 46px; height: 46px; border-radius: var(--radius-md); display: grid; place-items: center; font-size: 21px; background: var(--d100); flex: none; transition: transform .35s var(--spring); }
.stat:hover .ico { transform: scale(1.1) rotate(-6deg); }
.stat .v { font-size: 28px; font-weight: 700; line-height: 1.1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat .l { color: var(--muted); font-size: 12px; font-weight: 500; }
.stat.on { border-color: var(--brand); }
.stat.green .ico { background: var(--green-soft); } .stat.green .v { color: var(--green); }
.stat.red .ico { background: var(--red-soft); } .stat.red .v { color: var(--red); }
.stat.orange .ico { background: var(--orange-soft); } .stat.orange .v { color: var(--orange); }
.stat.blue .ico { background: var(--blue-soft); } .stat.blue .v { color: var(--blue); }

/* ---------- Tables (HeroUI table) ---------- */
table { width: 100%; border-collapse: separate; border-spacing: 0; }
th, td { text-align: left; padding: 11px 14px; vertical-align: middle; }
th { font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; background: var(--d100); position: sticky; top: 0; z-index: 1; white-space: nowrap; }
th:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
th:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
td { border-bottom: 1px solid var(--line); }
tbody tr:last-child td { border-bottom: none; }
tbody tr td { transition: background .15s; }
tbody tr:hover td { background: var(--d100); }
tbody tr:hover td:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
tbody tr:hover td:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
tr.click { cursor: pointer; }
td.small, td:has(.pill) { white-space: nowrap; }
.table-wrap { overflow-x: auto; }

/* ---------- Chips & avatars ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 99px; font-size: 12px; font-weight: 500; background: var(--d100); color: var(--muted); white-space: nowrap; line-height: 22px; }
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.green { background: var(--green-soft); color: var(--green); }
.pill.red { background: var(--red-soft); color: var(--red); }
.pill.orange { background: var(--orange-soft); color: var(--orange); }
.pill.blue { background: var(--blue-soft); color: var(--blue); }
.avatar {
  width: 38px; height: 38px; border-radius: 50%; background: var(--grad); color: #fff; display: inline-grid; place-items: center;
  font-weight: 600; font-size: 13px; flex: none; position: relative; transition: transform .3s var(--spring);
}
.avatar.on { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px #17c964; }
.avatar.on::after { content: ''; position: absolute; right: -2px; bottom: -2px; width: 11px; height: 11px; border-radius: 50%; background: #17c964; border: 2px solid var(--panel); }
tr:hover .avatar, .chat-item:hover .avatar { transform: scale(1.08); }
.who { display: flex; align-items: center; gap: 12px; }

/* ---------- Chat ---------- */
.chat { display: grid; grid-template-columns: 310px 1fr; height: calc(100vh - 116px); background: var(--panel); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.chat-list { border-right: 1px solid var(--line); overflow: auto; padding: 6px; }
.chat-item { display: flex; gap: 12px; align-items: center; padding: 10px 12px; cursor: pointer; border-radius: var(--radius-md); transition: background .15s, transform .2s var(--ease); margin-bottom: 2px; }
.chat-item:hover { background: var(--d100); }
.chat-item:active { transform: scale(.98); }
.chat-item.active { background: var(--brand-soft); }
.chat-item .t { flex: 1; min-width: 0; }
.chat-item .t b { display: block; font-weight: 600; }
.chat-item .t span { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.unread { background: var(--brand); color: #fff; border-radius: 99px; font-size: 11px; font-weight: 600; padding: 0 7px; line-height: 20px; animation: bump .4s var(--spring); }
.chat-box { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.chat-head { padding: 12px 16px; border-bottom: 1px solid var(--line); display: flex; gap: 12px; align-items: center; }
.msgs { flex: 1; overflow: auto; padding: 18px; display: flex; flex-direction: column; gap: 8px; background: var(--panel-2); }
.msg {
  max-width: 70%; padding: 9px 13px; border-radius: 18px 18px 18px 6px; background: var(--d100); align-self: flex-start;
  word-wrap: break-word; white-space: pre-wrap; animation: pop .35s var(--ease) both; transform-origin: bottom left;
}
.msg.me { align-self: flex-end; background: var(--brand); color: #fff; border-radius: 18px 18px 6px 18px; transform-origin: bottom right; }
.msg .time { display: block; font-size: 10px; color: var(--muted); text-align: right; margin-top: 3px; }
.msg.me .time { color: rgba(255,255,255,.8); }
.msg img, .comment img { max-width: 240px; max-height: 240px; border-radius: var(--radius-md); display: block; margin-top: 6px; cursor: zoom-in; transition: transform .25s var(--ease); }
.msg img:hover, .comment img:hover { transform: scale(1.03); }
.composer { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); align-items: flex-end; }
.composer textarea { min-height: 42px; max-height: 120px; }
.icon-btn { font-size: 20px; background: none; border: none; cursor: pointer; padding: 6px; transition: transform .25s var(--spring); }
.icon-btn:hover { transform: scale(1.15); }

/* ---------- Map ---------- */
.map { position: relative; z-index: 0; isolation: isolate; height: calc(100vh - 190px); min-height: 360px; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.map.small { height: 340px; }
.leaflet-control-layers, .leaflet-bar { border-radius: var(--radius-md) !important; border: none !important; box-shadow: var(--shadow) !important; overflow: hidden; }

/* ---------- Modal ---------- */
.modal-wrap { position: fixed; inset: 0; background: rgba(0, 0, 0, .35); backdrop-filter: blur(6px); display: grid; place-items: center; z-index: 2000; padding: 16px; animation: fadeIn .25s ease; }
.modal { background: var(--panel); border-radius: 22px; width: min(580px, 100%); max-height: 92vh; overflow: auto; padding: 24px; box-shadow: var(--shadow-lg); animation: pop .4s var(--ease) both; }
.modal.wide { width: min(820px, 100%); }
.modal h3 { font-size: 18px; }
.modal .actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 14px; }
.days { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 8px; }
.days label { margin: 0; }
.days input { display: none; }
.days span { display: inline-block; padding: 6px 14px; background: var(--d100); border-radius: 99px; cursor: pointer; color: var(--text); font-size: 13px; font-weight: 500; transition: all .2s var(--ease); }
.days span:hover { background: var(--d200); }
.days input:checked + span { background: var(--red); color: #fff; transform: scale(1.05); box-shadow: 0 6px 14px -6px rgba(243, 18, 96, .6); }

.comment { padding: 10px 0; border-bottom: 1px solid var(--line); animation: fadeUp .35s var(--ease) both; }
.comment .h { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.task-title { font-weight: 600; }
.overdue { color: var(--red); font-weight: 600; }
.pri-high td:first-child, .task-card.pri-high { box-shadow: inset 4px 0 0 var(--red); }

/* ---------- Toasts ---------- */
#toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 10px; z-index: 2500; max-width: 380px; }
.toast {
  background: var(--panel); border-radius: var(--radius); padding: 12px 16px 12px 18px; box-shadow: var(--shadow-lg); cursor: pointer;
  position: relative; overflow: hidden; animation: slideIn .45s var(--spring) both; transition: opacity .4s, transform .4s var(--ease);
}
.toast::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--brand); }
.toast b { display: block; } .toast span { color: var(--muted); font-size: 13px; }
.toast.green::before { background: #17c964; } .toast.red::before { background: var(--red); } .toast.orange::before { background: #f5a524; }
.toast.hide { opacity: 0; transform: translateX(40px) scale(.96); }

/* ---------- Team app (mobile) ---------- */
.staff { max-width: 560px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; }
.staff header {
  position: sticky; top: 0; z-index: 10; background: rgba(255,255,255,.75); backdrop-filter: saturate(180%) blur(14px);
  padding: 12px 16px; display: flex; align-items: center; gap: 12px; box-shadow: 0 1px 0 var(--line);
}
@media (prefers-color-scheme: dark) { .staff header { background: rgba(24,24,27,.75); } }
.staff main { flex: 1; padding: 16px 16px 110px; }
.tabs { position: fixed; bottom: 12px; left: 12px; right: 12px; display: flex; justify-content: center; z-index: 10; }
.tabs .in { display: flex; width: 100%; max-width: 536px; background: var(--panel); border-radius: 22px; box-shadow: var(--shadow-lg); padding: 6px; gap: 4px; }
.tab {
  flex: 1; text-align: center; padding: 7px 4px 8px; font-size: 11px; font-weight: 500; color: var(--muted); cursor: pointer; position: relative;
  background: none; border: none; font-family: inherit; border-radius: 16px; overflow: hidden; transition: background .3s var(--ease), color .2s;
}
.tab .i { display: block; font-size: 20px; margin-bottom: 1px; transition: transform .35s var(--spring); }
.tab.active { color: var(--brand-ink); background: var(--brand-soft); font-weight: 600; }
.tab.active .i { transform: translateY(-2px) scale(1.12); }
.tab .count { position: absolute; top: 2px; left: 56%; background: var(--red); color: #fff; border-radius: 99px; font-size: 10px; font-weight: 600; padding: 0 6px; line-height: 16px; animation: bump .4s var(--spring); }
.big-status { text-align: center; padding: 28px 12px; border-radius: 24px; margin-bottom: 14px; box-shadow: var(--shadow); animation: pop .5s var(--ease) both; }
.big-status .e { font-size: 44px; line-height: 1; display: inline-grid; place-items: center; width: 80px; height: 80px; border-radius: 50%; background: rgba(255,255,255,.22); }
.big-status b { display: block; font-size: 21px; margin-top: 12px; }
.big-status.in { background: linear-gradient(135deg, #12a150, #17c964); color: #fff; }
.big-status.in .e { animation: pulse 2s infinite; }
.big-status.out { background: var(--panel); color: var(--muted); }
.big-status.out .e { background: var(--d100); }
.big-status.out b { color: var(--text); }
.task-card { background: var(--panel); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; box-shadow: var(--shadow); transition: transform .25s var(--ease), box-shadow .25s; }
.task-card:active { transform: scale(.98); }
.staff .chat-box { height: calc(100vh - 200px); background: var(--panel); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.staff .msg { max-width: 85%; }
.staff h3 { margin-top: 4px; }

@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .side { position: fixed; bottom: 10px; left: 10px; right: 10px; top: auto; height: auto; flex-direction: row; overflow-x: auto; padding: 6px; z-index: 30; border-radius: 22px; box-shadow: var(--shadow-lg); }
  .side .brand, .side .me { display: none; }
  .nav { flex-direction: column; gap: 0; font-size: 11px; padding: 6px 10px; }
  .main { padding: 18px 14px 100px; }
  .chat { grid-template-columns: 1fr; height: calc(100vh - 180px); }
  .chat.has-open .chat-list { display: none; }
  .chat:not(.has-open) .chat-box { display: none; }
  .notif-panel { right: 8px; left: 8px; width: auto; }
  .grid3 { grid-template-columns: 1fr 1fr; }
  #toasts { bottom: 96px; left: 12px; right: 12px; max-width: none; }
}
.staff-body #toasts { bottom: 104px; left: 12px; right: 12px; max-width: none; }
@media (max-width: 480px) { .grid2, .grid3 { grid-template-columns: 1fr; } .login-card { top: 6vh; margin: 0 14px; } }
