:root {
  --green-950: #062f62;
  --green-900: #07366f;
  --green-700: #175da5;
  --green-100: #dfecf9;
  --blue-700: #235e8a;
  --amber-600: #b66a12;
  --red-700: #a33b35;
  --ink: #17201d;
  --muted: #66736e;
  --line: #dce2df;
  --surface: #ffffff;
  --background: #f3f6f4;
  --shadow: 0 18px 45px rgba(20, 47, 39, 0.14);
  --sidebar-blue: #07366f;
  --sidebar-blue-light: #174f91;
}

html { color-scheme: light; }
html[data-theme="dark"] {
  color-scheme: dark;
  --ink: #e6edf5;
  --muted: #9eacba;
  --line: #2a3a4b;
  --surface: #142231;
  --background: #0b1520;
  --green-100: #183653;
  --green-700: #65aaf0;
  --blue-700: #78b7ee;
  --amber-600: #f1b85b;
  --red-700: #ff938b;
  --shadow: 0 18px 45px rgba(0, 0, 0, .34);
  --sidebar-blue: #071c36;
  --sidebar-blue-light: #123b68;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { font-family: "Inter", sans-serif; color: var(--ink); background: var(--background); letter-spacing: 0; }
button, input, select, textarea { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
.hidden { display: none !important; }
.mobile-only { display: none !important; }
.muted { color: var(--muted); }
.eyebrow { margin: 0 0 5px; color: var(--green-700); font-size: 12px; font-weight: 700; text-transform: uppercase; }

.login-view { min-height: 100vh; display: grid; grid-template-columns: minmax(320px, 44%) 1fr; background: var(--surface); }
.login-brand { padding: 48px; display: grid; place-items: center; color: white; background: var(--sidebar-blue); }
.login-brand strong, .sidebar-brand strong { display: block; font-size: 18px; }
.login-brand span, .sidebar-brand span { display: block; margin-top: 2px; font-size: 12px; opacity: .72; }
.login-showcase-logo { width: min(680px, 88%); padding: clamp(18px, 3vw, 34px); display: grid; place-items: center; border-radius: 18px; background: white; box-shadow: 0 24px 60px rgba(0,0,0,.28); }
.login-showcase-logo img { display: block; width: 100%; height: auto; max-height: 62vh; object-fit: contain; }
.brand-logo { width: 150px; height: 64px; padding: 5px 8px; display: flex; align-items: center; border-radius: 4px; background: white; overflow: hidden; }
.brand-logo img { display: block; width: 100%; height: auto; object-fit: contain; }
.brand-logo.small { width: 62px; height: 62px; padding: 5px; flex: 0 0 auto; border-radius: 10px; background: white; box-shadow: 0 5px 16px rgba(0,0,0,.2); }
.brand-logo.small img { width: 100%; height: 100%; border-radius: 7px; object-fit: cover; }
.login-form { width: min(420px, calc(100% - 48px)); margin: auto; display: grid; gap: 20px; }
.login-form h1 { margin: 0; font-size: 34px; }
.login-form p { margin-bottom: 0; }
label { display: grid; gap: 7px; color: #35423d; font-size: 13px; font-weight: 600; }
input, select, textarea { width: 100%; border: 1px solid #cbd4d0; border-radius: 6px; padding: 11px 12px; color: var(--ink); background: white; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--green-700); box-shadow: 0 0 0 3px rgba(23,93,165,.14); }
.password-field { position: relative; }
.password-field input { padding-right: 45px; }
.password-field .icon-button { position: absolute; right: 4px; top: 4px; }
.form-error { min-height: 20px; margin: -8px 0 !important; color: var(--red-700); font-size: 13px; }
.field-help { color: var(--muted); font-size: 11px; font-weight: 400; }

.primary-button, .secondary-button { min-height: 40px; border: 0; border-radius: 6px; padding: 0 15px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 600; text-decoration: none; }
.primary-button { color: white; background: var(--green-700); }
.primary-button:hover { background: var(--green-900); }
.primary-button:disabled { opacity: .55; cursor: wait; }
.secondary-button { border: 1px solid var(--line); color: var(--ink); background: white; }
.mail-button, .help-button { color: var(--green-700); }
.icon-button { width: 38px; height: 38px; border: 0; border-radius: 5px; display: inline-grid; place-items: center; color: var(--muted); background: transparent; }
.icon-button:hover { color: var(--ink); background: rgba(23,63,53,.08); }
.icon-button.danger { color: #b42318; }
.icon-button.danger:hover { color: #7a271a; background: rgba(180,35,24,.1); }
.icon-button.inverse { color: rgba(255,255,255,.72); }
.icon-button svg, .primary-button svg { width: 18px; height: 18px; }

.app-view { min-height: 100vh; display: grid; grid-template-columns: 280px minmax(0, 1fr); }
.sidebar { height: 100vh; position: sticky; top: 0; display: flex; flex-direction: column; color: white; background: var(--sidebar-blue); overflow: hidden; }
.sidebar-brand { min-width: 0; min-height: 94px; padding: 15px 18px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid rgba(255,255,255,.1); }
.main-nav { width: 100%; min-width: 0; padding: 14px 10px; display: grid; gap: 3px; overflow-x: hidden; overflow-y: auto; scrollbar-gutter: stable; }
.nav-item { width: 100%; min-width: 0; min-height: 42px; border: 0; border-radius: 5px; padding: 0 11px; display: flex; align-items: center; gap: 11px; color: rgba(255,255,255,.68); background: transparent; text-align: left; font-size: 13px; font-weight: 500; }
.nav-item svg { width: 18px; flex: 0 0 18px; }
.nav-item span:not(.nav-badge) { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-badge { min-width: 20px; height: 20px; padding: 0 6px; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; color: white; background: #e11d48; border: 2px solid rgba(255,255,255,.95); font-size: 10px; font-weight: 800; line-height: 1; box-shadow: 0 5px 12px rgba(0,0,0,.22); }
.nav-item:hover, .nav-item.active { color: white; background: var(--sidebar-blue-light); }
.sidebar-user { margin-top: auto; min-height: 72px; padding: 13px; display: flex; align-items: center; gap: 10px; border-top: 1px solid rgba(255,255,255,.1); }
.avatar { width: 35px; height: 35px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; color: var(--sidebar-blue); background: #d8e8fa; font-weight: 700; }
.user-copy { min-width: 0; flex: 1; }
.user-copy strong, .user-copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-copy strong { font-size: 12px; }
.user-copy span { margin-top: 3px; color: rgba(255,255,255,.6); font-size: 11px; }

.main-content { min-width: 0; }
.topbar { height: 80px; padding: 0 28px; display: flex; align-items: center; gap: 15px; border-bottom: 1px solid var(--line); background: var(--surface); }
.topbar h1 { margin: 0; font-size: 22px; }
.topbar #back-button { flex: 0 0 auto; color: var(--green-700); border: 1px solid var(--line); background: white; }
.topbar #back-button:hover { color: white; background: var(--green-700); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.theme-button { min-width: 112px; color: var(--green-700); }
.content { padding: 24px 28px 40px; }
.loading-state, .empty-state, .error-state { min-height: 320px; display: grid; place-items: center; align-content: center; gap: 10px; color: var(--muted); text-align: center; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--green-100); border-top-color: var(--green-700); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(160px, 1fr)); gap: 14px; }
.dashboard-welcome { min-height: 145px; margin-bottom: 22px; padding: 23px; display: flex; align-items: center; gap: 17px; border-radius: 11px; color: white; background: linear-gradient(120deg, #07366f, #175da5); box-shadow: 0 15px 36px rgba(7,54,111,.22); }
.dashboard-welcome-icon { width: 56px; height: 56px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 13px; color: #175da5; background: white; box-shadow: 0 8px 20px rgba(0,0,0,.13); }
.dashboard-welcome-icon svg { width: 27px; height: 27px; }
.dashboard-welcome-copy { min-width: 0; }
.dashboard-welcome-copy > span { color: #bfdbfe; font-size: 10px; font-weight: 800; text-transform: capitalize; }
.dashboard-welcome-copy h2 { margin: 6px 0 4px; font-size: 24px; }
.dashboard-welcome-copy p { max-width: 610px; margin: 0; color: #dbeafe; font-size: 12px; line-height: 1.5; }
.dashboard-welcome-metrics { margin-left: auto; display: flex; gap: 8px; }
.dashboard-welcome-metrics span { min-width: 96px; padding: 10px 12px; border-radius: 9px; color: #dbeafe; background: rgba(255,255,255,.12); font-size: 10px; text-align: center; }
.dashboard-welcome-metrics strong { display: block; margin-bottom: 3px; color: white; font-size: 21px; }
.dashboard-section-heading { margin-bottom: 12px; display: flex; align-items: flex-end; justify-content: space-between; gap: 15px; }
.dashboard-section-heading h2 { margin: 0; font-size: 18px; }
.dashboard-section-heading > span { color: var(--muted); font-size: 11px; }
.stat { min-height: 132px; padding: 17px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: 0 8px 22px rgba(15,42,70,.05); }
.dashboard-stat { width: 100%; color: inherit; text-align: left; cursor: pointer; transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease; }
.dashboard-stat:hover { transform: translateY(-3px); border-color: #7bb2e8; box-shadow: 0 12px 26px rgba(23,93,165,.13); }
.dashboard-stat:focus-visible { outline: 3px solid rgba(37,99,235,.25); outline-offset: 2px; }
.dashboard-stat small { margin-top: 12px; padding-top: 9px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; color: var(--green-700); font-size: 10px; font-weight: 700; }
.dashboard-stat small svg { width: 14px; height: 14px; }
.stat-head { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 13px; }
.stat-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 9px; color: var(--green-700); background: var(--green-100); }
.stat-icon svg { width: 18px; }
.stat strong { display: block; margin-top: 10px; font-size: 27px; }
.stats-grid .dashboard-stat:nth-child(2) .stat-icon { color: #7c3aed; background: #ede9fe; }
.stats-grid .dashboard-stat:nth-child(3) .stat-icon { color: #dc2626; background: #fee2e2; }
.stats-grid .dashboard-stat:nth-child(4) .stat-icon { color: #a16207; background: #fef3c7; }
.stats-grid .dashboard-stat:nth-child(5) .stat-icon { color: #be185d; background: #fce7f3; }
.stats-grid .dashboard-stat:nth-child(6) .stat-icon { color: #475569; background: #e2e8f0; }
.dashboard-grid { margin-top: 18px; display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; }
.dashboard-activity-panel { overflow: hidden; min-height: 330px; border-radius: 10px; box-shadow: 0 9px 25px rgba(15,42,70,.05); }
.dashboard-activity-panel .panel-header { min-height: 69px; }
.dashboard-activity-panel .panel-header > div { display: flex; align-items: center; gap: 10px; }
.dashboard-activity-panel .panel-header h2 { margin: 0; font-size: 14px; }
.dashboard-activity-panel .panel-header p { margin: 3px 0 0; color: var(--muted); font-size: 10px; }
.dashboard-panel-icon { width: 37px; height: 37px; display: grid; place-items: center; border-radius: 8px; }
.dashboard-panel-icon svg { width: 18px; }
.dashboard-panel-icon.amber { color: #a16207; background: #fef3c7; }
.dashboard-panel-icon.blue { color: #175da5; background: #dbeafe; }
.dashboard-count { min-width: 28px; height: 28px; padding: 0 8px; display: grid; place-items: center; border-radius: 999px; color: #92400e; background: #fef3c7; font-size: 11px; font-weight: 800; }
.dashboard-count.neutral { color: #175da5; background: #dbeafe; }
.dashboard-list-pagination { min-height: 48px; margin-top: auto; padding: 7px 12px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: center; gap: 12px; background: rgba(248,250,252,.55); }
.dashboard-list-pagination span { color: var(--muted); font-size: 10px; font-weight: 700; }
.dashboard-list-pagination .icon-button { width: 32px; height: 32px; border: 1px solid var(--line); background: var(--surface); }
.dashboard-list-pagination .icon-button:disabled { opacity: .35; cursor: default; }
.dashboard-list-pagination .icon-button svg { width: 15px; }
.dashboard-list-empty { min-height: 245px; display: grid; place-items: center; align-content: center; gap: 8px; color: var(--muted); font-size: 12px; }
.dashboard-list-empty svg { width: 25px; color: #22c55e; }
.dashboard-activity-panel { display: flex; flex-direction: column; }
.dashboard-activity-panel .quick-list { min-height: 245px; }
.panel { border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
.panel-header { min-height: 58px; padding: 13px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); }
.panel-header h2 { margin: 0; font-size: 15px; }
.quick-list { padding: 6px 0; }
.quick-item { width: 100%; padding: 12px 16px; border: 0; border-bottom: 1px solid #edf0ee; display: flex; align-items: center; gap: 12px; color: inherit; background: transparent; text-align: left; }
.quick-item:last-child { border-bottom: 0; }
.quick-item:hover { background: #f8faf9; }
.quick-item-copy { min-width: 0; flex: 1; }
.quick-item-copy strong, .quick-item-copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quick-item-copy strong { font-size: 13px; }
.quick-item-copy span { margin-top: 4px; color: var(--muted); font-size: 12px; }

.toolbar { margin-bottom: 14px; display: flex; align-items: center; gap: 10px; }
.module-workspace-hero { min-height: 132px; margin-bottom: 16px; padding: 21px 22px; display: flex; align-items: center; gap: 16px; border-radius: 10px; color: white; background: linear-gradient(120deg, #07366f, #175da5); box-shadow: 0 14px 34px rgba(7, 54, 111, .18); }
.module-workspace-icon { width: 52px; height: 52px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 12px; color: #175da5; background: white; box-shadow: 0 7px 20px rgba(0,0,0,.12); }
.module-workspace-icon svg { width: 25px; height: 25px; }
.module-workspace-copy { min-width: 0; }
.module-workspace-copy > span { color: #bfdbfe; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.module-workspace-copy h2 { margin: 5px 0 4px; font-size: 22px; }
.module-workspace-copy p { max-width: 620px; margin: 0; color: #dbeafe; font-size: 12px; line-height: 1.45; }
.module-workspace-metrics { margin-left: auto; display: flex; gap: 8px; }
.module-workspace-metrics span { min-width: 82px; padding: 9px 11px; border-radius: 8px; color: #e2e8f0; background: rgba(255,255,255,.12); font-size: 10px; text-align: center; }
.module-workspace-metrics strong { display: block; margin-bottom: 3px; color: white; font-size: 20px; }
.module-workspace-metrics .pending { background: rgba(245, 158, 11, .22); }
.module-workspace-metrics .approved { background: rgba(34, 197, 94, .2); }
.module-records-shell { padding: 13px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.62); box-shadow: 0 8px 24px rgba(15, 42, 70, .04); }
.modern-toolbar { margin-bottom: 11px; padding: 3px; }
.modern-toolbar input, .modern-toolbar select { min-height: 42px; border-color: #d8e1e8; background: white; }
.modern-toolbar .search-field input { border-radius: 8px; }
.modern-table-panel { border-radius: 9px; box-shadow: 0 7px 20px rgba(15, 42, 70, .04); }
.modern-table-panel th { height: 42px; color: #52606a; background: #f4f8fb; }
.modern-table-panel tbody tr { transition: background .14s ease, transform .14s ease; }
.modern-table-panel tbody tr:hover { background: #f1f7fd; }
.modern-table-panel td { padding-top: 15px; padding-bottom: 15px; }
.modern-form-panel { padding: 18px; border-radius: 10px; box-shadow: 0 10px 28px rgba(15, 42, 70, .06); }
.modern-form-panel > .form-grid { padding-top: 5px; }
.modern-form-panel textarea { resize: vertical; line-height: 1.45; }
.search-field { max-width: 390px; position: relative; flex: 1; }
.search-field svg { width: 17px; position: absolute; left: 11px; top: 11px; color: var(--muted); }
.search-field input { padding-left: 36px; }
.toolbar select { width: 190px; }
.page-size-control { width: 150px; display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 10px; white-space: nowrap; }
.page-size-control select { width: 100%; min-width: 120px; }
.result-count { margin-left: auto; color: var(--muted); font-size: 12px; }
.utility-panel { margin-bottom: 14px; padding: 18px; border-radius: 9px; box-shadow: 0 8px 24px rgba(15, 42, 70, .04); }
.global-search-panel { margin-bottom: 16px; padding: 20px; border-radius: 10px; box-shadow: 0 10px 28px rgba(15, 42, 70, .06); }
.global-search-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.global-search-head h2 { margin: 0 0 5px; font-size: 18px; }
.global-search-head p, .global-search-summary { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.global-search-box { position: relative; }
.global-search-box svg { width: 19px; position: absolute; left: 13px; top: 14px; color: var(--green-700); }
.global-search-box input { min-height: 48px; padding-left: 44px; font-size: 15px; }
.global-search-summary { margin-top: 10px; }
.global-result-group { margin-bottom: 14px; overflow: hidden; }
.global-result-group > header { min-height: 58px; padding: 13px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); }
.global-result-group > header > div { min-width: 0; display: flex; align-items: center; gap: 10px; }
.global-result-group h3 { margin: 0; font-size: 15px; }
.global-result-group small { color: var(--muted); font-size: 12px; }
.global-result-list { display: grid; }
.global-result { width: 100%; min-height: 58px; border: 0; border-bottom: 1px solid #edf0ee; padding: 12px 16px; display: grid; grid-template-columns: minmax(0, 1fr) auto 22px; align-items: center; gap: 12px; color: inherit; background: white; text-align: left; }
.global-result:last-child { border-bottom: 0; }
.global-result:hover { background: #f8faf9; }
.global-result strong, .global-result small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.global-result small { margin-top: 4px; color: var(--muted); font-size: 12px; }
.info-hero { margin-bottom: 14px; padding: 18px; display: flex; align-items: center; gap: 16px; border-radius: 8px; color: white; background: var(--sidebar-blue); box-shadow: var(--shadow); }
.info-hero-logo { width: 118px; height: 58px; flex: 0 0 auto; padding: 6px 8px; display: flex; align-items: center; border-radius: 7px; background: white; }
.info-hero-logo img { width: 100%; height: auto; display: block; object-fit: contain; }
.info-hero h2 { margin: 0 0 5px; font-size: 20px; }
.info-hero p { margin: 0; color: #d8e8fa; font-size: 13px; line-height: 1.45; }
.info-editor-shell { margin-bottom: 14px; }
.info-editor-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 12px; align-items: start; }
.info-editor-card { padding: 15px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: 0 10px 28px rgba(15, 42, 70, .05); }
.info-editor-card.wide { grid-column: 1 / -1; }
.info-card-full { grid-column: 1 / -1; }
.info-card-third { grid-column: span 4; }
.info-editor-card header { margin-bottom: 11px; display: flex; align-items: center; gap: 10px; }
.info-editor-card h3, .info-editor-card h4 { margin: 0; }
.info-editor-card h3 { font-size: 15px; }
.info-editor-card h4 { font-size: 13px; }
.info-editor-card p, .slot-group-header span { margin: 3px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.info-editor-icon { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 7px; }
.info-editor-icon svg { width: 17px; height: 17px; }
.info-editor-icon.teal { color: #0e7c7b; background: #daf3f1; }
.info-editor-icon.blue { color: var(--blue-700); background: #dbeafe; }
.info-editor-icon.cyan { color: #0369a1; background: #e0f2fe; }
.info-editor-icon.violet { color: #6d28d9; background: #ede9fe; }
.info-editor-card label { display: grid; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 700; }
.info-editor-card textarea, .slot-row input { width: 100%; border: 1px solid var(--line); border-radius: 7px; color: var(--ink); background: #fbfdff; font: inherit; outline: none; }
.info-editor-card textarea { min-height: 122px; padding: 11px 12px; resize: vertical; line-height: 1.45; }
.info-editor-card textarea:focus, .slot-row input:focus { border-color: var(--blue-700); box-shadow: 0 0 0 3px rgba(23, 93, 165, .12); }
.slot-editor { margin-top: 11px; padding: 11px; border: 1px solid #e4edf7; border-radius: 8px; background: #f8fbff; }
.slot-group-header { margin-bottom: 9px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.slot-list { display: grid; gap: 7px; }
.slot-row { display: grid; grid-template-columns: minmax(120px, 1.2fr) minmax(90px, .8fr) minmax(90px, .8fr) minmax(70px, .55fr) 34px; align-items: end; gap: 7px; padding: 8px; border: 1px solid #e8eef4; border-radius: 8px; background: white; }
.slot-row.simple { grid-template-columns: repeat(2, minmax(120px, 1fr)); }
.slot-row input { height: 34px; padding: 0 10px; }
label.check-row { display: flex; align-items: center; gap: 8px; margin: 7px 0; font-weight: 700; color: var(--ink); }
.check-row input { width: auto; }
.pool-config-layout { display: grid; grid-template-columns: minmax(220px, .55fr) minmax(0, 1fr); gap: 12px; align-items: start; }
.pool-visible-schedule textarea { min-height: 130px; }
.pool-slots-layout { min-width: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pool-slots-layout .slot-editor { margin-top: 0; }
.pool-slots-layout .slot-row { grid-template-columns: repeat(2, 1fr); gap: 7px; padding: 7px; }
.pool-slots-layout .slot-row input { height: 32px; }
.pool-slots-layout .slot-row .icon-button { grid-column: 2; justify-self: end; }
.moving-config-layout { display: grid; grid-template-columns: minmax(200px, .65fr) minmax(0, 1fr); gap: 12px; align-items: start; }
.moving-slots-layout { min-width: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.moving-slots-layout .slot-editor { margin-top: 0; }
.sticky-form-actions { position: sticky; bottom: 0; z-index: 3; margin-top: 14px; padding: 12px 0 0; display: flex; justify-content: flex-end; background: linear-gradient(180deg, rgba(246,248,247,0), var(--bg) 35%); }
.inline-form { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(180px, 260px) auto; align-items: end; gap: 12px; }
.inline-form h2 { margin: 0 0 5px; font-size: 15px; }
.inline-form p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.table-panel { overflow: hidden; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: white; }
th { padding: 11px 14px; color: var(--muted); background: #f7f9f8; font-size: 11px; font-weight: 700; text-align: left; text-transform: uppercase; white-space: nowrap; }
td { padding: 13px 14px; border-top: 1px solid #edf0ee; font-size: 13px; vertical-align: middle; }
tbody tr { cursor: pointer; }
tbody tr:hover { background: #f8faf9; }
.cell-main { max-width: 340px; font-weight: 600; }
.cell-secondary { max-width: 270px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge { display: inline-flex; align-items: center; border-radius: 4px; padding: 4px 7px; font-size: 11px; font-weight: 700; white-space: nowrap; color: var(--amber-600); background: #fff3d9; }
.badge.green { color: #175da5; background: #dfecf9; }
.badge.red { color: var(--red-700); background: #f9e2e0; }
.badge.blue { color: var(--blue-700); background: #e0edf7; }
.badge.gray { color: #58635f; background: #e9eeec; }

.backdrop { position: fixed; inset: 0; z-index: 30; background: rgba(14,25,21,.35); }
.detail-drawer { width: min(520px, 100%); height: 100vh; position: fixed; z-index: 40; top: 0; right: 0; transform: translateX(105%); transition: transform .22s ease; background: white; box-shadow: var(--shadow); overflow-y: auto; }
.detail-drawer.open { transform: translateX(0); }
.detail-drawer > header, .modal > header { min-height: 72px; padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.detail-drawer h2, .modal h2 { margin: 0; font-size: 20px; }
.drawer-content { padding: 20px; }
.detail-section { margin-bottom: 24px; }
.detail-section h3 { margin: 0 0 12px; font-size: 13px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.detail-field { min-width: 0; }
.detail-field span { display: block; margin-bottom: 4px; color: var(--muted); font-size: 11px; text-transform: uppercase; }
.detail-field strong { display: block; font-size: 13px; word-break: break-word; }
.detail-message { padding: 14px; border: 1px solid var(--line); border-radius: 6px; color: #35423d; background: #f8faf9; font-size: 13px; line-height: 1.55; white-space: pre-wrap; }
.detail-image { display: block; width: 100%; max-height: 420px; border-radius: 6px; object-fit: contain; background: #f3f6f4; }
.management-form { display: grid; gap: 13px; padding-top: 18px; border-top: 1px solid var(--line); }
.management-form footer { display: flex; justify-content: flex-end; }
.management-lock { padding: 16px; display: grid; grid-template-columns: 22px 1fr; gap: 5px 10px; border: 1px solid #e2b45d; border-radius: 6px; color: #704b0b; background: #fff8e8; }
.management-lock svg { width: 20px; grid-row: 1 / span 2; }
.management-lock span { font-size: 12px; line-height: 1.45; }

.modal-backdrop { position: fixed; inset: 0; z-index: 60; padding: 20px; display: grid; place-items: center; background: rgba(14,25,21,.5); }
.modal { width: min(620px, 100%); max-height: calc(100vh - 40px); border-radius: 7px; background: white; box-shadow: var(--shadow); overflow-y: auto; }
.modal-form { padding: 20px; display: grid; gap: 16px; }
.modal-form > div:not(.hidden) { display: grid; gap: 14px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.reminder-layout { display: grid; gap: 16px; }
.reminder-hero { min-height: 132px; padding: 22px; display: flex; align-items: center; gap: 16px; border-radius: 9px; color: white; background: linear-gradient(120deg, #07366f, #175da5); box-shadow: 0 14px 34px rgba(7, 54, 111, .2); }
.reminder-hero-icon { width: 52px; height: 52px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 12px; color: #07366f; background: white; }
.reminder-hero-icon svg { width: 25px; height: 25px; }
.reminder-hero h2 { margin: 7px 0 4px; font-size: 22px; }
.reminder-hero p { margin: 0; color: #dbeafe; font-size: 13px; }
.reminder-status { display: inline-flex; padding: 4px 8px; border-radius: 999px; color: #475569; background: #e2e8f0; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.reminder-status.active { color: #166534; background: #dcfce7; }
.reminder-switch { margin-left: auto; display: grid; grid-template-columns: 46px auto; align-items: center; gap: 4px 10px; color: white; cursor: pointer; }
.reminder-switch input { position: absolute; opacity: 0; pointer-events: none; }
.reminder-switch > span { width: 46px; height: 25px; position: relative; grid-row: 1; border-radius: 999px; background: rgba(255,255,255,.3); transition: .2s ease; }
.reminder-switch > span::after { content: ""; width: 19px; height: 19px; position: absolute; left: 3px; top: 3px; border-radius: 50%; background: white; transition: .2s ease; }
.reminder-switch input:checked + span { background: #22c55e; }
.reminder-switch input:checked + span::after { transform: translateX(21px); }
.reminder-switch strong { grid-column: 2; grid-row: 1; font-size: 12px; white-space: nowrap; }
.reminder-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(340px, 1fr); gap: 16px; align-items: start; }
.reminder-card { padding: 18px; box-shadow: 0 8px 24px rgba(15, 42, 70, .04); }
.reminder-card > header { margin-bottom: 17px; display: flex; align-items: center; gap: 11px; }
.reminder-card h3 { margin: 0; font-size: 15px; }
.reminder-card header p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.reminder-card-icon { width: 39px; height: 39px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 8px; }
.reminder-card-icon svg { width: 19px; }
.reminder-card-icon.blue { color: #175da5; background: #dbeafe; }
.reminder-card-icon.violet { color: #6d28d9; background: #ede9fe; }
.reminder-card-icon.teal { color: #0f766e; background: #ccfbf1; }
.reminder-card-icon.amber { color: #a16207; background: #fef3c7; }
.reminder-fields { display: grid; gap: 14px; }
.reminder-fields textarea { min-height: 122px; resize: vertical; line-height: 1.45; }
.field-counter { justify-self: end; color: var(--muted); font-size: 10px; font-weight: 500; }
.reminder-schedule-grid { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 10px; }
.reminder-days { margin: 17px 0 0; padding: 0; border: 0; }
.reminder-days legend { margin-bottom: 8px; color: #35423d; font-size: 12px; font-weight: 700; }
.reminder-days > div { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.reminder-days label { cursor: pointer; }
.reminder-days input { position: absolute; opacity: 0; pointer-events: none; }
.reminder-days span { min-height: 36px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); background: #f8fafc; font-size: 11px; }
.reminder-days input:checked + span { border-color: #93c5fd; color: #175da5; background: #dbeafe; font-weight: 800; }
.reminder-note { margin-top: 14px; padding: 10px 11px; display: flex; align-items: center; gap: 8px; border-radius: 7px; color: #475569; background: #f1f5f9; font-size: 11px; }
.reminder-note svg { width: 15px; flex: 0 0 auto; }
.notification-preview { padding: 14px; display: grid; grid-template-columns: 46px 1fr; gap: 11px; border: 1px solid #dbe3eb; border-radius: 11px; background: #f8fafc; box-shadow: 0 7px 18px rgba(15, 23, 42, .08); }
.notification-preview img { width: 46px; height: 46px; padding: 4px; border-radius: 10px; object-fit: contain; background: white; }
.notification-preview strong { display: block; font-size: 13px; }
.notification-preview p { margin: 4px 0; color: #475569; font-size: 12px; line-height: 1.4; overflow-wrap: anywhere; }
.notification-preview small { color: #94a3b8; font-size: 10px; }
.reminder-metrics { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.reminder-metrics > div { padding: 11px; border-radius: 7px; background: #f8fafc; }
.reminder-metrics dt { color: var(--muted); font-size: 10px; text-transform: uppercase; }
.reminder-metrics dd { margin: 5px 0 0; font-size: 13px; font-weight: 700; overflow-wrap: anywhere; }
.reminder-actions { position: sticky; bottom: 0; z-index: 5; padding: 13px 15px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.96); box-shadow: 0 -7px 22px rgba(15,42,70,.07); backdrop-filter: blur(10px); }
.reminder-actions > span { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; }
.reminder-actions > span svg { width: 16px; }
.reminder-actions > div { display: flex; gap: 8px; }
.reminder-actions svg { width: 17px; }
.modal-form footer { padding-top: 4px; display: flex; justify-content: flex-end; gap: 8px; }
.help-modal { width: min(700px, 100%); }
.help-chat { padding: 18px; display: grid; gap: 14px; }
.help-chat-messages { max-height: 360px; overflow-y: auto; display: grid; gap: 10px; align-content: start; }
.help-message { max-width: 78%; padding: 11px 13px; border-radius: 14px; color: var(--ink); background: #e6f0fa; font-size: 13px; line-height: 1.45; }
.help-message.user { margin-left: auto; color: white; background: var(--green-700); }
.help-chat-options { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.help-chat-options button { min-height: 34px; border: 1px solid #cfe0f3; border-radius: 999px; padding: 0 12px; color: var(--green-700); background: #f4f8fd; font-size: 12px; font-weight: 700; }
.help-chat-options button:hover { border-color: var(--green-700); background: #e6f0fa; }
.toast { position: fixed; z-index: 100; right: 22px; bottom: 22px; max-width: 360px; padding: 12px 15px; border-radius: 6px; color: white; background: var(--green-950); box-shadow: var(--shadow); transform: translateY(100px); opacity: 0; transition: .2s ease; font-size: 13px; }
.toast.show { transform: translateY(0); opacity: 1; }
.reservation-calendar-modal { width: min(920px, 100%); }
.reservation-overview { overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: white; box-shadow: 0 10px 30px rgba(15, 42, 70, .06); }
.reservation-overview-head { padding: 20px 22px; display: flex; align-items: center; justify-content: space-between; gap: 20px; color: white; background: linear-gradient(120deg, #07366f, #175da5); }
.reservation-overview-head h2 { margin: 0 0 5px; font-size: 22px; }
.reservation-overview-head p:not(.eyebrow) { margin: 0; color: #dbeafe; font-size: 12px; }
.reservation-overview-head .eyebrow { color: #bfdbfe; }
.reservation-summary { display: flex; gap: 9px; }
.reservation-summary span { min-width: 88px; padding: 9px 11px; border-radius: 8px; color: #e2e8f0; background: rgba(255,255,255,.12); font-size: 10px; text-align: center; }
.reservation-summary strong { display: block; margin-bottom: 3px; color: white; font-size: 20px; }
.reservation-summary .pending { background: rgba(245, 158, 11, .22); }
.reservation-summary .approved { background: rgba(34, 197, 94, .2); }
.reservation-calendar-toolbar { min-height: 62px; padding: 11px 16px; display: flex; align-items: center; gap: 16px; border-bottom: 1px solid var(--line); background: #fbfdff; }
.month-navigation { display: flex; align-items: center; gap: 6px; }
.month-navigation strong { min-width: 160px; margin-left: 6px; font-size: 14px; }
.reservation-calendar-toolbar .calendar-legend { margin-left: auto; }
.reservation-inline-calendar { padding: 14px; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 7px; }
.reservation-inline-calendar > b { padding: 6px; color: var(--muted); font-size: 11px; text-align: center; }
.reservation-inline-calendar > b span { display: none; }
.reservation-calendar-empty { min-height: 82px; }
.reservation-calendar-cell { min-height: 82px; position: relative; padding: 9px; border: 1px solid var(--line); border-radius: 8px; display: grid; align-content: space-between; gap: 8px; color: var(--ink); background: white; text-align: left; transition: transform .14s ease, border-color .14s ease, box-shadow .14s ease; }
.reservation-calendar-cell:hover { z-index: 1; transform: translateY(-2px); border-color: #60a5fa; box-shadow: 0 7px 16px rgba(23, 93, 165, .12); }
.reservation-calendar-cell.available { background: #f8fffb; }
.reservation-calendar-cell.limited { border-color: #f5d77a; background: #fffbeb; }
.reservation-calendar-cell.blocked { border-color: #cbd5e1; background: #f1f5f9; }
.reservation-calendar-cell.holiday { border-color: #d8b4fe; background: #faf5ff; }
.reservation-calendar-cell.today { box-shadow: inset 0 0 0 2px #175da5; }
.reservation-calendar-cell.selected { border-color: #175da5; color: white; background: #175da5; box-shadow: 0 7px 18px rgba(23, 93, 165, .24); }
.calendar-cell-number { font-size: 15px; font-weight: 800; }
.calendar-cell-detail { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.reservation-calendar-cell.selected .calendar-cell-detail { color: #dbeafe; }
.calendar-cell-count { width: 20px; height: 20px; position: absolute; right: 7px; top: 7px; display: grid; place-items: center; border-radius: 50%; color: #92400e; background: #fde68a; font-size: 10px; }
.reservation-calendar-cell.selected .calendar-cell-count { color: #175da5; background: white; }
.reservation-records-section { margin-top: 18px; scroll-margin-top: 18px; }
.reservation-records-head { padding: 0 2px 13px; display: flex; align-items: flex-end; justify-content: space-between; gap: 15px; }
.reservation-records-head h2 { margin: 0 0 4px; font-size: 19px; }
.reservation-records-head p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: 12px; }
.reservation-toolbar { margin-bottom: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: white; }
.reservation-table-panel { min-height: 280px; }

html[data-theme="dark"] body,
html[data-theme="dark"] .main-content { background: var(--background); }
html[data-theme="dark"] .login-view,
html[data-theme="dark"] .topbar,
html[data-theme="dark"] .panel,
html[data-theme="dark"] .stat,
html[data-theme="dark"] .modal,
html[data-theme="dark"] .detail-drawer,
html[data-theme="dark"] .info-editor-card,
html[data-theme="dark"] .reminder-card,
html[data-theme="dark"] .reservation-overview,
html[data-theme="dark"] .reservation-toolbar,
html[data-theme="dark"] .modern-table-panel,
html[data-theme="dark"] table {
  color: var(--ink);
  background: var(--surface);
}
html[data-theme="dark"] label,
html[data-theme="dark"] .reminder-days legend { color: #cad5df; }
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] .modern-toolbar input,
html[data-theme="dark"] .modern-toolbar select,
html[data-theme="dark"] .info-editor-card textarea,
html[data-theme="dark"] .slot-row input {
  border-color: #34485b;
  color: var(--ink);
  background: #0f1c29;
}
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder { color: #718295; }
html[data-theme="dark"] .secondary-button,
html[data-theme="dark"] .topbar #back-button {
  border-color: #34485b;
  color: #d8e5f1;
  background: #172838;
}
html[data-theme="dark"] .secondary-button:hover,
html[data-theme="dark"] .topbar #back-button:hover {
  border-color: #65aaf0;
  color: white;
  background: #20466d;
}
html[data-theme="dark"] .icon-button:hover { background: rgba(101,170,240,.13); }
html[data-theme="dark"] .module-records-shell { background: rgba(20,34,49,.62); }
html[data-theme="dark"] .modern-table-panel th,
html[data-theme="dark"] th { color: #aebdca; background: #192a3a; }
html[data-theme="dark"] td { border-top-color: #26384a; }
html[data-theme="dark"] tbody tr:hover,
html[data-theme="dark"] .modern-table-panel tbody tr:hover,
html[data-theme="dark"] .quick-item:hover,
html[data-theme="dark"] .global-result:hover { background: #192d40; }
html[data-theme="dark"] .quick-item,
html[data-theme="dark"] .global-result { border-bottom-color: #26384a; color: var(--ink); background: transparent; }
html[data-theme="dark"] .slot-editor,
html[data-theme="dark"] .reminder-note,
html[data-theme="dark"] .reminder-metrics > div,
html[data-theme="dark"] .notification-preview,
html[data-theme="dark"] .detail-message,
html[data-theme="dark"] .reservation-calendar-toolbar,
html[data-theme="dark"] .reminder-days span,
html[data-theme="dark"] .slot-row {
  border-color: #2c4053;
  color: #c2cfda;
  background: #0f1d2b;
}
html[data-theme="dark"] .notification-preview p,
html[data-theme="dark"] .reminder-note { color: #adbdca; }
html[data-theme="dark"] .reminder-days input:checked + span { border-color: #4f91d4; color: #c9e3ff; background: #173c60; }
html[data-theme="dark"] .reminder-actions {
  border-color: #2a3a4b;
  background: rgba(20,34,49,.96);
  box-shadow: 0 -7px 22px rgba(0,0,0,.2);
}
html[data-theme="dark"] .reservation-calendar-cell { border-color: #304457; color: var(--ink); background: #122130; }
html[data-theme="dark"] .reservation-calendar-cell.available { background: #10271f; }
html[data-theme="dark"] .reservation-calendar-cell.limited { border-color: #806721; background: #30270f; }
html[data-theme="dark"] .reservation-calendar-cell.blocked { border-color: #44566a; background: #1c2936; }
html[data-theme="dark"] .reservation-calendar-cell.holiday { border-color: #694593; background: #291b3a; }
html[data-theme="dark"] .reservation-calendar-cell.selected { border-color: #78b7ee; color: white; background: #175da5; }
html[data-theme="dark"] .calendar-cell-detail { color: #9aabba; }
html[data-theme="dark"] .calendar-day.available { color: #bdebd0; background: #173328; }
html[data-theme="dark"] .calendar-day.limited { color: #f7d880; background: #352b13; }
html[data-theme="dark"] .calendar-day.blocked { color: #bcc7d2; background: #253443; }
html[data-theme="dark"] .calendar-day.holiday { color: #dfc2ff; background: #352448; }
html[data-theme="dark"] .badge { color: #f1c777; background: #3a2d14; }
html[data-theme="dark"] .badge.green { color: #9bd0ff; background: #173c60; }
html[data-theme="dark"] .badge.red { color: #ffaaa4; background: #4a2428; }
html[data-theme="dark"] .badge.blue { color: #acd5fa; background: #193b57; }
html[data-theme="dark"] .badge.gray { color: #c1ccd5; background: #2b3946; }
html[data-theme="dark"] .management-lock { border-color: #765a24; color: #f0ce8e; background: #33270f; }
html[data-theme="dark"] .help-message { background: #1b3b59; }
html[data-theme="dark"] .help-chat-options button { border-color: #31587c; color: #a8d2fa; background: #142c42; }
html[data-theme="dark"] .detail-image { background: #0b1520; }
html[data-theme="dark"] .stats-grid .dashboard-stat:nth-child(2) .stat-icon { color: #c4b5fd; background: #35275b; }
html[data-theme="dark"] .stats-grid .dashboard-stat:nth-child(3) .stat-icon { color: #fca5a5; background: #4b2228; }
html[data-theme="dark"] .stats-grid .dashboard-stat:nth-child(4) .stat-icon,
html[data-theme="dark"] .dashboard-panel-icon.amber { color: #f4cf79; background: #3b2e13; }
html[data-theme="dark"] .stats-grid .dashboard-stat:nth-child(5) .stat-icon { color: #f9a8d4; background: #4a2038; }
html[data-theme="dark"] .stats-grid .dashboard-stat:nth-child(6) .stat-icon { color: #cbd5e1; background: #2c3b49; }
html[data-theme="dark"] .dashboard-panel-icon.blue,
html[data-theme="dark"] .dashboard-count.neutral { color: #acd5fa; background: #193b57; }
html[data-theme="dark"] .dashboard-count { color: #f4cf79; background: #3b2e13; }
html[data-theme="dark"] .dashboard-list-pagination { background: rgba(15,29,43,.62); }
.payment-concepts-modal { width: min(820px, 100%); }
.concept-form { display: grid; gap: 14px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.concept-actions { display: flex !important; grid-auto-flow: column; align-items: center; gap: 8px !important; }
.concept-actions .secondary-button { min-height: 34px; padding: 0 10px; font-size: 11px; }
.calendar-legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--muted); }
.calendar-legend span { display: inline-flex; align-items: center; gap: 6px; }
.calendar-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.calendar-dot.available, .calendar-day.available { background: #dcfce7; border-color: #86efac; }
.calendar-dot.limited, .calendar-day.limited { background: #fef3c7; border-color: #fcd34d; }
.calendar-dot.blocked, .calendar-day.blocked { background: #e5e7eb; border-color: #9ca3af; }
.calendar-dot.holiday, .calendar-day.holiday { background: #f3e8ff; border-color: #c084fc; }
.reservation-calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.reservation-calendar-grid > b { padding: 6px; text-align: center; color: var(--muted); font-size: 12px; }
.calendar-empty { min-height: 68px; }
.calendar-day { min-height: 68px; padding: 7px; border: 1px solid var(--line); border-radius: 7px; display: grid; align-content: space-between; text-align: left; color: var(--ink); }
.calendar-day strong { font-size: 15px; }
.calendar-day span { overflow: hidden; font-size: 10px; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.block-list { display: grid; gap: 8px; margin-top: 10px; }
.block-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 7px; }
.block-item div { display: grid; gap: 3px; }
.block-item span { color: var(--muted); font-size: 12px; }
.compact-filter { width: 120px; min-height: 40px; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 14px; border-top: 1px solid var(--line); }
.pagination span { color: var(--muted); font-size: 12px; font-weight: 700; }

@media (max-width: 1050px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .reminder-grid { grid-template-columns: 1fr; }
  .reservation-calendar-toolbar { align-items: flex-start; flex-wrap: wrap; }
  .reservation-calendar-toolbar .calendar-legend { width: 100%; margin-left: 0; order: 3; }
  .module-workspace-hero { align-items: flex-start; flex-wrap: wrap; }
  .module-workspace-metrics { width: 100%; margin-left: 68px; }
  .dashboard-welcome { align-items: flex-start; flex-wrap: wrap; }
  .dashboard-welcome-metrics { width: 100%; margin-left: 73px; }
  .info-card-third { grid-column: span 6; }
  .pool-config-layout, .moving-config-layout { grid-template-columns: 1fr; }
  .pool-visible-schedule textarea { min-height: 150px; }
}

@media (max-width: 760px) {
  .mobile-only { display: inline-grid !important; }
  .login-view { grid-template-columns: 1fr; }
  .login-brand { min-height: 280px; padding: 28px; }
  .login-showcase-logo { width: min(520px, 94%); padding: 18px; border-radius: 13px; }
  .login-showcase-logo img { max-height: 230px; }
  .login-form { padding: 40px 0; }
  .app-view { display: block; }
  .sidebar { width: min(280px, calc(100vw - 16px)); max-width: calc(100vw - 16px); position: fixed; z-index: 55; left: 0; transform: translateX(-105%); transition: transform .2s ease; }
  .sidebar.open { transform: translateX(0); }
  .sidebar-brand .mobile-only { margin-left: auto; color: white; }
  .topbar { height: 72px; padding: 0 14px; }
  .topbar h1 { font-size: 19px; }
  .topbar .eyebrow { display: none; }
  .content { padding: 16px 12px 32px; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .stat { min-height: 108px; padding: 14px; }
  .dashboard-welcome { padding: 18px; }
  .dashboard-welcome-icon { width: 46px; height: 46px; }
  .dashboard-welcome-copy { flex: 1; }
  .dashboard-welcome-copy h2 { font-size: 20px; }
  .dashboard-welcome-metrics { margin-left: 0; }
  .dashboard-welcome-metrics span { min-width: 0; flex: 1; }
  .dashboard-section-heading { align-items: flex-start; flex-direction: column; }
  .dashboard-activity-panel { min-height: 260px; }
  .toolbar { align-items: stretch; flex-wrap: wrap; }
  .module-workspace-hero { padding: 17px; }
  .module-workspace-icon { width: 44px; height: 44px; }
  .module-workspace-copy { flex: 1; }
  .module-workspace-copy h2 { font-size: 18px; }
  .module-workspace-metrics { margin-left: 0; display: grid; grid-template-columns: repeat(3, 1fr); }
  .module-workspace-metrics span { min-width: 0; }
  .module-records-shell { padding: 8px; }
  .search-field { min-width: 100%; max-width: none; }
  .toolbar select { width: calc(55% - 5px); }
  .toolbar .page-size-control { width: calc(50% - 5px); }
  .toolbar .page-size-control select { width: 100%; }
  .toolbar .compact-filter { width: calc(50% - 5px); }
  .toolbar #export-records, .toolbar #manage-reservation-blocks { flex: 1 1 auto; }
  .toolbar #manage-payment-concepts { flex: 1 1 auto; }
  .concept-item { align-items: flex-start; flex-direction: column; }
  .concept-actions { width: 100%; justify-content: flex-end; }
  .result-count { width: calc(45% - 5px); display: flex; align-items: center; justify-content: flex-end; }
  .topbar-actions .primary-button span, .topbar-actions .mail-button span, .topbar-actions .help-button span, .topbar-actions .theme-button span { display: none; }
  .topbar-actions .primary-button, .topbar-actions .mail-button, .topbar-actions .help-button, .topbar-actions .theme-button { width: 40px; min-width: 40px; padding: 0; }
  .info-hero { align-items: flex-start; flex-direction: column; }
  .info-editor-grid { grid-template-columns: 1fr; }
  .info-card-third, .info-card-full { grid-column: 1; }
  .slot-group-header { align-items: flex-start; flex-direction: column; }
  .slot-row { grid-template-columns: 1fr 1fr; }
  .slot-row label:first-child { grid-column: 1 / -1; }
  .slot-row .icon-button { justify-self: end; }
  .inline-form { grid-template-columns: 1fr; align-items: stretch; }
  .global-search-head { flex-direction: column; }
  .global-result-group > header { align-items: flex-start; flex-direction: column; }
  .global-result { grid-template-columns: minmax(0, 1fr) 22px; }
  .global-result .badge { grid-column: 1 / -1; justify-self: start; }
  .form-grid, .detail-grid { grid-template-columns: 1fr; }
  .reminder-hero { align-items: flex-start; flex-wrap: wrap; }
  .reminder-switch { width: 100%; margin-left: 68px; }
  .reminder-schedule-grid { grid-template-columns: 1fr 1fr; }
  .reminder-schedule-grid label:first-child { grid-column: 1 / -1; }
  .reminder-actions { position: static; align-items: stretch; flex-direction: column; }
  .reminder-actions > div { display: grid; grid-template-columns: 1fr; }
  .calendar-day { min-height: 52px; }
  .calendar-day span { display: none; }
  .reservation-overview-head { align-items: flex-start; flex-direction: column; }
  .reservation-summary { width: 100%; }
  .reservation-summary span { min-width: 0; flex: 1; }
  .reservation-calendar-toolbar { gap: 9px; }
  .month-navigation { width: 100%; }
  .month-navigation strong { min-width: 0; margin-left: auto; }
  .reservation-inline-calendar { padding: 8px; gap: 4px; }
  .reservation-inline-calendar > b { padding: 3px; font-size: 0; }
  .reservation-inline-calendar > b span { display: inline; font-size: 10px; }
  .reservation-calendar-empty, .reservation-calendar-cell { min-height: 58px; }
  .reservation-calendar-cell { padding: 6px; }
  .calendar-cell-detail { display: none; }
  .calendar-cell-count { width: 17px; height: 17px; right: 4px; top: 4px; font-size: 9px; }
  .reservation-records-head { align-items: flex-start; flex-direction: column; }
  .reservation-toolbar { padding: 9px; }
  .table-panel .table-wrap { overflow: visible; }
  .table-panel table, .table-panel tbody { display: block; }
  .table-panel thead { display: none; }
  .table-panel tbody { padding: 8px; }
  .table-panel tr { margin-bottom: 9px; padding: 12px; border: 1px solid var(--line); border-radius: 7px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; background: var(--surface); }
  .table-panel td { padding: 0; border: 0; display: block !important; }
  .table-panel td:nth-last-child(1) { grid-column: 2; grid-row: 1 / span 3; align-self: center; }
  .table-panel td:nth-child(2), .table-panel td:nth-child(3), .table-panel td:nth-child(4) { grid-column: 1; }
  .pagination { flex-wrap: wrap; }
}

@media (max-width: 420px) {
  .stats-grid { grid-template-columns: 1fr; }
  .dashboard-welcome-metrics { display: grid; grid-template-columns: 1fr; }
  .dashboard-welcome-metrics span { display: flex; align-items: center; justify-content: space-between; text-align: left; }
  .dashboard-welcome-metrics strong { margin: 0; font-size: 18px; }
  .reminder-hero { padding: 17px; }
  .reminder-hero-icon { width: 44px; height: 44px; }
  .reminder-hero h2 { font-size: 18px; }
  .reminder-switch { margin-left: 0; }
  .reminder-days > div { grid-template-columns: repeat(4, 1fr); }
  .reminder-metrics { grid-template-columns: 1fr; }
  .module-workspace-metrics { grid-template-columns: 1fr; width: 100%; }
  .module-workspace-metrics span { display: flex; align-items: center; justify-content: space-between; text-align: left; }
  .module-workspace-metrics strong { margin: 0; font-size: 17px; }
}
.payment-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 0 0 18px;
}

.payment-summary-grid .stat {
  min-height: 112px;
}

@media (max-width: 980px) {
  .payment-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .payment-summary-grid {
    grid-template-columns: 1fr;
  }
}
.danger-button {
  align-items: center;
  background: #b42318;
  border: 1px solid #b42318;
  border-radius: 10px;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  gap: 8px;
  justify-content: center;
  min-height: 42px;
  padding: 10px 14px;
}

.danger-button:hover {
  background: #912018;
}

.danger-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.module-kpi-grid { margin-bottom: 16px; }
.module-kpi-grid.kpi-compact { grid-template-columns: repeat(2, minmax(160px, 240px)); }
.dashboard-charts-row { margin: 18px 0; display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; align-items: stretch; }
.chart-panel { padding: 18px; box-shadow: 0 9px 25px rgba(15,42,70,.05); }
.chart-panel > header { margin-bottom: 16px; }
.chart-panel h2 { margin: 0; font-size: 15px; }
.chart-panel > header p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.bar-chart { height: 190px; display: grid; grid-template-columns: repeat(var(--bars, 5), 1fr); align-items: end; gap: 12px; }
.bar-chart-column { height: 100%; display: grid; grid-template-rows: 1fr auto auto; justify-items: center; gap: 6px; }
.bar-chart-track { width: 100%; height: 100%; display: flex; align-items: flex-end; justify-content: center; }
.bar-chart-fill { width: 56%; min-height: 3px; border-radius: 6px 6px 0 0; background: var(--green-700); transition: height .3s ease; }
.bar-chart-value { font-size: 12px; font-weight: 800; }
.bar-chart-label { color: var(--muted); font-size: 10px; text-align: center; }
.donut-chart-wrap { display: flex; align-items: center; gap: 22px; }
.donut-chart { width: 140px; height: 140px; flex: 0 0 auto; border-radius: 50%; }
.donut-legend { display: grid; gap: 12px; }
.donut-legend-item { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.donut-legend-item strong { margin-left: auto; }
.donut-dot { width: 10px; height: 10px; flex: 0 0 auto; border-radius: 50%; }
@media (max-width: 1050px) {
  .dashboard-charts-row { grid-template-columns: 1fr; }
}
.export-dropdown { position: relative; }
.export-menu { width: 190px; position: absolute; z-index: 20; top: calc(100% + 6px); right: 0; padding: 6px; display: grid; gap: 2px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); }
.export-menu button { min-height: 38px; border: 0; border-radius: 6px; padding: 0 10px; display: flex; align-items: center; gap: 8px; color: var(--ink); background: transparent; text-align: left; font-size: 13px; }
.export-menu button:hover { background: var(--green-100); }
.export-menu svg { width: 16px; }

@media print {
  .sidebar, .topbar, .toolbar, .pagination, .backdrop, .detail-drawer, .toast { display: none !important; }
  .app-view { display: block !important; }
  .content { padding: 0 !important; }
  .module-records-shell, .table-panel, .reservation-table-panel { box-shadow: none !important; }
}

.credential-value {
  background: #eef4ff;
  border: 1px solid #b2ccff;
  border-radius: 8px;
  color: #194185;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 1.05rem;
  overflow-wrap: anywhere;
  padding: 12px;
  user-select: all;
}
