/* MISA office panel. Same design language as the app: colours from misa_app/lib/theme/misa_palette.dart,
   radii and type scale from misa_theme.dart (card 14, button 12, input 10, pill 999; heavy, tight headings). */
:root {
  --blue50: #EEF3FB; --blue100: #D6E2F4; --blue200: #ADC4E8; --blue300: #7FA1D8; --blue400: #4F7BC2;
  --blue500: #2957A4; --blue600: #21498C; --blue700: #163A75; --blue800: #112D5B;
  --navy: #0E1F3D; --navy-deep: #0A1730;
  --red50: #FDEDEE; --red100: #FAD3D4; --red500: #ED3237; --red600: #D42228;
  --white: #FFFFFF; --slate25: #F9FAFC; --mist: #F4F6FA; --slate100: #EDF1F6; --line: #E2E8F0;
  --slate300: #CBD5E1; --slate400: #94A3B8; --slate500: #64748B; --slate600: #475569; --slate700: #334155; --ink: #0F172A;
  --success: #15803D; --success-soft: #E7F5EC; --warning: #B45309; --warning-soft: #FDF3E4; --error: #B42318; --error-soft: #FDECEA;
  --r-sm: 8px; --r-input: 10px; --r-button: 12px; --r-card: 14px; --r-sheet: 20px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 16px rgba(15, 23, 42, .04);
  --sidebar: 264px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 14.5px/1.45 var(--font); color: var(--ink); background: var(--mist); -webkit-font-smoothing: antialiased; }
a { color: var(--blue500); text-decoration: none; }
a:hover { color: var(--blue600); text-decoration: underline; }
h1 { font-size: 28px; line-height: 1.2; font-weight: 800; letter-spacing: -.6px; margin: 0; color: var(--ink); }
h2 { font-size: 16px; font-weight: 700; letter-spacing: -.1px; margin: 0; color: var(--ink); }
h3 { font-size: 11px; font-weight: 700; letter-spacing: .9px; text-transform: uppercase; color: var(--slate500); margin: 20px 0 8px; }
p { margin: 0 0 12px; }
.muted { color: var(--slate500); }
.small { font-size: 12.5px; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .9px; text-transform: uppercase; color: var(--blue500); margin: 0 0 6px; }
.icon { width: 20px; height: 20px; flex: none; }
.icon.sm { width: 16px; height: 16px; }

