/* ================= Design tokens ================= */
:root {
  --bg: #f4f5fb;
  --bg-glow-1: rgba(91, 91, 240, .10);
  --bg-glow-2: rgba(139, 92, 246, .08);
  --surface: #ffffff;
  --surface-2: #f7f8fc;
  --surface-3: #eef0f8;
  --border: #e6e8f1;
  --border-strong: #d6d9e6;
  --text: #141a2e;
  --muted: #6a7192;
  --primary: #5b5bf0;
  --primary-2: #8b5cf6;
  --primary-soft: #eeeefe;
  --primary-ink: #ffffff;
  --gradient: linear-gradient(135deg, #5b5bf0 0%, #8b5cf6 100%);
  --danger: #e5484d;
  --danger-soft: #fdeced;
  --warning: #d97706;
  --warning-soft: #fef3e2;
  --success: #12a671;
  --success-soft: #e3f6ee;
  --purple: #8b5cf6;
  --purple-soft: #f1ebfe;
  --info: #0ea5e9;
  --info-soft: #e2f4fd;
  --shadow-sm: 0 1px 2px rgba(20, 26, 46, .05);
  --shadow: 0 1px 2px rgba(20, 26, 46, .04), 0 6px 20px rgba(20, 26, 46, .06);
  --shadow-lg: 0 10px 40px rgba(20, 26, 46, .14);
  --ring: 0 0 0 4px rgba(91, 91, 240, .16);
  --radius: 16px;
  --radius-sm: 10px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --logo-a: #5b5bf0;
  --logo-b: #9b7bff;
  --logo-mark: #ffffff;
  --logo-accent: #ffd166;
  color-scheme: light;
}
/* Dark mode: follows the system unless the user picked a mode (data-theme on <html>). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c0f1d; --bg-glow-1: rgba(110, 110, 255, .13); --bg-glow-2: rgba(160, 110, 255, .09);
    --surface: #141a2d; --surface-2: #1a2137; --surface-3: #222a44; --border: #252d48; --border-strong: #323b5c;
    --text: #e9ebf7; --muted: #949bbb;
    --primary: #8486ff; --primary-2: #a98bfa; --primary-soft: #232853; --gradient: linear-gradient(135deg, #6b6cf6 0%, #9a6cf7 100%);
    --danger: #ff6b70; --danger-soft: #3a1d26; --warning: #fbb145; --warning-soft: #3a2c17; --success: #3ddc97; --success-soft: #133326;
    --purple: #b393ff; --purple-soft: #2b2350; --info: #4cc3f7; --info-soft: #14304a;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3); --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .28);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, .5); --ring: 0 0 0 4px rgba(132, 134, 255, .22);
    --logo-a: #8f93ff; --logo-b: #c9b6ff; --logo-mark: #0c0f1d; --logo-accent: #ff9f43;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0c0f1d; --bg-glow-1: rgba(110, 110, 255, .13); --bg-glow-2: rgba(160, 110, 255, .09);
  --surface: #141a2d; --surface-2: #1a2137; --surface-3: #222a44; --border: #252d48; --border-strong: #323b5c;
  --text: #e9ebf7; --muted: #949bbb;
  --primary: #8486ff; --primary-2: #a98bfa; --primary-soft: #232853; --gradient: linear-gradient(135deg, #6b6cf6 0%, #9a6cf7 100%);
  --danger: #ff6b70; --danger-soft: #3a1d26; --warning: #fbb145; --warning-soft: #3a2c17; --success: #3ddc97; --success-soft: #133326;
  --purple: #b393ff; --purple-soft: #2b2350; --info: #4cc3f7; --info-soft: #14304a;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3); --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .28);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, .5); --ring: 0 0 0 4px rgba(132, 134, 255, .22);
  --logo-a: #8f93ff; --logo-b: #c9b6ff; --logo-mark: #0c0f1d; --logo-accent: #ff9f43;
  color-scheme: dark;
}

/* ================= Base ================= */
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: 'IBM Plex Sans Arabic', 'Segoe UI', Tahoma, sans-serif;
  background:
    radial-gradient(900px 500px at 100% -10%, var(--bg-glow-1), transparent 60%),
    radial-gradient(700px 400px at -10% 110%, var(--bg-glow-2), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text); font-size: 15px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--primary-soft); color: var(--primary); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.error { color: var(--danger); min-height: 1.2em; margin: 0; font-size: 14px; }
