/* HimmelFix — modern UI (Heebo, blue theme, RTL) */
:root {
  --primary: #3b63e6;
  --primary-600: #2f52c8;
  --primary-50: #eef2fd;
  --primary-100: #dde6fc;
  --violet: #6366f1;
  --bg: #f3f5fa;
  --surface: #ffffff;
  --surface-2: #f7f8fb;
  --line: #e7eaf1;
  --line-2: #d6dce8;
  --ink: #111827;
  --ink-2: #374151;
  --muted: #6b7280;
  --muted-2: #9aa3b2;
  --danger: #e0524a;
  --danger-50: #fdeeed;
  --success: #16a34a;
  --success-50: #e8f7ee;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-sm: 0 1px 3px rgba(16, 24, 40, .06), 0 1px 2px rgba(16, 24, 40, .03);
  --shadow: 0 10px 30px -12px rgba(30, 41, 90, .18);
  --shadow-lg: 0 30px 70px -24px rgba(30, 41, 90, .35);
  --focus: 0 0 0 4px rgba(59, 99, 230, .16);
  --side-w: 272px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: 'Heebo', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  background: var(--bg); color: var(--ink); font-size: 16px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--primary); }
.svg { width: 1.15em; height: 1.15em; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.req { color: var(--danger); margin-inline-start: 2px; }
.nowrap { white-space: nowrap; }
.ltr { direction: ltr; text-align: right; }
.ltr-inline { direction: ltr; unicode-bidi: isolate; display: inline-block; }

/* ================================================ brand */
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; min-width: 0; }
.brand-logo { width: 150px; height: 50px; object-fit: contain; object-position: right center; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.brand-name { font-weight: 700; font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-tag { color: var(--muted); font-size: .88rem; white-space: nowrap; }

/* ================================================ public top bar */
body.public .topbar { position: sticky; top: 0; z-index: 30; background: rgba(255, 255, 255, .85); backdrop-filter: saturate(1.5) blur(12px); border-bottom: 1px solid var(--line); }
.topbar-inner { max-width: 1240px; margin: 0 auto; padding: 12px 28px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.nav { display: flex; align-items: center; gap: 8px; }
.nav-link {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 12px; color: var(--ink-2);
  text-decoration: none; font-weight: 500; white-space: nowrap; transition: background .15s, color .15s;
}
.nav-link .svg { width: 20px; height: 20px; color: var(--muted); transition: color .15s; }
.nav-link:hover { background: var(--surface-2); color: var(--ink); }
.nav-link.active { background: var(--primary); color: #fff; box-shadow: 0 8px 18px -8px rgba(59, 99, 230, .7); }
.nav-link.active .svg { color: #fff; }
body.public .nav-link.active { background: var(--primary-50); color: var(--primary); box-shadow: none; }
body.public .nav-link.active .svg { color: var(--primary); }

/* ================================================ staff sidebar */
body.staff .topbar {
  position: fixed; inset-block: 0; right: 0; width: var(--side-w); z-index: 30;
  background: var(--surface); border-inline-end: 1px solid var(--line);
}
.side { height: 100%; display: flex; flex-direction: column; padding: 24px 18px 18px; gap: 26px; overflow-y: auto; }
.side .brand { flex-direction: column; align-items: flex-start; gap: 10px; padding: 4px 8px 0; }
.side-nav { display: flex; flex-direction: column; gap: 4px; }
.side-label { font-size: .8rem; color: var(--muted-2); font-weight: 500; padding: 0 14px 6px; }
.nav-badge { margin-inline-start: auto; background: var(--primary-50); color: var(--primary); font-size: .78rem; font-weight: 700; border-radius: 999px; padding: 1px 9px; min-width: 24px; text-align: center; }
.nav-link.active .nav-badge { background: rgba(255,255,255,.22); color: #fff; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 14px; }
.side-card {
  position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 2px; padding: 18px 20px; border-radius: 18px; color: #fff;
  background: linear-gradient(150deg, #3b63e6 0%, #2a46b8 100%); box-shadow: 0 16px 30px -16px rgba(42, 70, 184, .8);
}
.side-card::after { content: ''; position: absolute; width: 140px; height: 140px; border-radius: 50%; background: rgba(255,255,255,.08); top: -50px; left: -40px; }
.side-card-label { font-size: .88rem; opacity: .85; }
.side-card-num { font-size: 2.2rem; font-weight: 700; line-height: 1.15; }
.side-card-sub { font-size: .85rem; opacity: .85; }
.side-user { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 14px; }
.side-user-text { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.3; }
.side-user-text b { font-weight: 600; font-size: .95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user-text span { font-size: .82rem; color: var(--muted); }

/* ================================================ layout */
.view { max-width: 1240px; margin: 0 auto; padding: 44px 28px 80px; }
body.staff .view { max-width: none; margin: 0 var(--side-w) 0 0; padding: 34px 40px 80px; }
body.staff .view > * { max-width: 1500px; margin-inline: auto; }
.narrow { max-width: 900px; margin: 0 auto; }
.mid { max-width: 1120px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
.page-title { font-size: clamp(1.7rem, 2.6vw, 2.15rem); font-weight: 700; margin: 0; letter-spacing: -.01em; line-height: 1.15; }
.page-sub { color: var(--muted); margin: 6px 0 0; font-size: 1.02rem; }
.head-actions { display: flex; gap: 10px; align-items: center; }
.section-h { font-size: 1.05rem; font-weight: 600; margin: 0 0 14px; color: var(--ink-2); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-xs); }
.card-pad { padding: 34px 36px; }

/* ================================================ buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 44px; padding: 9px 20px; border-radius: 12px;
  font-weight: 600; border: 1px solid transparent; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .15s, box-shadow .15s, border-color .15s, transform .05s;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--focus); }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 8px 18px -10px rgba(59, 99, 230, .9); }
.btn-primary:hover:not(:disabled) { background: var(--primary-600); }
.btn-primary:disabled { background: #a9bbf3; box-shadow: none; cursor: not-allowed; }
.btn-outline { background: #fff; border-color: var(--line-2); color: var(--ink); }
.btn-outline:hover:not(:disabled) { background: var(--surface-2); }
.btn-ghost { background: none; color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #c9433c; }
.btn-danger-soft { background: var(--danger-50); color: var(--danger); }
.btn-danger-soft:hover { background: #fbdedc; }
.btn-sm { min-height: 38px; padding: 6px 14px; font-size: .93rem; }
.btn-block { width: 100%; }
.btn-square { width: 52px; min-height: 52px; padding: 0; }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; border: 0; background: none;
  color: var(--ink-2); cursor: pointer; transition: background .15s, color .15s; flex: none;
}
.icon-btn:hover { background: var(--surface-2); color: var(--primary); }
.icon-btn:focus-visible { outline: none; box-shadow: var(--focus); }
.icon-btn.bordered { width: 44px; height: 44px; background: #fff; border: 1px solid var(--line-2); }
.icon-btn.danger { color: var(--danger); }
.icon-btn.danger:hover { background: var(--danger-50); color: var(--danger); }
.icon-btn.spinning .svg { animation: spin .8s linear infinite; }
.link-btn { display: inline-flex; gap: 6px; align-items: center; border: 0; background: none; color: var(--primary); cursor: pointer; font-weight: 500; padding: 4px 8px; border-radius: 8px; }
.link-btn:hover { background: var(--primary-50); }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid currentColor; border-top-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ================================================ forms */
.field { display: flex; flex-direction: column; gap: 9px; min-width: 0; }
.label { font-weight: 600; font-size: 1rem; color: var(--ink); }
.label .opt { color: var(--muted); font-weight: 400; }
.hint { color: var(--muted); font-size: .9rem; margin: -2px 0 0; }
.err { color: var(--danger); font-size: .9rem; margin: -2px 0 0; display: flex; gap: 6px; align-items: center; }
.input, .select, .textarea {
  width: 100%; min-height: 50px; padding: 11px 16px; border-radius: var(--radius-sm); border: 1px solid var(--line-2);
  background: #fff; font-size: 1rem; outline: none; transition: border-color .15s, box-shadow .15s;
}
.textarea { min-height: 140px; resize: vertical; line-height: 1.6; }
.input::placeholder, .textarea::placeholder { color: var(--muted-2); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary); box-shadow: var(--focus); }
.invalid .input, .invalid .select, .invalid .textarea, .invalid .combo-input, .input.invalid, .textarea.invalid { border-color: var(--danger); }
.select {
  appearance: none; -webkit-appearance: none; cursor: pointer; padding-inline-end: 42px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-size: 17px; background-position: left 14px center;
}
.select.placeholder { color: var(--muted-2); }
.input-icon { position: relative; }
.input-icon > .svg { position: absolute; inset-inline-start: 15px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-icon .input { padding-inline-start: 44px; }
.input-icon .input.ltr { padding-left: 16px; padding-right: 44px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
.form-stack { display: flex; flex-direction: column; gap: 28px; }

.seg { display: grid; grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); gap: 12px; }
.seg-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 58px; padding: 10px; background: #fff;
  border: 1px solid var(--line-2); border-radius: var(--radius-sm); cursor: pointer; font-size: 1.05rem; color: var(--ink-2);
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.seg-btn:hover { background: var(--surface-2); }
.seg-btn.selected { border-color: var(--c); background: color-mix(in srgb, var(--c) 9%, #fff); color: var(--ink); font-weight: 600; box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 20%, transparent); }
.seg-btn:focus-visible { outline: none; box-shadow: var(--focus); }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: none; display: inline-block; }

.drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 160px;
  border: 1.5px dashed var(--line-2); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--muted); cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
}
.drop:hover, .drop.drag { border-color: var(--primary); background: var(--primary-50); color: var(--primary); }
.drop .drop-ico { width: 52px; height: 52px; border-radius: 14px; background: #fff; display: grid; place-items: center; box-shadow: var(--shadow-sm); color: var(--primary); }
.drop .svg { width: 24px; height: 24px; }
.drop small { color: var(--muted-2); }
.photo-prev { position: relative; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--line); background: #0f172a; max-width: 420px; }
.photo-prev img { display: block; width: 100%; max-height: 320px; object-fit: contain; }
.photo-prev .icon-btn { position: absolute; top: 10px; inset-inline-start: 10px; background: rgba(255,255,255,.95); }

.combo { position: relative; }
.combo-list { position: absolute; inset-inline: 0; top: calc(100% + 6px); z-index: 20; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); max-height: 300px; overflow: auto; padding: 6px; }
.combo-opt { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 9px; cursor: pointer; }
.combo-opt.active, .combo-opt:hover { background: var(--primary-50); }
.combo-opt .room { min-width: 48px; text-align: center; font-weight: 700; color: var(--primary); background: var(--primary-100); border-radius: 7px; padding: 2px 8px; font-size: .88rem; }
.combo-opt.custom { color: var(--primary); border-top: 1px solid var(--line); border-radius: 0 0 9px 9px; margin-top: 4px; }
.combo-empty { padding: 12px; color: var(--muted); }
.combo-clear { position: absolute; inset-inline-end: 6px; top: 50%; transform: translateY(-50%); }

/* ================================================ OTP gate (Aurora frosted glass) */
.gate-wrap { display: grid; place-items: center; padding: 30px 0; position: relative; }
.gate-wrap::before { content: ''; position: absolute; inset: -40px 0; z-index: -1; background: radial-gradient(600px 300px at 70% 20%, rgba(130, 160, 255, .25), transparent 70%), radial-gradient(500px 280px at 25% 85%, rgba(167, 139, 250, .22), transparent 70%); }
.aurora {
  position: relative; width: min(760px, 100%); padding: 60px 64px 56px; border-radius: 40px; text-align: center;
  background: rgba(255, 255, 255, .6); border: 1.5px solid rgba(205, 212, 247, .95);
  box-shadow: 0 40px 90px -34px rgba(70, 90, 200, .4), inset 0 1px 0 rgba(255,255,255,.9);
  backdrop-filter: blur(24px) saturate(1.6); overflow: hidden; isolation: isolate;
}
.aurora::before, .aurora::after { content: ''; position: absolute; z-index: -1; border-radius: 50%; filter: blur(50px); opacity: .8; animation: aurora 14s ease-in-out infinite alternate; }
.aurora::before { width: 360px; height: 320px; top: -150px; inset-inline-start: -90px; background: radial-gradient(circle, #a9c2ff 0%, rgba(169,194,255,0) 70%); }
.aurora::after { width: 380px; height: 320px; bottom: -170px; inset-inline-end: -100px; background: radial-gradient(circle, #cfc6ff 0%, rgba(200,196,255,0) 70%); animation-delay: -7s; }
@keyframes aurora { 0% { transform: translate(0, 0) scale(1); } 50% { transform: translate(-30px, 20px) scale(1.12); } 100% { transform: translate(20px, -10px) scale(.95); } }
.gate-icon { width: 96px; height: 96px; margin: 0 auto 34px; border-radius: 28px; display: grid; place-items: center; color: #fff; background: linear-gradient(140deg, #4a7fea 0%, #6366f1 100%); box-shadow: 0 22px 40px -14px rgba(79, 99, 235, .6); }
.gate-icon .svg { width: 42px; height: 42px; }
.gate-title { font-size: clamp(1.9rem, 3.6vw, 2.4rem); font-weight: 800; margin: 0 0 14px; }
.gate-text { color: var(--muted); font-size: 1.15rem; max-width: 520px; margin: 0 auto 44px; line-height: 1.8; }
.gate-foot { color: var(--muted); margin: 36px 0 0; }
.otp-zone { position: relative; display: flex; justify-content: center; margin-bottom: 38px; }
.otp { display: flex; gap: 16px; direction: ltr; position: relative; z-index: 1; }
.otp-box {
  width: 88px; height: 98px; border-radius: 20px; text-align: center; font-size: 2.2rem; font-weight: 700; background: rgba(255,255,255,.95);
  border: 1.5px solid #dcdcf7; outline: none; caret-color: var(--ink); transition: border-color .15s, box-shadow .15s; color: var(--ink);
}
.otp-box:focus { border-color: #8b93f0; box-shadow: 0 0 0 5px rgba(99, 102, 241, .14); }
.otp-box.filled { border-color: #aab0f3; }
.otp.error .otp-box { border-color: var(--danger); background: #fff7f7; }
.otp.error { animation: shake .42s ease; }
.otp.success .otp-box { border-color: var(--success); background: #f3fbf6; color: var(--success); }
@keyframes shake { 0%,100% { transform: translateX(0); } 20% { transform: translateX(-10px); } 40% { transform: translateX(9px); } 60% { transform: translateX(-6px); } 80% { transform: translateX(4px); } }
.otp.verifying .otp-box { animation: digit-spin 1.1s cubic-bezier(.55,.1,.35,1) infinite; animation-delay: calc(var(--i) * 110ms); border-color: #a5abf5; }
@keyframes digit-spin { 0% { transform: rotateY(0) scale(1); } 45% { transform: rotateY(180deg) scale(.92); } 90%, 100% { transform: rotateY(360deg) scale(1); } }
.otp-error { color: var(--danger); font-weight: 500; margin: -22px 0 26px; min-height: 1.5em; }
/* orbiting verification circle — only inserted into the DOM while verifying */
.orbit { position: absolute; inset: -24px -36px; z-index: 0; pointer-events: none; animation: orbit-in .25s ease-out both; }
.orbit-ring { position: absolute; inset: 0; border-radius: 999px; border: 1.5px dashed rgba(99, 102, 241, .4); }
.orbit-arm { position: absolute; inset: 0; animation: spin 1.3s linear infinite; }
.orbit-dot { position: absolute; top: -9px; left: 50%; width: 18px; height: 18px; margin-left: -9px; border-radius: 50%; background: linear-gradient(140deg, #4a7fea, #6366f1); box-shadow: 0 0 0 6px rgba(99, 102, 241, .16), 0 0 18px rgba(99, 102, 241, .7); }
@keyframes orbit-in { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: scale(1); } }
.btn-gradient {
  width: 100%; min-height: 76px; border-radius: 22px; border: 1.5px solid rgba(255,255,255,.6); font-size: 1.35rem; font-weight: 700; color: #fff;
  background: linear-gradient(90deg, #4a7fea, #6366f1); cursor: pointer; box-shadow: 0 18px 36px -16px rgba(79, 99, 235, .7);
  display: inline-flex; align-items: center; justify-content: center; gap: 12px; transition: opacity .2s, filter .2s;
}
.btn-gradient:hover:not(:disabled) { filter: brightness(1.05); }
.btn-gradient:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }

/* ================================================ public report form */
.form-hero { display: flex; gap: 18px; align-items: center; margin-bottom: 26px; }
.form-hero-ico { width: 58px; height: 58px; border-radius: 16px; display: grid; place-items: center; background: var(--primary); color: #fff; box-shadow: 0 14px 26px -12px rgba(59,99,230,.8); flex: none; }
.form-hero-ico .svg { width: 28px; height: 28px; }
.form-sec { display: flex; flex-direction: column; gap: 22px; }
.form-sec + .form-sec { border-top: 1px solid var(--line); padding-top: 28px; }
.form-sec-title { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.05rem; margin: 0; }
.form-sec-title .num { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary); font-size: .9rem; }
.success-card { text-align: center; padding: 60px 36px; }
.success-icon { width: 88px; height: 88px; border-radius: 50%; margin: 0 auto 24px; display: grid; place-items: center; background: var(--success-50); color: var(--success); animation: pop .45s cubic-bezier(.2,1.4,.4,1); box-shadow: 0 0 0 10px #f3fbf6; }
.success-icon .svg { width: 44px; height: 44px; stroke-width: 2.5; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.success-card h2 { font-size: 1.9rem; margin: 0 0 10px; }
.success-card p { color: var(--muted); font-size: 1.1rem; margin: 0 0 28px; }

/* auth */
.auth-card { max-width: 460px; margin: 30px auto; padding: 40px 38px; }
.auth-card h1 { margin: 0 0 6px; font-size: 1.75rem; }
.auth-card .form-stack { gap: 20px; margin-top: 26px; }
.alert { padding: 12px 16px; border-radius: 12px; background: var(--danger-50); color: #a93630; font-size: .95rem; }

/* ================================================ dashboard: stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; margin-bottom: 26px; }
.stat {
  display: flex; flex-direction: column; gap: 6px; text-align: start; cursor: pointer; padding: 18px 20px; border-radius: 18px;
  background: color-mix(in srgb, var(--c) 8%, #fff); border: 1px solid color-mix(in srgb, var(--c) 14%, #fff);
  transition: box-shadow .15s, transform .15s, border-color .15s;
}
.stat:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.stat.active { border-color: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 18%, transparent); }
.stat:focus-visible { outline: none; box-shadow: var(--focus); }
.stat-top { display: flex; justify-content: space-between; align-items: center; }
.stat-label { color: var(--ink-2); font-size: .95rem; }
.stat-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: #fff; color: var(--c); box-shadow: var(--shadow-xs); }
.stat-ico .svg { width: 18px; height: 18px; }
.stat-num { font-size: 2.1rem; font-weight: 700; line-height: 1.1; letter-spacing: -.01em; }
.stat-sub { color: var(--muted); font-size: .85rem; display: inline-flex; gap: 4px; align-items: center; min-height: 1.3em; }
.trend { color: var(--success); display: inline-flex; gap: 3px; align-items: center; font-weight: 600; }
.trend .svg { width: 15px; height: 15px; }

/* toolbar */
.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 10px; box-shadow: var(--shadow-xs); }
.tb-search { flex: 1 1 280px; }
.tb-search .input { border-color: transparent; background: var(--surface-2); min-height: 44px; }
.tb-search .input:focus { background: #fff; }
.tb-filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.tb-sort { position: relative; display: flex; align-items: center; }
.tb-sort > .svg { position: absolute; inset-inline-start: 12px; color: var(--muted); pointer-events: none; }
.tb-sort .select { min-height: 44px; padding-inline-start: 36px; border-radius: 11px; font-size: .95rem; min-width: 170px; }
.results-meta { display: flex; justify-content: space-between; align-items: center; margin: 14px 4px 14px; font-size: .92rem; min-height: 30px; }
.vt { display: inline-flex; padding: 4px; background: #e9ecf3; border-radius: 12px; gap: 2px; }
.vt-btn { display: inline-flex; align-items: center; gap: 7px; border: 0; background: none; padding: 7px 14px; border-radius: 9px; cursor: pointer; color: var(--muted); font-weight: 500; }
.vt-btn[aria-pressed="true"] { background: #fff; color: var(--primary); box-shadow: var(--shadow-sm); }
.vt-btn:focus-visible { outline: none; box-shadow: var(--focus); }

/* multiselect chip */
.ms { position: relative; }
.ms-trigger {
  display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 14px; background: #fff; border: 1px solid var(--line-2);
  border-radius: 11px; cursor: pointer; font-size: .95rem; white-space: nowrap; max-width: 260px;
}
.ms-trigger:hover { background: var(--surface-2); }
.ms-trigger:focus-visible, .ms.open .ms-trigger { border-color: var(--primary); box-shadow: var(--focus); outline: none; }
.ms.has-value .ms-trigger { background: var(--primary-50); border-color: var(--primary-100); color: var(--primary-600); }
.ms-trigger > .svg { color: var(--muted); width: 16px; height: 16px; transition: transform .15s; }
.ms.open .ms-trigger > .svg { transform: rotate(180deg); }
.ms-value { overflow: hidden; text-overflow: ellipsis; display: flex; gap: 6px; align-items: center; }
.ms-prefix { color: var(--muted); }
.ms.has-value .ms-prefix { color: inherit; opacity: .75; }
.ms-count { background: var(--primary); color: #fff; border-radius: 999px; font-size: .75rem; font-weight: 700; padding: 0 7px; }
.pop {
  position: absolute; inset-inline-start: 0; min-width: 230px; top: calc(100% + 6px); z-index: 25; background: #fff; border: 1px solid var(--line);
  border-radius: 14px; box-shadow: var(--shadow-lg); padding: 6px; max-height: 320px; overflow: auto; animation: pop-in .14s ease-out;
}
@keyframes pop-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.pop-opt { display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 9px; cursor: pointer; user-select: none; }
.pop-opt:hover, .pop-opt:focus-visible { background: var(--surface-2); outline: none; }
.check { width: 19px; height: 19px; border-radius: 6px; border: 1.5px solid var(--line-2); display: grid; place-items: center; flex: none; background: #fff; color: #fff; }
.check .svg { width: 13px; height: 13px; stroke-width: 3; opacity: 0; }
.pop-opt[aria-selected="true"] .check { background: var(--primary); border-color: var(--primary); }
.pop-opt[aria-selected="true"] .check .svg { opacity: 1; }
.pop-actions { display: flex; justify-content: space-between; border-top: 1px solid var(--line); margin-top: 6px; padding: 8px 4px 2px; }

/* tags */
.chip { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 7px; font-size: .82rem; font-weight: 500; background: #eef2fd; color: #3550b8; white-space: nowrap; }
.flag { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 7px; font-size: .82rem; font-weight: 500; white-space: nowrap; color: color-mix(in srgb, var(--c) 80%, #000); background: color-mix(in srgb, var(--c) 12%, #fff); }
.flag .svg { width: 12px; height: 12px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: .82rem; font-weight: 600; white-space: nowrap; color: color-mix(in srgb, var(--c) 82%, #000); background: color-mix(in srgb, var(--c) 12%, #fff); }
.pill .dot { width: 7px; height: 7px; }
.kid { color: var(--muted-2); font-size: .82rem; direction: ltr; unicode-bidi: isolate; font-weight: 400; }
.avatar-i { display: inline-grid; place-items: center; border-radius: 50%; color: #fff; font-weight: 600; background: var(--a); flex: none; box-shadow: 0 0 0 2px #fff; line-height: 1; }
.avatar-empty { width: 26px; height: 26px; border-radius: 50%; border: 1.5px dashed var(--line-2); display: grid; place-items: center; color: var(--muted-2); }
.avatar-empty .svg { width: 13px; height: 13px; }
.assignee { display: inline-flex; align-items: center; gap: 8px; font-size: .9rem; color: var(--ink-2); white-space: nowrap; }
.assignee.none { color: var(--muted-2); }

/* board */
.board { display: grid; gap: 18px; overflow-x: auto; padding-bottom: 6px; align-items: start; }
.col { background: #eceff6; border-radius: 18px; padding: 8px; display: flex; flex-direction: column; min-width: 0; }
.col-head {
  display: flex; align-items: center; justify-content: space-between; padding: 11px 16px; border-radius: 12px; color: #fff; font-weight: 600;
  background: var(--c); box-shadow: 0 8px 18px -12px var(--c);
}
.col-count { background: rgba(255,255,255,.92); color: var(--c); border-radius: 999px; font-size: .8rem; font-weight: 700; padding: 0 9px; min-width: 26px; text-align: center; line-height: 1.6; }
.col-body { display: flex; flex-direction: column; gap: 10px; padding: 10px 2px 4px; min-height: 120px; border-radius: 12px; transition: background .15s, outline-color .15s; outline: 2px dashed transparent; outline-offset: -2px; }
.col-body.over { background: color-mix(in srgb, var(--c) 8%, transparent); outline-color: color-mix(in srgb, var(--c) 50%, transparent); }
.col-empty { border: 1.5px dashed #cfd5e2; border-radius: 12px; padding: 22px; text-align: center; color: var(--muted-2); font-size: .9rem; }
.kcard {
  background: #fff; border-radius: 14px; padding: 15px 16px 13px; box-shadow: var(--shadow-sm); border: 1px solid transparent;
  cursor: pointer; display: flex; flex-direction: column; gap: 8px; transition: box-shadow .15s, transform .15s, border-color .15s;
}
.kcard:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.kcard:focus-visible { outline: none; border-color: var(--primary); box-shadow: var(--focus); }
.kcard.dragging { opacity: .45; transform: rotate(-1.5deg); }
.kcard.done .kcard-title { color: var(--muted); }
.kcard-tags { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.kcard-tags .kid { margin-inline-start: auto; }
.kcard-title { margin: 2px 0 0; font-size: 1.02rem; font-weight: 700; line-height: 1.35; }
.kcard-desc { margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.kcard-reporter { display: flex; align-items: center; gap: 6px; font-size: .85rem; color: var(--muted); }
.kcard-reporter .svg { width: 14px; height: 14px; }
.kcard-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-top: 1px solid var(--line); padding-top: 10px; margin-top: 2px; }
.kcard-icons { display: inline-flex; gap: 10px; color: var(--muted-2); font-size: .8rem; white-space: nowrap; }
.kcard-icons span { display: inline-flex; gap: 4px; align-items: center; }
.kcard-icons .svg { width: 14px; height: 14px; }
.flash { animation: flash 2.4s ease-out; }
@keyframes flash { 0%, 35% { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-100); } }

/* table */
.tbl-wrap { overflow-x: auto; }
.cell-title .kid { margin-inline-start: 6px; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: start; font-weight: 500; color: var(--muted); font-size: .85rem; padding: 14px 16px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr { cursor: pointer; transition: background .12s; }
.tbl tbody tr:hover { background: #f9fafc; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.tbl tr.done .cell-title { color: var(--muted); }
.cell-main { display: flex; flex-direction: column; min-width: 0; max-width: 420px; }
.cell-title { font-weight: 600; }
.cell-sub { color: var(--muted); font-size: .87rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-actions { white-space: nowrap; text-align: end; width: 1%; }
.pill-select {
  appearance: none; -webkit-appearance: none; border: 0; cursor: pointer; font-weight: 600; font-size: .85rem; border-radius: 999px;
  padding: 5px 30px 5px 12px; color: color-mix(in srgb, var(--c) 82%, #000); background-color: color-mix(in srgb, var(--c) 12%, #fff);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-size: 13px; background-position: left 10px center; padding-inline: 12px 30px;
}
.pill-select:focus-visible { outline: none; box-shadow: var(--focus); }

.empty { text-align: center; padding: 64px 24px; color: var(--muted); }
.empty > .svg { width: 44px; height: 44px; color: #b2bccd; margin-bottom: 12px; }
.empty h3 { color: var(--ink); margin: 0 0 6px; font-size: 1.2rem; }
.skeleton-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.skeleton { background: linear-gradient(90deg, #e9edf4 25%, #f4f6fa 37%, #e9edf4 63%); background-size: 400% 100%; animation: shimmer 1.3s ease infinite; border-radius: 14px; }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ================================================ overlay, dialog, drawer */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(15, 23, 42, .4); backdrop-filter: blur(2px); display: grid; place-items: center; padding: 20px; animation: fade .15s ease-out; }
@keyframes fade { from { opacity: 0; } }
.dialog { background: #fff; border-radius: 20px; width: min(760px, 100%); max-height: calc(100vh - 40px); overflow: auto; box-shadow: var(--shadow-lg); animation: rise .2s cubic-bezier(.2,.9,.3,1); }
.dialog.sm { width: min(460px, 100%); }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.98); } }
.dialog-head { position: sticky; top: 0; background: #fff; z-index: 2; display: flex; align-items: flex-start; gap: 12px; padding: 22px 26px 16px; border-bottom: 1px solid var(--line); }
.dialog-head h2 { margin: 0; font-size: 1.3rem; }
.dialog-body { padding: 22px 26px 26px; display: flex; flex-direction: column; gap: 22px; }
.dialog-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 0 26px 22px; }

.drawer-overlay { place-items: stretch; justify-items: end; padding: 0; }
.drawer-overlay.out { animation: fade .2s reverse forwards; }
.drawer {
  grid-column: 1; justify-self: end; width: min(560px, 100vw); height: 100vh; background: #fff; display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg); animation: drawer-in .28s cubic-bezier(.2,.9,.3,1);
}
.drawer.out { animation: drawer-out .2s ease-in forwards; }
@keyframes drawer-in { from { transform: translateX(-100%); } }
@keyframes drawer-out { to { transform: translateX(-100%); } }
.drawer-head { display: flex; gap: 12px; align-items: flex-start; padding: 22px 24px 16px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin: 8px 0 0; font-size: 1.4rem; line-height: 1.3; }
.drawer-sub { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.drawer-body { flex: 1; overflow-y: auto; padding: 22px 24px; display: flex; flex-direction: column; gap: 24px; }
.drawer-foot { border-top: 1px solid var(--line); padding: 14px 18px; background: #fff; }
.composer { display: flex; align-items: flex-end; gap: 10px; }
.composer .textarea { min-height: 48px; max-height: 160px; padding: 12px 14px; resize: none; flex: 1; }
.composer .btn { min-height: 48px; }
.composer .avatar-i { margin-bottom: 7px; }
.manage { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
.manage .label { font-size: .88rem; font-weight: 500; color: var(--muted); }
.manage .select { min-height: 46px; }
.props { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 22px; margin: 0; }
.prop { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.prop dt { color: var(--muted); font-size: .84rem; display: flex; gap: 6px; align-items: center; }
.prop dt .svg { width: 14px; height: 14px; }
.prop dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.section-title { font-size: 1rem; font-weight: 700; margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
.count-pill { font-size: .8rem; font-weight: 500; color: var(--muted); background: var(--surface-2); border-radius: 999px; padding: 1px 10px; }
.desc-box { background: var(--surface-2); border-radius: 14px; padding: 14px 16px; white-space: pre-wrap; line-height: 1.65; }
.photo-full { display: block; max-width: 100%; max-height: 340px; border-radius: 14px; border: 1px solid var(--line); cursor: zoom-in; background: var(--surface-2); }
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; position: relative; }
.timeline::before { content: ''; position: absolute; top: 12px; bottom: 12px; inset-inline-start: 15px; width: 2px; background: var(--line); }
.tl-sys { display: flex; align-items: center; gap: 12px; position: relative; font-size: .9rem; color: var(--ink-2); }
.tl-dot { width: 32px; height: 32px; border-radius: 50%; background: var(--primary-50); color: var(--primary); display: grid; place-items: center; flex: none; box-shadow: 0 0 0 4px #fff; }
.tl-sys.done .tl-dot { background: var(--success-50); color: var(--success); }
.tl-dot .svg { width: 15px; height: 15px; }
.tl-text { flex: 1; }
.tl-time { color: var(--muted-2); font-size: .8rem; white-space: nowrap; }
.tl-comment { display: flex; gap: 12px; align-items: flex-start; position: relative; }
.tl-comment .avatar-i { box-shadow: 0 0 0 4px #fff; }
.tl-bubble { flex: 1; background: var(--surface-2); border-radius: 4px 14px 14px 14px; padding: 10px 14px; min-width: 0; }
.tl-head { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 2px; }
.tl-head b { font-weight: 600; font-size: .92rem; }
.tl-bubble p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.danger-zone { border-top: 1px solid var(--line); padding-top: 18px; }
.lightbox { position: fixed; inset: 0; z-index: 60; background: rgba(2, 6, 23, .88); display: grid; place-items: center; padding: 24px; cursor: zoom-out; animation: fade .15s; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 12px; }

/* ================================================ toasts & notifications */
.toasts { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: 10px; align-items: center; pointer-events: none; }
.toast { background: #111827; color: #fff; padding: 11px 18px; border-radius: 12px; box-shadow: var(--shadow-lg); display: flex; gap: 10px; align-items: center; animation: rise .2s; pointer-events: auto; font-size: .95rem; }
.toast.error { background: #b4332c; }
.toast.ok .svg { color: #86efac; }
.notifs { position: fixed; bottom: 24px; left: 24px; z-index: 70; display: flex; flex-direction: column-reverse; gap: 12px; width: min(380px, calc(100vw - 32px)); }
.notif { position: relative; background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lg); overflow: hidden; padding: 16px 18px 14px; animation: slide-in .35s cubic-bezier(.2,1.1,.3,1); }
.notif.out { animation: slide-out .25s ease-in forwards; }
@keyframes slide-in { from { opacity: 0; transform: translateX(-40px); } }
@keyframes slide-out { to { opacity: 0; transform: translateX(-40px); } }
.notif-top { display: flex; align-items: center; gap: 11px; margin-bottom: 10px; }
.notif-bell { width: 38px; height: 38px; border-radius: 12px; background: color-mix(in srgb, var(--c) 14%, #fff); color: var(--c); display: grid; place-items: center; animation: ring 1s ease .2s 2; flex: none; }
@keyframes ring { 0%,100% { transform: rotate(0); } 20% { transform: rotate(14deg); } 40% { transform: rotate(-12deg); } 60% { transform: rotate(8deg); } 80% { transform: rotate(-4deg); } }
.notif-titles { display: flex; flex-direction: column; line-height: 1.3; }
.notif-title { font-weight: 700; }
.notif-time { color: var(--muted-2); font-size: .8rem; }
.notif-close { margin-inline-start: auto; width: 32px; height: 32px; }
.notif-body { display: flex; flex-direction: column; gap: 6px; font-size: .92rem; }
.notif-tags { display: flex; gap: 6px; }
.notif-loc { display: flex; gap: 6px; align-items: center; font-weight: 600; }
.notif-loc .svg { width: 15px; height: 15px; color: var(--muted); }
.notif-desc { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notif-who { display: flex; gap: 8px; align-items: center; color: var(--ink-2); font-size: .88rem; }
.notif-actions { display: flex; gap: 8px; margin-top: 12px; }
.notif-bar { position: absolute; bottom: 0; inset-inline: 0; height: 3px; background: var(--c, var(--primary)); transform-origin: right; animation: drain linear forwards; }
.notif:hover .notif-bar { animation-play-state: paused; }
@keyframes drain { to { transform: scaleX(0); } }

/* ================================================ settings */
.tabs { display: flex; gap: 4px; padding: 5px; background: #e9ecf3; border-radius: 14px; margin-bottom: 24px; overflow-x: auto; scrollbar-width: none; }
.tab { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border: 0; background: none; border-radius: 10px; cursor: pointer; color: var(--muted); font-weight: 500; white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab.active { background: #fff; color: var(--primary); font-weight: 600; box-shadow: var(--shadow-sm); }
.tab:focus-visible { outline: none; box-shadow: var(--focus); }
.panel { padding: 30px 32px; }
.panel-desc { color: var(--muted); margin: 0 0 22px; }
.add-row { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.add-row .input { flex: 1 1 200px; }
.list { display: flex; flex-direction: column; gap: 10px; }
.item { display: flex; align-items: center; gap: 12px; padding: 8px 12px 8px 16px; min-height: 64px; background: #fff; border: 1px solid var(--line); border-radius: 14px; transition: box-shadow .15s, border-color .15s; }
.item:hover { border-color: var(--line-2); }
.item.dragging { box-shadow: var(--shadow-lg); z-index: 5; position: relative; }
.item-text { flex: 1; font-size: 1.05rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.item .input { min-height: 44px; }
.grip { cursor: grab; color: var(--muted-2); display: grid; place-items: center; width: 26px; height: 38px; touch-action: none; border-radius: 7px; flex: none; }
.grip:hover { background: var(--surface-2); color: var(--ink); }
.grip:active { cursor: grabbing; }
.grip:focus-visible { outline: none; box-shadow: var(--focus); }
.room-badge { min-width: 58px; height: 44px; padding: 0 10px; border-radius: 11px; background: var(--primary-50); color: var(--primary); font-weight: 700; font-size: 1.05rem; display: grid; place-items: center; flex: none; }
.item-actions { display: flex; gap: 4px; margin-inline-start: auto; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: .8rem; font-weight: 600; white-space: nowrap; }
.badge-s { background: var(--surface-2); color: var(--ink-2); }
.badge-s.s-first { background: var(--primary-50); color: var(--primary-600); }
.badge-s.s-done { background: var(--success-50); color: #15803d; }
.swatches { display: flex; gap: 7px; flex: none; }
.swatch { width: 32px; height: 32px; border-radius: 50%; border: 2px solid transparent; background: var(--c); cursor: pointer; padding: 0; transition: transform .1s; }
.swatch:hover { transform: scale(1.08); }
.swatch.selected { border-color: var(--ink); box-shadow: inset 0 0 0 2px #fff; }
.logo-box { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.logo-prev { width: 230px; height: 86px; border: 1px solid var(--line); border-radius: 14px; display: grid; place-items: center; background: var(--surface-2); padding: 10px 14px; }
.logo-prev img { max-width: 100%; max-height: 100%; object-fit: contain; }
.invite-box { background: var(--surface-2); border: 1px solid var(--line); border-radius: 16px; padding: 22px; margin-bottom: 30px; }
.invite-row { display: grid; grid-template-columns: 1fr 220px auto; gap: 12px; margin: 16px 0 10px; }
.link-box { display: flex; gap: 10px; align-items: center; margin-top: 14px; padding: 12px; background: #fff; border: 1px solid var(--primary-100); border-radius: 12px; }
.link-box code { flex: 1; direction: ltr; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .88rem; color: var(--primary-600); }
.user-row { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.avatar { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.avatar.admin { background: var(--primary); color: #fff; }
.avatar.maintenance { background: var(--primary-50); color: var(--primary); }
.avatar.pending { background: var(--surface-2); color: var(--muted); }
.user-info { min-width: 0; display: flex; flex-direction: column; }
.user-info b { font-weight: 600; }
.user-info span { color: var(--muted); direction: ltr; text-align: right; overflow: hidden; text-overflow: ellipsis; font-size: .92rem; }
.user-role { margin-inline-start: auto; color: var(--muted); font-size: .92rem; background: var(--surface-2); border-radius: 999px; padding: 2px 12px; }
.sub-title { font-size: 1.08rem; font-weight: 700; margin: 0 0 14px; }

/* ================================================ responsive */
@media (max-width: 1100px) {
  :root { --side-w: 232px; }
  .side-card { display: none !important; }
}
@media (max-width: 900px) {
  body.staff .topbar { position: sticky; top: 0; width: auto; inset-block: auto; border-inline-end: 0; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.92); backdrop-filter: blur(12px); }
  .side { flex-direction: row; align-items: center; padding: 8px 12px; gap: 8px; height: auto; overflow: visible; }
  .side .brand { flex-direction: row; padding: 0; }
  .side .brand-logo { width: 96px; height: 34px; }
  .side .brand-text, .side-label, .side-user-text, .side-user .avatar-i, .side-card { display: none !important; }
  .side-nav { flex-direction: row; gap: 2px; margin-inline-start: auto; }
  .side-nav .nav-link { padding: 9px 11px; gap: 7px; }
  .side-nav .nav-link .lbl { display: none; }
  .side-nav .nav-link.active .lbl { display: inline; }
  .nav-badge { display: none !important; }
  .side-foot { margin-top: 0; }
  .side-user { border: 0; padding: 0; }
  body.staff .view { margin: 0; padding: 22px 16px 70px; }
  .skeleton-row { grid-template-columns: 1fr; }
  .board { grid-template-columns: repeat(var(--cols, 3), minmax(260px, 82vw)) !important; scroll-snap-type: x mandatory; margin-inline: -16px; padding-inline: 16px; }
  .col { scroll-snap-align: start; }
}
@media (max-width: 760px) {
  .topbar-inner { padding: 10px 14px; }
  body.public .brand-logo { width: 105px; height: 35px; }
  body.public .brand-text { display: none; }
  body.public .nav-link .lbl { display: none; }
  .view { padding: 26px 16px 70px; }
  .card-pad, .panel { padding: 22px 18px; }
  .grid-2, .manage, .props { grid-template-columns: 1fr; gap: 20px; }
  .props { gap: 12px; }
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { padding: 14px; }
  .stat-num { font-size: 1.7rem; }
  .stat-sub { font-size: .78rem; }
  .toolbar { padding: 8px; }
  .tb-filters { width: 100%; }
  .tb-filters .ms, .tb-sort { flex: 1 1 calc(50% - 8px); }
  .ms-trigger { max-width: none; width: 100%; justify-content: space-between; }
  .tb-sort .select { min-width: 0; width: 100%; }
  .page-head { align-items: flex-start; }
  /* table -> cards */
  .tbl thead { display: none; }
  .tbl, .tbl tbody, .tbl tr, .tbl td { display: block; }
  .tbl tr { padding: 14px 16px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto; gap: 8px 10px; }
  .tbl td { padding: 0; border: 0; }
  .tbl td:first-child { grid-column: 1 / -1; }
  .tbl td.cell-actions { grid-column: 2; grid-row: 1; }
  .tbl td:first-child { grid-column: 1; grid-row: 1; }
  .tbl td[data-l]:not(:first-child) { display: inline-flex; }
  .cell-sub { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .aurora { padding: 40px 20px 36px; border-radius: 30px; }
  .gate-icon { width: 80px; height: 80px; border-radius: 24px; margin-bottom: 26px; }
  .gate-text { font-size: 1.05rem; margin-bottom: 32px; }
  .otp { gap: 10px; }
  .otp-box { width: 62px; height: 72px; font-size: 1.8rem; border-radius: 16px; }
  .btn-gradient { min-height: 64px; font-size: 1.2rem; border-radius: 18px; }
  .seg { gap: 8px; }
  .seg-btn { min-height: 52px; font-size: .95rem; gap: 6px; padding: 8px 4px; }
  .item { padding: 8px; gap: 8px; flex-wrap: wrap; }
  .swatch { width: 28px; height: 28px; }
  .invite-row { grid-template-columns: 1fr; }
  .user-row { flex-wrap: wrap; }
  .notifs { left: 12px; bottom: 12px; }
  .drawer { width: 100vw; }
  .drawer-head, .drawer-body { padding-inline: 16px; }
  .form-hero-ico { width: 48px; height: 48px; }
}
@media (max-width: 420px) { .otp-box { width: 54px; height: 64px; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
  .otp.verifying .otp-box { animation: none !important; opacity: .7; }
  .orbit-arm { animation: spin 1.3s linear infinite !important; }
}

/* ================================================ switches, opt-in, SMS */
.alert.info { background: var(--primary-50); color: var(--primary-600); }
.alert.ok { background: var(--success-50); color: #15803d; display: flex; gap: 8px; align-items: center; }
.switch { position: relative; display: inline-flex; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch input:disabled { cursor: not-allowed; }
.switch-ui { width: 44px; height: 26px; border-radius: 999px; background: #cfd6e3; position: relative; transition: background .18s; }
.switch-ui::after { content: ''; position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .18s; }
.switch input:checked + .switch-ui { background: var(--primary); }
.switch input:checked + .switch-ui::after { transform: translateX(-18px); }
.switch input:focus-visible + .switch-ui { box-shadow: var(--focus); }
.switch input:disabled + .switch-ui { opacity: .45; }
.switch-row { display: flex; gap: 14px; align-items: flex-start; cursor: pointer; }
.switch-text { display: flex; flex-direction: column; gap: 2px; }
.switch-label { font-weight: 600; }
.switch-inline { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; color: var(--muted); font-size: .9rem; flex: none; }
.optin { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; background: var(--primary-50); border: 1px solid var(--primary-100); cursor: pointer; position: relative; }
.optin input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.optin-box { width: 22px; height: 22px; border-radius: 7px; border: 1.5px solid var(--line-2); background: #fff; display: grid; place-items: center; color: #fff; flex: none; margin-top: 1px; }
.optin-box .svg { width: 14px; height: 14px; stroke-width: 3; opacity: 0; }
.optin input:checked + .optin-box { background: var(--primary); border-color: var(--primary); }
.optin input:checked + .optin-box .svg { opacity: 1; }
.optin input:focus-visible + .optin-box { box-shadow: var(--focus); }
.optin > span:last-child { display: flex; flex-direction: column; gap: 2px; }
.optin b { font-weight: 600; }
.sms-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.sms-card { display: flex; gap: 14px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-2); }
.sms-card b { display: block; margin-bottom: 4px; }
.sms-card .hint { margin: 6px 0 4px; }
.sms-card-ico { width: 40px; height: 40px; border-radius: 12px; background: #fff; color: var(--primary); display: grid; place-items: center; flex: none; box-shadow: var(--shadow-xs); }
.tl-sys.sms .tl-dot { background: #f1edff; color: #7c3aed; }
.tl-sys.fail .tl-dot { background: var(--danger-50); color: var(--danger); }
.tl-sys.fail .tl-text { color: var(--danger); }
@media (max-width: 760px) { .sms-cards { grid-template-columns: 1fr; } }

/* ---- urgency stars & note (report form) */
.seg-btn .star { color: var(--danger); font-weight: 700; margin-inline-start: -2px; }
.urg-note { margin: 10px 2px 0; font-size: .9rem; line-height: 1.5; color: var(--muted); }
.urg-note .star { color: var(--danger); font-weight: 700; }
@media (max-width: 560px) { .seg.seg-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---- settings: team toggle on problem types, star toggle on urgencies, worker rows */
.team-toggle { display: inline-flex; align-items: center; gap: 6px; flex: none; height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-2); background: #fff; color: var(--ink-2); font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer; }
.team-toggle svg { width: 16px; height: 16px; }
.team-toggle.on { background: #f3edff; border-color: #c9b5f7; color: #6d3fd6; }
.team-toggle:focus-visible, .star-toggle:focus-visible { outline: none; box-shadow: var(--focus); }
.star-toggle { flex: none; width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line-2); background: #fff; color: var(--muted-2); font: inherit; font-size: 1.3rem; font-weight: 700; line-height: 1; cursor: pointer; padding-top: 6px; }
.star-toggle.on { color: var(--danger); border-color: #f3b8b4; background: var(--danger-50); }
.worker-item { flex-wrap: wrap; row-gap: 8px; }
.team-sel { flex: 0 1 150px; min-height: 44px; }
.add-row .team-sel { max-width: 170px; }