/* ---------- App shell ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar); z-index: 30;
  display: flex; flex-direction: column; background: var(--navy); color: #fff;
  border-right: 1px solid rgba(255, 255, 255, .06);
}
.side-brand { display: flex; align-items: center; gap: 12px; padding: 20px 20px 18px; color: #fff; }
.side-brand:hover { text-decoration: none; color: #fff; }
.emblem { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: #fff; flex: none; }
.emblem img { width: 30px; height: 30px; object-fit: contain; }
.emblem.lg { width: 64px; height: 64px; border-radius: 18px; }
.emblem.lg img { width: 48px; height: 48px; }
.side-brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.side-brand-text strong { font-size: 18px; font-weight: 800; letter-spacing: .5px; }
.side-brand-text small { font-size: 12px; color: var(--blue200); }
.side-nav { flex: 1; overflow-y: auto; padding: 4px 12px 16px; }
.side-title { font-size: 10.5px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--blue300); opacity: .8; margin: 18px 12px 6px; }
.side-nav ul { list-style: none; margin: 0; padding: 0; }
.side-link {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px; margin: 2px 0; border-radius: var(--r-input);
  color: #C9D5EA; font-weight: 600; font-size: 14px;
}
.side-link:hover { background: rgba(255, 255, 255, .07); color: #fff; text-decoration: none; }
.side-link.active { background: var(--blue500); color: #fff; box-shadow: inset 3px 0 0 var(--red500); }
.side-link.soon { color: #7F8EA8; cursor: default; }
.side-link.soon:hover { background: none; color: #7F8EA8; }
.side-link em { margin-left: auto; font-style: normal; font-size: 10px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase;
  padding: 1px 7px; border-radius: 999px; background: rgba(255, 255, 255, .08); color: #9AA8C0; }
.side-foot { padding: 14px 16px 18px; border-top: 1px solid rgba(255, 255, 255, .08); display: flex; align-items: center; gap: 8px; }
.side-foot form { margin: 0; }
.me { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.me-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.me-text strong { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-text small { font-size: 12px; color: var(--blue200); }
.side-signout { display: inline-grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: var(--r-input);
  background: rgba(255, 255, 255, .06); color: #C9D5EA; cursor: pointer; }
.side-signout span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.side-signout:hover { background: var(--red600); color: #fff; }
.main { flex: 1; margin-left: var(--sidebar); min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 32px;
  background: rgba(244, 246, 250, .88); backdrop-filter: saturate(160%) blur(8px); border-bottom: 1px solid var(--line);
}
.topbar-title { font-weight: 700; color: var(--slate700); }
.topbar-env { margin-left: auto; color: var(--slate500); font-size: 13px; }
.icon-btn.menu-btn { display: none; }
.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: var(--r-input);
  background: #fff; color: var(--slate700); cursor: pointer; }
.content { padding: 28px 32px 48px; max-width: 1240px; width: 100%; }
.scrim { display: none; }

/* ---------- Page parts ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head p.muted { margin: 6px 0 0; }
.count-pill { display: inline-block; vertical-align: middle; font-size: 13px; font-weight: 700; letter-spacing: 0; padding: 3px 10px;
  border-radius: 999px; background: var(--blue50); color: var(--blue600); margin-left: 6px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--r-card); padding: 20px 22px; margin-bottom: 20px; box-shadow: var(--shadow); }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head h2 { display: flex; align-items: center; gap: 8px; }
.card-head h2 .icon { color: var(--blue500); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.grid-2 > .card { margin-bottom: 20px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 18px;
  font: 600 15px/1 var(--font); letter-spacing: .1px; border-radius: var(--r-button); border: 1px solid var(--slate300);
  background: #fff; color: var(--ink); cursor: pointer; white-space: nowrap; }
.btn:hover { text-decoration: none; background: var(--slate25); border-color: var(--slate400); color: var(--ink); }
.btn.primary { background: var(--blue500); border-color: var(--blue500); color: #fff; }
.btn.primary:hover { background: var(--blue600); border-color: var(--blue600); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--blue500); }
.btn.ghost:hover { background: var(--blue50); }
.btn.block { width: 100%; }
.btn .icon { width: 18px; height: 18px; }

/* Forms */
.form { margin-top: 20px; }
.field { display: block; margin-bottom: 16px; }
.field > span:first-child { display: block; font-size: 12.5px; font-weight: 600; letter-spacing: .2px; color: var(--slate700); margin-bottom: 6px; }
input[type=email], input[type=password], input[type=text], input[type=search], select {
  width: 100%; height: 44px; padding: 0 14px; font: 15px var(--font); color: var(--ink);
  border: 1px solid var(--slate300); border-radius: var(--r-input); background: #fff;
}
select { padding-right: 34px; appearance: none; cursor: pointer;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='18' height='18'%3E%3Cpath fill='%2364748B' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E") no-repeat right 10px center; }
input:focus, select:focus { outline: none; border-color: var(--blue500); box-shadow: 0 0 0 3px rgba(41, 87, 164, .18); }
input::placeholder { color: var(--slate400); }
.input-icon { position: relative; display: block; }
.input-icon .icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--slate400); pointer-events: none; }
.input-icon input { padding-left: 42px; }
.code-input { font-size: 26px !important; letter-spacing: 10px; text-align: center; height: 56px !important; font-variant-numeric: tabular-nums; }