h1, h2, h3 { margin: 0; line-height: 1.3; }
h2 { font-size: 16.5px; font-weight: 600; }
a { color: var(--primary); text-decoration: none; }
kbd { font-family: inherit; font-size: 11px; background: var(--surface-3); border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 6px; padding: 1px 6px; color: var(--muted); direction: ltr; }
.ic { width: 18px; height: 18px; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 99px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ================= Buttons & inputs ================= */
.btn {
  font: inherit; border: 1px solid var(--border); background: var(--surface); color: var(--text);
  padding: 8px 16px; border-radius: var(--radius-sm); cursor: pointer; font-weight: 500; white-space: nowrap;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: transform .15s var(--ease), box-shadow .2s, background-color .2s, border-color .2s, filter .2s;
}
.btn:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.97); }
.btn:focus-visible, .icon-btn:focus-visible, .seg button:focus-visible { outline: none; box-shadow: var(--ring); }
.btn.primary { background: var(--gradient); border-color: transparent; color: #fff; box-shadow: 0 4px 14px rgba(91, 91, 240, .28); }
.btn.primary:hover { filter: brightness(1.08); box-shadow: 0 6px 20px rgba(91, 91, 240, .36); }
.btn.danger { color: var(--danger); border-color: transparent; background: var(--danger-soft); }
.btn.success { color: #fff; background: var(--success); border-color: transparent; box-shadow: 0 4px 14px rgba(18, 166, 113, .25); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); box-shadow: none; }
.btn.ghost:hover { color: var(--text); background: var(--surface-3); transform: none; }
.btn.glass { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .28); color: #fff; backdrop-filter: blur(6px); }
.btn.glass:hover { background: rgba(255, 255, 255, .26); }
.btn.sm { padding: 5px 11px; font-size: 13px; border-radius: 8px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.icon-btn {
  font: inherit; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; width: 40px; height: 40px;
  cursor: pointer; position: relative; color: var(--text); display: inline-grid; place-items: center;
  transition: background-color .2s, transform .15s var(--ease), border-color .2s;
}
.icon-btn:hover { background: var(--surface-3); border-color: var(--border-strong); }
.icon-btn:active { transform: scale(.94); }
.theme-toggle .ic { transition: transform .5s var(--ease); }
.theme-toggle:hover .ic { transform: rotate(40deg); }
input, select, textarea {
  font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 9px 12px; width: 100%; transition: border-color .2s, box-shadow .2s;
}
input:hover, select:hover, textarea:hover { border-color: var(--border-strong); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
textarea { resize: vertical; min-height: 80px; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 500; }
input[type=range] { padding: 0; accent-color: var(--primary); border: 0; box-shadow: none; }
input[type=checkbox] { accent-color: var(--primary); }

/* ================= Login ================= */
.login { min-height: 100vh; display: grid; grid-template-columns: 1fr 1.1fr; }
.login-pane { display: grid; place-items: center; padding: 24px 16px; }
.login-card { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 18px; position: relative; animation: rise .6s var(--ease) both; }
.login-card .theme-toggle { position: absolute; top: -8px; inset-inline-end: 0; }
.login-card h1 { font-size: 26px; margin-top: 18px; }
.login-card p.muted { margin: -10px 0 6px; }
.login-card .btn.primary { padding: 12px; font-size: 16px; }
.login-art { position: relative; overflow: hidden; background: var(--gradient); color: #fff; display: flex; align-items: center; padding: 56px; }
.art-blob { position: absolute; border-radius: 50%; filter: blur(2px); opacity: .5; animation: float 9s ease-in-out infinite; }
.art-blob.b1 { width: 380px; height: 380px; background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.35), transparent 70%); top: -100px; inset-inline-start: -80px; }
.art-blob.b2 { width: 300px; height: 300px; background: radial-gradient(circle at 50% 50%, rgba(255,209,102,.35), transparent 70%); bottom: -80px; inset-inline-end: -60px; animation-delay: -4s; }
.art-content { position: relative; max-width: 460px; }
.art-content h2 { font-size: 34px; line-height: 1.35; font-weight: 700; }
.art-content > p { opacity: .85; font-size: 17px; margin: 14px 0 34px; }
.art-card {
  display: flex; align-items: center; gap: 10px; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .25);
  backdrop-filter: blur(10px); padding: 12px 16px; border-radius: 14px; margin-bottom: 12px; width: fit-content; font-size: 14.5px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .12); animation: rise .7s var(--ease) both, float 7s ease-in-out infinite;
}
.art-card.c1 { animation-delay: .15s, 0s; }
.art-card.c2 { animation-delay: .3s, -2s; margin-inline-start: 40px; }
.art-card.c3 { animation-delay: .45s, -4s; margin-inline-start: 14px; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.dot.ok { background: #4ade80; box-shadow: 0 0 0 4px rgba(74, 222, 128, .25); }
.dot.warn { background: #ffd166; box-shadow: 0 0 0 4px rgba(255, 209, 102, .25); }
.dot.info { background: #7dd3fc; box-shadow: 0 0 0 4px rgba(125, 211, 252, .25); }

/* ================= Shell ================= */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 256px; background: var(--surface); border-inline-end: 1px solid var(--border); padding: 20px 14px;
  display: flex; flex-direction: column; gap: 18px; position: sticky; top: 0; height: 100vh; flex-shrink: 0; z-index: 41;
}
.brand { font-weight: 700; font-size: 20px; display: flex; align-items: center; gap: 10px; padding: 2px 8px; }
.brand.big { font-size: 26px; }
.logo { width: 36px; height: 36px; flex-shrink: 0; display: block; filter: drop-shadow(0 4px 10px rgba(91, 91, 240, .3)); }
.brand.big .logo { width: 48px; height: 48px; }
.wordmark { letter-spacing: -.3px; direction: ltr; }
.wordmark b { background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 700; }
nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.nav-group { font-size: 11.5px; font-weight: 600; color: var(--muted); padding: 14px 12px 6px; letter-spacing: .3px; }
nav a {
  color: var(--muted); padding: 9px 12px; border-radius: 11px; display: flex; align-items: center; gap: 11px; font-weight: 500;
  position: relative; transition: background-color .2s, color .2s;
}
nav a:hover { background: var(--surface-2); color: var(--text); }
nav a:hover .ic { transform: scale(1.1); }
nav a .ic { transition: transform .2s var(--ease); }
nav a.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
nav a.active::before { content: ''; position: absolute; inset-inline-start: -14px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--gradient); }
nav a .count { margin-inline-start: auto; background: var(--danger); color: #fff; border-radius: 99px; font-size: 11.5px; padding: 0 7px; min-width: 20px; text-align: center; animation: pop .4s var(--ease); }
.sidebar-foot { border-top: 1px solid var(--border); padding-top: 14px; display: flex; flex-direction: column; gap: 2px; }
.me { display: flex; align-items: center; gap: 10px; padding: 4px 8px 10px; }
.me .avatar { width: 38px; height: 38px; font-size: 14px; }
.me strong { display: block; font-size: 14px; line-height: 1.3; }
.me span { font-size: 12.5px; color: var(--muted); }
.sidebar-foot .btn { justify-content: flex-start; }
.main { flex: 1; min-width: 0; }
.topbar {
  display: flex; align-items: center; gap: 14px; padding: 14px 28px; position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}
.page-head { flex: 1; min-width: 0; }
.topbar h1 { font-size: 21px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.page-sub { font-size: 12.5px; color: var(--muted); }
.search-trigger {
  font: inherit; display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 8px 12px; color: var(--muted); cursor: pointer; min-width: 240px; transition: border-color .2s, box-shadow .2s;
}
.search-trigger:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.search-trigger .st-label { flex: 1; text-align: start; font-size: 14px; }.top-actions { display: flex; gap: 8px; align-items: center; }
.menu-toggle { display: none; }
.view { padding: 24px 28px 56px; max-width: 1440px; }
.view.enter { animation: viewIn .35s var(--ease) both; }
.scrim { position: fixed; inset: 0; background: rgba(10, 12, 25, .45); backdrop-filter: blur(2px); z-index: 40; animation: fadeIn .2s both; }

/* ================= Notifications ================= */
.bell-wrap { position: relative; }
.badge-count { position: absolute; top: -5px; inset-inline-end: -5px; background: var(--danger); color: #fff; font-size: 10.5px; font-weight: 600; min-width: 19px; height: 19px; border-radius: 99px; display: grid; place-items: center; padding: 0 5px; border: 2px solid var(--bg); animation: pop .4s var(--ease); }
.bell-wrap.ring .ic { animation: ring .8s ease; transform-origin: 50% 0; }
.notif-panel {
  position: absolute; top: 50px; inset-inline-end: 0; width: 390px; max-width: calc(100vw - 24px); max-height: 500px; overflow: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); z-index: 30;
  animation: dropIn .22s var(--ease) both; transform-origin: top left;
}
.notif-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); }
.notif-item { padding: 12px 16px; border-bottom: 1px solid var(--border); cursor: pointer; font-size: 14px; transition: background-color .15s; position: relative; }
.notif-item:hover { background: var(--surface-2); }
.notif-item.unread { background: color-mix(in srgb, var(--primary-soft) 70%, transparent); padding-inline-start: 26px; }
.notif-item.unread::before { content: ''; position: absolute; inset-inline-start: 11px; top: 19px; width: 7px; height: 7px; border-radius: 50%; background: var(--primary); }
.notif-item time { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ================= Hero ================= */
.hero {
  position: relative; overflow: hidden; border-radius: 22px; padding: 28px 30px; margin-bottom: 20px; color: #fff;
  background: var(--gradient); box-shadow: 0 14px 40px rgba(91, 91, 240, .28);
  display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap;
}
.hero::before, .hero::after { content: ''; position: absolute; border-radius: 50%; pointer-events: none; }
.hero::before { width: 320px; height: 320px; background: radial-gradient(circle, rgba(255,255,255,.22), transparent 70%); top: -140px; inset-inline-end: -60px; animation: float 10s ease-in-out infinite; }
.hero::after { width: 220px; height: 220px; background: radial-gradient(circle, rgba(255,209,102,.28), transparent 70%); bottom: -120px; inset-inline-end: 34%; animation: float 12s ease-in-out infinite reverse; }
.hero > * { position: relative; }
.hero-date { opacity: .8; font-size: 14px; }
.hero h2 { font-size: 27px; font-weight: 700; margin: 4px 0 6px; }
.hero p { margin: 0; opacity: .9; max-width: 560px; }
.hero-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ================= Cards & stats ================= */
.grid { display: grid; gap: 16px; }
.stats { grid-template-columns: repeat(6, minmax(0, 1fr)); margin-bottom: 20px; }
@media (max-width: 1400px) { .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; cursor: pointer;
  display: flex; align-items: center; gap: 14px; position: relative; overflow: hidden;
  transition: transform .2s var(--ease), box-shadow .2s, border-color .2s;
}
.stat::after { content: ''; position: absolute; inset-inline: 0; top: 0; height: 3px; background: var(--accent, var(--primary)); transform: scaleX(0); transform-origin: right; transition: transform .35s var(--ease); }
.stat:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: transparent; }
.stat:hover::after { transform: scaleX(1); }
.stat-icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; flex-shrink: 0; color: var(--accent, var(--primary)); background: color-mix(in srgb, var(--accent, var(--primary)) 13%, transparent); transition: transform .3s var(--ease); }
.stat:hover .stat-icon { transform: rotate(-8deg) scale(1.06); }
.stat-icon .ic { width: 22px; height: 22px; }
.stat .label { color: var(--muted); font-size: 13px; font-weight: 500; }
.stat .value { font-size: 28px; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat.danger { --accent: var(--danger); } .stat.danger .value { color: var(--danger); }
.stat.warning { --accent: var(--warning); } .stat.warning .value { color: var(--warning); }
.stat.success { --accent: var(--success); } .stat.success .value { color: var(--success); }
.stat.purple { --accent: var(--purple); } .stat.purple .value { color: var(--purple); }
.stat.info { --accent: var(--info); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; min-width: 0; box-shadow: var(--shadow-sm); }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; gap: 8px; flex-wrap: wrap; }
.card-head h2 { display: flex; align-items: center; gap: 8px; }
.head-ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent, var(--primary)) 13%, transparent); color: var(--accent, var(--primary)); }
.head-ic .ic { width: 16px; height: 16px; }
.two-col { grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); margin-bottom: 16px; }
.empty { color: var(--muted); text-align: center; padding: 28px 8px; font-size: 14px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty .ic { width: 34px; height: 34px; opacity: .45; }
.alert { background: var(--warning-soft); color: var(--warning); border-radius: 14px; padding: 12px 16px; margin-bottom: 16px; display: flex; justify-content: space-between; align-items: center; gap: 12px; font-weight: 500; animation: rise .4s var(--ease) both; }

/* Entrance animation for page content */
.view.enter .stat, .view.enter .card, .view.enter .hero { animation: rise .5s var(--ease) both; }
.view.enter .stats > :nth-child(2) { animation-delay: .04s; }
.view.enter .stats > :nth-child(3) { animation-delay: .08s; }
.view.enter .stats > :nth-child(4) { animation-delay: .12s; }
.view.enter .stats > :nth-child(5) { animation-delay: .16s; }
.view.enter .stats > :nth-child(6) { animation-delay: .2s; }
.view.enter .grid > .card:nth-child(2) { animation-delay: .1s; }

/* Donut */
.donut-wrap { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.donut { width: 150px; height: 150px; flex-shrink: 0; }
.donut circle { fill: none; stroke-width: 14; }
.donut .seg { animation: draw 1s var(--ease) both; transition: stroke-width .2s; cursor: default; }
.donut .seg:hover { stroke-width: 18; }
.donut-total { font-size: 26px; font-weight: 700; fill: var(--text); }
.donut-label { font-size: 11px; fill: var(--muted); }
.legend { display: flex; flex-direction: column; gap: 8px; font-size: 14px; flex: 1; min-width: 160px; }
.legend-row { display: flex; align-items: center; gap: 8px; }
.legend-row b { margin-inline-start: auto; font-variant-numeric: tabular-nums; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.legend.inline { flex-direction: row; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--muted); }

/* ================= Task rows ================= */
.task-row { display: flex; align-items: center; gap: 12px; padding: 10px 8px; margin: 0 -8px; border-radius: 12px; cursor: pointer; transition: background-color .15s, transform .15s var(--ease); }
.task-row + .task-row { border-top: 1px solid var(--border); }
.task-row:hover { background: var(--surface-2); transform: translateX(-3px); }
.task-row .grow { flex: 1; min-width: 0; }
.task-row .title { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-row .sub { font-size: 13px; color: var(--muted); }

/* ================= Tables ================= */
.table-wrap { overflow-x: auto; }
.card.table-wrap { padding: 6px 8px; }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
th { text-align: start; color: var(--muted); font-weight: 500; font-size: 12.5px; padding: 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background-color .15s; }
tbody tr.clickable { cursor: pointer; }
tbody tr.clickable:hover { background: var(--surface-2); }
tbody tr.row-overdue td:first-child { box-shadow: inset -3px 0 0 var(--danger); }
tbody tr.row-overdue { background: color-mix(in srgb, var(--danger-soft) 45%, transparent); }

/* ================= Badges ================= */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 99px; font-size: 12.5px; font-weight: 500; white-space: nowrap; background: var(--surface-3); color: var(--muted); }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge.p-urgent::before, .badge.p-high::before, .badge.p-medium::before, .badge.p-low::before { display: none; }
.badge.in_progress { background: var(--primary-soft); color: var(--primary); }
.badge.review { background: var(--purple-soft); color: var(--purple); }
.badge.done { background: var(--success-soft); color: var(--success); }
.badge.cancelled { text-decoration: line-through; }
.badge.p-urgent { background: var(--danger-soft); color: var(--danger); }
.badge.p-high { background: var(--warning-soft); color: var(--warning); }
.badge.p-medium { background: var(--info-soft); color: var(--info); }
.badge.ps-active { background: var(--primary-soft); color: var(--primary); }
.badge.ps-on_hold { background: var(--warning-soft); color: var(--warning); }
.badge.ps-completed { background: var(--success-soft); color: var(--success); }
.due { font-size: 13px; white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.due.overdue { color: var(--danger); font-weight: 600; }
.due.overdue::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--danger); animation: pulse 1.6s infinite; }
.due.due_soon { color: var(--warning); font-weight: 600; }
.due.done_late { color: var(--warning); }
.due.done { color: var(--success); }
.progress { height: 7px; background: var(--surface-3); border-radius: 99px; overflow: hidden; min-width: 70px; flex: 1; }
.progress span { display: block; height: 100%; background: var(--gradient); border-radius: 99px; animation: grow 1s var(--ease) both; transition: width .5s var(--ease); }
.progress.overdue span { background: linear-gradient(90deg, var(--danger), #ff8a8e); }
.progress-cell { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); min-width: 110px; font-variant-numeric: tabular-nums; }

/* ================= Filters ================= */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; align-items: center; }
.toolbar input, .toolbar select { width: auto; min-width: 140px; }
.toolbar .search { flex: 1; min-width: 200px; }
.seg { display: inline-flex; background: var(--surface-3); border-radius: 12px; padding: 4px; gap: 2px; }
.seg button { font: inherit; font-size: 14px; border: 0; background: none; padding: 6px 14px; border-radius: 9px; cursor: pointer; color: var(--muted); transition: background-color .2s, color .2s, box-shadow .2s; }
.seg button:hover { color: var(--text); }
.seg button.active { background: var(--surface); color: var(--primary); font-weight: 600; box-shadow: var(--shadow-sm); }

/* ================= Board ================= */
.board { display: grid; grid-template-columns: repeat(4, minmax(250px, 1fr)); gap: 14px; overflow-x: auto; align-items: start; padding-bottom: 6px; }
.column { background: color-mix(in srgb, var(--surface-3) 60%, transparent); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; min-height: 320px; transition: background-color .2s, outline-color .2s; }
.column.drag-over { outline: 2px dashed var(--primary); outline-offset: -4px; background: var(--primary-soft); }
.column-head { display: flex; justify-content: space-between; align-items: center; font-weight: 600; margin-bottom: 12px; padding: 2px 4px; }
.kcard { background: var(--surface); border: 1px solid var(--border); border-radius: 13px; padding: 13px; margin-bottom: 10px; cursor: grab; box-shadow: var(--shadow-sm); transition: transform .2s var(--ease), box-shadow .2s, border-color .2s; animation: rise .4s var(--ease) both; }
.kcard:hover { transform: translateY(-2px) rotate(-.4deg); box-shadow: var(--shadow); border-color: var(--border-strong); }
.kcard:active { cursor: grabbing; }
.kcard.dragging { opacity: .45; transform: scale(.97); }
.kcard.overdue { border-inline-start: 4px solid var(--danger); }
.kcard.due_soon { border-inline-start: 4px solid var(--warning); }
.kcard .title { font-weight: 500; margin-bottom: 8px; }
.kcard .meta { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin-top: 8px; flex-wrap: wrap; }

/* ================= Avatar ================= */
.avatar {
  --av: var(--primary);
  width: 32px; height: 32px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 600; font-size: 13px; flex-shrink: 0;
  color: var(--av); background: color-mix(in srgb, var(--av) 15%, var(--surface)); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--av) 25%, transparent);
}

