/* =====================================================================
   Team Workspace — Glassmorphism UI
   ===================================================================== */
:root {
  --font: 'Prompt', 'Noto Sans Lao', 'Phetsarath OT', 'Saysettha OT', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --radius: 20px;
  --radius-sm: 12px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --sidebar-w: 264px;

  --bg-grad: linear-gradient(135deg, #c7d2fe 0%, #ddd6fe 35%, #f5d0fe 70%, #fbcfe8 100%);
  --blob1: #a78bfa; --blob2: #60a5fa; --blob3: #f472b6; --blob4: #c084fc;
  --glass: rgba(255, 255, 255, .5);
  --glass-2: rgba(255, 255, 255, .35);
  --glass-strong: rgba(255, 255, 255, .82);
  --glass-border: rgba(255, 255, 255, .75);
  --hairline: rgba(76, 29, 149, .1);
  --text: #1e1b4b;
  --text-2: #45427a;
  --muted: #6e6b96;
  --shadow: 0 8px 32px rgba(76, 29, 149, .12);
  --shadow-lg: 0 24px 60px rgba(76, 29, 149, .22);
  --glow: 0 18px 44px rgba(139, 92, 246, .3), 0 0 0 1px rgba(255, 255, 255, .9) inset;
  --accent: #7c3aed;
  --accent-2: #db2777;
  --accent-grad: linear-gradient(135deg, #7c3aed, #db2777);
  --input-bg: rgba(255, 255, 255, .6);
  --solid: #f6f1ff;

  --ok: #059669; --warn: #d97706; --bad: #dc2626;
  --ok-bg: rgba(16, 185, 129, .16); --warn-bg: rgba(245, 158, 11, .18); --bad-bg: rgba(239, 68, 68, .14);

  /* แผนก */
  --dept-it: #38bdf8; --dept-it-2: #6366f1;
  --dept-finance: #34d399; --dept-finance-2: #059669;
  --dept-marketing: #f472b6; --dept-marketing-2: #fb923c;

  /* สีกราฟ (ผ่านการตรวจ CVD) */
  --s-todo: #eda100; --s-doing: #2a78d6; --s-review: #eb6834; --s-done: #1baf7a;
  --c-it: #2a78d6; --c-finance: #1baf7a; --c-marketing: #eb6834;
  --grid: rgba(76, 29, 149, .1);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg-grad: linear-gradient(135deg, #0c0824 0%, #1b1650 40%, #2d0f45 75%, #3d0b35 100%);
  --blob1: #7c3aed; --blob2: #2563eb; --blob3: #db2777; --blob4: #9333ea;
  --glass: rgba(255, 255, 255, .07);
  --glass-2: rgba(255, 255, 255, .05);
  --glass-strong: rgba(28, 24, 70, .9);
  --glass-border: rgba(255, 255, 255, .14);
  --hairline: rgba(255, 255, 255, .09);
  --text: #f3f1ff;
  --text-2: #cfcbf3;
  --muted: #9e9acb;
  --shadow: 0 8px 32px rgba(0, 0, 0, .35);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, .5);
  --glow: 0 18px 44px rgba(168, 85, 247, .35), 0 0 0 1px rgba(255, 255, 255, .22) inset;
  --accent: #a78bfa;
  --accent-2: #f472b6;
  --accent-grad: linear-gradient(135deg, #8b5cf6, #ec4899);
  --input-bg: rgba(255, 255, 255, .06);
  --solid: #1d1848;
  --ok: #34d399; --warn: #fbbf24; --bad: #f87171;
  --ok-bg: rgba(52, 211, 153, .16); --warn-bg: rgba(251, 191, 36, .16); --bad-bg: rgba(248, 113, 113, .16);
  --s-todo: #c98500; --s-doing: #3987e5; --s-review: #d95926; --s-done: #199e70;
  --c-it: #3987e5; --c-finance: #199e70; --c-marketing: #d95926;
  --grid: rgba(255, 255, 255, .08);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font); color: var(--text); background: var(--bg-grad); background-attachment: fixed;
  font-size: 15px; line-height: 1.6; -webkit-font-smoothing: antialiased; overflow-x: hidden;
  transition: color .4s var(--ease);
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
img, video { max-width: 100%; }
::selection { background: rgba(139, 92, 246, .3); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(124, 58, 237, .25); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- พื้นหลังวงกลมเบลอ ---------- */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: var(--bg-grad); transition: background .6s; }
.blob { position: absolute; border-radius: 50%; filter: blur(80px); opacity: .55; will-change: transform; }
.b1 { width: 46vmax; height: 46vmax; background: var(--blob1); top: -14vmax; left: -10vmax; animation: float1 28s ease-in-out infinite alternate; }
.b2 { width: 38vmax; height: 38vmax; background: var(--blob2); bottom: -14vmax; right: -8vmax; animation: float2 34s ease-in-out infinite alternate; }
.b3 { width: 30vmax; height: 30vmax; background: var(--blob3); top: 30%; left: 45%; animation: float3 26s ease-in-out infinite alternate; opacity: .45; }
.b4 { width: 24vmax; height: 24vmax; background: var(--blob4); bottom: 5%; left: 8%; animation: float1 40s ease-in-out infinite alternate-reverse; opacity: .4; }
@keyframes float1 { to { transform: translate(14vmax, 10vmax) scale(1.15); } }
@keyframes float2 { to { transform: translate(-16vmax, -12vmax) scale(.9); } }
@keyframes float3 { 0% { transform: translate(0, 0); } 50% { transform: translate(-18vmax, 8vmax) scale(1.2); } 100% { transform: translate(6vmax, -10vmax) scale(.95); } }
@media (prefers-reduced-motion: reduce) { .blob { animation: none; } *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; } }

/* ---------- กระจก ---------- */
.glass {
  background: var(--glass); border: 1px solid var(--glass-border); border-radius: var(--radius);
  backdrop-filter: blur(18px) saturate(160%); -webkit-backdrop-filter: blur(18px) saturate(160%);
  box-shadow: var(--shadow);
}
.card { padding: 20px; transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .35s; }
@media (hover: hover) { .lift:hover { transform: translateY(-4px); box-shadow: var(--glow); } }
.card-title { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; font-size: 1.02rem; font-weight: 600; }
.card-title .sub { margin-left: auto; font-weight: 400; font-size: .85rem; color: var(--muted); }

/* ---------- ปุ่ม / ฟอร์ม ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--glass-border);
  background: var(--glass); padding: 9px 16px; border-radius: 12px; cursor: pointer; font-weight: 500; font-size: .92rem;
  transition: transform .2s var(--ease), box-shadow .25s, background .25s; white-space: nowrap; backdrop-filter: blur(10px);
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); background: var(--glass-strong); }
.btn:active { transform: translateY(0) scale(.98); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--accent-grad); color: #fff; border-color: transparent; box-shadow: 0 8px 22px rgba(168, 85, 247, .35); }
.btn-primary:hover { background: var(--accent-grad); box-shadow: 0 12px 30px rgba(219, 39, 119, .4); }
.btn-danger { color: var(--bad); }
.btn-ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.btn-sm { padding: 6px 11px; font-size: .84rem; border-radius: 10px; }
.btn-icon { padding: 8px; width: 40px; height: 40px; border-radius: 12px; }
.btn-ghost { background: transparent; border-color: transparent; backdrop-filter: none; }
.btn-ghost:hover { background: var(--glass); }
.btn svg, .icon { width: 18px; height: 18px; flex: none; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; min-width: 0; }
.field > label, .label { font-size: .84rem; color: var(--text-2); font-weight: 500; }
.input, select.input, textarea.input {
  width: 100%; padding: 10px 13px; border-radius: 12px; border: 1px solid var(--glass-border); background: var(--input-bg);
  outline: none; transition: border-color .2s, box-shadow .2s; min-height: 42px;
}
textarea.input { resize: vertical; min-height: 90px; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(139, 92, 246, .18); }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
:root[data-theme="dark"] select.input option { background: #1e1b4b; }
.row { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.row-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.hint { font-size: .8rem; color: var(--muted); }
.error-text { color: var(--bad); font-size: .86rem; min-height: 1.2em; }

/* segmented control พร้อมแถบเลื่อน */
.seg { position: relative; display: inline-flex; padding: 4px; gap: 2px; border-radius: 14px; background: var(--glass-2); border: 1px solid var(--glass-border); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { position: relative; z-index: 1; border: 0; background: transparent; padding: 7px 14px; border-radius: 10px; cursor: pointer; font-size: .88rem; color: var(--text-2); display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; transition: color .25s; }
.seg button.active { color: var(--text); font-weight: 600; }
.seg .seg-ind { position: absolute; z-index: 0; top: 4px; bottom: 4px; border-radius: 10px; background: var(--glass-strong); box-shadow: 0 4px 14px rgba(76, 29, 149, .15); transition: left .4s var(--ease), width .4s var(--ease); }
.seg .dot { width: 8px; height: 8px; border-radius: 50%; }

/* ---------- Layout ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; height: 100dvh; padding-top: max(18px, env(safe-area-inset-top)); padding: 18px 14px; display: flex; flex-direction: column; gap: 6px; border-radius: 0 24px 24px 0; border-left: 0; z-index: 30; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 12px; padding: 6px 10px 18px; }
.brand-logo { width: 42px; height: 42px; border-radius: 13px; background: var(--accent-grad); display: grid; place-items: center; color: #fff; box-shadow: 0 8px 20px rgba(168, 85, 247, .4); }
.brand-logo svg { width: 22px; height: 22px; }
.brand b { display: block; font-size: 1.05rem; letter-spacing: .2px; }
.brand small { color: var(--muted); font-size: .76rem; }
.nav-label { font-size: .72rem; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); padding: 14px 12px 4px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: var(--text-2); font-weight: 500; position: relative; transition: background .25s, color .25s, transform .25s var(--ease); }
.nav a:hover { background: var(--glass); color: var(--text); transform: translateX(3px); }
.nav a.active { background: var(--glass-strong); color: var(--text); box-shadow: var(--shadow); }
.nav a.active::before { content: ''; position: absolute; left: -14px; top: 10px; bottom: 10px; width: 4px; border-radius: 0 4px 4px 0; background: var(--accent-grad); }
.nav a .icon { width: 20px; height: 20px; }
.nav a .count { margin-left: auto; font-size: .74rem; background: var(--bad); color: #fff; border-radius: 10px; padding: 0 7px; line-height: 1.6; }
.nav .dept-dot { width: 10px; height: 10px; border-radius: 4px; margin: 0 5px; flex: none; }
.sidebar-foot { margin-top: auto; padding-top: 14px; }
.me-card { width: 100%; text-align: left; cursor: pointer; transition: background .2s; display: flex; gap: 10px; align-items: center; padding: 10px; border-radius: 14px; background: var(--glass-2); border: 1px solid var(--glass-border); }
.me-card .meta { min-width: 0; flex: 1; }
.me-card b { display: block; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-card small { color: var(--muted); font-size: .76rem; }

.main { min-width: 0; padding: 0 28px calc(40px + env(safe-area-inset-bottom)); padding-right: max(28px, env(safe-area-inset-right)); width: 100%; max-width: 1760px; margin: 0 auto; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 16px 0 14px; }
.topbar::before { content: ''; position: absolute; inset: 0 -28px; z-index: -1; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); mask: linear-gradient(#000 70%, transparent); }
.topbar h1 { font-size: 1.5rem; margin: 0; font-weight: 600; letter-spacing: .2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .crumb { color: var(--muted); font-size: .84rem; }
.topbar .spacer { flex: 1; }
.menu-btn { display: none; }
.presence-btn { gap: 8px; }
.pdot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; box-shadow: 0 0 0 3px rgba(255, 255, 255, .5); }
.pdot.available { background: #10b981; } .pdot.busy { background: #f59e0b; } .pdot.away { background: #94a3b8; }
.bell { position: relative; }
.bell .badge-dot { position: absolute; top: 4px; right: 4px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--bad); color: #fff; font-size: .7rem; display: grid; place-items: center; padding: 0 5px; animation: pop .4s var(--ease); }
@keyframes pop { from { transform: scale(0); } }

.page { animation: pageIn .55s var(--ease) both; }
.page.leaving { animation: pageOut .18s ease-in both; }
@keyframes pageIn { from { opacity: 0; transform: translateY(14px) scale(.995); filter: blur(4px); } }
@keyframes pageOut { to { opacity: 0; transform: translateY(-8px); filter: blur(3px); } }
.stagger > * { animation: rise .6s var(--ease) both; }
.stagger > *:nth-child(2) { animation-delay: .05s; } .stagger > *:nth-child(3) { animation-delay: .1s; } .stagger > *:nth-child(4) { animation-delay: .15s; }
.stagger > *:nth-child(5) { animation-delay: .2s; } .stagger > *:nth-child(6) { animation-delay: .25s; } .stagger > *:nth-child(n+7) { animation-delay: .3s; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 18px; }
.toolbar .spacer { flex: 1; }
.toolbar .input { width: auto; min-width: 150px; }
.search { position: relative; }
.search .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search .input { padding-left: 38px; min-width: 200px; }

.grid { display: grid; gap: 18px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-21 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.g-12 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.stats { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 18px; }

/* ---------- Stat tile ---------- */
.stat { padding: 18px 18px 16px; position: relative; overflow: hidden; }
.stat .k { color: var(--text-2); font-size: .86rem; display: flex; align-items: center; gap: 8px; }
.stat .k .ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; color: #fff; background: var(--ic, var(--accent-grad)); box-shadow: 0 6px 14px rgba(0, 0, 0, .12); }
.stat .k .ic svg { width: 17px; height: 17px; }
.stat .v { font-size: 2rem; font-weight: 600; margin-top: 8px; letter-spacing: .5px; font-variant-numeric: tabular-nums; line-height: 1.2; }
.stat .v small { font-size: .95rem; font-weight: 400; color: var(--muted); margin-left: 3px; }
.stat .d { font-size: .8rem; color: var(--muted); }
.stat.bad .v { color: var(--bad); }
.stat::after { content: ''; position: absolute; width: 120px; height: 120px; right: -40px; top: -40px; border-radius: 50%; background: var(--ic, var(--accent-grad)); opacity: .12; filter: blur(4px); }

/* ---------- Chips / Badges ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: .76rem; font-weight: 500; background: var(--glass-2); border: 1px solid var(--glass-border); white-space: nowrap; }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; }
.dept-chip { color: #fff; border: 0; background: linear-gradient(135deg, var(--dc1), var(--dc2)); text-shadow: 0 1px 2px rgba(0, 0, 0, .15); }
.prio { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 8px; font-size: .74rem; font-weight: 600; }
.prio-low { background: rgba(100, 116, 139, .16); color: var(--muted); }
.prio-medium { background: rgba(59, 130, 246, .16); color: #3b82f6; }
.prio-high { background: rgba(249, 115, 22, .18); color: #ea580c; }
.prio-urgent { background: rgba(239, 68, 68, .18); color: var(--bad); }
:root[data-theme="dark"] .prio-medium { color: #93c5fd; } :root[data-theme="dark"] .prio-high { color: #fdba74; }
.prio-urgent::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: .25; } }
.due { display: inline-flex; align-items: center; gap: 4px; font-size: .78rem; color: var(--muted); white-space: nowrap; }
.due svg { width: 14px; height: 14px; }
.due.soon { color: var(--warn); font-weight: 500; }
.due.over { color: var(--bad); font-weight: 600; }
.due.ok { color: var(--ok); }
.status-pill { font-size: .76rem; padding: 2px 10px; border-radius: 999px; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; background: var(--glass-2); }
.status-pill::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--sc); }

/* ---------- Avatar ---------- */
.avatar { --size: 36px; width: var(--size); height: var(--size); border-radius: 50%; display: inline-grid; place-items: center; color: #fff; font-weight: 600; font-size: calc(var(--size) * .4); flex: none; background: linear-gradient(135deg, var(--dc1, #8b5cf6), var(--dc2, #ec4899)); position: relative; box-shadow: 0 0 0 2px var(--glass-border); }
.avatar.sm { --size: 26px; } .avatar.lg { --size: 52px; } .avatar.xl { --size: 64px; }
.avatar .pdot { position: absolute; right: -1px; bottom: -1px; width: 30%; height: 30%; min-width: 9px; min-height: 9px; box-shadow: 0 0 0 2px var(--glass-strong); }
.avatars { display: flex; } .avatars .avatar { margin-left: -8px; } .avatars .avatar:first-child { margin-left: 0; }

/* ---------- Progress / load bars ---------- */
.bar { height: 7px; border-radius: 99px; background: var(--hairline); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 99px; background: var(--accent-grad); width: 0; transition: width 1.1s var(--ease); }
.load-bar > i.free { background: linear-gradient(90deg, #34d399, #10b981); }
.load-bar > i.balanced { background: linear-gradient(90deg, #fcd34d, #f59e0b); }
.load-bar > i.overloaded { background: linear-gradient(90deg, #fb7185, #ef4444); }
.load-tag { font-size: .75rem; font-weight: 600; padding: 1px 9px; border-radius: 99px; display: inline-flex; align-items: center; gap: 5px; }
.load-tag.free { background: var(--ok-bg); color: var(--ok); }
.load-tag.balanced { background: var(--warn-bg); color: var(--warn); }
.load-tag.overloaded { background: var(--bad-bg); color: var(--bad); }
.load-tag.away { background: rgba(148, 163, 184, .2); color: var(--muted); }

/* ---------- Lists ---------- */
.list { display: flex; flex-direction: column; gap: 8px; }
.li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: var(--glass-2); border: 1px solid transparent; cursor: pointer; transition: background .25s, border-color .25s, transform .25s var(--ease); min-width: 0; }
.li:hover { background: var(--glass-strong); border-color: var(--glass-border); transform: translateX(3px); }
.li .grow { flex: 1; min-width: 0; }
.li .t { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.li .s { font-size: .8rem; color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.li.over { border-left: 3px solid var(--bad); }
.stripe { width: 4px; align-self: stretch; border-radius: 4px; background: linear-gradient(var(--dc1), var(--dc2)); flex: none; }
.empty { text-align: center; color: var(--muted); padding: 26px 10px; font-size: .9rem; }
.empty svg { width: 40px; height: 40px; opacity: .45; display: block; margin: 0 auto 8px; }

/* ---------- Kanban ---------- */
.board { display: grid; grid-template-columns: repeat(4, minmax(250px, 1fr)); gap: 16px; overflow-x: auto; padding-bottom: 10px; align-items: start; scroll-snap-type: x proximity; }
.col { padding: 12px; min-height: 300px; display: flex; flex-direction: column; gap: 10px; transition: background .25s, box-shadow .25s, transform .25s; scroll-snap-align: start; }
.col.drop-target { background: var(--glass-strong); box-shadow: var(--glow); transform: scale(1.01); }
.col-head { display: flex; align-items: center; gap: 8px; padding: 4px 6px 6px; font-weight: 600; }
.col-head .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--sc); box-shadow: 0 0 10px var(--sc); }
.col-head .n { margin-left: auto; font-size: .8rem; color: var(--muted); background: var(--glass-2); padding: 0 9px; border-radius: 99px; }
.col-body { display: flex; flex-direction: column; gap: 10px; min-height: 80px; flex: 1; }
.tcard {
  position: relative; padding: 13px 13px 12px 16px; border-radius: 16px; cursor: grab; user-select: none;
  background: var(--glass-strong); border: 1px solid var(--glass-border); box-shadow: 0 4px 14px rgba(76, 29, 149, .08);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), opacity .2s; overflow: hidden; -webkit-touch-callout: none;
}
.tcard::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: linear-gradient(var(--dc1), var(--dc2)); }
@media (hover: hover) { .tcard:hover { transform: translateY(-3px); box-shadow: var(--glow); } }
.tcard.over { box-shadow: 0 0 0 1.5px rgba(239, 68, 68, .55), 0 6px 18px rgba(239, 68, 68, .18); }
.tcard.over::after { content: attr(data-over); position: absolute; top: 0; right: 0; font-size: .66rem; font-weight: 600; color: #fff; background: var(--bad); padding: 1px 8px; border-bottom-left-radius: 9px; }
.tcard .cover { margin: -13px -13px 10px -16px; height: 110px; background-size: cover; background-position: center; border-bottom: 1px solid var(--glass-border); }
.tcard h4 { margin: 0 0 8px; font-size: .93rem; font-weight: 500; line-height: 1.4; }
.tcard .meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tcard .foot { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: .78rem; color: var(--muted); }
.tcard .foot .ic { display: inline-flex; align-items: center; gap: 3px; }
.tcard .foot svg { width: 14px; height: 14px; }
.tcard .bar { height: 5px; margin-top: 10px; }
.tcard.drag-source { opacity: .25; transform: scale(.97); }
.drag-ghost { position: fixed !important; z-index: 1000; pointer-events: none; margin: 0; cursor: grabbing; box-shadow: var(--shadow-lg), var(--glow) !important; transition: none !important; }
.drop-ph { border-radius: 16px; border: 2px dashed rgba(139, 92, 246, .5); background: rgba(139, 92, 246, .08); transition: height .2s var(--ease); flex: none; }
body.dragging, body.dragging * { cursor: grabbing !important; user-select: none; }

/* ---------- Timeline / Gantt ---------- */
.gantt { overflow: hidden; padding: 0; }
.gantt-scroll { overflow: auto; max-height: calc(100vh - 230px); position: relative; }
.gantt-grid { display: grid; position: relative; }
.g-head { position: sticky; top: 0; z-index: 5; background: var(--solid); backdrop-filter: blur(16px); }
.g-left { position: sticky; left: 0; z-index: 4; background: var(--solid); backdrop-filter: blur(16px); border-right: 1px solid var(--hairline); }
.g-corner { position: sticky; left: 0; top: 0; z-index: 6; background: var(--solid); border-right: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline); padding: 10px 14px; font-weight: 600; display: flex; align-items: flex-end; }
.g-months, .g-days { display: flex; }
.g-month { font-size: .78rem; font-weight: 600; padding: 6px 8px 2px; border-left: 1px solid var(--hairline); color: var(--text-2); white-space: nowrap; overflow: hidden; }
.g-day { flex: none; text-align: center; font-size: .7rem; color: var(--muted); padding: 2px 0 6px; border-bottom: 1px solid var(--hairline); line-height: 1.25; }
.g-day b { display: block; font-size: .8rem; color: var(--text-2); font-weight: 500; }
.g-day.we { background: var(--hairline); }
.g-day.today b { background: var(--accent-grad); color: #fff; border-radius: 8px; width: 24px; margin: 0 auto; }
.g-group { padding: 8px 14px; font-weight: 600; font-size: .85rem; display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--hairline); }
.g-row-label { height: 46px; display: flex; align-items: center; gap: 10px; padding: 0 14px; border-bottom: 1px solid var(--hairline); cursor: pointer; min-width: 0; }
.g-row-label:hover { background: var(--glass); }
.g-row-label .t { font-size: .86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.g-row-label .s { font-size: .74rem; color: var(--muted); }
.g-track { height: 46px; position: relative; border-bottom: 1px solid var(--hairline); }
.g-track.grp { height: auto; }
.g-bg { position: absolute; inset: 0; display: flex; pointer-events: none; }
.g-bg span { flex: none; height: 100%; border-left: 1px solid transparent; }
.g-bg span.we { background: var(--hairline); }
.g-bar {
  position: absolute; top: 9px; height: 28px; border-radius: 9px; cursor: pointer; overflow: hidden; display: flex; align-items: center;
  background: linear-gradient(90deg, var(--dc1), var(--dc2)); color: #fff; font-size: .74rem; font-weight: 500; padding: 0 9px; white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .15); transform-origin: left center; animation: growX .9s var(--ease) both; transition: filter .2s, transform .2s;
}
.g-bar:hover { filter: brightness(1.1) saturate(1.1); transform: translateY(-1px); }
.g-bar .pf { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(255, 255, 255, .28); }
.g-bar span { position: relative; text-shadow: 0 1px 2px rgba(0, 0, 0, .3); overflow: hidden; text-overflow: ellipsis; }
.g-bar.done { opacity: .55; }
.g-bar.over { box-shadow: 0 0 0 2px var(--bad), 0 4px 14px rgba(239, 68, 68, .35); }
.g-bar.over::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(135deg, transparent 0 8px, rgba(239, 68, 68, .35) 8px 12px); }
@keyframes growX { from { transform: scaleX(0); opacity: 0; } }
.g-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--accent-2); z-index: 3; pointer-events: none; box-shadow: 0 0 10px var(--accent-2); }

/* ---------- Calendar ---------- */
.cal-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.cal-head h3 { margin: 0; font-size: 1.15rem; font-weight: 600; min-width: 160px; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal .wd { text-align: center; font-size: .8rem; color: var(--muted); padding: 4px 0; font-weight: 500; }
.cal .day { min-height: 112px; padding: 6px; border-radius: 14px; background: var(--glass-2); border: 1px solid transparent; display: flex; flex-direction: column; gap: 3px; cursor: pointer; transition: background .2s, border-color .2s, transform .25s var(--ease); min-width: 0; }
.cal .day:hover { background: var(--glass-strong); border-color: var(--glass-border); transform: translateY(-2px); }
.cal .day.other { opacity: .45; }
.cal .day.we { background: var(--glass); }
.cal .day .n { font-size: .82rem; font-weight: 500; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 9px; }
.cal .day.today .n { background: var(--accent-grad); color: #fff; }
.cal .day.sel { border-color: var(--accent); }
.ev { font-size: .72rem; padding: 2px 7px; border-radius: 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #fff; background: linear-gradient(90deg, var(--dc1), var(--dc2)); cursor: pointer; }
.ev.meet { background: var(--glass-strong); color: var(--text); border-left: 3px solid var(--accent); }
.ev.over { background: var(--bad); }
.ev.done { opacity: .5; text-decoration: line-through; }
.ev-more { font-size: .72rem; color: var(--muted); padding-left: 4px; }
.cal-dots { display: none; gap: 3px; flex-wrap: wrap; }
.cal-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--dc1, var(--accent)); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .8rem; color: var(--text-2); align-items: center; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 11px; height: 11px; border-radius: 4px; display: inline-block; background: var(--c); }

/* ---------- Team cards ---------- */
.team-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.member { display: flex; flex-direction: column; gap: 12px; }
.member .top { display: flex; gap: 12px; align-items: center; }
.member .top .name { font-weight: 600; } .member .top .ttl { font-size: .8rem; color: var(--muted); }
.member .nums { display: flex; gap: 8px; }
.member .nums div { flex: 1; text-align: center; background: var(--glass-2); border-radius: 12px; padding: 6px 0; }
.member .nums b { display: block; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.member .nums small { font-size: .72rem; color: var(--muted); }
.member .cur { display: flex; flex-direction: column; gap: 4px; font-size: .82rem; }
.member .cur a { color: var(--text-2); display: flex; gap: 6px; align-items: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.member .cur a:hover { color: var(--accent); }
.member.away { opacity: .72; }
.summary-pills { display: flex; flex-wrap: wrap; gap: 10px; }
.summary-pills .load-tag { font-size: .85rem; padding: 6px 14px; }

/* ---------- KPI ---------- */
.rank-table { width: 100%; border-collapse: separate; border-spacing: 0 6px; font-size: .9rem; }
.rank-table th { text-align: left; font-weight: 500; color: var(--muted); font-size: .8rem; padding: 4px 10px; white-space: nowrap; }
.rank-table td { padding: 10px; background: var(--glass-2); vertical-align: middle; }
.rank-table tr td:first-child { border-radius: 12px 0 0 12px; } .rank-table tr td:last-child { border-radius: 0 12px 12px 0; }
.rank-table tbody tr { cursor: pointer; transition: transform .25s var(--ease); }
.rank-table tbody tr:hover td { background: var(--glass-strong); }
.rank-table tbody tr.sel td { background: var(--glass-strong); box-shadow: inset 0 0 0 1px var(--accent); }
.rank-table .num { font-variant-numeric: tabular-nums; text-align: right; }
.medal { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .85rem; background: var(--glass); }
.medal.m1 { background: linear-gradient(135deg, #fde68a, #f59e0b); color: #78350f; }
.medal.m2 { background: linear-gradient(135deg, #e5e7eb, #9ca3af); color: #1f2937; }
.medal.m3 { background: linear-gradient(135deg, #fed7aa, #c2410c); color: #fff; }
.who { display: flex; align-items: center; gap: 10px; min-width: 170px; }
.who b { font-weight: 500; display: block; } .who small { color: var(--muted); font-size: .76rem; }
.mini-bar { display: flex; align-items: center; gap: 8px; min-width: 110px; }
.mini-bar .bar { flex: 1; }
.table-wrap { overflow-x: auto; }

/* ---------- Charts ---------- */
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .axis text { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart .gridline { stroke: var(--grid); stroke-width: 1; }
.chart .baseline { stroke: var(--muted); stroke-opacity: .4; }
.chart .line { fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.chart .draw { animation: draw 1.6s var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.chart .area { opacity: 0; animation: fadeIn 1s .6s forwards; }
.chart .grow-y { transform-box: fill-box; transform-origin: bottom; animation: growY .9s var(--ease) both; }
@keyframes growY { from { transform: scaleY(0); } }
.chart .grow-x { transform-box: fill-box; transform-origin: left; animation: growXc .9s var(--ease) both; }
@keyframes growXc { from { transform: scaleX(0); } }
@keyframes fadeIn { to { opacity: 1; } }
.chart .dot-m { stroke: var(--glass-strong); stroke-width: 2; opacity: 0; animation: fadeIn .4s forwards; }
.chart .hit { fill: transparent; cursor: pointer; }
.chart .crosshair { stroke: var(--muted); stroke-dasharray: 3 3; opacity: 0; transition: opacity .15s; pointer-events: none; }
.chart .lbl { fill: var(--text-2); font-size: 11px; font-family: var(--font); font-weight: 500; }
.chart .mark:hover { filter: brightness(1.08); }
.donut-wrap { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; justify-content: center; }
.donut { position: relative; width: 180px; height: 180px; flex: none; }
.donut svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.donut circle.seg { fill: none; stroke-width: 22; transition: stroke-dasharray 1.3s var(--ease), stroke-width .2s; cursor: pointer; }
.donut circle.seg:hover { stroke-width: 26; }
.donut .center { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; pointer-events: none; }
.donut .center b { font-size: 1.9rem; font-weight: 600; display: block; line-height: 1.1; }
.donut .center small { color: var(--muted); font-size: .8rem; }
.dlegend { display: flex; flex-direction: column; gap: 8px; min-width: 150px; }
.dlegend div { display: flex; align-items: center; gap: 10px; font-size: .88rem; }
.dlegend i { width: 12px; height: 12px; border-radius: 4px; background: var(--c); }
.dlegend b { margin-left: auto; font-variant-numeric: tabular-nums; }
#tooltip { position: fixed; z-index: 2000; pointer-events: none; opacity: 0; transform: translateY(4px); transition: opacity .15s, transform .15s; background: var(--glass-strong); backdrop-filter: blur(16px); border: 1px solid var(--glass-border); border-radius: 12px; padding: 8px 12px; font-size: .82rem; box-shadow: var(--shadow-lg); max-width: 260px; }
#tooltip.show { opacity: 1; transform: none; }
#tooltip .tt-h { font-weight: 600; margin-bottom: 4px; }
#tooltip .tt-r { display: flex; align-items: center; gap: 8px; } #tooltip .tt-r i { width: 10px; height: 3px; border-radius: 2px; background: var(--c); } #tooltip .tt-r b { margin-left: auto; padding-left: 12px; }

/* ---------- Dept workspace hero ---------- */
.hero { position: relative; overflow: hidden; padding: 26px; margin-bottom: 18px; display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.hero::before { content: ''; position: absolute; inset: 0; background: linear-gradient(120deg, var(--dc1), var(--dc2)); opacity: .22; z-index: -1; }
.hero::after { content: ''; position: absolute; width: 280px; height: 280px; border-radius: 50%; right: -60px; top: -120px; background: var(--dc2); filter: blur(50px); opacity: .35; z-index: -1; }
.hero .hico { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--dc1), var(--dc2)); box-shadow: 0 10px 26px rgba(0, 0, 0, .18); }
.hero .hico svg { width: 30px; height: 30px; }
.hero h2 { margin: 0; font-size: 1.5rem; font-weight: 600; }
.hero p { margin: 2px 0 0; color: var(--text-2); }
.hero .hstats { margin-left: auto; display: flex; gap: 22px; }
.hero .hstats div { text-align: center; } .hero .hstats b { display: block; font-size: 1.6rem; font-weight: 600; } .hero .hstats small { color: var(--text-2); font-size: .8rem; }
.tabs { margin-bottom: 18px; }

/* ---------- Files ---------- */
.files-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.fcard { border-radius: 16px; overflow: hidden; background: var(--glass-strong); border: 1px solid var(--glass-border); cursor: pointer; transition: transform .3s var(--ease), box-shadow .3s; display: flex; flex-direction: column; position: relative; }
.fcard:hover { transform: translateY(-4px); box-shadow: var(--glow); }
.fcard .thumb { aspect-ratio: 4/3; display: grid; place-items: center; background: var(--glass-2); position: relative; overflow: hidden; }
.fcard .thumb img, .fcard .thumb video { width: 100%; height: 100%; object-fit: cover; }
.fcard .thumb .ficon { width: 54px; height: 54px; border-radius: 14px; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: .78rem; letter-spacing: .5px; }
.fcard .thumb .play { position: absolute; width: 46px; height: 46px; border-radius: 50%; background: rgba(0, 0, 0, .45); display: grid; place-items: center; color: #fff; backdrop-filter: blur(6px); }
.fcard .info { padding: 9px 11px; font-size: .8rem; min-width: 0; }
.fcard .info b { display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .84rem; }
.fcard .info small { color: var(--muted); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fcard .del { position: absolute; top: 6px; right: 6px; opacity: 0; transition: opacity .2s; background: rgba(0, 0, 0, .5); color: #fff; border: 0; border-radius: 8px; width: 28px; height: 28px; display: grid; place-items: center; cursor: pointer; }
.fcard:hover .del { opacity: 1; }
.dropzone { border: 2px dashed var(--glass-border); border-radius: 16px; padding: 18px; text-align: center; color: var(--muted); font-size: .88rem; transition: border-color .2s, background .2s; cursor: pointer; }
.dropzone.over, .dropzone:hover { border-color: var(--accent); background: rgba(139, 92, 246, .08); color: var(--text); }
.upload-item { display: flex; align-items: center; gap: 10px; font-size: .84rem; }
.upload-item .bar { flex: 1; }

/* ---------- Modal / Drawer ---------- */
.overlay { position: fixed; inset: 0; z-index: 100; background: rgba(15, 10, 40, .35); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); display: grid; place-items: center; padding: 20px; animation: fadeIn .25s both; opacity: 0; }
.overlay.closing { animation: fadeOut .2s both; }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }
.modal { width: min(640px, 100%); max-height: calc(100vh - 40px); overflow: auto; padding: 24px; background: var(--glass-strong); animation: modalIn .45s var(--ease) both; }
.modal.wide { width: min(980px, 100%); }
.overlay.closing .modal { animation: modalOut .2s both; }
@keyframes modalIn { from { opacity: 0; transform: translateY(24px) scale(.96); } }
@keyframes modalOut { to { opacity: 0; transform: translateY(12px) scale(.98); } }
.modal-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 18px; }
.modal-head h2 { margin: 0; font-size: 1.25rem; font-weight: 600; flex: 1; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; flex-wrap: wrap; }
.overlay.drawer { place-items: stretch end; padding: 0; }
.overlay.drawer .modal { width: min(720px, 100%); max-height: 100vh; height: 100vh; border-radius: 24px 0 0 24px; animation: drawerIn .5s var(--ease) both; }
.overlay.drawer.closing .modal { animation: drawerOut .22s ease-in both; }
@keyframes drawerIn { from { transform: translateX(60px); opacity: 0; } }
@keyframes drawerOut { to { transform: translateX(60px); opacity: 0; } }

.task-title-input { font-size: 1.3rem; font-weight: 600; border: 0; background: transparent; width: 100%; padding: 4px 0; outline: none; border-bottom: 2px solid transparent; transition: border-color .2s; }
.task-title-input:focus { border-color: var(--accent); }
.meta-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 16px; margin: 14px 0; }
.section { margin-top: 22px; }
.section h3 { font-size: .95rem; margin: 0 0 10px; display: flex; align-items: center; gap: 8px; font-weight: 600; }
.section h3 .n { color: var(--muted); font-weight: 400; }
.range { -webkit-appearance: none; appearance: none; width: 100%; height: 8px; border-radius: 8px; background: linear-gradient(90deg, #8b5cf6 0, #ec4899 var(--p), var(--hairline) var(--p)); outline: none; }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 2px 10px rgba(124, 58, 237, .5); cursor: pointer; border: 3px solid #a855f7; }
.range::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 3px solid #a855f7; cursor: pointer; }
.progress-row { display: flex; gap: 14px; align-items: center; }
.progress-row b { min-width: 48px; text-align: right; font-variant-numeric: tabular-nums; font-size: 1.1rem; }
.comments { display: flex; flex-direction: column; gap: 12px; }
.cmt { display: flex; gap: 10px; animation: rise .4s var(--ease) both; }
.cmt .bubble { background: var(--glass-2); border: 1px solid var(--glass-border); padding: 9px 13px; border-radius: 4px 14px 14px 14px; flex: 1; min-width: 0; }
.cmt .bubble .h { font-size: .8rem; color: var(--muted); display: flex; gap: 8px; }
.cmt .bubble .h b { color: var(--text); font-weight: 500; }
.cmt .bubble p { margin: 2px 0 0; white-space: pre-wrap; word-break: break-word; }
.cmt-form { display: flex; gap: 10px; margin-top: 12px; align-items: flex-end; }
.cmt-form textarea { min-height: 44px; height: 44px; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.media-video { grid-column: 1 / -1; border-radius: 14px; overflow: hidden; background: #000; position: relative; }
.media-video video { width: 100%; max-height: 380px; display: block; }
.media-video .cap { position: absolute; left: 0; right: 0; top: 0; padding: 8px 12px; font-size: .8rem; color: #fff; background: linear-gradient(rgba(0, 0, 0, .55), transparent); display: flex; gap: 8px; align-items: center; pointer-events: none; }
.media-video .cap a, .media-video .cap button { pointer-events: auto; }

.assignee-list { display: flex; flex-direction: column; gap: 8px; max-height: 300px; overflow-y: auto; padding: 2px; }
.assignee { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 14px; background: var(--glass-2); border: 1.5px solid transparent; cursor: pointer; transition: border-color .2s, background .2s, transform .2s var(--ease); }
.assignee:hover { background: var(--glass-strong); transform: translateX(2px); }
.assignee.sel { border-color: var(--accent); background: var(--glass-strong); box-shadow: 0 0 0 4px rgba(139, 92, 246, .14); }
.assignee input { display: none; }
.assignee .grow { flex: 1; min-width: 0; }
.assignee .grow b { font-weight: 500; font-size: .9rem; } .assignee .grow small { color: var(--muted); font-size: .76rem; display: block; }
.assignee .lb { width: 90px; }
.assignee .best { font-size: .68rem; background: var(--ok-bg); color: var(--ok); padding: 0 7px; border-radius: 99px; font-weight: 600; margin-left: 6px; }
.check-list { display: flex; flex-direction: column; gap: 6px; max-height: 260px; overflow-y: auto; }
.check-item { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 12px; cursor: pointer; background: var(--glass-2); transition: background .2s; }
.check-item:hover { background: var(--glass-strong); }
.check-item input { width: 18px; height: 18px; accent-color: #8b5cf6; }
.check-group { font-size: .78rem; color: var(--muted); margin: 8px 0 2px; font-weight: 600; }

/* lightbox */
.lightbox { position: fixed; inset: 0; z-index: 300; background: rgba(5, 3, 20, .85); backdrop-filter: blur(10px); display: flex; flex-direction: column; animation: fadeIn .25s both; opacity: 0; }
.lightbox .lb-bar { display: flex; align-items: center; gap: 10px; padding: 14px 18px; color: #fff; }
.lightbox .lb-bar .btn { color: #fff; background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .2); }
.lightbox .lb-body { flex: 1; display: grid; place-items: center; padding: 0 18px 18px; min-height: 0; }
.lightbox img, .lightbox video { max-width: 100%; max-height: calc(100vh - 100px); border-radius: 12px; box-shadow: 0 30px 80px rgba(0, 0, 0, .6); animation: modalIn .4s var(--ease) both; }
.lightbox iframe { width: min(1000px, 100%); height: calc(100vh - 100px); border: 0; border-radius: 12px; background: #fff; }

/* ---------- Meetings ---------- */
.meet { display: flex; gap: 16px; align-items: flex-start; }
.meet .date { width: 64px; flex: none; text-align: center; border-radius: 16px; padding: 8px 0; background: var(--accent-grad); color: #fff; box-shadow: 0 8px 20px rgba(168, 85, 247, .3); }
.meet .date b { display: block; font-size: 1.5rem; line-height: 1.1; } .meet .date small { font-size: .74rem; opacity: .9; }
.meet .body { flex: 1; min-width: 0; }
.meet h4 { margin: 0 0 4px; font-size: 1.02rem; font-weight: 600; }
.meet .info { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .84rem; color: var(--text-2); margin-bottom: 8px; }
.meet .info span { display: inline-flex; align-items: center; gap: 5px; } .meet .info svg { width: 15px; height: 15px; }
.meet .agenda { font-size: .85rem; color: var(--text-2); white-space: pre-wrap; background: var(--glass-2); padding: 8px 12px; border-radius: 12px; margin: 8px 0; }
.meet .att { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.att-chip { display: inline-flex; align-items: center; gap: 6px; font-size: .76rem; padding: 2px 9px 2px 3px; border-radius: 99px; background: var(--glass-2); }
.att-chip.accepted { box-shadow: inset 0 0 0 1.5px var(--ok); } .att-chip.declined { opacity: .55; text-decoration: line-through; } .att-chip.pending { outline: 1.5px dashed var(--muted); outline-offset: -1.5px; }
.att-chip .r { font-size: .7rem; }
.rsvp { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; align-items: center; }
.meet.past { opacity: .6; }

/* ---------- Notifications ---------- */
.popover { position: absolute; right: 0; top: calc(100% + 10px); width: min(380px, calc(100vw - 24px)); max-height: 480px; overflow: auto; padding: 10px; z-index: 50; background: var(--glass-strong); animation: modalIn .3s var(--ease) both; }
.popover .ph { display: flex; align-items: center; padding: 6px 8px 10px; font-weight: 600; }
.popover .ph button { margin-left: auto; }
.notif { display: flex; gap: 10px; padding: 10px; border-radius: 12px; cursor: pointer; transition: background .2s; }
.notif:hover { background: var(--glass); }
.notif.unread { background: rgba(139, 92, 246, .1); }
.notif .ni { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; color: #fff; flex: none; background: var(--c, var(--accent-grad)); }
.notif .ni svg { width: 17px; height: 17px; }
.notif b { font-weight: 500; font-size: .88rem; display: block; } .notif small { color: var(--muted); font-size: .78rem; display: block; }
.notif .tm { font-size: .72rem; color: var(--muted); }
.menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 200px; padding: 6px; z-index: 50; background: var(--glass-strong); animation: modalIn .3s var(--ease) both; }
.menu button { display: flex; width: 100%; gap: 10px; align-items: center; padding: 9px 12px; border: 0; background: transparent; border-radius: 10px; cursor: pointer; text-align: left; font-size: .9rem; }
.menu button:hover { background: var(--glass); }
.rel { position: relative; }

/* ---------- Toast ---------- */
#toasts { position: fixed; right: 20px; bottom: 20px; z-index: 500; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
.toast { padding: 12px 16px; border-radius: 14px; background: var(--glass-strong); border: 1px solid var(--glass-border); backdrop-filter: blur(16px); box-shadow: var(--shadow-lg); display: flex; gap: 10px; align-items: center; max-width: 380px; font-size: .9rem; animation: toastIn .45s var(--ease) both; cursor: pointer; }
.toast.out { animation: toastOut .3s ease-in both; }
.toast .ti { width: 26px; height: 26px; border-radius: 9px; display: grid; place-items: center; color: #fff; flex: none; }
.toast .ti svg { width: 15px; height: 15px; }
.toast.ok .ti { background: #10b981; } .toast.err .ti { background: #ef4444; } .toast.info .ti { background: var(--accent-grad); }
@keyframes toastIn { from { opacity: 0; transform: translateX(40px) scale(.95); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(40px); } }

/* ---------- Login ---------- */
.role-badge { font-size: .68rem; padding: 0 7px; border-radius: 99px; font-weight: 600; }
.role-admin { background: rgba(124, 58, 237, .18); color: var(--accent); }
.role-supervisor { background: rgba(14, 165, 233, .18); color: #0284c7; }
.role-staff { background: rgba(100, 116, 139, .18); color: var(--muted); }
:root[data-theme="dark"] .role-supervisor { color: #7dd3fc; }

.boot { min-height: 100vh; display: grid; place-items: center; }
.spinner { width: 44px; height: 44px; border-radius: 50%; border: 4px solid rgba(255, 255, 255, .4); border-top-color: #8b5cf6; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, var(--glass-2), var(--glass-strong), var(--glass-2)); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 14px; min-height: 120px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.mobile-backdrop { display: none; }
.hide-sm { }
.muted { color: var(--muted); }
.mt { margin-top: 18px; }
.flex { display: flex; align-items: center; gap: 10px; }
.wrap { flex-wrap: wrap; }

