/* ==========================================================================
   Dr. Prime Office CRM — design system (light + dark), layout, components
   Brand: navy #211e55 · sky #8ec3f2
   Motion: calm and quick — no looping movement, everything settles in < 0.6s.
   ========================================================================== */

:root {
  --font: "Plus Jakarta Sans", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;

  --navy: #211e55;
  --sky: #8ec3f2;
  --bg: #f3f5fb;
  --surface: #ffffff;
  --surface-2: #f5f7fc;
  --surface-3: #ebeef7;
  --border: #e6e9f3;
  --border-strong: #d4d9e8;
  --text: #171a3a;
  --text-2: #3d4366;
  --muted: #7a809c;
  --primary: #3446c6;
  --primary-soft: rgba(52, 70, 198, .09);
  --primary-text: #3446c6;
  --grad: linear-gradient(135deg, #211e55 0%, #3446c6 62%, #5f8ff0 100%);
  --danger: #e5484d;
  --danger-soft: rgba(229, 72, 77, .1);
  --success: #12b886;
  --warning: #f59f00;

  --sidebar-bg: #ffffff;
  --overlay: rgba(17, 20, 48, .42);
  --hatch-a: #fafbfe;
  --hatch-b: #f1f3f9;
  --hatch-warn-a: #fffaf2;
  --hatch-warn-b: #fdf0de;

  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(23, 26, 58, .05);
  --shadow: 0 2px 4px rgba(23, 26, 58, .03), 0 8px 24px rgba(23, 26, 58, .06);
  --shadow-lg: 0 24px 60px rgba(23, 26, 58, .16);
  --ring: 0 0 0 4px rgba(52, 70, 198, .16);

  --ease: cubic-bezier(.22, 1, .36, 1);        /* ease-out-quint: fast start, soft landing */
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
  --spring: cubic-bezier(.34, 1.4, .64, 1);

  --st-todo: #7a8199;
  --st-started: #0ea5c6;
  --st-in_progress: #3446c6;
  --st-review: #8b5cf6;
  --st-done: #12b886;
  --st-on_hold: #f59f00;
  --cat-task_work: #3446c6;
  --cat-meeting: #8b5cf6;
  --cat-research: #0ea5c6;
  --cat-client: #f59f00;
  --cat-break: #9aa3b8;
  --cat-other: #e64980;
  --pr-low: #9aa3b8;
  --pr-medium: #4c8df6;
  --pr-high: #f59f00;
  --pr-urgent: #e5484d;
}

[data-theme="dark"] {
  --bg: #0b0d1c;
  --surface: #13162b;
  --surface-2: #181c34;
  --surface-3: #20253f;
  --border: #252a46;
  --border-strong: #323858;
  --text: #e9ebf8;
  --text-2: #c2c7e0;
  --muted: #8a90b0;
  --primary: #6f86f5;
  --primary-soft: rgba(111, 134, 245, .14);
  --primary-text: #9fb0ff;
  --grad: linear-gradient(135deg, #2b2878 0%, #3d52d6 60%, #6a9bf4 100%);
  --danger-soft: rgba(229, 72, 77, .16);
  --sidebar-bg: #10132a;
  --overlay: rgba(0, 0, 0, .6);
  --hatch-a: #151931;
  --hatch-b: #1a1f3a;
  --hatch-warn-a: #1d1a1c;
  --hatch-warn-b: #2a2220;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow: 0 2px 4px rgba(0, 0, 0, .2), 0 10px 28px rgba(0, 0, 0, .28);
  --shadow-lg: 0 28px 70px rgba(0, 0, 0, .55);
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body { font: 14px/1.55 var(--font); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.015em; }
p { margin: 0; }
img { max-width: 100%; }
code { background: var(--surface-3); padding: 1px 6px; border-radius: 6px; font-size: 12.5px; }
kbd { font: 600 11px var(--font); color: var(--muted); background: var(--surface); border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 6px; padding: 1px 6px; min-width: 20px; text-align: center; display: inline-block; }
[hidden] { display: none !important; }
::selection { background: rgba(52, 70, 198, .2); }
.ico { flex: 0 0 auto; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.text-danger { color: var(--danger); font-weight: 650; }
.link { color: var(--primary-text); font-weight: 650; }
.link:hover { text-decoration: underline; }
.btn-link { background: none; border: 0; padding: 0; cursor: pointer; font: inherit; }
.empty { color: var(--muted); padding: 24px 8px; text-align: center; }
.empty .ico { display: block; margin: 0 auto 10px; opacity: .45; }
.hint { color: var(--muted); font-size: 13px; margin: 0 0 18px; display: flex; gap: 8px; align-items: flex-start; }
.hint .ico { margin-top: 2px; }

/* ---------- motion ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(10px); filter: blur(3px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: scale(.97) translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes slide-left { from { transform: translateX(100%); } to { transform: none; } }
@keyframes grow-x { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes breathe { 0%, 100% { box-shadow: 0 0 0 0 rgba(18, 184, 134, .45); } 50% { box-shadow: 0 0 0 5px rgba(18, 184, 134, 0); } }
@keyframes shimmer { from { background-position: -460px 0; } to { background-position: 460px 0; } }
@keyframes confetti { to { transform: translate(var(--dx), var(--dy)) rotate(var(--rot)); opacity: 0; } }
@keyframes draw { from { stroke-dasharray: 0 999; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes tick { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

.reveal { animation: rise .6s var(--ease) both; animation-delay: calc(var(--i, 0) * 45ms); }
.skeleton { border-radius: 12px; background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-3) 50%, var(--surface-2) 100%); background-size: 920px 100%; animation: shimmer 1.3s linear infinite; }

/* Smooth cross-page transitions (Chrome, Edge, Safari 18+). Other browsers just navigate normally. */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: .18s var(--ease-in-out) both fade reverse; }
::view-transition-new(root) { animation: .32s var(--ease) both rise; }
.sidebar { view-transition-name: sidebar; }
::view-transition-old(sidebar), ::view-transition-new(sidebar) { animation: none; }

/* ---------- layout ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 264px; flex: 0 0 264px; background: var(--sidebar-bg); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; z-index: 40;
  transition: width .35s var(--ease), flex-basis .35s var(--ease), transform .35s var(--ease);
}
.brand { display: flex; align-items: center; gap: 8px; padding: 22px 16px 14px 22px; min-height: 76px; }
.brand-logo { height: 38px; width: auto; max-width: 180px; object-fit: contain; flex: 1 1 auto; object-position: left center; }
.brand-mark { display: none; height: 26px; width: auto; }
[data-theme="dark"] .brand-logo, [data-theme="dark"] .brand-mark, [data-theme="dark"] .auth-logo { filter: brightness(0) invert(1); }
.collapse-btn { width: 32px; height: 32px; flex: 0 0 auto; }
.nav { display: flex; flex-direction: column; gap: 3px; padding: 4px 14px; flex: 1; overflow-y: auto; }
.nav-section { font-size: 11.5px; font-weight: 700; color: var(--muted); padding: 14px 12px 6px; letter-spacing: .02em; }
.nav-link {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 13px; font-weight: 600; color: var(--text-2);
  position: relative; transition: background .25s var(--ease), color .25s var(--ease);
}
.nav-link:hover { background: var(--surface-2); color: var(--text); }
.nav-link.active { background: var(--grad); color: #fff; box-shadow: 0 8px 20px rgba(52, 70, 198, .28); }
.nav-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 750; display: inline-grid; place-items: center; animation: pop .35s var(--spring); }
.nav-link.active .nav-badge { background: #fff; color: var(--primary); }
.nav-people { display: flex; flex-direction: column; gap: 2px; }
.nav-person { display: flex; align-items: center; gap: 10px; padding: 7px 14px; border-radius: 11px; color: var(--text-2); font-weight: 550; font-size: 13.5px; transition: background .25s var(--ease); }
.nav-person:hover { background: var(--surface-2); }
.nav-person .avatar { width: 24px; height: 24px; font-size: 9.5px; }
.nav-person span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-foot { padding: 12px 14px 18px; border-top: 1px solid var(--border); }
.logout-btn { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 14px; border-radius: 13px; border: 0; background: none; color: var(--text-2); font: 600 14px var(--font); cursor: pointer; transition: background .25s var(--ease), color .25s; }
.logout-btn:hover { background: var(--danger-soft); color: var(--danger); }
.sidebar-backdrop { display: none; }

.sidebar-collapsed .sidebar { width: 84px; flex-basis: 84px; }
.sidebar-collapsed .brand { flex-direction: column; padding: 18px 0 10px; gap: 10px; }
.sidebar-collapsed .brand-logo { display: none; }
.sidebar-collapsed .brand-mark { display: block; }
.sidebar-collapsed .nav-link span, .sidebar-collapsed .nav-section, .sidebar-collapsed .nav-people, .sidebar-collapsed .logout-btn span { display: none; }
.sidebar-collapsed .collapse-btn svg { transform: scaleX(-1); }
.sidebar-collapsed .nav-link, .sidebar-collapsed .logout-btn { justify-content: center; padding: 12px; }
.sidebar-collapsed .nav-link .nav-badge { display: inline-grid; position: absolute; top: 4px; right: 6px; min-width: 16px; height: 16px; font-size: 10px; padding: 0 4px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 16px; padding: 18px 34px 8px; }
.topbar-title { flex: 1; min-width: 0; }
.topbar-title h1 { font-size: 26px; font-weight: 800; letter-spacing: -.03em; }
.topbar-title h1 .light { font-weight: 500; color: var(--text-2); }
.topbar-title p { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.top-search {
  display: flex; align-items: center; gap: 10px; width: min(340px, 30vw); padding: 11px 16px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); color: var(--muted); font: 500 14px var(--font); cursor: pointer;
  box-shadow: var(--shadow-sm); transition: border-color .25s, box-shadow .25s var(--ease);
}
.top-search:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.top-search span { flex: 1; text-align: left; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.theme-switch { position: relative; display: inline-flex; align-items: center; padding: 4px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); cursor: pointer; box-shadow: var(--shadow-sm); }
.theme-switch span { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; color: var(--muted); position: relative; z-index: 1; transition: color .3s var(--ease); }
.theme-switch::before { content: ""; position: absolute; top: 4px; left: 4px; width: 30px; height: 30px; border-radius: 50%; background: var(--primary-soft); transition: transform .45s var(--ease); }
[data-theme="dark"] .theme-switch::before { transform: translateX(30px); }
[data-theme="light"] .theme-switch .t-sun, [data-theme="dark"] .theme-switch .t-moon { color: var(--primary-text); }
.profile-chip { display: flex; align-items: center; gap: 10px; padding: 4px 14px 4px 4px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-weight: 650; box-shadow: var(--shadow-sm); transition: box-shadow .25s var(--ease); }
.profile-chip:hover { box-shadow: var(--shadow); }
.profile-chip small { display: block; font-size: 11px; color: var(--muted); font-weight: 550; line-height: 1.1; }
.profile-chip strong { display: block; line-height: 1.2; font-size: 13px; }
.topbar .menu-btn { display: none; }
.content { padding: 18px 34px 56px; }

/* ---------- buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 10px 17px; border-radius: 12px;
  border: 1px solid transparent; font: 650 13.5px var(--font); cursor: pointer; white-space: nowrap; position: relative;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), background .25s, border-color .25s, color .25s, opacity .25s;
}
.btn:active { transform: scale(.97); transition-duration: .1s; }
.btn:focus-visible, .icon-btn:focus-visible, .input:focus-visible { outline: none; box-shadow: var(--ring); }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 8px 20px rgba(52, 70, 198, .28); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 28px rgba(52, 70, 198, .34); }
.btn-primary:disabled { opacity: .6; cursor: wait; transform: none; }
.btn-ghost { background: var(--surface); border-color: var(--border); color: var(--text); box-shadow: var(--shadow-sm); }
.btn-ghost:hover { border-color: var(--border-strong); background: var(--surface-2); }
.btn-soft { background: var(--primary-soft); color: var(--primary-text); }
.btn-soft:hover { background: rgba(52, 70, 198, .15); }
.btn-danger { background: transparent; color: var(--danger); border-color: rgba(229, 72, 77, .35); }
.btn-danger:hover { background: var(--danger-soft); }
.btn-sm { padding: 6px 12px; font-size: 12.5px; border-radius: 10px; }
.btn-block { width: 100%; }
.btn.loading { color: transparent !important; pointer-events: none; }
.btn.loading::after { content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .45); border-top-color: #fff; animation: spin .7s linear infinite; }
.btn-ghost.loading::after, .btn-soft.loading::after { border-color: var(--border-strong); border-top-color: var(--primary); }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 12px; border: 0; background: transparent; color: var(--muted); cursor: pointer; transition: background .25s var(--ease), color .25s, transform .2s var(--ease); }
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn:active { transform: scale(.92); }

.input, .field input, .field select, .field textarea, .select {
  font: 500 14px var(--font); color: var(--text); background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 10px 13px; min-height: 42px; width: 100%; transition: border-color .25s, box-shadow .25s var(--ease), background .25s;
}
.input, .select { width: auto; }
select.input, .field select, .select {
  appearance: none; -webkit-appearance: none; padding-right: 36px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237a809c' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center;
}
.input:hover, .field input:hover, .field select:hover, .field textarea:hover { border-color: var(--border-strong); }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
input[type="date"], input[type="time"] { color-scheme: light; }
[data-theme="dark"] input[type="date"], [data-theme="dark"] input[type="time"] { color-scheme: dark; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field > span { font-size: 12.5px; font-weight: 700; color: var(--text-2); }
.field textarea { resize: vertical; line-height: 1.5; }
.field input:disabled { background: var(--surface-2); color: var(--muted); }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; white-space: nowrap; user-select: none; }
.check input { width: 17px; height: 17px; accent-color: var(--primary); }
.inline-field { display: inline-flex; align-items: center; gap: 8px; font-weight: 650; color: var(--text-2); }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.form-error { background: var(--danger-soft); color: var(--danger); border: 1px solid rgba(229, 72, 77, .3); padding: 10px 14px; border-radius: 12px; margin-bottom: 16px; font-weight: 600; animation: pop .35s var(--ease); }
.search-box { position: relative; display: flex; align-items: center; }
.search-box .ico { position: absolute; left: 14px; color: var(--muted); pointer-events: none; }
.search-box .input { padding-left: 40px; width: 100%; border-radius: 999px; }

.seg { display: inline-flex; background: var(--surface-3); border-radius: 13px; padding: 4px; gap: 2px; }
.seg button, .seg a { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; color: var(--muted); font: 650 13px var(--font); padding: 7px 13px; border-radius: 10px; cursor: pointer; transition: background .3s var(--ease), color .25s, box-shadow .3s; }
.seg button.active, .seg a.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

.alert { padding: 12px 16px; border-radius: 14px; margin-bottom: 18px; border: 1px solid; font-weight: 600; animation: pop .4s var(--ease); }
.alert-success { background: rgba(18, 184, 134, .1); color: #0c8a64; border-color: rgba(18, 184, 134, .28); }
[data-theme="dark"] .alert-success { color: #5be0b3; }
.alert-error { background: var(--danger-soft); color: var(--danger); border-color: rgba(229, 72, 77, .3); }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; background: var(--surface-3); color: var(--text-2); white-space: nowrap; vertical-align: middle; line-height: 1.7; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: 0 0 auto; background: var(--c, var(--muted)); }
.badge-ok { background: rgba(18, 184, 134, .13); color: #0c8a64; }
[data-theme="dark"] .badge-ok { color: #5be0b3; }
.st-todo { --c: var(--st-todo); } .st-started { --c: var(--st-started); } .st-in_progress { --c: var(--st-in_progress); }
.st-review { --c: var(--st-review); } .st-done { --c: var(--st-done); } .st-on_hold { --c: var(--st-on_hold); }
.cat-task_work { --c: var(--cat-task_work); } .cat-meeting { --c: var(--cat-meeting); } .cat-research { --c: var(--cat-research); }
.cat-client { --c: var(--cat-client); } .cat-break { --c: var(--cat-break); } .cat-other { --c: var(--cat-other); }
.prio-low { --c: var(--pr-low); } .prio-medium { --c: var(--pr-medium); } .prio-high { --c: var(--pr-high); } .prio-urgent { --c: var(--pr-urgent); }
.badge[class*="st-"], .badge[class*="cat-"], .badge[class*="prio-"] { background: color-mix(in srgb, var(--c) 13%, transparent); color: color-mix(in srgb, var(--c) 80%, var(--text)); }
.prio-flag { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 750; color: var(--c); }

.avatar { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 36px; height: 36px; border-radius: 50%; color: #fff; font-weight: 750; font-size: 12.5px; letter-spacing: .3px; box-shadow: 0 0 0 2px var(--surface); }
.avatar.sm { width: 26px; height: 26px; font-size: 10px; }
.avatar.lg { width: 50px; height: 50px; font-size: 16px; }
.av-0 { background: linear-gradient(135deg, #211e55, #3446c6); } .av-1 { background: linear-gradient(135deg, #12b886, #0ca678); }
.av-2 { background: linear-gradient(135deg, #f59f00, #f76707); } .av-3 { background: linear-gradient(135deg, #4c8df6, #8ec3f2); }
.av-4 { background: linear-gradient(135deg, #8b5cf6, #c084fc); } .av-5 { background: linear-gradient(135deg, #0ea5c6, #22b8cf); }
.av-6 { background: linear-gradient(135deg, #5c6388, #3d4366); } .av-7 { background: linear-gradient(135deg, #e64980, #f783ac); }
.avatar-stack { display: flex; }
.avatar-stack .avatar { margin-left: -10px; box-shadow: 0 0 0 3px var(--surface); transition: transform .3s var(--ease); }
.avatar-stack .avatar:first-child { margin-left: 0; }
.avatar-stack .avatar:hover { transform: translateY(-3px); z-index: 1; }
.person { display: inline-flex; align-items: center; gap: 9px; font-weight: 600; min-width: 0; }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 22px 24px; margin-bottom: 22px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.panel-head h2 { font-size: 16.5px; font-weight: 750; display: flex; align-items: center; gap: 9px; }
.panel-head h2 .ico { color: var(--primary-text); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; margin-bottom: 22px; }
.grid-2 > .panel { margin-bottom: 0; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.align-start { align-items: start; }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; }
.table th, .table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 750; white-space: nowrap; background: var(--surface-2); }
.table th:first-child { border-top-left-radius: 12px; } .table th:last-child { border-top-right-radius: 12px; }
.table tbody tr { transition: background .2s; }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: 0; }
.table th.sortable { cursor: pointer; user-select: none; }
.table th.sortable:hover { color: var(--text); }
.table th.sorted::after { content: " ↓"; } .table th.sorted.asc::after { content: " ↑"; }
.row-muted td { opacity: .5; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 18px; }
.toolbar .search-box { flex: 1 1 240px; }

.tabs { display: inline-flex; gap: 4px; background: var(--surface-3); padding: 4px; border-radius: 14px; margin-bottom: 20px; }
.tab { display: inline-flex; align-items: center; gap: 7px; background: none; border: 0; padding: 8px 16px; font: 650 13.5px var(--font); color: var(--muted); cursor: pointer; border-radius: 11px; transition: background .3s var(--ease), color .25s, box-shadow .3s; }
.tab.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* ==========================================================================
   Dashboard
   ========================================================================== */
.dash { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.dash-main, .dash-side { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.dash .panel { margin-bottom: 0; }

.tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
.tile {
  position: relative; overflow: hidden; border-radius: 24px; padding: 18px 18px 20px; color: #fff; min-height: 150px;
  display: flex; flex-direction: column; justify-content: space-between; background: var(--tg);
  box-shadow: 0 14px 30px -12px var(--tsh); transition: transform .45s var(--ease), box-shadow .45s var(--ease);
}
.tile:hover { transform: translateY(-5px); box-shadow: 0 22px 40px -14px var(--tsh); }
.tile::before, .tile::after { content: ""; position: absolute; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .14); pointer-events: none; transition: transform .7s var(--ease); }
.tile::before { width: 180px; height: 180px; right: -60px; top: -40px; box-shadow: 0 0 0 22px rgba(255, 255, 255, .05), 0 0 0 44px rgba(255, 255, 255, .03); }
.tile::after { width: 70px; height: 70px; right: 10px; bottom: -30px; background: rgba(255, 255, 255, .08); border: 0; }
.tile:hover::before { transform: scale(1.08) rotate(8deg); }
.tile-icon { width: 42px; height: 42px; border-radius: 13px; background: rgba(255, 255, 255, .22); display: grid; place-items: center; }
.tile strong { display: block; font-size: 34px; font-weight: 800; line-height: 1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; margin-top: 18px; }
.tile span.label { display: block; font-size: 14px; font-weight: 600; opacity: .92; margin-top: 6px; }
.tile small { position: relative; z-index: 1; display: block; font-size: 11.5px; opacity: .8; margin-top: 2px; }
.t-navy { --tg: linear-gradient(140deg, #211e55, #3446c6); --tsh: rgba(33, 30, 85, .55); }
.t-amber { --tg: linear-gradient(140deg, #f59f00, #fcc419); --tsh: rgba(245, 159, 0, .55); }
.t-violet { --tg: linear-gradient(140deg, #7048e8, #a78bfa); --tsh: rgba(112, 72, 232, .5); }
.t-green { --tg: linear-gradient(140deg, #0ca678, #38d9a9); --tsh: rgba(12, 166, 120, .5); }
.t-rose { --tg: linear-gradient(140deg, #e03131, #ff8787); --tsh: rgba(224, 49, 49, .45); }

.side-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 20px 22px; }
.side-card h3 { font-size: 15.5px; font-weight: 750; display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 14px; }

.timer-display { font-size: 38px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1; color: var(--text); }
.timer-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.timer-btns { display: flex; gap: 8px; }
.round-btn { width: 44px; height: 44px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer; color: #fff; transition: transform .35s var(--spring), box-shadow .3s var(--ease); }
.round-btn:hover { transform: scale(1.08); }
.round-btn:active { transform: scale(.94); }
.round-btn.play { background: linear-gradient(140deg, #12b886, #38d9a9); box-shadow: 0 8px 18px -6px rgba(18, 184, 134, .6); }
.round-btn.stop { background: linear-gradient(140deg, #211e55, #3446c6); box-shadow: 0 8px 18px -6px rgba(52, 70, 198, .6); }
.round-btn.discard { background: var(--surface-3); color: var(--muted); box-shadow: none; }
.timer-meta { margin-top: 10px; font-size: 12.5px; color: var(--muted); }
.timer-meta.running { color: var(--success); font-weight: 650; }

.team-card .big { font-size: 32px; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.team-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-top: 16px; }
.meter { height: 7px; border-radius: 999px; background: var(--surface-3); overflow: hidden; margin-top: 8px; }
.meter i { display: block; height: 100%; border-radius: inherit; background: var(--grad); transform-origin: left; animation: grow-x 1.1s var(--ease) both .3s; }

.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cal-head strong { font-size: 15.5px; font-weight: 750; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.cal-grid .dow { font-size: 11.5px; font-weight: 650; color: var(--muted); padding: 6px 0; }
.cal-day { position: relative; aspect-ratio: 1; display: grid; place-items: center; border-radius: 50%; font-weight: 650; font-size: 13.5px; color: var(--text-2); border: 0; background: none; cursor: pointer; font-family: var(--font); transition: background .25s var(--ease), color .25s; }
.cal-day:hover { background: var(--surface-3); }
.cal-day.other { color: var(--muted); opacity: .45; }
.cal-day.today { background: var(--grad); color: #fff; box-shadow: 0 6px 14px rgba(52, 70, 198, .35); }
.cal-day.selected:not(.today) { background: var(--primary-soft); color: var(--primary-text); }
.cal-day i { position: absolute; bottom: 3px; left: 50%; transform: translateX(-50%); display: flex; gap: 2px; }
.cal-day i b { width: 4px; height: 4px; border-radius: 50%; background: var(--warning); }
.cal-day i b.late { background: var(--danger); }
.cal-day.today i b { background: #fff; }
.cal-list { list-style: none; margin: 12px 0 0; padding: 12px 0 0; border-top: 1px solid var(--border); display: grid; gap: 8px; font-size: 13px; animation: fade .3s var(--ease); }
.cal-list li a { display: flex; align-items: center; gap: 8px; }
.cal-list .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }

.msg-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.msg-list a { display: flex; gap: 12px; align-items: center; padding: 9px 8px; margin: 0 -8px; border-radius: 14px; transition: background .25s var(--ease); }
.msg-list a:hover { background: var(--surface-2); }
.msg-list .body { flex: 1; min-width: 0; }
.msg-list strong { display: flex; justify-content: space-between; gap: 8px; font-size: 13.5px; }
.msg-list strong time { font-size: 11.5px; color: var(--muted); font-weight: 550; flex: 0 0 auto; }
.msg-list p { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-list .unread p { color: var(--text); font-weight: 650; }

.recent-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.rtask { display: flex; flex-direction: column; gap: 10px; padding: 18px; border-radius: 18px; background: var(--surface-2); border: 1px solid var(--border); transition: transform .45s var(--ease), box-shadow .45s var(--ease), background .3s; }
.rtask:hover { transform: translateY(-4px); box-shadow: var(--shadow); background: var(--surface); }
.rtask-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 4px 11px; border-radius: 8px; font-size: 12px; font-weight: 700; color: #fff; background: var(--c, var(--primary)); }
.pill.soft { background: color-mix(in srgb, var(--c) 14%, transparent); color: color-mix(in srgb, var(--c) 85%, var(--text)); }
.rtask h4 { font-size: 15.5px; font-weight: 700; line-height: 1.35; }
.rtask p { color: var(--muted); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.progress { position: relative; height: 6px; border-radius: 999px; background: var(--surface-3); margin: 6px 6px 0 0; }
.progress i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: inherit; background: var(--c, var(--primary)); transform-origin: left; animation: grow-x 1s var(--ease) both .2s; }
.progress i::after { content: ""; position: absolute; right: -6px; top: 50%; width: 13px; height: 13px; margin-top: -6.5px; border-radius: 50%; background: var(--c, var(--primary)); box-shadow: 0 0 0 3px var(--surface); }
.rtask-foot { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; color: var(--muted); font-weight: 600; margin-top: 2px; gap: 8px; }

.live-list { display: grid; gap: 10px; }
.live-card { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 16px; background: var(--surface-2); transition: background .3s var(--ease); }
.live-card:hover { background: var(--surface-3); }
.avatar-wrap { position: relative; display: inline-flex; }
.live-dot { position: absolute; right: -1px; bottom: -1px; width: 12px; height: 12px; border-radius: 50%; background: var(--muted); border: 2px solid var(--surface-2); }
.live-dot.on { background: var(--success); animation: breathe 2.6s ease-in-out infinite; }
.live-card strong { display: block; font-size: 13.5px; }
.live-card .what { color: var(--text-2); font-size: 13px; }
.live-card .meta { margin-top: 4px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-size: 12px; color: var(--muted); }
.live-hours { margin-left: auto; text-align: right; font-weight: 750; font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 13.5px; }
.live-hours small { display: block; color: var(--muted); font-weight: 550; font-size: 11px; }

.section-title { font-size: 12px; font-weight: 750; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 20px 0 10px; display: flex; align-items: center; justify-content: space-between; }
.mini-tl { display: grid; gap: 10px; margin-top: 6px; }
.mt-scale { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-left: 120px; font-variant-numeric: tabular-nums; }
.mt-row { display: grid; grid-template-columns: 110px 1fr; gap: 10px; align-items: center; }
.mt-name { font-weight: 650; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt-lane { position: relative; height: 26px; border-radius: 9px; background: repeating-linear-gradient(-45deg, var(--hatch-a), var(--hatch-a) 6px, var(--hatch-b) 6px, var(--hatch-b) 12px); overflow: hidden; }
.mt-block { position: absolute; top: 3px; bottom: 3px; border-radius: 7px; background: var(--c); transform-origin: left; animation: grow-x .8s var(--ease) both; }
.mt-now { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--danger); }

.workload { display: grid; gap: 14px; }
.wl-row { display: grid; grid-template-columns: 160px 1fr 56px; gap: 14px; align-items: center; }
.wl-bar { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: var(--surface-3); }
.wl-bar span { background: var(--c); transform-origin: left; animation: grow-x 1s var(--ease) both; animation-delay: calc(var(--i, 0) * 70ms + 150ms); }
.wl-bar span + span { box-shadow: -2px 0 0 var(--surface); }
.wl-total { text-align: right; font-weight: 750; font-variant-numeric: tabular-nums; }
.wl-total small { display: block; font-weight: 600; color: var(--danger); font-size: 11px; }
.legend-inline { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--muted); font-weight: 600; margin-top: 16px; }
.legend-inline span { display: inline-flex; align-items: center; gap: 6px; }

.donut-wrap { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.donut { position: relative; width: 150px; height: 150px; flex: 0 0 auto; }
.donut svg { transform: rotate(-90deg); }
.donut circle { fill: none; stroke-width: 16; animation: draw 1.2s var(--ease) both; transition: stroke-width .3s var(--ease); }
.donut circle.track { stroke: var(--surface-3); animation: none; }
.donut circle:hover:not(.track) { stroke-width: 20; }
.donut-center { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.donut-center strong { font-size: 28px; font-weight: 800; display: block; line-height: 1; }
.donut-center span { font-size: 12px; color: var(--muted); font-weight: 650; }
.legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; flex: 1; min-width: 170px; }
.legend li { display: flex; align-items: center; gap: 10px; font-weight: 600; padding: 4px 8px; border-radius: 9px; transition: background .25s; }
.legend li:hover { background: var(--surface-2); }
.legend li strong { margin-left: auto; font-variant-numeric: tabular-nums; }
.legend .pct { color: var(--muted); font-size: 12px; width: 40px; text-align: right; }

.feed { list-style: none; margin: 0; padding: 0; position: relative; }
.feed::before { content: ""; position: absolute; left: 12px; top: 8px; bottom: 8px; width: 2px; background: var(--border); }
.feed li { display: flex; gap: 12px; padding: 7px 0; position: relative; font-size: 13px; }
.feed .avatar { z-index: 1; }
.feed .when, .history-list .when { color: var(--muted); font-size: 11.5px; display: block; }

/* ==========================================================================
   Kanban
   ========================================================================== */
.board { display: flex; gap: 16px; overflow-x: auto; padding: 4px 4px 18px; align-items: flex-start; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity; }
.column {
  flex: 0 0 300px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 22px; display: flex; flex-direction: column;
  max-height: calc(100vh - 200px); min-height: min(calc(100vh - 200px), 640px); scroll-snap-align: start; transition: background .3s, border-color .3s, box-shadow .3s;
}
[data-theme="dark"] .column { background: color-mix(in srgb, var(--surface) 70%, var(--bg)); }
.board.intro .column { animation: rise .55s var(--ease) both; animation-delay: calc(var(--i, 0) * 45ms); }
.column.drop-target { background: color-mix(in srgb, var(--c) 7%, var(--surface-2)); border-color: color-mix(in srgb, var(--c) 45%, transparent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 10%, transparent); }
.col-head { display: flex; align-items: center; gap: 9px; padding: 16px 16px 10px; font-weight: 750; }
.col-head .dot { width: 10px; height: 10px; box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 18%, transparent); }
.col-count { background: var(--surface); color: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: 0 9px; font-size: 12px; font-weight: 700; }
.col-add { margin-left: auto; width: 32px; height: 32px; }
.col-body { flex: 1; overflow-y: auto; padding: 4px 12px 14px; display: flex; flex-direction: column; gap: 12px; min-height: 80px; }
.col-empty { color: var(--muted); text-align: center; font-size: 13px; padding: 24px 8px; border: 1.5px dashed var(--border-strong); border-radius: 16px; }
.tcard {
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 14px 15px 13px; box-shadow: var(--shadow-sm);
  cursor: grab; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; position: relative; overflow: hidden;
  transition: box-shadow .4s var(--ease), border-color .3s, transform .4s var(--ease);
}
.tcard::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 0 3px 3px 0; background: var(--c, transparent); }
.tcard:hover { box-shadow: var(--shadow); border-color: var(--border-strong); transform: translateY(-3px); }
.tcard:focus-visible { outline: none; box-shadow: var(--ring); }
.tcard.new { animation: pop .5s var(--ease); }
.tcard.overdue { border-color: rgba(229, 72, 77, .35); }
.tcard-top { display: flex; align-items: center; gap: 7px; margin-bottom: 8px; }
.tcard-title { font-size: 14.5px; font-weight: 700; margin: 0 0 4px; word-break: break-word; line-height: 1.35; }
.tcard.is-done .tcard-title { text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--text) 30%, transparent); color: var(--muted); }
.tcard-desc { color: var(--muted); font-size: 12.5px; margin: 0 0 10px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; }
.tcard-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: 12px; color: var(--muted); }
.tcard-foot .created { margin-left: auto; white-space: nowrap; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 8px; font-size: 11.5px; font-weight: 700; background: var(--surface-2); color: var(--text-2); white-space: nowrap; }
.chip.late { background: var(--danger-soft); color: var(--danger); }
.chip.soon { background: rgba(245, 159, 0, .14); color: #b77400; }
[data-theme="dark"] .chip.soon { color: #ffc34d; }
.chip.ok { background: rgba(18, 184, 134, .13); color: #0c8a64; }
.quick-done { margin-left: auto; width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--border-strong); color: transparent; transition: all .3s var(--ease); }
.tcard:hover .quick-done { color: var(--muted); }
.quick-done:hover { background: var(--success); border-color: var(--success); color: #fff !important; transform: scale(1.1); }
.card-placeholder { border: 2px dashed color-mix(in srgb, var(--primary) 50%, transparent); border-radius: 18px; background: var(--primary-soft); flex: 0 0 auto; }
.drag-ghost { position: fixed; left: 0; top: 0; z-index: 1000; pointer-events: none; margin: 0; box-shadow: var(--shadow-lg); cursor: grabbing; transition: none; }
body.dragging, body.dragging * { cursor: grabbing !important; }
.confetti { position: fixed; z-index: 1100; width: 8px; height: 12px; border-radius: 2px; pointer-events: none; animation: confetti 1s cubic-bezier(.15, .7, .3, 1) forwards; }
.list-view tbody tr { cursor: pointer; }
.list-title { font-weight: 650; }
.list-title small { display: block; color: var(--muted); font-weight: 500; max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* attachments */
.dropzone { display: block; border: 1.5px dashed var(--border-strong); border-radius: 16px; padding: 16px; text-align: center; color: var(--muted); font-size: 13px; cursor: pointer; transition: border-color .25s, background .25s, color .25s; }
.dropzone:hover, .dropzone.over { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-text); }
.dropzone strong { color: var(--primary-text); }
.dropzone input { display: none; }
.files { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.file-item { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 14px; background: var(--surface-2); animation: pop .35s var(--ease); }
.file-thumb { width: 44px; height: 44px; border-radius: 10px; flex: 0 0 auto; display: grid; place-items: center; background: var(--surface-3); color: var(--primary-text); font: 800 10.5px var(--font); text-transform: uppercase; overflow: hidden; }
.file-thumb img { width: 100%; height: 100%; object-fit: cover; }
.file-item .meta { flex: 1; min-width: 0; }
.file-item .meta a { font-weight: 650; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-item .meta a:hover { color: var(--primary-text); }
.file-item .meta small { color: var(--muted); font-size: 11.5px; }
.upload-progress { height: 4px; border-radius: 99px; background: var(--surface-3); overflow: hidden; margin-top: 8px; }
.upload-progress i { display: block; height: 100%; width: 0; background: var(--grad); transition: width .2s; }

/* ==========================================================================
   Drawer & modal
   ========================================================================== */
.drawer { position: fixed; inset: 0; z-index: 200; display: flex; justify-content: flex-end; }
.drawer-overlay { position: absolute; inset: 0; background: var(--overlay); backdrop-filter: blur(4px); animation: fade .3s var(--ease); }
.drawer-panel { position: relative; width: min(580px, 100%); height: 100%; background: var(--surface); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: slide-left .45s var(--ease); border-left: 1px solid var(--border); }
.drawer.closing .drawer-panel { animation: slide-left .3s var(--ease-in-out) reverse forwards; }
.drawer.closing .drawer-overlay { animation: fade .3s var(--ease) reverse forwards; }
.drawer-head { display: flex; align-items: center; gap: 10px; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.drawer-head h2 { font-size: 16.5px; flex: 1; }
.drawer-body { flex: 1; overflow-y: auto; padding: 22px 24px; }
.drawer-foot { display: flex; align-items: center; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--border); background: var(--surface-2); }
.title-input { font: 800 21px var(--font) !important; border: 0 !important; padding: 4px 0 !important; background: transparent !important; box-shadow: none !important; letter-spacing: -.02em; min-height: 0 !important; }
.title-input::placeholder { color: var(--muted); opacity: .6; }
.prop-grid { display: grid; grid-template-columns: 120px 1fr; gap: 8px 14px; align-items: center; margin: 14px 0 18px; padding: 16px; background: var(--surface-2); border-radius: 18px; }
.prop-grid label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 650; font-size: 13px; }
.prop-grid select, .prop-grid input { min-height: 38px; padding-top: 7px; padding-bottom: 7px; background-color: var(--surface); }
.task-meta { font-size: 12.5px; color: var(--muted); margin: 6px 0 16px; line-height: 1.7; }
.history-list { list-style: none; margin: 0; padding: 0; position: relative; }
.history-list li { position: relative; padding: 0 0 14px 22px; font-size: 13px; line-height: 1.5; }
.history-list li::before { content: ""; position: absolute; left: 4px; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.history-list li::after { content: ""; position: absolute; left: 7.5px; top: 16px; bottom: 0; width: 1px; background: var(--border); }
.history-list li:last-child::after { display: none; }

.modal { position: fixed; inset: 0; z-index: 210; display: flex; align-items: flex-start; justify-content: center; padding: 8vh 16px; overflow-y: auto; }
.modal::before { content: ""; position: fixed; inset: 0; background: var(--overlay); backdrop-filter: blur(4px); animation: fade .25s var(--ease); }
.modal-dialog { position: relative; background: var(--surface); border-radius: 24px; width: 100%; max-width: 560px; box-shadow: var(--shadow-lg); border: 1px solid var(--border); animation: pop .4s var(--ease); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 6px; }
.modal-head h2 { font-size: 18px; font-weight: 800; }
.modal-body { padding: 14px 24px 4px; }
.modal-foot { display: flex; align-items: center; gap: 8px; padding: 14px 24px 20px; }
body.modal-open { overflow: hidden; }

.cat-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.cat-chip { position: relative; }
.cat-chip input { position: absolute; opacity: 0; pointer-events: none; }
.cat-chip span { display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border-radius: 999px; border: 1px solid var(--border); font-weight: 650; font-size: 13px; cursor: pointer; transition: all .3s var(--ease); background: var(--surface); }
.cat-chip span:hover { border-color: var(--c); }
.cat-chip input:checked + span { background: color-mix(in srgb, var(--c) 14%, var(--surface)); border-color: var(--c); color: color-mix(in srgb, var(--c) 80%, var(--text)); }
.cat-chip input:focus-visible + span { box-shadow: var(--ring); }
.pick-list { display: grid; gap: 4px; max-height: 260px; overflow-y: auto; }
.pick-list label { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; cursor: pointer; font-weight: 600; transition: background .2s; }
.pick-list label:hover { background: var(--surface-2); }
.pick-list input { width: 17px; height: 17px; accent-color: var(--primary); }

/* ==========================================================================
   Office activity
   ========================================================================== */
.date-bar { display: flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%; }
.date-bar .day-strip { flex: 1 1 auto; min-width: 0; }
.day-strip { display: flex; gap: 6px; overflow-x: auto; padding: 2px; scrollbar-width: none; }
.day-strip::-webkit-scrollbar { display: none; }
.day-pill { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 1px; width: 54px; padding: 8px 0; border-radius: 15px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; font: inherit; color: var(--text-2); transition: all .35s var(--ease); }
.day-pill small { font-size: 11px; color: var(--muted); font-weight: 700; text-transform: uppercase; }
.day-pill strong { font-size: 17px; font-weight: 800; }
.day-pill:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.day-pill.today strong { color: var(--primary-text); }
.day-pill.active { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 10px 20px -6px rgba(52, 70, 198, .5); }
.day-pill.active small, .day-pill.active.today strong { color: rgba(255, 255, 255, .9); }

.person-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; margin-bottom: 20px; }
.person-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px 20px; box-shadow: var(--shadow); display: flex; gap: 16px; align-items: center; transition: transform .45s var(--ease), box-shadow .45s var(--ease); }
.person-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.ring { position: relative; width: 84px; height: 84px; flex: 0 0 auto; }
.ring svg { transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 8; stroke-linecap: round; }
.ring .track { stroke: var(--surface-3); }
.ring .val { stroke: url(#ringGrad); transition: stroke-dasharray 1.2s var(--ease); }
.ring-center { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; line-height: 1.1; }
.ring-center strong { font-size: 16px; font-weight: 800; }
.ring-center small { font-size: 10.5px; color: var(--muted); display: block; font-weight: 650; }
.person-card .info { flex: 1; min-width: 0; }
.person-card .name { display: flex; align-items: center; gap: 8px; font-weight: 750; margin-bottom: 6px; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; font-size: 12.5px; margin: 8px 0 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 700; }
.person-card .now { margin-top: 8px; font-size: 12.5px; display: flex; align-items: center; gap: 7px; }
.now .live-dot { position: static; border: 0; width: 9px; height: 9px; }

.gantt-panel { padding: 0; overflow: hidden; }
.gantt-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.gantt { min-width: 760px; position: relative; }
.g-head, .g-row { display: grid; grid-template-columns: 172px 1fr; }
.g-head { border-bottom: 1px solid var(--border); background: var(--surface-2); }
.g-head .g-name { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 750; }
.g-hours { display: grid; }
.g-hours span { font-size: 11.5px; color: var(--muted); font-weight: 650; padding: 11px 0 11px 6px; border-left: 1px solid var(--border); font-variant-numeric: tabular-nums; }
.g-hours span.off { opacity: .55; }
.g-name { padding: 14px 16px; display: flex; align-items: center; gap: 10px; font-weight: 650; border-right: 1px solid var(--border); min-width: 0; }
.g-name .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.g-name small { display: block; color: var(--muted); font-weight: 550; font-size: 11.5px; }
.g-row { border-bottom: 1px solid var(--border); animation: rise .55s var(--ease) both; animation-delay: calc(var(--i, 0) * 60ms); }
.g-row:last-child { border-bottom: 0; }
.g-lane { position: relative; min-height: 76px; display: grid; }
.g-slot { border-left: 1px solid var(--border); position: relative; transition: background .25s; }
.g-slot.empty.work { background: repeating-linear-gradient(-45deg, var(--hatch-warn-a), var(--hatch-warn-a) 7px, var(--hatch-warn-b) 7px, var(--hatch-warn-b) 14px); }
.g-slot.empty.off { background: repeating-linear-gradient(-45deg, var(--hatch-a), var(--hatch-a) 7px, var(--hatch-b) 7px, var(--hatch-b) 14px); }
.g-slot.addable { cursor: pointer; }
.g-slot.addable:hover { background: var(--primary-soft); }
.g-slot.addable:hover::after { content: "+"; position: absolute; inset: 0; display: grid; place-items: center; color: var(--primary-text); font-weight: 700; font-size: 18px; }
.g-block {
  position: absolute; top: 9px; bottom: 9px; border-radius: 12px; padding: 6px 10px; overflow: hidden; z-index: 1; color: #fff;
  background: linear-gradient(135deg, var(--c), color-mix(in srgb, var(--c) 72%, #000)); box-shadow: 0 6px 14px -4px color-mix(in srgb, var(--c) 45%, transparent);
  font-size: 12px; line-height: 1.3; border: 0; text-align: left; font-family: var(--font); cursor: default;
  transform-origin: left; animation: grow-x .7s var(--ease) both; animation-delay: calc(var(--i, 0) * 35ms + 120ms);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}
button.g-block { cursor: pointer; }
.g-block:hover { transform: translateY(-2px); box-shadow: 0 12px 24px -6px color-mix(in srgb, var(--c) 55%, transparent); z-index: 3; }
.g-block b { display: block; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-block span { opacity: .88; white-space: nowrap; font-variant-numeric: tabular-nums; }
.g-block.cat-break { background: repeating-linear-gradient(-45deg, #9aa3b8, #9aa3b8 6px, #8b94aa 6px, #8b94aa 12px); box-shadow: none; }
.g-now { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--danger); z-index: 4; pointer-events: none; }
.g-now::before { content: attr(data-label); position: absolute; top: 4px; left: 50%; transform: translateX(-50%); background: var(--danger); color: #fff; font-size: 10.5px; font-weight: 750; padding: 1px 7px; border-radius: 7px; white-space: nowrap; }
.g-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; padding: 12px 16px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); font-weight: 600; }
.g-legend span { display: inline-flex; align-items: center; gap: 6px; }
.g-legend i { width: 18px; height: 10px; border-radius: 3px; display: inline-block; }
.g-legend i.hatch { background: repeating-linear-gradient(-45deg, var(--hatch-warn-a), var(--hatch-warn-a) 3px, var(--hatch-warn-b) 3px, var(--hatch-warn-b) 6px); border: 1px solid var(--border); }

.agenda { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.ag-person h3 { font-size: 14px; display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }
.ag-list { list-style: none; margin: 0 0 0 6px; padding: 0 0 0 14px; border-left: 2px solid var(--border); display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.ag-item { position: relative; display: flex; gap: 10px; padding: 11px 13px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); text-align: left; font: inherit; color: inherit; width: 100%; }
button.ag-item { cursor: pointer; transition: border-color .25s, transform .35s var(--ease); }
button.ag-item:hover { border-color: var(--c); transform: translateX(3px); }
.ag-item::before { content: ""; position: absolute; left: -21px; top: 15px; width: 10px; height: 10px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 3px var(--surface); }
.ag-item .grow { min-width: 0; overflow-wrap: anywhere; }
.ag-time { font-weight: 750; font-variant-numeric: tabular-nums; white-space: nowrap; min-width: 92px; font-size: 13px; }
.ag-gap { display: flex; align-items: center; gap: 10px; padding: 9px 13px; border-radius: 14px; border: 1.5px dashed var(--border-strong); color: var(--muted); font-size: 12.5px; }
.ag-gap .ag-time { color: var(--muted); font-weight: 600; }
.ag-gap button { margin-left: auto; }

.tooltip { position: fixed; z-index: 1200; max-width: 280px; background: #151838; color: #e9ebf8; padding: 10px 13px; border-radius: 12px; font-size: 12.5px; line-height: 1.45; pointer-events: none; box-shadow: var(--shadow-lg); animation: fade .15s var(--ease); }
.tooltip b { display: block; font-size: 13px; }
.tooltip .tt-muted { color: #a3a9c8; }
.cat-bars { display: grid; gap: 12px; }
.cat-bar-row { display: grid; grid-template-columns: 160px 1fr 70px; gap: 12px; align-items: center; font-size: 13px; }

/* ==========================================================================
   Chat
   ========================================================================== */
.chat { display: grid; grid-template-columns: 320px minmax(0, 1fr); height: calc(100vh - 150px); min-height: 520px; background: var(--surface); border: 1px solid var(--border); border-radius: 24px; box-shadow: var(--shadow); overflow: hidden; }
.chat-side { display: flex; flex-direction: column; border-right: 1px solid var(--border); min-height: 0; }
.chat-side-head { display: flex; align-items: center; gap: 8px; padding: 16px; border-bottom: 1px solid var(--border); }
.chat-side-head .search-box { flex: 1; }
.room-list { list-style: none; margin: 0; padding: 8px; overflow-y: auto; flex: 1; }
.room-list .group-label { font-size: 11.5px; font-weight: 750; color: var(--muted); padding: 10px 10px 6px; text-transform: uppercase; letter-spacing: .06em; }
.room { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 16px; cursor: pointer; transition: background .25s var(--ease); width: 100%; border: 0; background: none; text-align: left; font: inherit; color: inherit; }
.room:hover { background: var(--surface-2); }
.room.active { background: var(--primary-soft); }
.room .body { flex: 1; min-width: 0; }
.room strong { display: flex; justify-content: space-between; gap: 8px; font-size: 13.5px; }
.room strong time { font-size: 11px; color: var(--muted); font-weight: 550; flex: 0 0 auto; }
.room p { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room.unread p { color: var(--text); font-weight: 650; }
.room .count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--primary); color: #fff; font-size: 11px; font-weight: 750; display: inline-grid; place-items: center; animation: pop .3s var(--spring); }
.group-icon { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; color: #fff; background: var(--grad); flex: 0 0 auto; font-weight: 800; font-size: 14px; }
.chat-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.chat-room { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.pick-list .room { padding: 8px 10px; }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.chat-head .title { flex: 1; min-width: 0; }
.chat-head strong { display: block; font-size: 15px; }
.chat-head small { color: var(--muted); font-size: 12px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-back { display: none; }
.messages { flex: 1; overflow-y: auto; padding: 18px 22px; display: flex; flex-direction: column; gap: 2px; background: var(--surface-2); }
[data-theme="dark"] .messages { background: color-mix(in srgb, var(--surface) 60%, var(--bg)); }
.day-sep { align-self: center; font-size: 11.5px; font-weight: 700; color: var(--muted); background: var(--surface); border: 1px solid var(--border); padding: 3px 12px; border-radius: 999px; margin: 14px 0 8px; }
.msg { display: flex; gap: 10px; align-items: flex-end; max-width: 78%; margin-top: 8px; }
.msg.new { animation: pop .3s var(--ease); }
.msg.cont { margin-top: 2px; }
.msg.cont .avatar { visibility: hidden; }
.msg.mine { align-self: flex-end; flex-direction: row-reverse; }
.bubble { background: var(--surface); border: 1px solid var(--border); padding: 9px 13px; border-radius: 18px 18px 18px 6px; box-shadow: var(--shadow-sm); position: relative; min-width: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.msg.mine .bubble { background: var(--grad); color: #fff; border-color: transparent; border-radius: 18px 18px 6px 18px; }
.bubble .who { display: block; font-size: 12px; font-weight: 750; color: var(--primary-text); margin-bottom: 2px; white-space: normal; }
.bubble .time { display: block; font-size: 10.5px; opacity: .65; margin-top: 4px; text-align: right; white-space: normal; }
.bubble.deleted { font-style: italic; color: var(--muted); background: transparent; box-shadow: none; }
.msg.mine .bubble.deleted { background: transparent; color: var(--muted); border: 1px dashed var(--border-strong); }
.bubble .bfile { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; background: rgba(0, 0, 0, .05); margin: 4px 0 2px; white-space: normal; }
.msg.mine .bubble .bfile { background: rgba(255, 255, 255, .16); }
.bubble .bfile b { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.bubble img.bimg { display: block; max-width: 260px; max-height: 240px; border-radius: 12px; margin: 4px 0 2px; }
.msg-del { opacity: 0; transition: opacity .2s; align-self: center; width: 30px; height: 30px; }
.msg:hover .msg-del { opacity: 1; }
.composer { display: flex; align-items: flex-end; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--border); background: var(--surface); }
.composer textarea { flex: 1; resize: none; max-height: 140px; min-height: 44px; border-radius: 14px; padding: 11px 14px; font: 500 14px var(--font); color: var(--text); background: var(--surface-2); border: 1px solid var(--border); line-height: 1.4; }
.composer textarea:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); background: var(--surface); }
.composer .send { width: 44px; height: 44px; border-radius: 14px; padding: 0; }
.composer label.icon-btn { cursor: pointer; }
.composer input[type=file] { display: none; }
.attach-preview { display: flex; align-items: center; gap: 8px; padding: 8px 14px 0; font-size: 12.5px; color: var(--muted); background: var(--surface); }
.chat-empty { flex: 1; display: grid; place-items: center; text-align: center; color: var(--muted); padding: 30px; }
.chat-empty img { width: 150px; margin: 0 auto 16px; display: block; }
.chat-empty h3 { color: var(--text); font-size: 18px; margin-bottom: 6px; }
[data-theme="dark"] .chat-empty img { filter: brightness(0) invert(1); opacity: .8; }

/* ==========================================================================
   Team, misc
   ========================================================================== */
.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 18px; }
.person-tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 14px; transition: transform .45s var(--ease), box-shadow .45s var(--ease); position: relative; overflow: hidden; }
.person-tile:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.person-tile::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 68px; background: linear-gradient(135deg, rgba(33, 30, 85, .08), rgba(142, 195, 242, .22)); }
.person-tile.inactive { opacity: .6; }
.pt-head { display: flex; align-items: center; gap: 12px; position: relative; }
.pt-head strong { display: block; font-size: 15px; }
.pt-head small { color: var(--muted); }
.pt-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.pt-stats div { background: var(--surface-2); border-radius: 14px; padding: 9px 4px; }
.pt-stats strong { display: block; font-size: 17px; font-weight: 800; }
.pt-stats span { font-size: 11px; color: var(--muted); font-weight: 650; }
.pt-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.pt-meta { font-size: 12px; color: var(--muted); }
.plain-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.plain-list li { display: flex; gap: 10px; color: var(--text-2); }
.plain-list li .ico { color: var(--primary-text); margin-top: 2px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-bottom: 22px; }

.palette { position: fixed; inset: 0; z-index: 400; display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; }
.palette::before { content: ""; position: fixed; inset: 0; background: var(--overlay); backdrop-filter: blur(5px); animation: fade .2s; }
.palette-box { position: relative; width: 100%; max-width: 620px; background: var(--surface); border: 1px solid var(--border); border-radius: 22px; box-shadow: var(--shadow-lg); overflow: hidden; animation: pop .3s var(--ease); }
.palette-input { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--border); color: var(--muted); }
.palette-input input { flex: 1; border: 0; background: transparent; font: 500 16px var(--font); color: var(--text); outline: none; }
.palette-list { list-style: none; margin: 0; padding: 8px; max-height: 50vh; overflow-y: auto; }
.palette-list .group { font-size: 11px; font-weight: 750; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 10px 12px 4px; }
.palette-list .item { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 12px; cursor: pointer; color: var(--text-2); font-weight: 600; }
.palette-list .item .ico { color: var(--muted); }
.palette-list .item small { margin-left: auto; color: var(--muted); font-weight: 500; }
.palette-list .item.active { background: var(--primary-soft); color: var(--text); }
.palette-list .item.active .ico { color: var(--primary-text); }
.palette-foot { display: flex; gap: 16px; padding: 10px 18px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); background: var(--surface-2); flex-wrap: wrap; }

.toast-wrap { position: fixed; right: 24px; bottom: 24px; z-index: 500; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
.toast { display: flex; align-items: center; gap: 10px; background: var(--surface); color: var(--text); border: 1px solid var(--border); padding: 12px 18px 12px 12px; border-radius: 16px; box-shadow: var(--shadow-lg); font-weight: 600; max-width: 400px; animation: pop .4s var(--ease); }
a.toast:hover { border-color: var(--border-strong); }
.toast .t-icon { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: rgba(18, 184, 134, .14); color: var(--success); flex: 0 0 auto; }
.toast.error .t-icon { background: var(--danger-soft); color: var(--danger); }
.toast.msg .t-icon { background: var(--primary-soft); color: var(--primary-text); }
.toast small { display: block; font-weight: 500; color: var(--muted); font-size: 12px; }
.toast.leaving { transition: opacity .35s var(--ease), transform .35s var(--ease); opacity: 0; transform: translateY(8px); }

/* ==========================================================================
   Auth pages (static background — no moving shapes)
   ========================================================================== */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; position: relative; overflow: hidden; background: #f3f6fd; }
[data-theme="dark"] .auth-page { background: #0b0d1c; }
.auth-bg { position: fixed; inset: 0; pointer-events: none;
  background: radial-gradient(900px 520px at 12% 8%, rgba(142, 195, 242, .45), transparent 60%),
              radial-gradient(800px 520px at 92% 95%, rgba(52, 70, 198, .18), transparent 60%); }
[data-theme="dark"] .auth-bg { background: radial-gradient(900px 520px at 12% 8%, rgba(61, 82, 214, .28), transparent 60%), radial-gradient(800px 520px at 92% 95%, rgba(142, 195, 242, .12), transparent 60%); }
.auth-wave { position: fixed; left: 0; right: 0; bottom: 0; width: 100%; height: 34vh; pointer-events: none; }
.auth-wave path { fill: none; stroke-linecap: round; }
.auth-card { position: relative; width: 100%; max-width: 430px; border-radius: 28px; padding: 38px 36px; color: var(--text); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg); animation: pop .7s var(--ease); }
.auth-wide { max-width: 780px; }
.auth-logo { height: 44px; width: auto; display: block; }
.auth-card h1 { font-size: 26px; font-weight: 800; margin: 26px 0 6px; letter-spacing: -.03em; }
.auth-card > p, .auth-card form > p { margin: 0 0 22px; }
.pw-wrap { position: relative; display: flex; }
.pw-wrap input { padding-right: 46px; }
.pw-toggle { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; }
.pw-toggle.on { color: var(--primary-text); }
.auth-foot { margin-top: 18px; text-align: center; font-size: 12.5px; color: var(--muted); }
.install-group { border: 1px solid var(--border); border-radius: 16px; padding: 14px 16px 0; margin: 0 0 16px; }
.install-group legend { font-weight: 750; padding: 0 6px; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1400px) {
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1200px) {
  .dash { grid-template-columns: minmax(0, 1fr); }
  .dash-side { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .top-search { width: 220px; }
}
@media (max-width: 900px) {
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; transform: translateX(-105%); width: 280px !important; box-shadow: var(--shadow-lg); }
  .sidebar-collapsed .sidebar .brand-logo { display: block; }
  .sidebar-collapsed .sidebar .brand-mark { display: none; }
  .sidebar-collapsed .sidebar .nav-link span, .sidebar-collapsed .sidebar .nav-section, .sidebar-collapsed .sidebar .logout-btn span { display: initial; }
  .sidebar-collapsed .sidebar .nav-people { display: flex; }
  .sidebar-collapsed .sidebar .brand { flex-direction: row; padding: 22px 16px 14px 22px; }
  .sidebar-collapsed .sidebar .nav-link, .sidebar-collapsed .sidebar .logout-btn { justify-content: flex-start; padding: 10px 14px; }
  .sidebar-collapsed .sidebar .nav-link .nav-badge { position: static; }
  .collapse-btn { display: none; }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: var(--overlay); z-index: 35; animation: fade .25s; }
  .topbar .menu-btn { display: inline-flex; }
  .topbar { padding: 14px 16px 6px; gap: 10px; }
  .topbar-title h1 { font-size: 20px; }
  .topbar-title p, .profile-chip div, .top-search span, .top-search kbd { display: none; }
  .top-search { width: auto; padding: 10px; }
  .profile-chip { padding: 3px; }
  .content { padding: 14px 16px 48px; }
  .column { flex-basis: 84vw; max-width: 330px; max-height: none; }
  .col-body { overflow: visible; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .dash-side { grid-template-columns: minmax(0, 1fr); }
  .recent-grid { grid-template-columns: minmax(0, 1fr); }
  .chat { grid-template-columns: minmax(0, 1fr); height: calc(100vh - 110px); }
  .chat.in-room .chat-side { display: none; }
  .chat:not(.in-room) .chat-main { display: none; }
  .chat-back { display: inline-flex; }
  .msg { max-width: 92%; }
}
@media (max-width: 600px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .toolbar > .select, .toolbar > .input { flex: 1 1 140px; }
  .tile { min-height: 128px; padding: 16px; border-radius: 20px; }
  .tile strong { font-size: 28px; margin-top: 12px; }
  .wl-row { grid-template-columns: 1fr 56px; }
  .wl-row .person { grid-column: 1 / -1; }
  .prop-grid { grid-template-columns: 1fr; }
  .auth-card { padding: 30px 22px; }
  .modal { padding: 0; }
  .modal-dialog { border-radius: 0; min-height: 100%; max-width: none; }
  .toast-wrap { left: 16px; right: 16px; align-items: stretch; }
  .palette { padding-top: 16px; }
  .cat-bar-row { grid-template-columns: 1fr 60px; }
  .cat-bar-row > :first-child { grid-column: 1 / -1; }
  .date-bar { flex: 1 1 100%; }
  .day-pill { width: 44px; }
  .ag-item, .ag-gap { flex-wrap: wrap; }
  .ag-time { min-width: 0; }
  #tab-day .toolbar .seg, #tab-day .toolbar .btn-primary { flex: 1 1 auto; justify-content: center; }
  #tab-day .toolbar .seg button { flex: 1; justify-content: center; }
  .theme-switch span, .theme-switch::before { width: 26px; height: 26px; }
  [data-theme="dark"] .theme-switch::before { transform: translateX(26px); }
}
@media (max-width: 420px) {
  .grid-3 { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; transition-duration: .01ms !important; }
}