/* ================= Modal ================= */
.modal-backdrop { position: fixed; inset: 0; background: rgba(10, 12, 25, .5); backdrop-filter: blur(4px); display: flex; align-items: flex-start; justify-content: center; padding: 48px 16px; overflow-y: auto; z-index: 50; animation: fadeIn .2s both; }
.modal { background: var(--surface); border-radius: 20px; width: 100%; max-width: 560px; box-shadow: var(--shadow-lg); border: 1px solid var(--border); animation: modalIn .28s var(--ease) both; }
.modal.wide { max-width: 940px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--border); gap: 12px; }
.modal-head h2 { font-size: 18px; }
.modal-body { padding: 20px 22px; }
.form { display: flex; flex-direction: column; gap: 14px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.task-layout { display: grid; grid-template-columns: 1fr 300px; gap: 22px; }
.task-side { display: flex; flex-direction: column; gap: 14px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; align-self: start; position: sticky; top: 0; }
.kv { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; align-items: center; }
.kv span:first-child { color: var(--muted); }
.desc { white-space: pre-wrap; background: var(--surface-2); border: 1px solid var(--border); padding: 12px 14px; border-radius: 12px; margin: 0 0 16px; }
.section-title { font-size: 15px; font-weight: 600; margin: 20px 0 10px; }
.timeline { display: flex; flex-direction: column; gap: 14px; position: relative; }
.tl-item { display: flex; gap: 10px; font-size: 14px; animation: rise .35s var(--ease) both; }
.tl-item .body { flex: 1; min-width: 0; }
.tl-item .who { font-weight: 600; }
.tl-item time { font-size: 12px; color: var(--muted); margin-inline-start: 6px; }
.tl-item.comment .text { background: var(--surface-2); border: 1px solid var(--border); border-radius: 4px 14px 14px 14px; padding: 8px 12px; margin-top: 4px; white-space: pre-wrap; }
.tl-item.system .avatar { --av: var(--warning); }
.ext-box { border: 1px solid color-mix(in srgb, var(--warning) 45%, transparent); background: var(--warning-soft); border-radius: 14px; padding: 14px; margin-bottom: 14px; font-size: 14px; }
.ext-box .actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.ext-box input { margin-top: 8px; }
.status-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ================= Checklist & attachments ================= */
.checklist { display: flex; flex-direction: column; gap: 2px; }
.check-item { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 10px; font-size: 14px; transition: background-color .15s; }
.check-item:hover { background: var(--surface-2); }
.check-item input { width: 19px; height: 19px; accent-color: var(--success); flex-shrink: 0; cursor: pointer; transition: transform .15s var(--ease); }
.check-item input:active { transform: scale(.85); }
.check-item.done .grow { text-decoration: line-through; color: var(--muted); }
.check-item .grow, .file-item .grow { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.attachments { display: flex; flex-direction: column; gap: 8px; }
.file-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--border); border-radius: 12px; font-size: 14px; transition: border-color .2s, background-color .2s; }
.file-item:hover { border-color: var(--border-strong); background: var(--surface-2); }
.file-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); font-size: 11px; font-weight: 700; flex-shrink: 0; direction: ltr; }