/* Alerts and pills */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-input); margin: 16px 0; font-size: 14px; }
.alert .icon { width: 18px; height: 18px; margin-top: 1px; }
.alert.error { background: var(--error-soft); color: var(--error); }
.pill { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--blue50); color: var(--blue600); white-space: nowrap; }
.pill.green { background: var(--success-soft); color: var(--success); }
.pill.amber { background: var(--warning-soft); color: var(--warning); }
.pill.red { background: var(--red50); color: var(--red600); }
.pill.grey { background: var(--slate100); color: var(--slate600); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* Avatars */
.avatar { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; flex: none;
  background: var(--blue50); color: var(--blue600); font-weight: 800; font-size: 14px; letter-spacing: .3px; }
.avatar.sm { width: 34px; height: 34px; border-radius: 10px; font-size: 12.5px; background: var(--blue500); color: #fff; }
.avatar.xl { width: 84px; height: 84px; border-radius: 20px; font-size: 28px; }
.icon-badge { display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: var(--blue50); color: var(--blue500); margin-bottom: 14px; }
.icon-badge .icon { width: 24px; height: 24px; }
.icon-badge.red { background: var(--red50); color: var(--red600); }

/* Dashboard */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--r-card); padding: 18px; box-shadow: var(--shadow);
  display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; align-items: center; }
