/* ==========================================================================
   Meeting Management System — design system
   Light + dark themes, Inter typeface, 8px spacing rhythm
   ========================================================================== */
:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #eef2f7;
  --border: #e5e9f0;
  --border-strong: #d3dae5;
  --text: #0f172a;
  --text-2: #334155;
  --muted: #64748b;
  --primary: #3b5bdb;
  --primary-600: #3049c2;
  --primary-soft: #edf1ff;
  --primary-text: #3049c2;
  --success: #0f9d6b; --success-soft: #e6f7f0; --success-text: #0a7a53;
  --warning: #d48806; --warning-soft: #fff6e5; --warning-text: #9a6100;
  --danger: #e0412f;  --danger-soft: #fdeeec;  --danger-text: #b92f20;
  --info: #1c7ed6;    --info-soft: #e8f3fd;    --info-text: #1864ab;
  --violet: #7048e8;  --violet-soft: #f1ecfe;
  --teal: #0ca678;    --teal-soft: #e4f8f1;
  --sidebar: #0c1222;
  --sidebar-2: #151d33;
  --sidebar-text: #a5b0c8;
  --sidebar-active: rgba(99, 125, 255, .16);
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow: 0 1px 3px rgba(15, 23, 42, .06), 0 1px 2px rgba(15, 23, 42, .04);
  --shadow-lg: 0 12px 32px -8px rgba(15, 23, 42, .18), 0 4px 10px -4px rgba(15, 23, 42, .08);
  --ring: 0 0 0 3px rgba(59, 91, 219, .18);
  --hero: linear-gradient(120deg, #2a3fa8 0%, #3b5bdb 45%, #6d5ae6 100%);
  color-scheme: light;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0f1c; --surface: #111827; --surface-2: #151e30; --surface-3: #1b2639;
    --border: #222e44; --border-strong: #2f3d58;
    --text: #e7ecf5; --text-2: #c2cbdc; --muted: #8b97ae;
    --primary: #6b8cff; --primary-600: #5a7bf0; --primary-soft: rgba(107, 140, 255, .14); --primary-text: #9fb4ff;
    --success: #34c38f; --success-soft: rgba(52, 195, 143, .14); --success-text: #5fd8aa;
    --warning: #f0b33a; --warning-soft: rgba(240, 179, 58, .14); --warning-text: #f5c76b;
    --danger: #f26b5b;  --danger-soft: rgba(242, 107, 91, .14);  --danger-text: #ff8f81;
    --info: #4dabf7;    --info-soft: rgba(77, 171, 247, .14);    --info-text: #7cc1fa;
    --violet: #9775fa;  --violet-soft: rgba(151, 117, 250, .15);
    --teal: #38d9a9;    --teal-soft: rgba(56, 217, 169, .14);
    --sidebar: #070b15; --sidebar-2: #0f1626;
    --shadow: 0 1px 3px rgba(0, 0, 0, .4); --shadow-lg: 0 16px 40px -10px rgba(0, 0, 0, .6);
    --hero: linear-gradient(120deg, #1d2a6b 0%, #2c44a8 50%, #4b3bb0 100%);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0a0f1c; --surface: #111827; --surface-2: #151e30; --surface-3: #1b2639;
  --border: #222e44; --border-strong: #2f3d58;
  --text: #e7ecf5; --text-2: #c2cbdc; --muted: #8b97ae;
  --primary: #6b8cff; --primary-600: #5a7bf0; --primary-soft: rgba(107, 140, 255, .14); --primary-text: #9fb4ff;
  --success: #34c38f; --success-soft: rgba(52, 195, 143, .14); --success-text: #5fd8aa;
  --warning: #f0b33a; --warning-soft: rgba(240, 179, 58, .14); --warning-text: #f5c76b;
  --danger: #f26b5b;  --danger-soft: rgba(242, 107, 91, .14);  --danger-text: #ff8f81;
  --info: #4dabf7;    --info-soft: rgba(77, 171, 247, .14);    --info-text: #7cc1fa;
  --violet: #9775fa;  --violet-soft: rgba(151, 117, 250, .15);
  --teal: #38d9a9;    --teal-soft: rgba(56, 217, 169, .14);
  --sidebar: #070b15; --sidebar-2: #0f1626;
  --shadow: 0 1px 3px rgba(0, 0, 0, .4); --shadow-lg: 0 16px 40px -10px rgba(0, 0, 0, .6);
  --hero: linear-gradient(120deg, #1d2a6b 0%, #2c44a8 50%, #4b3bb0 100%);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.55; -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss01"; }
a { color: var(--primary-text); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.6rem; margin: 0; line-height: 1.2; letter-spacing: -.02em; font-weight: 700; }
h2 { font-size: 1rem; margin: 0 0 12px; font-weight: 650; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; }
p { margin: 6px 0 10px; }
.icon { flex-shrink: 0; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.prewrap { white-space: pre-wrap; }
.text-danger { color: var(--danger-text); }
.text-accent { color: var(--primary-text); font-weight: 500; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .72rem; font-weight: 600; color: var(--muted); margin: 0 0 4px; }
.strong-link { color: var(--text); font-weight: 600; }
.strong-link:hover { color: var(--primary-text); }
::selection { background: var(--primary-soft); }

/* ---------- Layout ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 256px; background: linear-gradient(180deg, var(--sidebar) 0%, var(--sidebar-2) 100%); color: var(--sidebar-text);
  position: fixed; inset: 0 auto 0 0; padding: 18px 14px 14px; overflow-y: auto; overflow-x: hidden; z-index: 40;
  display: flex; flex-direction: column; transition: transform .22s ease; border-right: 1px solid rgba(255, 255, 255, .04);
}
.brand { display: flex; gap: 11px; align-items: center; padding: 4px 8px 18px; color: #fff; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 10px; color: #fff; display: grid; place-items: center; flex-shrink: 0;
  background: linear-gradient(135deg, #5c7cfa, #7048e8); box-shadow: 0 6px 16px -4px rgba(92, 124, 250, .6);
}
.brand-name { font-weight: 650; line-height: 1.25; font-size: .95rem; }
.brand-sub { font-size: .74rem; color: var(--sidebar-text); }
.sidebar-cta { margin: 0 4px 14px; width: auto; }
.nav { display: flex; flex-direction: column; gap: 1px; flex: 1; }
.nav a {
  display: flex; gap: 11px; align-items: center; padding: 8px 12px; border-radius: 8px;
  color: var(--sidebar-text); font-weight: 500; font-size: .9rem; position: relative;
}
.nav a .icon { width: 18px; height: 18px; opacity: .85; }
.nav a:hover { background: rgba(255, 255, 255, .05); color: #fff; text-decoration: none; }
.nav a.active { background: var(--sidebar-active); color: #fff; }
.nav a.active::before { content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: #748ffc; }
.nav a.active .icon { color: #91a7ff; opacity: 1; }
.nav-section { text-transform: uppercase; font-size: .68rem; letter-spacing: .09em; padding: 16px 12px 6px; color: #5f6b85; font-weight: 600; }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 10px; margin-top: 12px; border-radius: 10px; background: rgba(255, 255, 255, .04); color: #fff; }
.sidebar-user:hover { background: rgba(255, 255, 255, .08); text-decoration: none; }
.su-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.su-text strong { font-size: .86rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.su-text small { color: var(--sidebar-text); font-size: .74rem; }

.main { flex: 1; margin-left: 256px; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 14px; padding: 10px 32px; position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--surface) 82%, transparent); backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.search {
  display: flex; align-items: center; gap: 8px; flex: 1; max-width: 440px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 10px; padding: 0 12px; color: var(--muted); transition: border-color .15s, box-shadow .15s;
}
.search:focus-within { border-color: var(--primary); box-shadow: var(--ring); }
.search input { border: 0; background: transparent; padding: 8px 0; width: 100%; outline: none; font: inherit; color: var(--text); box-shadow: none; }
.search input:focus { box-shadow: none; outline: none; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.today-label { color: var(--muted); font-size: .84rem; margin-right: 8px; }
.content { padding: 28px 32px 56px; width: 100%; }
.icon-btn.menu-btn { display: none; }
.sidebar-backdrop { display: none; }

.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; border: 0;
  background: transparent; color: var(--muted); cursor: pointer; position: relative; transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); text-decoration: none; }
.icon-btn.danger:hover { background: var(--danger-soft); color: var(--danger-text); }
.theme-sun { display: none; }
:root[data-theme="dark"] .theme-sun { display: inline; }
:root[data-theme="dark"] .theme-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-sun { display: inline; }
  :root:not([data-theme="light"]) .theme-moon { display: none; }
}
.bell .dot {
  position: absolute; top: 3px; right: 2px; background: var(--danger); color: #fff; font-size: .62rem;
  font-weight: 700; border-radius: 10px; padding: 0 5px; line-height: 16px; min-width: 16px; text-align: center;
  box-shadow: 0 0 0 2px var(--surface);
}

.user-menu, .dropdown { position: relative; }
.user-menu summary, .dropdown summary { list-style: none; cursor: pointer; }
.user-menu summary::-webkit-details-marker, .dropdown summary::-webkit-details-marker { display: none; }
.user-menu summary { display: flex; align-items: center; gap: 4px; padding: 3px 6px 3px 3px; border-radius: 22px; color: var(--muted); }
.user-menu summary:hover { background: var(--surface-3); }
.menu {
  position: absolute; right: 0; top: calc(100% + 8px); background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg); min-width: 240px; padding: 6px; z-index: 50;
  animation: pop .14s ease-out;
}
@keyframes pop { from { opacity: 0; transform: translateY(-4px); } }
.menu-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: 4px; display: flex; flex-direction: column; }
.menu-head span { font-size: .78rem; color: var(--muted); }
.menu a, .menu button {
  display: flex; gap: 9px; align-items: center; width: 100%; padding: 8px 10px; border-radius: 7px; border: 0;
  background: none; color: var(--text); font: inherit; cursor: pointer; text-align: left;
}
.menu a:hover, .menu button:hover { background: var(--surface-3); text-decoration: none; }
.dropdown .menu { left: 0; right: auto; }

.avatar {
  --h: 225; width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0; display: inline-grid; place-items: center;
  font-size: .74rem; font-weight: 650; letter-spacing: .02em;
  background: hsl(var(--h) 70% 92%); color: hsl(var(--h) 55% 32%);
}
:root[data-theme="dark"] .avatar { background: hsl(var(--h) 40% 24%); color: hsl(var(--h) 80% 82%); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .avatar { background: hsl(var(--h) 40% 24%); color: hsl(var(--h) 80% 82%); } }
.avatar.sm { width: 26px; height: 26px; font-size: .64rem; }
.avatar-stack { display: inline-flex; }
.avatar-stack .avatar { box-shadow: 0 0 0 2px var(--surface); margin-left: -3px; }
.avatar-stack .avatar:first-child { margin-left: 0; }
.avatar.more { background: var(--surface-3); color: var(--muted); }

/* ---------- Generic components ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head p { margin: 6px 0 0; }
.back-link { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: .85rem; margin-bottom: 10px; font-weight: 500; }
.back-link:hover { color: var(--text); text-decoration: none; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px 22px; box-shadow: var(--shadow); margin-bottom: 20px;
}
.card.flush { padding: 0; overflow: hidden; }
.card.narrow { max-width: 680px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h2 { margin: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; align-items: start; }
.grid-main { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 0 20px; align-items: start; }
.empty { color: var(--muted); padding: 28px 8px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.empty .icon { opacity: .45; }
.empty p { margin: 4px 0; }
.empty.compact { padding: 18px 8px; }
.link { font-size: .84rem; font-weight: 550; display: inline-flex; align-items: center; gap: 4px; }
.plain-list { list-style: none; margin: 0; padding: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 15px;
  border-radius: 9px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font: inherit; font-weight: 550; cursor: pointer; white-space: nowrap; line-height: 1.25; box-shadow: var(--shadow-sm);
  transition: background .15s, border-color .15s, box-shadow .15s, transform .05s;
}
.btn:hover { background: var(--surface-2); border-color: var(--muted); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn-sm { padding: 6px 11px; font-size: .83rem; border-radius: 8px; }
.btn-lg { padding: 10px 20px; font-size: .95rem; }
.btn-block { width: 100%; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 1px 2px rgba(59, 91, 219, .3), inset 0 1px 0 rgba(255, 255, 255, .12); }
.btn-primary:hover { background: var(--primary-600); border-color: var(--primary-600); }
.btn-success { background: var(--success); border-color: var(--success); color: #fff; }
.btn-success:hover { background: var(--success); filter: brightness(.94); border-color: var(--success); }
.btn-warning { background: var(--warning-soft); border-color: var(--warning); color: var(--warning-text); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-ghost-danger, .btn-danger-outline { color: var(--danger-text); border-color: color-mix(in srgb, var(--danger) 35%, transparent); background: transparent; }
.btn-ghost-danger:hover, .btn-danger-outline:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn-white { background: #fff; color: #1e2b6f; border-color: #fff; }
.btn-white:hover { background: #eef1ff; border-color: #eef1ff; }
.btn-light { background: rgba(255, 255, 255, .14); color: #fff; border-color: rgba(255, 255, 255, .25); box-shadow: none; }
.btn-light:hover { background: rgba(255, 255, 255, .24); border-color: rgba(255, 255, 255, .4); }
.btn-group { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.link-btn { background: none; border: 0; color: var(--primary-text); cursor: pointer; padding: 0; font: inherit; font-size: .82rem; font-weight: 550; }
.link-btn:hover { text-decoration: underline; }

.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 20px; font-size: .73rem; font-weight: 600;
  background: var(--surface-3); color: var(--text-2); white-space: nowrap; line-height: 1.6;
}
.bdot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-type { background: var(--primary-soft); color: var(--primary-text); }
.badge-scheduled { background: var(--info-soft); color: var(--info-text); }
.badge-in_progress { background: var(--warning-soft); color: var(--warning-text); }
.badge-in_progress .bdot { animation: pulse 1.4s infinite; }
.badge-completed { background: var(--success-soft); color: var(--success-text); }
.badge-cancelled { background: var(--surface-3); color: var(--muted); text-decoration: line-through; }
.badge-overdue { background: var(--danger-soft); color: var(--danger-text); }
.rsvp-accepted, .action-done, .att-present, .minutes-approved, .outcome-carried { background: var(--success-soft); color: var(--success-text); }
.rsvp-tentative, .action-in_progress, .att-excused, .minutes-submitted, .outcome-deferred { background: var(--warning-soft); color: var(--warning-text); }
.rsvp-declined, .att-absent, .outcome-defeated { background: var(--danger-soft); color: var(--danger-text); }
.rsvp-pending, .att-unknown, .minutes-draft { background: var(--surface-3); color: var(--text-2); }
.action-open, .outcome-noted { background: var(--info-soft); color: var(--info-text); }
.role-admin { background: var(--violet-soft); color: var(--violet); }
.role-organizer { background: var(--primary-soft); color: var(--primary-text); }
.role-secretary { background: var(--warning-soft); color: var(--warning-text); }
@keyframes pulse { 50% { opacity: .3; } }

.type-chip, .aud-chip {
  --c: #868e96; display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 20px;
  font-size: .74rem; font-weight: 600; white-space: nowrap; line-height: 1.6;
  background: color-mix(in srgb, var(--c) 13%, transparent); color: color-mix(in srgb, var(--c) 75%, var(--text));
}
.tdot { width: 8px; height: 8px; border-radius: 3px; background: var(--c); flex-shrink: 0; }

.flashes { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.flash {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 14px; border-radius: 10px;
  border: 1px solid transparent; background: var(--surface); box-shadow: var(--shadow); animation: pop .2s ease-out;
}
.flash-msg { flex: 1; }
.flash-icon { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0; }
.flash-success { border-color: color-mix(in srgb, var(--success) 30%, transparent); }
.flash-success .flash-icon { background: var(--success-soft); color: var(--success-text); }
.flash-error { border-color: color-mix(in srgb, var(--danger) 35%, transparent); }
.flash-error .flash-icon { background: var(--danger-soft); color: var(--danger-text); }
.flash-warning { border-color: color-mix(in srgb, var(--warning) 35%, transparent); }
.flash-warning .flash-icon { background: var(--warning-soft); color: var(--warning-text); }
.flash-info { border-color: color-mix(in srgb, var(--info) 30%, transparent); }
.flash-info .flash-icon { background: var(--info-soft); color: var(--info-text); }
.flash-close { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 4px; border-radius: 6px; display: grid; }
.flash-close:hover { background: var(--surface-3); }

/* ---------- Forms ---------- */
.form { display: flex; flex-direction: column; gap: 16px; }
.form label, .field { display: flex; flex-direction: column; gap: 6px; font-weight: 550; font-size: .86rem; color: var(--text-2); }
.field-label { font-weight: 550; font-size: .86rem; }
.label-hint { font-weight: 400; color: var(--muted); font-size: .78rem; }
input, select, textarea {
  font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-radius: 9px;
  padding: 9px 11px; width: 100%; font-weight: 400; font-size: .9rem; transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--primary); }
textarea { resize: vertical; line-height: 1.55; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
select { appearance: none; padding-right: 32px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; }
.select-sm, .att-select, .status-select { width: auto; padding: 5px 30px 5px 10px; font-size: .83rem; border-radius: 8px; }
.att-select.att-present { border-color: color-mix(in srgb, var(--success) 50%, transparent); color: var(--success-text); }
.att-select.att-absent { border-color: color-mix(in srgb, var(--danger) 50%, transparent); color: var(--danger-text); }
.att-select.att-excused { border-color: color-mix(in srgb, var(--warning) 50%, transparent); color: var(--warning-text); }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.row-3 { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 14px; }
.row-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 2px; }
.form-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 0 20px; align-items: start; }
.form-grid .form-actions { grid-column: 1 / -1; }
.form-grid .card { display: flex; flex-direction: column; gap: 16px; }
.form-grid .card h2, .form-grid .card .card-head { margin: 0; }
.form-col { min-width: 0; }
.sticky-card { position: sticky; top: 76px; }
.sticky-actions {
  position: sticky; bottom: 0; z-index: 5; padding: 14px 18px; margin: 0 -4px; border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(8px);
  border: 1px solid var(--border); box-shadow: var(--shadow-lg);
}
.section-title { display: flex; align-items: center; gap: 10px; }
.section-title h2 { margin: 0; }
.step { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: .78rem; font-weight: 700; background: var(--primary-soft); color: var(--primary-text); }
.inline-form { display: inline-flex; gap: 6px; align-items: center; }
.toolbar-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filters select { width: auto; }
.input-icon { position: relative; display: flex; align-items: center; flex: 1; min-width: 220px; }
.input-icon .icon { position: absolute; left: 11px; color: var(--muted); pointer-events: none; }
.input-icon input { padding-left: 34px; }
.date-input { width: auto; }
.radio { flex-direction: row !important; align-items: flex-start; gap: 9px !important; font-weight: 400 !important; cursor: pointer; }
.radio input { margin-top: 3px; }

/* Segmented control */
.seg { display: inline-flex; background: var(--surface-3); border-radius: 10px; padding: 3px; gap: 2px; }
.seg a, .seg button {
  padding: 6px 13px; border-radius: 8px; color: var(--muted); font-weight: 550; font-size: .84rem; border: 0; background: none;
  cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font-family: inherit; white-space: nowrap;
}
.seg a:hover, .seg button:hover { color: var(--text); text-decoration: none; }
.seg .active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.seg-lg a { padding: 7px 15px; }
.tabs-inline { display: flex; gap: 4px; margin-bottom: 12px; flex-wrap: wrap; }
.tabs-inline a { padding: 7px 14px; border-radius: 8px; color: var(--muted); font-weight: 550; }
.tabs-inline a.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); border: 1px solid var(--border); }
.tabs-inline a:hover { text-decoration: none; color: var(--text); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.chip {
  padding: 5px 12px; border-radius: 20px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2);
  font-size: .8rem; font-weight: 550; cursor: pointer; font-family: inherit; display: inline-flex; align-items: center; gap: 6px;
}
.chip:hover { border-color: var(--primary); color: var(--primary-text); text-decoration: none; }
.chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ---------- Participant picker ---------- */
.picker { display: flex; flex-direction: column; gap: 10px; }
.picker .seg { width: 100%; }
.picker .seg button { flex: 1; justify-content: center; }
.picker-summary { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: .86rem; color: var(--text-2); flex-wrap: wrap; }
.picker-summary strong { color: var(--primary-text); font-size: 1rem; }
.picker-links { display: flex; gap: 14px; }
.chip-tray { display: flex; flex-wrap: wrap; gap: 5px; max-height: 92px; overflow-y: auto; }
.chip-tray:empty { display: none; }
.tray-chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 4px 2px 10px; border-radius: 20px; font-size: .76rem; font-weight: 550;
  background: var(--primary-soft); color: var(--primary-text); border: 0; cursor: pointer; font-family: inherit;
}
.tray-chip:hover { background: var(--danger-soft); color: var(--danger-text); }
.tray-chip .x { width: 16px; height: 16px; display: grid; place-items: center; border-radius: 50%; font-size: .9rem; line-height: 1; }
.picker-pane { display: none; flex-direction: column; gap: 8px; }
.picker-pane.active { display: flex; }
.hint { color: var(--muted); font-size: .8rem; margin: 0; }
.people-list { display: flex; flex-direction: column; max-height: 380px; overflow-y: auto; border: 1px solid var(--border); border-radius: 10px; padding: 4px; }
.person {
  display: flex !important; flex-direction: row !important; align-items: center; gap: 10px !important; padding: 7px 9px;
  border-radius: 8px; cursor: pointer; font-weight: 400 !important; color: var(--text) !important; transition: background .12s;
}
.person:hover { background: var(--surface-2); }
.person:has(input:checked) { background: var(--primary-soft); }
.person.locked { opacity: .6; cursor: default; }
.person-text { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; flex: 1; }
.person-text strong { font-weight: 550; font-size: .88rem; }
.person-text small { color: var(--muted); font-size: .76rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-cell { display: flex; align-items: center; gap: 10px; }
.unit-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; max-height: 380px; overflow-y: auto; }
.unit {
  --c: var(--primary); display: flex !important; flex-direction: row !important; align-items: center; gap: 10px !important; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 10px; cursor: pointer; font-weight: 400 !important; color: var(--text) !important;
  transition: border-color .15s, background .15s; position: relative;
}
.unit:hover { border-color: var(--border-strong); background: var(--surface-2); }
.unit input { position: absolute; opacity: 0; pointer-events: none; }
.unit:has(input:checked) { border-color: var(--c); background: color-mix(in srgb, var(--c) 8%, var(--surface)); box-shadow: 0 0 0 1px var(--c); }
.unit:has(input:focus-visible) { box-shadow: var(--ring); }
.unit.empty-unit { opacity: .5; cursor: not-allowed; }
.unit-icon { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-3); color: var(--muted); flex-shrink: 0; }
.unit-icon.colored { background: color-mix(in srgb, var(--c) 14%, transparent); color: var(--c); }
.unit-text { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; flex: 1; }
.unit-text strong { font-weight: 600; font-size: .88rem; }
.unit-text small { color: var(--muted); font-size: .75rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.unit-check { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--border-strong); display: grid; place-items: center; color: transparent; flex-shrink: 0; }
.unit:has(input:checked) .unit-check { background: var(--c); border-color: var(--c); color: #fff; }

/* ---------- Recurrence builder ---------- */
.recur { border: 1px dashed var(--border-strong); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 14px; background: var(--surface-2); }
.recur-head { display: flex; gap: 12px; align-items: flex-start; }
.recur-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--violet-soft); color: var(--violet); flex-shrink: 0; }
.preset-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.preview { border: 1px solid var(--border); border-radius: 10px; background: var(--surface); overflow: hidden; }
.preview-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.preview-dates { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; padding: 10px; max-height: 260px; overflow-y: auto; }
.pv-date { display: flex; align-items: center; gap: 8px; padding: 6px 9px; border-radius: 8px; background: var(--surface-2); font-size: .8rem; border: 1px solid transparent; }
.pv-date .n { font-size: .7rem; color: var(--muted); min-width: 18px; }
.pv-date.weekend { border-color: color-mix(in srgb, var(--warning) 35%, transparent); }
.pv-date.clash { background: var(--danger-soft); color: var(--danger-text); border-color: color-mix(in srgb, var(--danger) 35%, transparent); text-decoration: line-through; }
.scope-box { border: 1px solid var(--border); background: var(--surface-2); border-radius: 10px; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.scope-box strong { display: flex; align-items: center; gap: 7px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; padding: 11px 16px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.row-link { cursor: pointer; transition: background .12s; }
.row-link:hover td { background: var(--surface-2); }
.done-row td { opacity: .55; }
.title-cell { --c: var(--primary); display: flex; gap: 12px; align-items: stretch; }
.tbar { width: 3px; border-radius: 3px; background: var(--c); flex-shrink: 0; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: 4px 0 20px; overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: 11px 14px; color: var(--muted); font-weight: 550; border-bottom: 2px solid transparent; white-space: nowrap; margin-bottom: -1px; display: inline-flex; align-items: center; gap: 6px; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.active { color: var(--primary-text); border-bottom-color: var(--primary); }
.count { background: var(--surface-3); color: var(--text-2); font-size: .7rem; padding: 1px 7px; border-radius: 10px; font-weight: 600; }
.count-approved { background: var(--success-soft); color: var(--success-text); }
.count-submitted { background: var(--warning-soft); color: var(--warning-text); }
.tab-panel { display: none; animation: fade .18s ease-out; }
.tab-panel.active { display: block; }
@keyframes fade { from { opacity: 0; } }

/* ---------- Dashboard ---------- */
.hero {
  background: var(--hero); color: #fff; border-radius: 16px; padding: 28px 30px; margin-bottom: 20px;
  display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; position: relative; overflow: hidden;
  box-shadow: 0 18px 40px -18px rgba(59, 91, 219, .65);
}
.hero::after { content: ""; position: absolute; right: -60px; top: -80px; width: 280px; height: 280px; border-radius: 50%; background: rgba(255, 255, 255, .07); }
.hero::before { content: ""; position: absolute; right: 120px; bottom: -120px; width: 220px; height: 220px; border-radius: 50%; background: rgba(255, 255, 255, .05); }
.hero .eyebrow { color: rgba(255, 255, 255, .7); }
.hero h1 { font-size: 1.85rem; }
.hero-sub { color: rgba(255, 255, 255, .85); margin: 8px 0 0; }
.hero-sub .text-danger { color: #ffc9c2; }
.hero-actions { display: flex; gap: 8px; position: relative; z-index: 1; flex-wrap: wrap; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow);
  display: flex; gap: 14px; align-items: center; color: var(--text); transition: border-color .15s, transform .15s, box-shadow .15s;
}
a.stat:hover { border-color: var(--border-strong); text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.stat-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; }
.si-blue { background: var(--primary-soft); color: var(--primary-text); }
.si-violet { background: var(--violet-soft); color: var(--violet); }
.si-teal { background: var(--teal-soft); color: var(--teal); }
.si-amber { background: var(--warning-soft); color: var(--warning-text); }
.si-red { background: var(--danger-soft); color: var(--danger-text); }
.stat-body { display: flex; flex-direction: column; min-width: 0; }
.stat-value { font-size: 1.6rem; font-weight: 700; line-height: 1.15; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat-label { color: var(--muted); font-size: .8rem; }
.attention { border-left: 3px solid var(--warning); }
.attention-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); flex-wrap: wrap; }
.attention-row:first-child { border-top: 0; padding-top: 0; }

.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.timeline li { display: grid; grid-template-columns: 54px 1fr; gap: 12px; align-items: stretch; }
.timeline li.past { opacity: .55; }
.tl-time { display: flex; flex-direction: column; font-size: .8rem; color: var(--muted); padding-top: 8px; font-variant-numeric: tabular-nums; }
.tl-time strong { color: var(--text); font-size: .9rem; }
.tl-card { --c: var(--primary); display: block; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--border); border-left: 3px solid var(--c); background: color-mix(in srgb, var(--c) 5%, var(--surface)); color: var(--text); }
.tl-card:hover { text-decoration: none; border-color: var(--border-strong); border-left-color: var(--c); }
.timeline li.live .tl-card { box-shadow: 0 0 0 1px var(--c), 0 8px 20px -10px var(--c); }
.tl-title { font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tl-meta { display: flex; gap: 12px; color: var(--muted); font-size: .8rem; margin-top: 2px; flex-wrap: wrap; }
.tl-meta span, .mi-meta span { display: inline-flex; align-items: center; gap: 4px; }
.live-pill { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; background: var(--danger); color: #fff; padding: 1px 7px; border-radius: 10px; }

.meeting-list { list-style: none; margin: 0 -8px; padding: 0; }
.meeting-item { display: flex; align-items: center; gap: 14px; padding: 10px 8px; border-radius: 10px; color: var(--text); }
.meeting-item:hover { background: var(--surface-2); text-decoration: none; }
.date-chip { --c: var(--primary); width: 46px; text-align: center; border-radius: 10px; overflow: hidden; flex-shrink: 0; background: color-mix(in srgb, var(--c) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--c) 25%, transparent); }
.dc-mon { display: block; font-size: .64rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding-top: 4px; color: var(--c); }
.dc-day { display: block; font-size: 1.15rem; font-weight: 700; padding-bottom: 3px; line-height: 1.2; }
.mi-body { flex: 1; min-width: 0; }
.mi-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mi-meta { color: var(--muted); font-size: .8rem; display: flex; gap: 12px; flex-wrap: wrap; margin-top: 2px; }
.rel { color: var(--primary-text); font-weight: 550; }
.task-list { list-style: none; margin: 0; padding: 0; }
.task-list li { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--border); }
.task-list li:first-child { border-top: 0; padding-top: 2px; }
.task-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; background: var(--info); }
.task-dot.in_progress { background: var(--warning); }
.task-dot.overdue { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.task-dot.done { background: var(--success); }
.task-main { flex: 1; min-width: 0; }
.task-title { font-weight: 550; }
.quick-links { display: flex; flex-direction: column; gap: 2px; }
.quick-links a { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 10px; color: var(--text); margin: 0 -10px; }
.quick-links a:hover { background: var(--surface-2); text-decoration: none; }
.quick-links a > .icon:first-child { color: var(--primary-text); }
.quick-links span { flex: 1; display: flex; flex-direction: column; line-height: 1.3; }
.quick-links strong { font-weight: 600; font-size: .9rem; }
.quick-links small { color: var(--muted); font-size: .78rem; }
.quick-links a > .icon:last-child { color: var(--muted); }

/* ---------- Meeting detail ---------- */
.meeting-header { --c: var(--primary); position: relative; overflow: hidden; padding-top: 24px; }
.meeting-header::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: linear-gradient(90deg, var(--c), color-mix(in srgb, var(--c) 40%, #fff)); }
.mh-top { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.mh-main { flex: 1; min-width: 280px; }
.mh-main h1 { margin: 10px 0 0; }
.mh-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.mh-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--muted); margin-top: 10px; font-size: .88rem; }
.mh-meta span { display: inline-flex; gap: 6px; align-items: center; }
.audience { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 12px; }
.aud-chip { --c: var(--primary); }
.mh-side { display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.mh-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.stepper { list-style: none; display: flex; margin: 22px 0 0; padding: 16px 0 0; border-top: 1px solid var(--border); gap: 0; counter-reset: s; overflow-x: auto; }
.stepper li { flex: 1; display: flex; align-items: center; gap: 8px; font-size: .8rem; color: var(--muted); font-weight: 550; white-space: nowrap; position: relative; min-width: 110px; }
.stepper li:not(:last-child)::after { content: ""; flex: 1; height: 2px; background: var(--border); margin: 0 10px; border-radius: 2px; }
.stepper li.done { color: var(--text); }
.stepper li.done:not(:last-child)::after { background: var(--success); }
.st-dot { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: .7rem; font-weight: 700; background: var(--surface-3); color: var(--muted); flex-shrink: 0; }
.stepper li.done .st-dot { background: var(--success); color: #fff; }
.rsvp-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 22px; flex-wrap: wrap; background: var(--primary-soft); border-color: color-mix(in srgb, var(--primary) 25%, transparent); }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 10px 20px; margin: 12px 0 0; }
.facts dt { color: var(--muted); font-size: .86rem; }
.facts dd { margin: 0; }
.mini-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.mini-stats div { background: var(--surface-2); border-radius: 10px; padding: 10px 6px; text-align: center; font-size: .74rem; color: var(--muted); border: 1px solid var(--border); }
.mini-stats span { display: block; font-size: 1.35rem; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.mini-stats .ms-ok span { color: var(--success-text); }
.mini-stats .ms-warn span { color: var(--warning-text); }
.mini-stats .ms-bad span { color: var(--danger-text); }
.stack-bar { display: flex; height: 8px; border-radius: 6px; overflow: hidden; background: var(--surface-3); margin-bottom: 14px; }
.sb-ok { background: var(--success); } .sb-warn { background: var(--warning); } .sb-bad { background: var(--danger); }
.quorum { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 9px; font-weight: 600; font-size: .84rem; }
.quorum.ok { background: var(--success-soft); color: var(--success-text); }
.quorum.no { background: var(--danger-soft); color: var(--danger-text); }
.glance { list-style: none; margin: 0; padding: 0; }
.glance li a { display: flex; align-items: center; gap: 10px; padding: 8px 0; color: var(--text-2); border-top: 1px solid var(--border); }
.glance li:first-child a { border-top: 0; }
.glance li a .icon { color: var(--muted); }
.glance li a:hover { color: var(--primary-text); text-decoration: none; }
.series-strip { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.series-item { display: flex; flex-direction: column; align-items: center; min-width: 46px; padding: 6px 4px; border-radius: 9px; border: 1px solid var(--border); color: var(--text); background: var(--surface); }
.series-item:hover { border-color: var(--primary); text-decoration: none; }
.series-item.past { opacity: .6; }
.series-item.current { background: var(--primary); border-color: var(--primary); color: #fff; opacity: 1; }
.series-item.st-cancelled .si-day { text-decoration: line-through; }
.si-mon { font-size: .62rem; text-transform: uppercase; font-weight: 700; letter-spacing: .05em; opacity: .8; }
.si-day { font-weight: 700; font-size: .95rem; }
.arising { border-left: 3px solid var(--violet); }
.agenda { list-style: none; margin: 0; padding: 0; }
.agenda li { display: flex; gap: 14px; padding: 14px 0; border-top: 1px solid var(--border); align-items: flex-start; }
.agenda li:first-child { border-top: 0; padding-top: 4px; }
.agenda-num { width: 30px; height: 30px; border-radius: 9px; background: var(--primary-soft); color: var(--primary-text); display: grid; place-items: center; font-weight: 700; flex-shrink: 0; font-size: .85rem; }
.agenda-body { flex: 1; min-width: 0; }
.agenda-body p { margin: 2px 0; }
.agenda-meta { display: flex; gap: 14px; color: var(--muted); font-size: .8rem; margin-top: 3px; }
.agenda-meta span { display: inline-flex; align-items: center; gap: 4px; }
.agenda-tools { display: flex; gap: 2px; }
.minutes-editor { min-height: 320px; }
.minutes-view { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 18px 20px; line-height: 1.7; }
.decision-list { margin: 0; padding: 0; list-style: none; }
.decision-list li { display: flex; gap: 14px; align-items: flex-start; padding: 14px 0; border-top: 1px solid var(--border); }
.decision-list li:first-child { border-top: 0; padding-top: 4px; }
.dec-num { width: 28px; height: 28px; border-radius: 8px; background: var(--violet-soft); color: var(--violet); display: grid; place-items: center; font-weight: 700; font-size: .82rem; flex-shrink: 0; }
.dec-body { flex: 1; min-width: 0; }
.dec-text { font-weight: 550; }
.dec-meta { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; color: var(--muted); font-size: .8rem; margin-top: 5px; }
.dec-meta span:not(.badge) { display: inline-flex; align-items: center; gap: 4px; }
.votes { margin-top: 10px; max-width: 420px; }
.vote-bar { display: flex; height: 8px; border-radius: 6px; overflow: hidden; background: var(--surface-3); gap: 2px; }
.v-for { background: var(--success); } .v-against { background: var(--danger); } .v-abstain { background: var(--muted); opacity: .5; }
.vote-legend { display: flex; gap: 14px; font-size: .76rem; margin-top: 5px; font-weight: 550; }
.lg-for { color: var(--success-text); } .lg-against { color: var(--danger-text); } .lg-abstain { color: var(--muted); }
.file-list { list-style: none; margin: 0 0 16px; padding: 0; }
.file-list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); }
.file-list li:first-child { border-top: 0; }
.file-icon { width: 40px; height: 40px; border-radius: 9px; background: var(--primary-soft); color: var(--primary-text); display: grid; place-items: center; font-size: .64rem; font-weight: 800; letter-spacing: .04em; flex-shrink: 0; }
.file-info { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.file-info a { font-weight: 550; color: var(--text); }
.upload-form { display: flex; gap: 10px; align-items: stretch; flex-wrap: wrap; }
.dropzone {
  flex: 1; min-width: 240px; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1.5px dashed var(--border-strong);
  border-radius: 10px; cursor: pointer; color: var(--muted); background: var(--surface-2); font-weight: 400;
}
.dropzone:hover { border-color: var(--primary); color: var(--primary-text); }
.dropzone span { display: flex; flex-direction: column; color: var(--text-2); font-size: .86rem; }
.dropzone input { width: auto; border: 0; padding: 0; background: none; font-size: .8rem; margin-left: auto; max-width: 220px; }
.danger-zone {
  margin-top: 24px; padding: 16px 20px; border: 1px solid color-mix(in srgb, var(--danger) 25%, var(--border)); border-radius: var(--radius);
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; background: color-mix(in srgb, var(--danger) 3%, var(--surface));
}

/* ---------- Calendar ---------- */
.cal-nav { display: flex; align-items: center; gap: 8px; }
.cal-nav h1 { min-width: 210px; text-align: center; }
.calendar { margin-bottom: 14px; }
.cal-head, .cal-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-head div { padding: 10px; text-align: center; font-size: .72rem; font-weight: 600; color: var(--muted); background: var(--surface-2); border-bottom: 1px solid var(--border); text-transform: uppercase; letter-spacing: .06em; }
.cal-day { min-height: 118px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 6px; display: flex; flex-direction: column; gap: 3px; min-width: 0; transition: background .12s; }
.cal-week:last-child .cal-day { border-bottom: 0; }
.cal-day:nth-child(7n) { border-right: 0; }
.cal-day:hover { background: var(--surface-2); }
.cal-day.wkend { background: color-mix(in srgb, var(--surface-2) 60%, var(--surface)); }
.cal-day.other { background: var(--surface-2); }
.cal-day.other .cal-num { color: color-mix(in srgb, var(--muted) 55%, transparent); }
.cal-day-head { display: flex; justify-content: space-between; align-items: center; }
.cal-num { font-size: .82rem; font-weight: 600; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; }
.cal-day.today .cal-num { background: var(--primary); color: #fff; }
.cal-add { opacity: 0; color: var(--muted); padding: 3px; border-radius: 6px; display: grid; }
.cal-add:hover { background: var(--surface-3); color: var(--primary-text); }
.cal-day:hover .cal-add { opacity: 1; }
.cal-event {
  --c: var(--primary); display: block; font-size: .74rem; padding: 3px 7px; border-radius: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: color-mix(in srgb, var(--c) 13%, var(--surface)); color: color-mix(in srgb, var(--c) 70%, var(--text)); border-left: 3px solid var(--c); font-weight: 500;
}
.cal-event:hover { text-decoration: none; background: color-mix(in srgb, var(--c) 22%, var(--surface)); }
.cal-event.st-cancelled { text-decoration: line-through; opacity: .55; }
.ev-time { font-weight: 700; }
.legend { display: flex; flex-wrap: wrap; gap: 8px; }
.legend-item { --c: var(--muted); display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 9px; color: var(--text-2); font-size: .84rem; border: 1px solid transparent; }
.legend-item:hover { background: var(--surface-2); text-decoration: none; }
.legend-item.active { border-color: var(--border-strong); background: var(--surface-2); color: var(--text); }
.legend-item strong { font-variant-numeric: tabular-nums; }
.legend-item.plain { padding: 2px 6px; color: var(--muted); }
.legend-card { padding: 10px 12px; }

/* ---------- Annual planner ---------- */
.year-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.month-card { margin: 0; padding: 16px 16px 12px; display: flex; flex-direction: column; }
.month-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.month-head a { color: var(--text); }
.month-head h2 { margin: 0; font-size: .98rem; }
.mini-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; text-align: center; }
.mc-h { font-size: .64rem; color: var(--muted); font-weight: 600; padding-bottom: 2px; }
.mc-d { --c: var(--primary); font-size: .76rem; height: 28px; display: grid; place-items: center; border-radius: 7px; color: var(--text-2); position: relative; font-variant-numeric: tabular-nums; }
.mc-d.wkend { color: var(--muted); }
.mc-d.out { visibility: hidden; }
.mc-d.today { box-shadow: inset 0 0 0 1.5px var(--primary); font-weight: 700; }
.mc-d.has { background: var(--c); color: #fff; font-weight: 700; }
.mc-d.has:hover { text-decoration: none; filter: brightness(1.1); transform: scale(1.08); }
.mc-d i { position: absolute; top: -4px; right: -4px; font-style: normal; font-size: .58rem; background: var(--text); color: var(--surface); border-radius: 8px; min-width: 14px; height: 14px; line-height: 14px; padding: 0 3px; }
.month-list { list-style: none; margin: 10px 0 0; padding: 10px 0 0; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 2px; }
.month-list a { --c: var(--primary); display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 6px; color: var(--text-2); font-size: .8rem; }
.month-list a:hover { background: var(--surface-2); text-decoration: none; }
.month-list .cancelled a { text-decoration: line-through; opacity: .55; }
.ml-day { font-weight: 700; min-width: 24px; padding: 0 4px; border-radius: 5px; text-align: center; background: color-mix(in srgb, var(--c) 15%, transparent); color: color-mix(in srgb, var(--c) 75%, var(--text)); font-size: .74rem; }
.ml-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.month-list .icon { color: var(--muted); }
.month-list .more a { color: var(--primary-text); font-weight: 550; }

/* ---------- Groups ---------- */
.group-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.group-card { --c: var(--primary); margin: 0; display: flex; flex-direction: column; gap: 10px; border-top: 3px solid var(--c); }
.group-card p { margin: 0; }
.group-top { display: flex; gap: 12px; align-items: center; }
.group-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 14%, transparent); color: var(--c); flex-shrink: 0; }
.group-title h2 { margin: 0; }
.group-names { line-height: 1.5; }
.group-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.group-foot > span:first-child { display: inline-flex; align-items: center; gap: 5px; }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch { cursor: pointer; flex-direction: row !important; }
.swatch input { position: absolute; opacity: 0; }
.swatch span { width: 30px; height: 30px; border-radius: 50%; background: var(--c); display: block; box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px transparent; transition: box-shadow .15s; }
.swatch input:checked + span { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--c); }
.swatch input:focus-visible + span { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--primary); }

/* ---------- Rooms ---------- */
.room-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 0 18px; }
.booking-list { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.booking-list li { --c: var(--primary); display: flex; gap: 12px; padding: 8px 10px; font-size: .86rem; border-radius: 8px; background: color-mix(in srgb, var(--c) 7%, var(--surface)); border-left: 3px solid var(--c); }
.booking-list li.free { color: var(--success-text); font-weight: 550; background: var(--success-soft); border-left-color: var(--success); }
.room-edit { margin-top: 14px; }
.room-edit summary { cursor: pointer; color: var(--primary-text); font-size: .84rem; margin-bottom: 10px; font-weight: 550; }

/* ---------- Notifications ---------- */
.notif-list { list-style: none; margin: 0; padding: 0; }
.notif-list a { display: flex; gap: 12px; align-items: center; padding: 12px 10px; border-bottom: 1px solid var(--border); color: var(--muted); border-radius: 8px; }
.notif-list li:last-child a { border-bottom: 0; }
.notif-list a:hover { background: var(--surface-2); text-decoration: none; }
.notif-msg { flex: 1; color: var(--text-2); }
.notif-list li.unread a { color: var(--primary-text); }
.notif-list li.unread .notif-msg { font-weight: 600; color: var(--text); }

/* ---------- Reports ---------- */
.bar-chart { display: flex; align-items: flex-end; gap: 8px; height: 210px; padding-top: 18px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 5px; }
.bar { width: 100%; max-width: 28px; background: linear-gradient(180deg, var(--primary), color-mix(in srgb, var(--primary) 65%, var(--violet))); border-radius: 6px 6px 2px 2px; min-height: 3px; }
.bar-val { font-size: .72rem; color: var(--muted); font-weight: 600; }
.bar-label { font-size: .7rem; color: var(--muted); }
.hbars { display: flex; flex-direction: column; gap: 12px; }
.hbar-row { display: grid; grid-template-columns: 150px 1fr 30px; gap: 10px; align-items: center; font-size: .86rem; }
.hbar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-track { background: var(--surface-3); border-radius: 6px; height: 10px; }
.hbar { height: 100%; background: var(--primary); border-radius: 6px; }
.hbar-val { text-align: right; font-weight: 650; }
.rate { font-weight: 700; }
.rate.good { color: var(--success-text); } .rate.mid { color: var(--warning-text); } .rate.bad { color: var(--danger-text); }

/* ---------- Admin ---------- */
.dept-list { list-style: none; margin: 0 0 12px; padding: 0; }
.dept-row { display: flex; gap: 10px; align-items: center; padding: 6px 0; }
.dept-row input { flex: 1; }
.dept-row.add { border-top: 1px solid var(--border); padding-top: 14px; }
.profile-head { display: flex; gap: 14px; align-items: center; margin-bottom: 12px; }
.profile-head .avatar { width: 56px; height: 56px; font-size: 1.1rem; }
.profile-head h2 { margin: 0; }

/* ---------- Sign-in & errors ---------- */
.auth { display: grid; grid-template-columns: 1.1fr 1fr; min-height: 100vh; }
.auth-hero { background: var(--hero); color: #fff; padding: 44px 52px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-hero::after { content: ""; position: absolute; width: 520px; height: 520px; border-radius: 50%; right: -180px; bottom: -200px; background: rgba(255, 255, 255, .06); }
.auth-brand { display: flex; align-items: center; gap: 12px; font-weight: 650; font-size: 1.05rem; }
.auth-copy { max-width: 470px; position: relative; z-index: 1; }
.auth-copy h1 { font-size: 2.4rem; line-height: 1.12; letter-spacing: -.03em; }
.auth-copy p { color: rgba(255, 255, 255, .82); font-size: 1.02rem; margin: 16px 0 26px; }
.auth-points { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.auth-points li { display: flex; align-items: center; gap: 12px; color: rgba(255, 255, 255, .92); }
.auth-points .icon { padding: 7px; width: 32px; height: 32px; border-radius: 9px; background: rgba(255, 255, 255, .14); }
.auth-foot { color: rgba(255, 255, 255, .55); font-size: .8rem; }
.auth-panel { display: grid; place-items: center; padding: 32px 20px; background: var(--surface); }
.auth-card { width: 100%; max-width: 380px; }
.auth-card h2 { font-size: 1.55rem; margin: 0; letter-spacing: -.02em; }
.auth-card > .muted { margin: 6px 0 22px; }
.auth-card .flash { margin-bottom: 14px; }
.demo-box { margin-top: 22px; border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; font-size: .8rem; color: var(--muted); background: var(--surface-2); }
.demo-box summary { cursor: pointer; font-weight: 600; color: var(--text-2); }
.demo-box table { width: 100%; margin-top: 8px; border-collapse: collapse; }
.demo-box td { padding: 3px 6px 3px 0; }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--hero); }
.error-state { background: var(--surface); border-radius: 16px; padding: 44px; max-width: 480px; margin: 40px auto; box-shadow: var(--shadow-lg); }
.error-code { font-size: 3.8rem; font-weight: 800; line-height: 1; letter-spacing: -.04em; background: var(--hero); -webkit-background-clip: text; background-clip: text; color: transparent; }
.error-state h1 { margin: 12px 0 16px; font-size: 1.3rem; color: var(--text); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .grid-2, .form-grid, .grid-main { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .sticky-card { position: static; }
}
@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .auth-hero { padding: 28px 22px; gap: 24px; }
  .auth-copy h1 { font-size: 1.7rem; }
  .auth-points, .auth-foot { display: none; }
}
@media (max-width: 800px) {
  .sidebar { transform: translateX(-100%); }
  body.nav-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  body.nav-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(2, 6, 23, .5); z-index: 35; }
  .main { margin-left: 0; }
  .icon-btn.menu-btn { display: inline-grid; }
  .topbar { padding: 8px 16px; gap: 8px; }
  .content { padding: 18px 16px 48px; }
  .hide-sm { display: none !important; }
  .row-2, .row-3 { grid-template-columns: 1fr; }
  .row-4 { grid-template-columns: 1fr 1fr; }
  .hero { padding: 22px 20px; }
  .hero h1 { font-size: 1.45rem; }
  .stats { gap: 10px; }
  .stat { padding: 12px; gap: 10px; }
  .stat-icon { width: 36px; height: 36px; }
  .stat-value { font-size: 1.3rem; }
  .cal-day { min-height: 76px; padding: 3px; }
  .cal-event .ev-time { display: none; }
  .cal-event { font-size: .66rem; padding: 1px 4px; }
  .cal-nav h1 { min-width: 0; font-size: 1.2rem; }
  .mini-stats { grid-template-columns: repeat(2, 1fr); }
  .hbar-row { grid-template-columns: 100px 1fr 26px; }
  .facts { grid-template-columns: 1fr; gap: 2px; }
  .facts dd { margin-bottom: 8px; }
  .mh-side { align-items: flex-start; }
  .mh-actions { justify-content: flex-start; }
  .seg-lg { overflow-x: auto; max-width: 100%; }
  .sticky-actions { margin: 0; }
  .year-grid, .group-grid, .room-grid { grid-template-columns: 1fr; }
}