/* ================= Projects ================= */
.project-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.project-card { color: var(--text); display: block; transition: transform .2s var(--ease), box-shadow .2s, border-color .2s; position: relative; overflow: hidden; }
.project-card::before { content: ''; position: absolute; inset-inline: 0; top: 0; height: 4px; background: var(--gradient); opacity: .85; }
.project-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: transparent; }
.project-stats { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; }
.members { display: flex; flex-wrap: wrap; gap: 8px; }
.member { display: inline-flex; align-items: center; gap: 6px; background: var(--surface-2); border: 1px solid var(--border); padding: 4px 12px 4px 4px; border-radius: 99px; font-size: 13px; }
.member .avatar { width: 26px; height: 26px; font-size: 11px; }

/* ================= Sequential chains ================= */
.pipeline { display: flex; align-items: stretch; gap: 6px; overflow-x: auto; padding: 2px 2px 6px; }
.pipe-arrow { align-self: center; color: var(--muted); font-size: 18px; flex-shrink: 0; }
.pipe-step { display: flex; gap: 9px; align-items: flex-start; min-width: 160px; max-width: 230px; padding: 11px; border-radius: 13px; border: 1px solid var(--border); background: var(--surface-2); flex-shrink: 0; transition: transform .2s var(--ease), box-shadow .2s, border-color .2s; }
.pipe-step.clickable { cursor: pointer; }
.pipe-step.clickable:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow); }
.pipe-step.here { box-shadow: var(--ring); border-color: var(--primary); }
.pipe-num { width: 27px; height: 27px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; flex-shrink: 0; background: var(--surface-3); color: var(--muted); }
.pipe-body { min-width: 0; }
.pipe-name { font-weight: 600; font-size: 14px; }
.pipe-title { font-size: 12.5px; }
.pipe-sub { font-size: 12px; color: var(--muted); }
.pipe-step.done { background: var(--success-soft); border-color: transparent; }
.pipe-step.done .pipe-num { background: var(--success); color: #fff; }
.pipe-step.current { background: var(--primary-soft); border-color: color-mix(in srgb, var(--primary) 50%, transparent); }
.pipe-step.current .pipe-num { background: var(--gradient); color: #fff; animation: glow 2s infinite; }
.pipe-step.overdue { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 50%, transparent); }
.pipe-step.overdue .pipe-num { background: var(--danger); color: #fff; }
.pipe-step.overdue .pipe-sub { color: var(--danger); font-weight: 600; }
.pipe-step.pending { opacity: .7; }
.step-row { display: grid; grid-template-columns: 28px minmax(140px, 1.2fr) minmax(140px, 2fr) 90px auto; gap: 8px; align-items: center; margin-bottom: 8px; animation: rise .3s var(--ease) both; }
.step-num { width: 27px; height: 27px; border-radius: 50%; background: var(--gradient); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.step-days { flex-direction: row; align-items: center; gap: 4px; font-weight: 400; font-size: 13px; }
.step-days input { padding: 6px 8px; }
.step-tools { display: flex; }
.step-tools .btn { padding: 4px 7px; }

/* ================= Calendar ================= */
.calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: var(--border); gap: 1px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.cal-head { background: var(--surface-2); text-align: center; padding: 10px 4px; font-size: 13px; font-weight: 600; color: var(--muted); }
.cal-day { background: var(--surface); min-height: 116px; padding: 7px; display: flex; flex-direction: column; gap: 3px; min-width: 0; transition: background-color .15s; }
.cal-day:hover { background: var(--surface-2); }
.cal-day.other { background: color-mix(in srgb, var(--surface-2) 70%, var(--bg)); }
.cal-day.other .cal-num { opacity: .4; }
.cal-num { font-size: 13px; font-weight: 600; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; }
.cal-day.today .cal-num { background: var(--gradient); color: #fff; box-shadow: 0 3px 10px rgba(91, 91, 240, .4); }
.cal-tasks { display: flex; flex-direction: column; gap: 3px; max-height: 112px; overflow-y: auto; }
.cal-chip { font-size: 12px; padding: 2px 7px; border-radius: 6px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-inline-start: 3px solid; transition: transform .15s var(--ease), filter .15s; animation: rise .3s var(--ease) both; }
.cal-chip:hover { transform: translateX(-2px); filter: brightness(.96); }
.cal-chip.open { background: var(--primary-soft); color: var(--primary); }
.cal-chip.soon { background: var(--warning-soft); color: var(--warning); }
.cal-chip.overdue { background: var(--danger-soft); color: var(--danger); font-weight: 600; }
.cal-chip.done { background: var(--success-soft); color: var(--success); text-decoration: line-through; }

/* ================= Permissions & accounts ================= */
.switch {
  appearance: none; -webkit-appearance: none; width: 40px; height: 23px; padding: 0; border-radius: 99px; cursor: pointer; flex-shrink: 0;
  background: var(--surface-3); border: 1px solid var(--border-strong); position: relative; vertical-align: middle; transition: background-color .2s, border-color .2s;
}
.switch::after { content: ''; position: absolute; top: 2px; inset-inline-start: 2px; width: 17px; height: 17px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .25s var(--ease); }
.switch:checked { background: var(--gradient); border-color: transparent; }
.switch:checked::after { transform: translateX(-17px); }
.switch:disabled { opacity: .55; cursor: not-allowed; }
.switch:focus-visible { outline: none; box-shadow: var(--ring); }
.perm-table td:first-child { min-width: 220px; }
.perm-table th:not(:first-child) { width: 110px; }
@media (max-width: 600px) { .perm-table td, .perm-table th { padding: 10px 8px; } .perm-table td:first-child { min-width: 170px; } }
.perm-group-row td { background: var(--surface-2); font-weight: 600; font-size: 12.5px; color: var(--muted); padding-top: 9px; padding-bottom: 9px; }
.cred-card { background: var(--surface-2); border: 1px dashed var(--border-strong); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.cred-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 14px; flex-wrap: wrap; }
.cred-row span { color: var(--muted); }
.cred-row code { font-family: ui-monospace, Consolas, monospace; direction: ltr; background: var(--surface); border: 1px solid var(--border); padding: 3px 10px; border-radius: 8px; font-size: 14px; user-select: all; }

/* ================= Settings ================= */
.company-name { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.company-side { padding: 2px 8px 0 0; margin-inline-start: 46px; margin-top: -4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.company-login { font-size: 15px; margin-top: -10px; }
.setting-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 340px); gap: 16px; align-items: center; padding: 14px 0; border-top: 1px solid var(--border); }
.card-head + .setting-row { border-top: 0; padding-top: 0; }
.setting-label { font-weight: 500; }
.unit-input { display: flex; align-items: center; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); overflow: hidden; transition: border-color .2s, box-shadow .2s; }
.unit-input:focus-within { border-color: var(--primary); box-shadow: var(--ring); }
.unit-input input { border: 0; box-shadow: none !important; width: 90px; flex: 1; }
.unit-input span { padding: 0 12px; color: var(--muted); font-size: 13px; background: var(--surface-2); align-self: stretch; display: grid; place-items: center; border-inline-start: 1px solid var(--border); white-space: nowrap; }
.day-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.day-chip { flex-direction: row; cursor: pointer; }
.day-chip input { display: none; }
.day-chip span { padding: 5px 11px; border-radius: 99px; border: 1px solid var(--border); font-size: 13px; font-weight: 500; color: var(--muted); transition: all .2s; user-select: none; }
.day-chip input:checked + span { background: var(--primary-soft); border-color: color-mix(in srgb, var(--primary) 45%, transparent); color: var(--primary); }
.settings-actions { position: sticky; bottom: 16px; display: flex; justify-content: flex-end; }
.settings-actions .btn { padding: 11px 22px; }
.role-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.role-card { border: 1px solid var(--border); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 6px; background: var(--surface-2); transition: border-color .2s, transform .2s var(--ease); }
.role-card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.role-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.role-foot { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-top: auto; flex-wrap: wrap; }
@media (max-width: 700px) { .setting-row { grid-template-columns: 1fr; gap: 8px; } }

/* ================= Sign in as employee ================= */
.imp-banner {
  position: sticky; top: 0; z-index: 21; height: 48px; display: flex; align-items: center; justify-content: center; gap: 14px; padding: 0 16px;
  background: linear-gradient(90deg, #f59e0b, #f97316); color: #fff; font-size: 14px; font-weight: 500; box-shadow: 0 4px 16px rgba(249, 115, 22, .3);
}
.imp-banner .ic { width: 18px; height: 18px; }
.imp-banner .who { display: flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.imp-banner .btn { background: #fff; color: #c2410c; border: 0; padding: 6px 14px; font-weight: 600; flex-shrink: 0; }
.imp-banner .btn:hover { background: #fff7ed; }
.main.impersonating .topbar { top: 48px; }
.tl-item .by-admin { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; color: #c2410c; background: #ffedd5; border-radius: 99px; padding: 1px 8px; margin-inline-start: 6px; }
:root[data-theme="dark"] .tl-item .by-admin { background: #3a2410; color: #fdba74; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tl-item .by-admin { background: #3a2410; color: #fdba74; } }
@media (max-width: 600px) { .imp-banner { font-size: 12.5px; gap: 8px; } .imp-banner .hint { display: none; } }

/* ================= Skeleton loading ================= */
.skeleton-list { display: flex; flex-direction: column; gap: 12px; }
.skeleton-list i { display: block; height: 58px; border-radius: 14px; background: linear-gradient(90deg, var(--surface-3) 25%, var(--surface-2) 50%, var(--surface-3) 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite linear; }
.skeleton-list i:nth-child(2) { width: 92%; } .skeleton-list i:nth-child(3) { width: 80%; }

/* ================= Command palette ================= */
.palette-backdrop { position: fixed; inset: 0; z-index: 70; background: rgba(10, 12, 25, .45); backdrop-filter: blur(4px); display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; animation: fadeIn .15s both; }
.palette { width: 100%; max-width: 600px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow-lg); overflow: hidden; animation: modalIn .22s var(--ease) both; }
.palette-input { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); color: var(--muted); }
.palette-input input { border: 0; box-shadow: none; padding: 4px 0; font-size: 17px; background: transparent; }
.palette-list { max-height: 380px; overflow-y: auto; padding: 8px; }
.palette-section { font-size: 11.5px; color: var(--muted); padding: 8px 10px 4px; font-weight: 600; }
.palette-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 11px; cursor: pointer; font-size: 14.5px; }
.palette-item .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette-item.active { background: var(--primary-soft); color: var(--primary); }
.palette-hint { font-size: 12px; color: var(--muted); }
.palette-foot { display: flex; gap: 14px; padding: 10px 16px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); }

/* ================= Toasts ================= */
.toasts { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; background: var(--text); color: var(--bg); padding: 10px 18px 10px 14px; border-radius: 14px; box-shadow: var(--shadow-lg); font-weight: 500; animation: toastIn .35s var(--ease) both; pointer-events: auto; }
.toast.out { animation: toastOut .3s ease both; }
.toast-ic { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700; color: #fff; background: var(--success); flex-shrink: 0; }
.toast.err .toast-ic { background: var(--danger); }

.print-only { display: none; }

/* ================= Animations ================= */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes dropIn { from { opacity: 0; transform: translateY(-6px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(16px) scale(.95); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(10px) scale(.96); } }
@keyframes grow { from { width: 0; } }
@keyframes draw { from { stroke-dasharray: 0 999; } }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes pop { 0% { transform: scale(.4); } 70% { transform: scale(1.15); } 100% { transform: scale(1); } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--danger) 55%, transparent); } 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
@keyframes glow { 0%, 100% { box-shadow: 0 0 0 0 rgba(91, 91, 240, .45); } 50% { box-shadow: 0 0 0 6px rgba(91, 91, 240, 0); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
@keyframes ring { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(16deg); } 40% { transform: rotate(-14deg); } 60% { transform: rotate(8deg); } 80% { transform: rotate(-4deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ================= Responsive ================= */
@media (max-width: 1100px) {
  .login { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .search-trigger { min-width: 0; width: 40px; height: 40px; padding: 0; justify-content: center; color: var(--text); }
  .search-trigger .st-label, .search-trigger kbd { display: none; }
}
@media (max-width: 900px) {
  .sidebar { position: fixed; inset-inline-start: 0; transform: translateX(105%); transition: transform .3s var(--ease); box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .menu-toggle { display: inline-grid; }
  .topbar { padding: 12px 16px; gap: 8px; }
  .topbar h1 { font-size: 17px; }
  .page-sub { display: none; }
  .view { padding: 16px; }
  .two-col, .task-layout, .form-row { grid-template-columns: 1fr; }
  .task-side { position: static; }
  .board { grid-template-columns: repeat(4, 260px); }
  .hero { padding: 22px; border-radius: 18px; }
  .hero h2 { font-size: 22px; }
  .cal-day { min-height: 70px; padding: 3px; }
  .cal-chip { font-size: 10px; padding: 1px 3px; }
  .cal-head { font-size: 11px; }
  .top-actions { gap: 6px; }
}
@media (max-width: 700px) {
  .step-row { grid-template-columns: 28px 1fr auto; padding: 8px; border: 1px solid var(--border); border-radius: 12px; }
  .step-row [data-f="title"] { grid-column: 2 / -1; }
  .step-row .step-days { grid-column: 2; }
}
@media (max-width: 600px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 12px; gap: 10px; flex-direction: column; align-items: flex-start; }
  .stat-icon { width: 38px; height: 38px; border-radius: 11px; }
  .stat .value { font-size: 24px; }
  .pipeline { flex-direction: column; overflow: visible; }
  .pipe-step { max-width: none; min-width: 0; }
  .pipe-arrow { transform: rotate(-90deg); }
  .donut-wrap { justify-content: center; }
}
@media (max-width: 480px) {
  #new-task-btn .btn-label { display: none; }
  #new-task-btn { padding: 8px 11px; }
  .icon-btn { width: 38px; height: 38px; }
}

@media print {
  .sidebar, .topbar .top-actions, .search-trigger, .menu-toggle, .no-print, .toasts { display: none !important; }
  .print-only { display: block; }
  body { background: #fff; }
  .view { padding: 0; }
  .card, .stat { break-inside: avoid; animation: none !important; }
}
