/* Unified service workspace: Geist typography, neutral surfaces, semantic accents. */
:root {
  --ink:#171717; --muted:#616161; --line:#e5e7eb; --line-strong:#cbd0d8;
  --blue:#171717; --blue-dark:#333; --pale:#f5f6f8; --mint:#edf9f1;
  --surface:#fff; --canvas:#fafafa;
  --shadow-sm:0 1px 2px #00000004; --shadow-md:0 8px 24px #00000008;
}
html,body { background:var(--canvas); color:var(--ink); }
body { font-size:14px; }
.shell { max-width:1440px; padding:0 32px 48px; }
.topbar { padding:24px 0 0; margin-bottom:32px; background:transparent; border:0; border-bottom:1px solid var(--line); border-radius:0; box-shadow:none; }
.brand-mark { width:36px; height:36px; border-radius:9px; background:#171717; box-shadow:none; }
.brand h1 { font-size:18px; font-weight:600; letter-spacing:-.04em; }
.eyebrow { color:var(--muted); font-size:10px; letter-spacing:.1em; }
.account-box { top:22px; right:0; }
.account-box .institution-clock { color:var(--muted); font-variant-numeric:tabular-nums; }
.account-logout { background:#fff; border:1px solid var(--line); color:#525252; }
.nav { gap:24px; padding:0; scrollbar-width:thin; }
.nav button { border-radius:0; padding:13px 2px; border-bottom:2px solid transparent; color:#616161; background:transparent; }
.nav button:hover { color:#171717; background:transparent; }
.nav button.active { background:transparent; color:#171717; border-bottom-color:#171717; box-shadow:none; }
.nav button.referral-alert { color:#b42318; }
.nav button:focus-visible { outline-offset:-3px; }
.panel,.panel-lite,.side,.chat,.channel-card,.qr-panel,.calendar-stat,.referral-card {
  background:#fff; border:1px solid var(--line); border-radius:10px; box-shadow:var(--shadow-sm);
}
.admin-head,.calendar-page-head,.referrals-head { align-items:center; }
.admin-head p,.calendar-page-head p,.referrals-head p { max-width:760px; color:var(--muted); }
.primary,.send,.review-referral { background:#171717; color:#fff; border:1px solid #171717; border-radius:7px; font-weight:500; box-shadow:0 1px 2px #0000000a; }
.primary:hover,.send:hover,.review-referral:hover { background:#333; border-color:#333; }
button:focus-visible,a:focus-visible,summary:focus-visible { outline:2px solid #0070f3; outline-offset:3px; }
input:not([type=checkbox]):not([type=radio]),select,textarea { border:1px solid var(--line-strong); border-radius:7px; background:#fff; color:#171717; box-shadow:0 1px 2px #00000003; }
input:focus,select:focus,textarea:focus,.category-settings input:focus { border-color:#0070f3; box-shadow:0 0 0 3px #0070f31a; }
input::placeholder,textarea::placeholder { color:#737373; }
label,.field > label,.account-edit-grid label { color:#404040; font-weight:500; }
button,input,select,textarea { max-width:100%; }
input[type=checkbox],input[type=radio] { accent-color:#171717; }
.hint,.muted,.user-intro,.side-copy { color:var(--muted); }
.editor-row,.account-edit-form,.user-row { background:#fff; border:1px solid var(--line); border-radius:8px; }
.account-edit-form { background:#fafafa; }
.user-actions { gap:6px; }
.user-edit,.category-secondary,.category-rename { color:#404040; border:1px solid #d4d4d4; background:#fff; border-radius:6px; font-weight:500; }
.user-edit:hover,.category-secondary:hover,.category-rename:hover { background:#f5f5f5; border-color:#a3a3a3; }
.category-danger,.user-delete { color:#b42318; background:#fff; border:1px solid #efd0cd; border-radius:6px; font-weight:500; }
.category-danger:hover,.user-delete:hover { background:#fff5f4; border-color:#e5a6a0; }
.avatar,.recipient-avatar,.channel-icon { color:#404040; background:#f5f5f5; border:1px solid var(--line); border-radius:8px; }
.status,.user-status { background:#effaf3; color:#17643a; border-color:#c8e9d4; }
.dot { background:#228447; box-shadow:0 0 0 3px #22844712; }
.user-status.inactive { color:#7c3030; background:#fff1f0; }
.chat-head,.composer { background:#fff; }
.message.agent { background:#f5f5f5; color:#171717; }
.message.user { background:#171717; color:#fff; }
.quick .chip { background:#fff; border:1px solid var(--line); color:#404040; }
.quick .chip:hover { background:#fafafa; border-color:#a3a3a3; }
.auth-gate { background:#fafafa; overflow-y:auto; }
.auth-card { border-radius:12px; border:1px solid var(--line); box-shadow:0 8px 32px #00000006; }
.auth-card > p { color:var(--muted); }
.department-panel { margin-bottom:24px; }
.department-panel > h3 { margin:0 0 6px; font-size:17px; }
.department-create,.department-row { display:grid; grid-template-columns:minmax(160px,1fr) 60px auto auto; align-items:end; gap:12px; }
.department-create { grid-template-columns:minmax(160px,1fr) 60px auto; padding:18px; margin:20px 0; border:1px solid var(--line); border-radius:8px; background:#fafafa; }
.department-create label { display:grid; gap:7px; }
.department-row { margin:0; padding:14px 0; border-bottom:1px solid var(--line); }
.department-row:last-child { border-bottom:0; }
.department-row button { min-height:40px; padding:8px 14px; font-size:13px; }
.department-row input[type=color],.department-create input[type=color] { height:40px; padding:4px; cursor:pointer; }
.department-message { margin-top:12px; font-size:13px; color:#404040; }
.department-message:empty { display:none; }
#calendar-unlinked { margin-top:20px; }
#calendar-unlinked[hidden] { display:none; }
#calendar-unlinked .department-row { grid-template-columns:1fr minmax(160px,1fr) auto; }
#view-calendar { --calendar-blue:#171717; --calendar-ink:#171717; --calendar-muted:#616161; --calendar-line:#e5e7eb; }
.calendar-settings { padding:20px 24px; background:#fff; border:1px solid var(--line); border-radius:10px; }
.calendar-settings h3 { color:#171717; }
.calendar-stat { background:#fff; }
.stat-copy strong { color:#171717; }
.stat-copy span { color:var(--muted); }
.calendar-toolbar { border:1px solid var(--line); background:#fff; }
.area-tabs { flex-wrap:wrap; overflow:visible; }
.area-tab.active { box-shadow:none; }
.calendar-main-grid > * { min-width:0; }
.institutional-calendar { overflow-x:auto; }
.calendar-day.today { background:#f0f7ff; }
.calendar-day.today .day-number { background:#0068d6; color:#fff; }
.calendar-day.outside { background:#fafafa; }
.count-badge { color:#404040; background:#f0f0f0; }
.knowledge-section { border:1px solid var(--line); border-radius:10px; box-shadow:none; }
.knowledge-section > summary { background:#fff; }
.knowledge-section > summary:hover { background:#fafafa; }
.knowledge-section[open] { border-color:#cbd0d8; box-shadow:none; }
.knowledge-section[open] > summary { background:#fafafa; }
.knowledge-title strong { color:#171717; font-size:15px; font-weight:550; }
.knowledge-title > span,.knowledge-save-note { color:var(--muted); }
.knowledge-number,.knowledge-section[open] .knowledge-number { background:#f5f5f5; color:#525252; border-color:var(--line); border-radius:6px; }
.category-heading h3 { font-size:18px; font-weight:600; color:#171717; }
.category-heading p { color:var(--muted); }
.category-body,.knowledge-body { border-color:var(--line); }
.category-entry { background:#fff; border:1px solid var(--line); border-radius:8px; }
.category-toggle { color:#404040; }
.category-toggle input { accent-color:#171717; }
.category-empty { border-color:#d4d4d4; background:#fafafa; color:var(--muted); }
#view-referrals .referral-settings { border:1px solid var(--line); border-radius:10px; }
.rs-heading { background:#fafafa; border-color:var(--line); }
.rs-admin { color:#525252; background:#eee; }
.rs-heading p,.rs-section-head p,.rs-footer .settings-message { color:var(--muted); }
.referral-settings .recipient-card { border:1px solid var(--line); border-radius:8px; }
.referral-settings .recipient-card.is-enabled { border-color:#b8d9c4; background:#fff; }
.referral-settings .recipient-toggle input:checked { background:#228447; }
.referral-settings input[readonly],.referral-settings select:disabled { background:#fafafa; color:#616161; }
.referral-filter.active { color:#171717; border-color:#171717; background:#f5f5f5; }
.referral-request { color:#171717; }
.referral-meta { color:var(--muted); }
.qr-panel { background:#fff; }
.qr-preview { background:#fafafa; border-color:#cbd0d8; }
.qr-copy,.qr-head p { color:var(--muted); }
@media(max-width:900px) {
  .calendar-management-grid { grid-template-columns:1fr; }
  .admin-head,.calendar-page-head,.referrals-head { align-items:flex-start; flex-wrap:wrap; }
}
@media(max-width:760px) {
  .shell { padding:0 16px 28px; }
  .topbar { padding-top:18px; margin-bottom:24px; }
  .account-box { position:static; }
  .nav { gap:18px; }
  .nav button { min-height:44px; }
  .department-create { padding:14px; }
  .department-create,.department-row { grid-template-columns:minmax(0,1fr) 60px; }
  .department-row button,.department-create button { min-height:44px; width:100%; }
  .department-create button { grid-column:1/-1; }
  #calendar-unlinked .department-row { grid-template-columns:1fr; }
  .category-heading,.category-actions { flex-wrap:wrap; }
  .area-tabs { flex-wrap:nowrap; overflow-x:auto; padding-bottom:4px; }
  .area-tab { flex-shrink:0; }
  .qr-layout { gap:20px; }
}
@media(prefers-reduced-motion:reduce) {
  .nav button.referral-alert { animation:none; background:#fff1f0; border-bottom-color:#b42318; }
}

/* Compact department catalog; scoped to avoid changing legacy calendar rows. */
.profile-grid { display:grid; grid-template-columns:minmax(0,1.2fr) minmax(0,1fr); gap:24px; align-items:start; max-width:1100px; }
.profile-form { display:grid; gap:18px; margin-top:24px; }
.profile-form label { display:grid; gap:7px; font-size:14px; }
.profile-form button { justify-self:start; }
.profile-form [role=status] { margin:0; font-size:14px; }
.profile-access { display:grid; gap:8px; padding:16px; border:1px solid var(--line); border-radius:8px; background:#fafafa; }
@media(max-width:760px) { .profile-grid { grid-template-columns:1fr; } }
#departments-panel .department-create { max-width:680px; margin:18px 0 24px; padding:14px; }
#departments-panel .department-list { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; }
#departments-panel .department-row { grid-template-columns:minmax(0,1fr) 48px; gap:12px; padding:16px; margin:0; border:1px solid var(--line); border-radius:9px; background:#fff; align-content:start; }
#departments-panel .department-row:focus-within { border-color:#a3a3a3; }
#departments-panel .department-row label { display:grid; gap:6px; min-width:0; font-size:12px; }
#departments-panel .department-row input { min-width:0; width:100%; }
#departments-panel .department-card-actions { grid-column:1/-1; display:flex; justify-content:flex-end; gap:8px; border-top:1px solid var(--line); padding-top:12px; }
#departments-panel .department-card-actions button { width:auto; min-height:34px; padding:6px 12px; font-size:12px; }
@media(max-width:1100px) { #departments-panel .department-list { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:620px) {
  #departments-panel .department-list { grid-template-columns:1fr; }
  #departments-panel .department-card-actions button { min-height:44px; }
}
.agenda-feature { display:flex; align-items:center; gap:24px; padding:24px; margin:0 0 24px; border:1px solid #dedee7; border-radius:16px; background:#faf9ff; }
.agenda-feature > div { flex:1; min-width:0; }
.agenda-feature h3 { margin:8px 0; }
.agenda-feature p { color:#5c6170; line-height:1.6; max-width:850px; }
.agenda-feature .agenda-feature-actions { flex:0 0 280px; display:grid; gap:10px; }
.agenda-feature button { padding:14px 20px; white-space:normal; }
.agenda-feature button[hidden] { display:none !important; }
#agenda-feature-status { font-size:13px; font-weight:600; margin-bottom:0; }
@media(max-width:720px) { .agenda-feature { flex-direction:column; align-items:stretch; padding:18px; } .agenda-feature .agenda-feature-actions { flex:auto; } .agenda-feature button { width:100%; } }