.stat-icon { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; flex: none; }
.stat-icon.blue { background: var(--blue50); color: var(--blue500); }
.stat-icon.red { background: var(--red50); color: var(--red600); }
.stat-icon.green { background: var(--success-soft); color: var(--success); }
.stat-icon.amber { background: var(--warning-soft); color: var(--warning); }
.stat-body { display: flex; flex-direction: column; min-width: 0; }
.stat .num { font-size: 28px; font-weight: 800; letter-spacing: -.6px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat .lbl { font-size: 13px; font-weight: 600; color: var(--slate600); }
.stat .delta { grid-column: 1 / -1; font-size: 12.5px; color: var(--success); font-weight: 600; margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--slate100); }
.stat .delta.muted { color: var(--slate500); font-weight: 500; }
.bars { list-style: none; margin: 0; padding: 0; }
.bars li { display: grid; grid-template-columns: 150px 1fr 40px; align-items: center; gap: 12px; padding: 7px 0; }
.bar-label { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--slate700); font-size: 13.5px; }
.bar-label .icon { color: var(--slate400); }
.bar-label.wide { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bars li:has(.wide) { grid-template-columns: minmax(0, 220px) 1fr 40px; }
.bar-num { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
progress { appearance: none; width: 100%; height: 8px; border: 0; border-radius: 999px; background: var(--slate100); overflow: hidden; }
progress::-webkit-progress-bar { background: var(--slate100); border-radius: 999px; }
progress::-webkit-progress-value { background: var(--blue500); border-radius: 999px; }
progress::-moz-progress-bar { background: var(--blue500); border-radius: 999px; }
.attention { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.attn { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: var(--r-button); background: var(--slate25); border: 1px solid var(--slate100); }
.attn strong { font-size: 18px; font-weight: 800; }

/* Tables */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 16px; border-bottom: 1px solid var(--line); background: var(--slate25); }
.toolbar .grow { flex: 1 1 320px; }
.toolbar select { width: auto; max-width: 240px; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--slate100); vertical-align: middle; }
.table thead th { font-size: 11px; font-weight: 700; letter-spacing: .9px; text-transform: uppercase; color: var(--slate500); background: #fff; padding-top: 14px; padding-bottom: 10px; }
.table tbody tr:last-child td { border-bottom: 0; }
.table td.num { font-variant-numeric: tabular-nums; }
.row-link { cursor: pointer; }
.row-link:hover td { background: var(--blue50); }
.arrow-col { width: 36px; text-align: right; }
.who { display: flex; align-items: center; gap: 12px; min-width: 240px; }
.who > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.row-main { font-weight: 700; color: var(--ink); }
.row-main:hover { color: var(--blue500); }
.who small { color: var(--slate500); font-size: 13px; }
.pager { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-top: 1px solid var(--line); }
.empty-state { text-align: center; padding: 48px 24px; }
.empty-state h2 { margin-bottom: 6px; }

/* Member page */
.back { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13.5px; margin-bottom: 14px; color: var(--slate600); }
.profile-head { display: flex; gap: 22px; align-items: center; padding: 24px; }
.logo-box { display: grid; place-items: center; width: 84px; height: 84px; border-radius: 20px; border: 1px solid var(--line); background: #fff; flex: none; overflow: hidden; }
.logo-box img { max-width: 72px; max-height: 72px; object-fit: contain; }
.profile-main h1 { font-size: 26px; }
.profile-main p.muted { margin: 4px 0 0; }
.kv { margin: 0; }
.kv-row { display: grid; grid-template-columns: 160px 1fr; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--slate100); }
.kv-row:last-child { border-bottom: 0; }
.kv dt { color: var(--slate500); font-weight: 600; font-size: 13px; }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.kv.stacked .kv-row { grid-template-columns: 1fr; gap: 4px; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--slate100); }
.list li:last-child { border-bottom: 0; }
.list-main { display: flex; flex-direction: column; flex: 1; font-weight: 600; font-variant-numeric: tabular-nums; }
.list-main small { font-weight: 400; color: var(--slate500); font-size: 12.5px; }

/* ---------- Sign-in ---------- */
.auth { background: #fff; }
.auth-shell { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 100vh; }
.auth-brand { position: relative; display: flex; flex-direction: column; justify-content: space-between; padding: 48px;
  color: #fff; background: radial-gradient(circle at 85% 10%, rgba(41, 87, 164, .55), transparent 55%), linear-gradient(160deg, var(--navy) 0%, var(--navy-deep) 100%); overflow: hidden; }
.auth-brand::after { content: ""; position: absolute; right: -80px; bottom: -80px; width: 320px; height: 320px; border-radius: 50%;
  border: 40px solid rgba(237, 50, 55, .14); }
.auth-brand-inner { margin-top: 12vh; max-width: 440px; position: relative; z-index: 1; }
.auth-brand .eyebrow { color: var(--blue200); margin-top: 28px; }
.auth-brand h2 { font-size: 34px; font-weight: 800; letter-spacing: -.8px; line-height: 1.15; color: #fff; margin: 4px 0 14px; }
.auth-brand p { color: #C9D5EA; font-size: 16px; line-height: 1.5; }
.auth-foot { position: relative; z-index: 1; color: var(--blue200) !important; font-size: 13px !important; margin: 0; }
.auth-main { display: grid; place-items: center; padding: 32px; background: var(--mist); }
.auth-card { width: 100%; max-width: 400px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-sheet); padding: 36px; box-shadow: var(--shadow); }
.auth-card h1 { font-size: 26px; margin-bottom: 6px; }

/* ---------- Narrow screens ---------- */
@media (max-width: 1100px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 960px) {
  .grid-2, .attention { grid-template-columns: 1fr; }
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; }
  body.nav-open .sidebar { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, .3); }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 25; background: rgba(10, 23, 48, .45); }
  .main { margin-left: 0; }
  .icon-btn.menu-btn { display: inline-grid; }
  .topbar, .content { padding-left: 18px; padding-right: 18px; }
  .topbar-env { display: none; }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-brand { padding: 28px; }
  .auth-brand-inner { margin-top: 0; }
  .auth-brand h2 { font-size: 26px; }
  .auth-foot { display: none; }
}
@media (max-width: 560px) {
  .stats { grid-template-columns: 1fr; }
  .kv-row { grid-template-columns: 1fr; gap: 2px; }
  .profile-head { flex-direction: column; align-items: flex-start; }
  .bars li, .bars li:has(.wide) { grid-template-columns: 110px 1fr 32px; }
  h1 { font-size: 23px; }
}
.auth-card p.center { margin: 16px 0 0; }

/* ---------- Forms and actions (W2) ---------- */
textarea { width: 100%; min-height: 84px; padding: 10px 14px; font: 15px/1.45 var(--font); color: var(--ink); resize: vertical;
  border: 1px solid var(--slate300); border-radius: var(--r-input); background: #fff; }
textarea:focus { outline: none; border-color: var(--blue500); box-shadow: 0 0 0 3px rgba(41, 87, 164, .18); }
input[type=tel] { width: 100%; height: 44px; padding: 0 14px; font: 15px var(--font); border: 1px solid var(--slate300); border-radius: var(--r-input); }
input[type=tel]:focus { outline: none; border-color: var(--blue500); box-shadow: 0 0 0 3px rgba(41, 87, 164, .18); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; }
.req { color: var(--red600); font-weight: 700; }
.hint { display: block; margin-top: 5px; font-size: 12.5px; color: var(--slate500); }
.field-error { display: block; margin-top: 5px; font-size: 12.5px; font-weight: 600; color: var(--error); }
.has-error input, .has-error select, .has-error textarea { border-color: var(--error); background: #FFFBFA; }
.form-actions { position: sticky; bottom: 0; z-index: 5; display: flex; justify-content: flex-end; gap: 10px; padding: 14px 0;
  background: linear-gradient(to top, var(--mist) 70%, rgba(244, 246, 250, 0)); }
.checklist { border: 1px solid var(--slate300); border-radius: var(--r-input); padding: 10px; background: var(--slate25); }
.checklist .input-icon { margin-bottom: 8px; }
.checklist input[type=search] { height: 38px; }
.checklist-items { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; max-height: 220px; overflow-y: auto; padding-right: 4px; }
.check { display: flex; align-items: flex-start; gap: 8px; padding: 6px 8px; border-radius: var(--r-sm); font-size: 13.5px; cursor: pointer; margin: 0; }
.check:hover { background: #fff; }
.check.on { background: var(--blue50); color: var(--blue700); font-weight: 600; }
.check input { margin-top: 3px; accent-color: var(--blue500); }
.check[hidden] { display: none; }
.alert.success { background: var(--success-soft); color: var(--success); }
.head-actions { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; align-self: flex-start; }
.btn.danger { border-color: var(--red600); color: var(--red600); }
.btn.danger:hover { background: var(--red600); color: #fff; }
.actions-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.action-box { padding: 16px; border-radius: var(--r-button); background: var(--slate25); border: 1px solid var(--slate100); margin: 0; }
.action-box h3 { margin-top: 0; }
.action-box .field { margin-bottom: 12px; }
.phone-rows { display: grid; gap: 10px; }
.phone-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) 140px; gap: 12px; align-items: center; }
.phone-row.head { font-size: 11px; font-weight: 700; letter-spacing: .9px; text-transform: uppercase; color: var(--slate500); }
.phone-row .field-error { grid-column: 1 / -1; margin-top: -4px; }
@media (max-width: 960px) {
  .form-grid, .actions-grid { grid-template-columns: 1fr; }
  .checklist-items { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .head-actions { margin-left: 0; }
  .profile-head { flex-wrap: wrap; }
}
@media (max-width: 560px) {
  .checklist-items { grid-template-columns: 1fr; }
  .phone-row { grid-template-columns: 1fr; }
  .phone-row.head { display: none; }
}
.input-icon input[type=tel], .input-icon input[type=search], .input-icon input[type=email], .input-icon input[type=password] { padding-left: 42px; }

/* ---------- Media and catalogue (W2) ---------- */
input[type=file] { font: 14px var(--font); color: var(--slate600); max-width: 100%; }
input[type=file]::file-selector-button { font: 600 13.5px var(--font); margin-right: 10px; padding: 8px 14px; border-radius: var(--r-input);
  border: 1px solid var(--slate300); background: #fff; color: var(--ink); cursor: pointer; }
input[type=file]::file-selector-button:hover { background: var(--slate25); }
.btn-link.danger-link { color: var(--red600); font-size: 13.5px; font-weight: 600; }
.media-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.media-box { display: flex; gap: 16px; align-items: flex-start; padding: 16px; border-radius: var(--r-button); background: var(--slate25); border: 1px solid var(--slate100); }
.media-box h3 { margin: 0 0 10px; }
.media-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.media-preview { display: grid; place-items: center; width: 88px; height: 88px; flex: none; border-radius: 16px; border: 1px solid var(--line);
  background: #fff; color: var(--slate400); overflow: hidden; }
.media-preview.round { border-radius: 50%; }
.media-preview img { width: 100%; height: 100%; object-fit: contain; }
.media-preview.round img { object-fit: cover; }
.media-preview .icon { width: 32px; height: 32px; }
.upload-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 0; }
.upload-row input[type=file] { flex: 1; min-width: 180px; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-bottom: 16px; }
.product { display: flex; gap: 12px; align-items: center; padding: 10px; border: 1px solid var(--slate100); border-radius: var(--r-button); background: #fff; }
.product:hover { border-color: var(--blue200); background: var(--blue50); }
.product-img { display: grid; place-items: center; width: 64px; height: 64px; flex: none; border-radius: 12px; background: var(--slate100); color: var(--slate400); overflow: hidden; }
.product-img img { width: 100%; height: 100%; object-fit: cover; }
.product-img.lg { width: 160px; height: 160px; border-radius: 16px; }
.product-body { display: flex; flex-direction: column; min-width: 0; }
.product-body .row-main { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.add-box { margin-top: 8px; }
.add-box > summary { list-style: none; display: inline-flex; }
.add-box > summary::-webkit-details-marker { display: none; }
.add-box[open] > summary { background: #fff; color: var(--blue500); border-color: var(--blue200); }
.add-form { margin-top: 16px; padding: 16px; border-radius: var(--r-button); background: var(--slate25); border: 1px solid var(--slate100); }
.form-grid .wide { grid-column: 1 / -1; }
.product-edit { display: flex; gap: 24px; align-items: flex-start; }
.product-edit .grow { flex: 1; min-width: 0; }
.remove-row { display: flex; justify-content: flex-end; margin: 0 0 24px; }
.list li form { margin: 0; }
@media (max-width: 960px) { .media-grid { grid-template-columns: 1fr; } .product-edit { flex-direction: column; } }

/* ---------- Fees (W3) ---------- */
.stat-link { color: inherit; text-decoration: none; }
.stat-link:hover { text-decoration: none; border-color: var(--blue200); color: inherit; }
.stat-link.on { border-color: var(--blue500); box-shadow: 0 0 0 3px rgba(41, 87, 164, .15); }
.year-pick { margin: 0; }
.year-pick .field { margin: 0; min-width: 140px; }
input[type=date] { width: 100%; height: 44px; padding: 0 14px; font: 15px var(--font); border: 1px solid var(--slate300); border-radius: var(--r-input); background: #fff; }
input[type=date]:focus { outline: none; border-color: var(--blue500); box-shadow: 0 0 0 3px rgba(41, 87, 164, .18); }
.segmented { display: inline-flex; padding: 4px; gap: 4px; border-radius: var(--r-button); background: var(--slate100); }
.segmented label { margin: 0; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: inline-block; padding: 8px 18px; border-radius: var(--r-input); font-weight: 600; color: var(--slate600); }
.segmented input:checked + span { background: #fff; color: var(--blue600); box-shadow: 0 1px 3px rgba(15, 23, 42, .12); }
.segmented input:focus-visible + span { outline: 2px solid var(--blue500); }
.field[hidden] { display: none; }
.form-actions.inline { position: static; background: none; padding: 8px 0 0; }

/* ---------- Guests, applications, privacy, categories (W3) ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 18px; }
.tabs a { padding: 8px 14px; border-radius: 999px; font-weight: 600; font-size: 13.5px; color: var(--slate600); background: #fff; border: 1px solid var(--line); }
.tabs a:hover { text-decoration: none; border-color: var(--blue200); color: var(--blue600); }
.tabs a.on { background: var(--blue500); border-color: var(--blue500); color: #fff; }
.tabs a b { display: inline-block; min-width: 20px; margin-left: 4px; padding: 0 6px; border-radius: 999px; background: var(--red500); color: #fff; font-size: 11.5px; text-align: center; }
.tabs-gap { flex: 1; }
.app-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.app-title { flex: 1; min-width: 220px; }
.app-title h2 { margin-bottom: 2px; }
.app-title p { margin: 0; }
.app-head .chips { margin: 0; }
.app-details { margin-top: 14px; border-top: 1px solid var(--slate100); padding-top: 10px; }
.app-details summary { cursor: pointer; font-weight: 600; color: var(--blue500); font-size: 13.5px; }
.request.overdue { border-color: var(--red100); box-shadow: inset 4px 0 0 var(--red500), var(--shadow); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .92em; letter-spacing: .3px; }
.message { margin-top: 14px; padding: 14px 16px; border-radius: var(--r-button); background: var(--slate25); border: 1px solid var(--slate100); }
.message p { margin: 6px 0 0; }
.request-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--slate100); }
.request-actions p { flex-basis: 100%; margin: 0; }
.request-actions form { margin: 0; }
.request-actions .field.grow { flex: 1 1 280px; margin: 0; }
.add-inline { display: flex; gap: 12px; align-items: flex-end; margin: 0; }
.add-inline .field { margin: 0; }
.add-inline .grow { flex: 1; }
.rename-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0; }
.rename-row input { height: 36px; max-width: 320px; }
.rename-row .btn { min-height: 36px; padding: 0 12px; font-size: 13.5px; }
.rename-row .field-error { flex-basis: 100%; margin: 0; }
.row-off td { color: var(--slate500); }
.table td form { margin: 0; }
.rename-row { flex-wrap: nowrap; }
.rename-row input { flex: 1; min-width: 160px; max-width: none; }
#cat-table td:nth-child(3) { width: 45%; }
button.btn-link { border: 0; background: none; padding: 0; }

/* ---------- Staff accounts, my account (W4) ---------- */
a.me { color: #fff; text-decoration: none; border-radius: var(--r-input); padding: 4px; margin: -4px; }
a.me:hover { background: rgba(255, 255, 255, .07); text-decoration: none; color: #fff; }
.row-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row-actions form { margin: 0; }
.row-actions .btn { min-height: 36px; padding: 0 12px; font-size: 13.5px; }
.pop { position: relative; }
.pop > summary { list-style: none; }
.pop > summary::-webkit-details-marker { display: none; }
.pop-body { position: absolute; right: 0; top: calc(100% + 6px); z-index: 10; width: 280px; padding: 14px; background: #fff;
  border: 1px solid var(--line); border-radius: var(--r-button); box-shadow: 0 10px 30px rgba(15, 23, 42, .15); }
.narrow-card { max-width: 520px; }
.block { display: block; }
.toolbar input[type=email], .toolbar input[type=text], .toolbar input[type=date] { width: auto; height: 44px; }
.compact-rows td { padding-top: 9px; padding-bottom: 9px; font-size: 13.5px; }
pre.stack { white-space: pre-wrap; font: 12px/1.5 ui-monospace, Menlo, monospace; background: var(--slate25); border: 1px solid var(--slate100); border-radius: var(--r-input); padding: 12px; max-height: 420px; overflow: auto; }
details.compose > summary { list-style: none; cursor: pointer; }
details.compose > summary::-webkit-details-marker { display: none; }
.compose-form { margin-top: 16px; }
.committee-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.card.person { display: flex; gap: 14px; align-items: center; margin: 0; }
.card.person h2 { margin: 0; font-size: 15.5px; }
.card.person .eyebrow { margin-bottom: 2px; }
.card.person p { margin: 0; }

/* ---------- Committee editing and handover ---------- */
.committee-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.committee-actions p { flex-basis: 100%; margin: 4px 0 0; }
.handover .steps { margin: 6px 0 0; padding-left: 20px; }
.handover .steps li { margin: 4px 0; }
.undo-row { margin: -8px 0 16px; text-align: right; }
.section-title { margin-top: 24px; }
.seat-table input { width: 100%; height: 38px; padding: 0 10px; font: 14px var(--font); border: 1px solid var(--slate300); border-radius: var(--r-sm); }
.seat-table input.short { max-width: 90px; }
.seat-table td { padding: 6px 8px; vertical-align: top; }

/* ---------- Committee seats: search and rows ---------- */
.seat-table th:nth-child(1) { width: 15%; }
.seat-table th:nth-child(2) { width: 28%; }
.seat-table th:nth-child(3) { width: 20%; }
.seat-table th:nth-child(4) { width: 13%; }
.seat-person { position: relative; }
.lookup { position: relative; }
.lookup-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 20; margin: 0; padding: 4px; list-style: none; max-height: 300px; overflow-y: auto;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-input); box-shadow: 0 12px 30px rgba(15, 23, 42, .16); }
.lookup-list li { display: flex; flex-direction: column; padding: 8px 10px; border-radius: var(--r-sm); cursor: pointer; }
.lookup-list li small { color: var(--slate500); font-size: 12px; }
.lookup-list li.on, .lookup-list li:hover { background: var(--blue50); }
.lookup-list li.empty { cursor: default; color: var(--slate500); font-size: 13px; }
.lookup-list li.empty:hover { background: none; }
.seat-info { display: block; margin-top: 4px; font-size: 12px; color: var(--slate500); min-height: 1em; }
.seat-info.linked { color: var(--success); font-weight: 600; }
.seat-remove { width: 48px; text-align: center; }
.seat-remove .icon-btn { width: 34px; height: 34px; font-size: 20px; line-height: 1; color: var(--slate500); }
.seat-remove .icon-btn:hover { color: var(--red600); border-color: var(--red100); background: var(--red50); }
.seat-add { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 14px 16px; border-top: 1px solid var(--line); background: var(--slate25); }
.seat-table th:nth-child(5) { width: 190px; }
.photo-cell { display: flex; gap: 10px; align-items: flex-start; }
.seat-thumb { display: grid; place-items: center; width: 52px; height: 52px; flex: none; border-radius: 50%; overflow: hidden; background: var(--slate100); color: var(--slate400); }
.seat-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; }
.photo-tools { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.photo-tools select { height: 30px; font-size: 12px; padding: 0 26px 0 8px; background-position: right 4px center; }
.btn.mini { min-height: 30px; padding: 0 10px; font-size: 12.5px; cursor: pointer; }
.photo-status { font-size: 12px; }
.photo-status.good { color: var(--success); }
.photo-status.bad { color: var(--error); }
.card.flush.seats-card, .seats-wrap { overflow: visible; }

/* ---------- Meeting records ---------- */
.attendees .checklist-items { max-height: 420px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.attendees .check span { display: flex; flex-direction: column; }
.attendees .check small { color: var(--slate500); font-weight: 400; font-size: 12px; }
.checklist-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.checklist-tools .grow { flex: 1 1 240px; }
.checklist-tools .input-icon { margin: 0; }
.check.only-ticked { padding: 4px 8px; }
.alert.info { background: var(--blue50); color: var(--blue700); }
input[type=time] { width: 100%; height: 44px; padding: 0 14px; font: 15px var(--font); border: 1px solid var(--slate300); border-radius: var(--r-input); background: #fff; }
@media (max-width: 960px) { .attendees .checklist-items { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .attendees .checklist-items { grid-template-columns: 1fr; } }
