:root {
  --ink: #17232d;
  --muted: #687987;
  --line: #dfe7eb;
  --surface: #fff;
  --canvas: #f3f7f8;
  --primary: #097a73;
  --primary-dark: #075f5a;
  --primary-soft: #e4f4f1;
  --navy: #123948;
  --orange: #e9873f;
  --red: #c84b51;
  --yellow: #c78b18;
  --shadow: 0 18px 48px rgba(18, 57, 72, .1);
  --radius: 16px;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { min-width: 320px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.danger-text { color: var(--red) !important; }

.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, 1.1fr) minmax(440px, .9fr); }
.login-story { position: relative; overflow: hidden; padding: 52px 7vw; color: white; background: linear-gradient(145deg, #0d4a56 0%, #0a766f 64%, #47a797 100%); display: flex; flex-direction: column; justify-content: space-between; }
.login-story::before, .login-story::after { content: ""; position: absolute; border: 1px solid rgba(255,255,255,.13); border-radius: 50%; }
.login-story::before { width: 540px; height: 540px; right: -170px; top: -90px; box-shadow: 0 0 0 70px rgba(255,255,255,.025), 0 0 0 150px rgba(255,255,255,.018); }
.login-story::after { width: 240px; height: 240px; left: -100px; bottom: 100px; }
.brand, .sidebar-brand { display: flex; align-items: center; gap: 12px; font-size: 20px; font-weight: 750; letter-spacing: .04em; }
.brand-mark { position: relative; display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: #f26122 url("/app-icon.png") center/cover no-repeat; box-shadow: none; }
.brand-light .brand-mark { background: #f26122 url("/app-icon.png") center/cover no-repeat; }
.brand-mark i, .brand-mark b { display: none; }
.story-copy { position: relative; z-index: 1; max-width: 660px; }
.eyebrow { display: block; color: var(--primary); font-size: 12px; line-height: 1; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; margin-bottom: 16px; }
.eyebrow.light { color: #b9e9df; }
.story-copy h1 { font-size: clamp(42px, 5vw, 72px); line-height: 1.14; letter-spacing: -.05em; margin: 0 0 26px; }
.story-copy > p { max-width: 600px; color: #d9efeb; font-size: 18px; line-height: 1.9; }
.story-points { display: flex; gap: 10px; margin-top: 46px; }
.story-points div { min-width: 130px; padding: 17px 18px; border: 1px solid rgba(255,255,255,.15); border-radius: 14px; background: rgba(255,255,255,.08); backdrop-filter: blur(8px); }
.story-points strong, .story-points span { display: block; }
.story-points strong { margin-bottom: 7px; font-size: 16px; }
.story-points span, .story-foot { color: #cce9e4; font-size: 12px; }
.login-panel { display: grid; place-items: center; padding: 56px; background: #fbfdfd; }
.login-card { width: min(100%, 400px); }
.mobile-brand { display: none; }
.login-card h2 { margin: 0; font-size: 34px; letter-spacing: -.03em; }
.login-card > p { margin: 10px 0 30px; }
label { display: grid; gap: 8px; color: #344852; font-size: 13px; font-weight: 650; margin: 0 0 18px; }
input, select, textarea { width: 100%; color: var(--ink); border: 1px solid #d5e0e4; border-radius: 10px; padding: 12px 13px; outline: none; background: white; transition: border-color .2s, box-shadow .2s; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(9,122,115,.12); }
textarea { min-height: 96px; resize: vertical; }
.password-field { position: relative; display: block; }
.password-field input { padding-right: 72px; }
.password-field .icon-button { position: absolute; right: 5px; top: 5px; width: 58px; height: 34px; font-size: 12px; color: var(--primary); }
.form-error { min-height: 20px; margin: -5px 0 10px !important; color: var(--red) !important; font-size: 13px; }
.button { border: 0; border-radius: 10px; padding: 10px 16px; font-weight: 700; color: var(--ink); background: #edf2f3; transition: transform .15s, background .15s; }
.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: .55; cursor: wait; transform: none; }
.button.primary { color: white; background: var(--primary); box-shadow: 0 6px 18px rgba(9,122,115,.18); }
.button.primary:hover { background: var(--primary-dark); }
.button.ghost { color: #526671; background: transparent; border: 1px solid var(--line); }
.button.danger { color: white; background: var(--red); }
.button.small { padding: 7px 10px; font-size: 12px; }
.button.wide { width: 100%; padding: 13px; }
.login-hint { margin-top: 26px; color: var(--muted); text-align: center; font-size: 12px; }
.status-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; background: #35a86f; box-shadow: 0 0 0 4px rgba(53,168,111,.12); }

.app-shell { min-height: 100vh; display: block; }
.sidebar { position: fixed; left: 0; top: 0; width: 252px; height: 100vh; z-index: 20; display: flex; flex-direction: column; padding: 26px 18px 18px; color: #d7e4e8; background: #123742; }
.sidebar-brand { padding: 0 9px 24px; color: white; border-bottom: 1px solid rgba(255,255,255,.1); }
.sidebar-brand .brand-mark { width: 38px; height: 38px; background: #f26122 url("/app-icon.png") center/cover no-repeat; }
.sidebar-brand small, .privacy-pill small { display: block; margin-top: 3px; color: #8da9b1; font-size: 10px; font-weight: 500; letter-spacing: .04em; }
.sidebar nav { flex: 1; overflow: auto; padding-top: 15px; }
.nav-label { margin: 20px 12px 8px; color: #6f929c; font-size: 10px; font-weight: 800; letter-spacing: .14em; }
.nav-item { width: 100%; display: flex; align-items: center; gap: 12px; margin: 3px 0; padding: 10px 12px; border: 0; border-radius: 9px; color: #b7cbd1; background: transparent; text-align: left; font-size: 14px; }
.nav-item span { width: 21px; color: #7899a2; text-align: center; font-size: 16px; }
.nav-item:hover { color: white; background: rgba(255,255,255,.06); }
.nav-item.active { color: white; background: #0b8178; box-shadow: 0 8px 25px rgba(4,35,39,.2); }
.nav-item.active span { color: white; }
.sidebar-foot { padding-top: 14px; border-top: 1px solid rgba(255,255,255,.1); color: #76959e; font-size: 10px; }
.privacy-pill { display: flex; align-items: center; gap: 9px; margin-bottom: 15px; }
.privacy-pill > span { color: #5cd0a3; font-size: 8px; }
.privacy-pill strong { display: block; color: #bad1d6; font-size: 11px; }
.workspace { min-width: 0; margin-left: 252px; width: calc(100% - 252px); overflow-x: hidden; }
.topbar { position: sticky; top: 0; z-index: 15; height: 72px; display: flex; align-items: center; justify-content: space-between; padding: 0 34px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.93); backdrop-filter: blur(14px); }
.crumb { display: flex; gap: 10px; align-items: center; font-size: 13px; }
.crumb b { color: #c2ccd0; }
.crumb strong { color: var(--primary); }
.top-actions { position: relative; display: flex; align-items: center; gap: 18px; }
.notification-shell { position: relative; }
.notification-button { position: relative; color: var(--primary); font-size: 20px; }
.notification-badge { position: absolute; right: -4px; top: -4px; min-width: 18px; height: 18px; display: grid; place-items: center; padding: 0 5px; border: 2px solid white; border-radius: 999px; color: white; background: var(--red); font-size: 9px; font-weight: 800; }
.notification-panel { position: absolute; z-index: 30; right: 0; top: 45px; width: min(380px, calc(100vw - 30px)); overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: white; box-shadow: 0 18px 50px rgba(13,43,53,.18); }
.notification-panel > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 15px; border-bottom: 1px solid var(--line); }
.notification-panel > header strong, .notification-panel > header small { display: block; }
.notification-panel > header small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.notification-list { max-height: min(460px, calc(100vh - 120px)); overflow-y: auto; }
.notification-item { width: 100%; display: grid; grid-template-columns: 8px 1fr; gap: 10px; padding: 13px 15px; border: 0; border-bottom: 1px solid #edf1f2; color: var(--ink); background: white; text-align: left; }
.notification-item:hover { background: #fff9f2; }
.notification-item.unread { background: #fffaf5; }
.notification-dot { width: 7px; height: 7px; margin-top: 5px; border-radius: 50%; background: #c8d2d5; }
.notification-item.unread .notification-dot { background: var(--orange); box-shadow: 0 0 0 3px #fff0e5; }
.notification-item strong, .notification-item small, .notification-item time { display: block; }
.notification-item strong { font-size: 12px; }
.notification-item small { margin-top: 5px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.notification-item time { margin-top: 6px; color: #9aa8ad; font-size: 9px; }
.notification-empty { padding: 36px 18px; color: var(--muted); text-align: center; font-size: 11px; }
.server-clock { color: var(--muted); font-size: 12px; }
.scope-switch { display: flex; align-items: center; gap: 6px; padding: 7px 10px; border: 1px solid #cfe0e4; border-radius: 10px; color: #34535d; background: #f7fafb; font-size: 10px; transition: border-color .18s, background .18s, transform .18s; }
.scope-switch:hover { transform: translateY(-1px); border-color: var(--primary); background: var(--primary-soft); }
.scope-switch span { color: var(--muted); }
.scope-switch strong { color: var(--primary); font-size: 11px; }
.scope-switch b { color: var(--orange); font-size: 12px; }
.user-button { display: flex; align-items: center; gap: 9px; padding: 5px 7px; border: 0; border-radius: 10px; color: var(--ink); background: transparent; }
.user-button:hover { background: #f0f5f5; }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; color: white; background: var(--primary); font-size: 13px; }
.user-copy { text-align: left; line-height: 1.2; }
.user-copy strong, .user-copy small { display: block; }
.user-copy strong { font-size: 12px; }
.user-copy small { color: var(--muted); font-size: 10px; margin-top: 3px; }
.user-menu { position: absolute; right: 0; top: 48px; min-width: 150px; padding: 7px; border: 1px solid var(--line); border-radius: 11px; background: white; box-shadow: var(--shadow); }
.user-menu button { display: block; width: 100%; padding: 9px 11px; border: 0; border-radius: 7px; background: white; text-align: left; font-size: 12px; }
.user-menu button:hover { background: #f2f6f6; }
.icon-button { display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 9px; color: var(--muted); background: transparent; }
.icon-button:hover { background: #eef4f4; }
.menu-button { display: none; }
.page-root { padding: 30px 34px 60px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.page-heading h1 { margin: 4px 0 6px; font-size: 28px; letter-spacing: -.035em; }
.page-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.heading-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.period-form { display: flex; align-items: end; gap: 8px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.period-form label { display: grid; gap: 4px; color: var(--muted); font-size: 9px; font-weight: 750; }
.period-form input { width: 128px; padding: 7px 9px; font-size: 11px; }
.period-separator { align-self: center; margin-top: 12px; color: var(--muted); font-size: 10px; }

.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; margin-bottom: 18px; }
.metrics.metrics-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.metric-card, .panel { border: 1px solid #e0e8eb; border-radius: var(--radius); background: white; box-shadow: 0 5px 20px rgba(19,57,72,.035); }
.metric-card { position: relative; overflow: hidden; min-height: 135px; padding: 20px; }
.metric-card::after { content: ""; position: absolute; right: -20px; top: -28px; width: 88px; height: 88px; border-radius: 50%; background: var(--primary-soft); }
.metric-card.orange::after { background: #fff0e5; }
.metric-card.navy::after { background: #e7eff2; }
.metric-card.red::after { background: #fae9ea; }
.metric-label { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 12px; font-weight: 650; }
.metric-icon { position: relative; z-index: 1; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: var(--primary); background: var(--primary-soft); }
.orange .metric-icon { color: var(--orange); background: #fff0e5; }
.navy .metric-icon { color: var(--navy); background: #e7eff2; }
.red .metric-icon { color: var(--red); background: #fae9ea; }
.metric-value { margin-top: 17px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 28px; font-weight: 800; letter-spacing: -.05em; }
.metric-note { margin-top: 7px; color: var(--muted); font-size: 11px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(320px, .9fr); gap: 18px; }
.panel { overflow: hidden; }
.panel-header { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 16px 19px; border-bottom: 1px solid #edf1f2; }
.panel-header h2 { margin: 0; font-size: 15px; }
.panel-header small { color: var(--muted); }
.panel-body { padding: 19px; }
.panel.no-border .panel-header { border: 0; }
.schedule-list, .activity-list { display: grid; }
.schedule-item { display: grid; grid-template-columns: 72px 1fr auto; gap: 13px; align-items: center; padding: 13px 0; border-bottom: 1px solid #edf1f2; }
.schedule-item:last-child, .activity-item:last-child { border: 0; }
.schedule-time { font-family: ui-monospace, monospace; font-size: 12px; color: var(--primary); }
.schedule-main strong, .schedule-main small { display: block; }
.schedule-main strong { font-size: 13px; }
.schedule-main small { margin-top: 4px; color: var(--muted); font-size: 11px; }
.activity-item { display: grid; grid-template-columns: 30px 1fr; gap: 10px; padding: 11px 0; border-bottom: 1px solid #edf1f2; }
.activity-dot { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; color: var(--primary); background: var(--primary-soft); font-size: 10px; }
.activity-item p { margin: 0; font-size: 12px; line-height: 1.5; }
.activity-item time { color: var(--muted); font-size: 10px; }
.empty-state { padding: 44px 20px; color: var(--muted); text-align: center; }
.empty-state strong { display: block; margin-bottom: 7px; color: var(--ink); }
.chart { height: 190px; display: flex; align-items: end; gap: 9px; padding-top: 18px; }
.chart-column { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: end; align-items: center; gap: 7px; }
.chart-bar { width: min(36px, 72%); min-height: 3px; border-radius: 6px 6px 2px 2px; background: linear-gradient(#21a398, #08776f); }
.chart-column small { color: var(--muted); font-size: 9px; white-space: nowrap; }
.chart-column b { font-size: 9px; }

.toolbar { display: flex; align-items: center; gap: 10px; padding: 15px 18px; border-bottom: 1px solid var(--line); }
.search-box { position: relative; flex: 1; max-width: 380px; }
.search-box input { padding: 9px 13px 9px 35px; font-size: 12px; }
.search-box::before { content: "⌕"; position: absolute; z-index: 1; left: 12px; top: 8px; color: var(--muted); }
.toolbar select { width: 150px; padding: 9px 11px; font-size: 12px; }
.filter-toolbar { flex-wrap: wrap; align-items: center; }
.filter-toolbar > input { width: 150px; padding: 9px 11px; font-size: 12px; }
.filter-toolbar .search-box { min-width: 240px; }
.table-wrap { overflow: auto; scrollbar-width: none; }
.table-wrap::-webkit-scrollbar { width: 0; height: 0; }
.table-scroll-shell { position: relative; min-width: 0; }
.table-scroll-shell.has-floating-scroller { padding-bottom: 42px; }
table { width: 100%; border-collapse: collapse; }
th { padding: 11px 16px; color: #72828b; background: #f8fafb; font-size: 10px; font-weight: 800; letter-spacing: .07em; text-align: left; white-space: nowrap; }
td { padding: 13px 16px; border-top: 1px solid #edf1f2; font-size: 12px; vertical-align: middle; }
tbody tr:hover { background: #fbfdfd; }
.freeze-first th:first-child, .freeze-first td:first-child { position: sticky; left: 0; z-index: 3; min-width: 165px; background: white; box-shadow: 1px 0 0 var(--line), 7px 0 12px rgba(20,52,63,.04); }
.freeze-first th:first-child { z-index: 5; background: #f8fafb; }
.freeze-first tbody tr:hover td:first-child { background: #fbfdfd; }
.table-local-scroller { position: absolute; z-index: 9; left: 12px; right: 12px; display: grid; grid-template-columns: auto minmax(160px, 1fr); align-items: center; gap: 12px; min-height: 34px; padding: 5px 14px; border: 1px solid rgba(205,218,222,.92); border-radius: 10px; background: rgba(248,250,251,.94); box-shadow: 0 5px 16px rgba(25,56,67,.12); backdrop-filter: blur(10px); }
.table-local-scroller.is-floating { box-shadow: 0 8px 24px rgba(25,56,67,.2); }
.table-local-scroller span { color: var(--muted); font-size: 10px; font-weight: 750; white-space: nowrap; }
.table-local-scroller input { width: 100%; margin: 0; padding: 0; accent-color: var(--orange); cursor: ew-resize; }
.cell-sub { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; font-weight: 500; }
.patient-cell { display: flex; align-items: center; gap: 10px; }
.patient-avatar { display: grid; place-items: center; width: 31px; height: 31px; flex: 0 0 auto; border-radius: 9px; color: var(--primary); background: var(--primary-soft); font-weight: 750; }
.patient-cell strong, .patient-cell small { display: block; }
.patient-cell small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.badge { display: inline-flex; align-items: center; padding: 4px 8px; border-radius: 999px; color: var(--primary); background: var(--primary-soft); font-size: 10px; font-weight: 750; white-space: nowrap; }
.badge.gray { color: #66757c; background: #edf1f2; }
.badge.orange { color: #a75b22; background: #fff0e5; }
.badge.red { color: #aa3c43; background: #fae9ea; }
.badge.blue { color: #356b86; background: #e7f1f7; }
.actions { display: flex; gap: 5px; }
.text-button { padding: 4px 6px; border: 0; color: var(--primary); background: transparent; font-size: 11px; }
.text-button:hover { text-decoration: underline; }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 13px 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.pagination-buttons { display: flex; gap: 6px; }
.followup-candidates { margin-bottom: 18px; }

.modal-layer { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 22px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(6,29,36,.52); backdrop-filter: blur(3px); }
.modal-card { position: relative; width: min(680px, 100%); max-height: calc(100vh - 44px); overflow: auto; border-radius: 18px; background: white; box-shadow: 0 30px 80px rgba(0,0,0,.25); }
.modal-card > header { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: flex-start; padding: 22px 25px 17px; border-bottom: 1px solid var(--line); background: white; }
.modal-card h2 { margin: 0; font-size: 21px; }
.modal-card .eyebrow { margin-bottom: 8px; }
.modal-body { padding: 22px 25px 5px; }
.modal-card footer { position: sticky; bottom: 0; display: flex; justify-content: flex-end; gap: 9px; padding: 14px 25px; border-top: 1px solid var(--line); background: white; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.form-grid .full { grid-column: 1 / -1; }
.form-help { margin: -7px 0 15px; color: var(--muted); font-size: 11px; }
.patient-picker { position: relative; display: grid; gap: 7px; }
.patient-picker::before { content: "⌕"; position: absolute; z-index: 1; left: 12px; top: 9px; color: var(--muted); }
.patient-picker > input[type="search"] { padding-left: 34px; background: white; }
.patient-picker > small { color: var(--muted); font-size: 10px; font-weight: 400; }
.switch-row { display: flex; align-items: center; justify-content: space-between; padding: 12px; border: 1px solid var(--line); border-radius: 10px; }
.switch-row input { width: auto; }
.toast-region { position: fixed; z-index: 100; right: 22px; bottom: 22px; display: grid; gap: 8px; }
.toast { min-width: 270px; max-width: 380px; padding: 13px 16px; border-left: 4px solid var(--primary); border-radius: 9px; color: white; background: #173d47; box-shadow: var(--shadow); font-size: 12px; animation: toast-in .25s ease both; }
.toast.error { border-color: #f18086; }
@keyframes toast-in { from { transform: translateY(10px); opacity: 0; } }
.alert { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 18px; padding: 14px 17px; border: 1px solid #f2d9ad; border-radius: 12px; color: #75501a; background: #fff8e9; font-size: 12px; line-height: 1.6; }
.alert strong { display: block; }
.ai-hero { min-height: 270px; display: grid; grid-template-columns: 1.1fr .9fr; overflow: hidden; border-radius: 20px; color: white; background: linear-gradient(135deg, #173d4a, #0a716c); }
.ai-copy { padding: 40px; }
.ai-copy h2 { margin: 0 0 14px; font-size: 30px; }
.ai-copy p { max-width: 570px; color: #cee5e4; line-height: 1.8; }
.ai-visual { position: relative; display: grid; place-items: center; background: radial-gradient(circle, rgba(99,218,198,.22), transparent 58%); }
.ai-orbit { width: 155px; height: 155px; border: 1px solid rgba(255,255,255,.35); border-radius: 50%; display: grid; place-items: center; box-shadow: 0 0 0 30px rgba(255,255,255,.035), 0 0 0 62px rgba(255,255,255,.025); font-size: 48px; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.role-list { display: grid; gap: 10px; }
.role-row { display: flex; justify-content: space-between; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 10px; }
.role-row strong, .role-row small { display: block; }
.role-row small { margin-top: 4px; color: var(--muted); }
.ratio-value { min-width: 120px; text-align: right; }
.ratio-value strong { margin-bottom: 5px; font-size: 12px; }
.ratio-track { display: block; width: 120px; height: 6px; overflow: hidden; border-radius: 8px; background: #e8efef; }
.ratio-track i { display: block; height: 100%; border-radius: inherit; background: var(--primary); }
.consultant-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.consultant-hero-grid { display: grid; grid-template-columns: minmax(300px, 1fr) minmax(0, 2fr); gap: 18px; margin-bottom: 18px; }
.consultant-revenue-hero { align-self: start; width: 100%; min-height: 0; height: 190px; display: flex; flex-direction: column; justify-content: space-between; padding: 25px 28px; overflow: hidden; border: 1px solid #d8e7f4; border-radius: var(--radius); color: white; background: linear-gradient(145deg, #1768ac, #0b4f8a); box-shadow: 0 18px 42px rgba(20,92,151,.18); text-align: left; cursor: pointer; transition: transform .18s ease, box-shadow .18s ease; }
.consultant-revenue-hero:hover { transform: translateY(-2px); box-shadow: 0 22px 48px rgba(20,92,151,.24); }
.consultant-revenue-hero:focus-visible { outline: 3px solid rgba(23,104,172,.28); outline-offset: 3px; }
.consultant-revenue-hero > div { display: flex; align-items: flex-start; flex-direction: column; gap: 7px; }
.consultant-revenue-hero span { font-size: 15px; font-weight: 750; letter-spacing: .08em; white-space: nowrap; }
.consultant-revenue-hero small { color: rgba(255,255,255,.76); }
.consultant-revenue-hero > strong { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: clamp(34px, 3.3vw, 54px); letter-spacing: -.07em; overflow-wrap: anywhere; }
.consultant-revenue-hero p { margin: 0; color: rgba(255,255,255,.82); font-size: 12px; }
.consultant-revenue-hero p b { float: right; color: white; font-weight: 750; }
.consultant-kpi-grid { height: 190px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); gap: 9px; }
.consultant-kpi-grid.has-five { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.consultant-kpi-grid .metric-card { min-height: 0; padding: 11px 13px; }
.consultant-kpi-grid .metric-card:last-child { grid-column: auto; }
.consultant-kpi-grid .metric-value { margin-top: 4px; font-size: 19px; }
.consultant-kpi-grid .metric-note { margin-top: 3px; font-size: 9px; }
.consultant-kpi-grid .metric-icon { width: 25px; height: 25px; }
.dashboard-link-card { width: 100%; color: inherit; font-family: inherit; text-align: left; cursor: pointer; transition: transform .18s ease, box-shadow .18s ease; }
.dashboard-link-card:hover { transform: translateY(-2px); box-shadow: 0 10px 25px rgba(19,57,72,.1); }
.dashboard-link-card:focus-visible { outline: 3px solid rgba(244,122,31,.24); outline-offset: 2px; }
.admin-hero-grid { display: grid; grid-template-columns: minmax(330px, 1.15fr) minmax(0, 2fr); gap: 18px; margin-bottom: 18px; }
.admin-revenue-hero { align-self: stretch; width: 100%; min-height: 190px; display: flex; flex-direction: column; justify-content: space-between; padding: 25px 28px; overflow: hidden; border: 1px solid #d8e7f4; border-radius: var(--radius); color: white; background: linear-gradient(135deg, #195f9c, #0a477d); box-shadow: 0 18px 42px rgba(20,92,151,.2); text-align: left; cursor: pointer; transition: transform .18s ease, box-shadow .18s ease; }
.admin-revenue-hero:hover { transform: translateY(-2px); box-shadow: 0 22px 48px rgba(20,92,151,.27); }
.admin-revenue-hero:focus-visible { outline: 3px solid rgba(23,104,172,.28); outline-offset: 3px; }
.admin-revenue-hero > div { display: flex; align-items: flex-start; flex-direction: column; gap: 7px; }
.admin-revenue-hero span { font-size: 15px; font-weight: 800; letter-spacing: .08em; white-space: nowrap; }
.admin-revenue-hero small { color: rgba(255,255,255,.76); }
.admin-revenue-hero > strong { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: clamp(36px, 3.5vw, 56px); letter-spacing: -.07em; overflow-wrap: anywhere; }
.admin-revenue-hero p { margin: 0; color: rgba(255,255,255,.82); font-size: 12px; }
.admin-revenue-hero p b { float: right; color: white; font-weight: 800; }
.admin-kpi-grid { min-height: 190px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); gap: 9px; }
.admin-kpi-grid .metric-card { min-height: 0; padding: 11px 13px; }
.admin-kpi-grid .metric-card:nth-child(4), .admin-kpi-grid .metric-card:nth-child(5) { grid-column: span 1; }
.admin-kpi-grid .metric-card:nth-child(5) { grid-column: span 2; }
.admin-kpi-grid .metric-value { margin-top: 4px; font-size: 19px; }
.admin-kpi-grid .metric-note { margin-top: 3px; font-size: 9px; }
.admin-kpi-grid .metric-icon { width: 25px; height: 25px; }
.admin-dashboard-panels { grid-template-columns: minmax(0, 1.65fr) minmax(320px, .9fr); }
.admin-schedule-list { display: grid; }
.admin-schedule-item { display: grid; grid-template-columns: 130px minmax(260px, 1fr) auto; gap: 14px; align-items: center; padding: 15px 0; border-bottom: 1px solid #edf1f2; }
.admin-schedule-item:last-child { border: 0; }
.admin-schedule-date strong, .admin-schedule-date small, .admin-schedule-main strong, .admin-schedule-main small { display: block; }
.admin-schedule-date strong { color: var(--primary); font: 750 13px ui-monospace, monospace; }
.admin-schedule-date small { margin-top: 5px; color: var(--muted); font-size: 10px; }
.admin-schedule-main strong { font-size: 13px; }
.admin-schedule-main small { margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.admin-schedule-status { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.consultant-intention-list { display: grid; gap: 12px; max-height: 390px; overflow-y: auto; }
.consultant-intention-row { display: grid; grid-template-columns: minmax(110px, .35fr) minmax(420px, 1fr); align-items: center; gap: 16px; padding: 13px; border: 1px solid var(--line); border-radius: 11px; }
.consultant-intention-name { border: 0; color: inherit; background: transparent; font-family: inherit; text-align: left; cursor: pointer; }
.consultant-intention-name:hover strong { color: var(--orange); }
.consultant-intention-name:focus-visible { outline: 3px solid rgba(244,122,31,.24); outline-offset: 2px; }
.consultant-intention-name strong, .consultant-intention-name small { display: block; }
.consultant-intention-name small { margin-top: 4px; color: var(--muted); }
.intention-breakdown { display: grid; grid-template-columns: repeat(4, minmax(72px, 1fr)); gap: 7px; }
.intention-chip { display: grid; grid-template-columns: 1fr auto; gap: 2px 7px; padding: 8px 9px; border: 0; border-radius: 8px; color: inherit; background: #f2f5f5; font-family: inherit; text-align: left; cursor: pointer; transition: transform .16s ease, box-shadow .16s ease; }
.intention-chip:hover { transform: translateY(-1px); box-shadow: 0 5px 14px rgba(19,57,72,.1); }
.intention-chip:focus-visible { outline: 3px solid rgba(244,122,31,.24); outline-offset: 2px; }
.intention-chip b { font-size: 10px; }
.intention-chip strong { font-size: 14px; }
.intention-chip small { grid-column: 1 / -1; color: var(--muted); font-size: 9px; }
.intention-1 { background: #edf3f6; }
.intention-2 { background: #fff3e9; }
.intention-3 { background: #e9f7f3; }
.ranking-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px; }
.dashboard-ranking-list { display: grid; gap: 13px; }
.dashboard-ranking-row { display: grid; grid-template-columns: 28px minmax(80px, .35fr) minmax(220px, 1fr); align-items: center; gap: 10px; }
.ranking-number { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 8px; color: var(--orange); background: #fff0e5; font: 800 11px ui-monospace, monospace; }
.dashboard-ranking-row > strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.ranking-bars { display: grid; gap: 7px; }
.ranking-bars > div, .ranking-bars > button { position: relative; width: 100%; height: 22px; overflow: hidden; border: 0; border-radius: 6px; color: inherit; background: #f0f4f5; font-family: inherit; text-align: left; cursor: pointer; }
.ranking-bars > button:hover { box-shadow: inset 0 0 0 1px rgba(244,122,31,.35); }
.ranking-bars > button:focus-visible { outline: 3px solid rgba(244,122,31,.24); outline-offset: 2px; }
.ranking-bars small { position: absolute; z-index: 1; left: 8px; top: 4px; color: #24434b; font-size: 9px; }
.ranking-bars i { display: block; height: 100%; border-radius: inherit; opacity: .62; }
.performance-bar { background: linear-gradient(90deg, #ffb27f, #f26122); }
.customer-bar { background: linear-gradient(90deg, #7fd5ca, #15988d); }
.consultant-trend-panel { margin-top: 0; }
.comparison-section { margin-bottom: 18px; padding: 20px; border: 1px solid #dce8ef; border-radius: 18px; background: linear-gradient(145deg, #f5faff, #fff); box-shadow: 0 10px 28px rgba(22,88,128,.06); }
.comparison-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 16px; }
.comparison-heading h2 { margin: 3px 0 5px; color: #153f65; font-size: 20px; }
.comparison-heading p { margin: 0; color: var(--muted); font-size: 11px; }
.comparison-switch { display: inline-flex; padding: 3px; border: 1px solid #d6e4ed; border-radius: 10px; background: #edf5fa; }
.comparison-switch button { padding: 8px 15px; border: 0; border-radius: 8px; color: #507084; background: transparent; font: 700 11px inherit; cursor: pointer; }
.comparison-switch button.active { color: white; background: #176fa4; box-shadow: 0 4px 11px rgba(23,111,164,.22); }
.comparison-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.trend-card { border-color: #dce8ef; box-shadow: none; }
.trend-card .panel-header { min-height: 68px; }
.trend-legend { display: flex; flex-wrap: wrap; gap: 12px; color: var(--muted); font-size: 10px; }
.trend-legend span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.trend-legend i { width: 16px; height: 3px; border-radius: 3px; }
.trend-legend i.appointment { background: #227db3; }
.trend-legend i.completed { background: #f27a2a; }
.trend-doctor-select { min-width: 130px; max-width: 190px; padding: 8px 28px 8px 10px; border: 1px solid #d2e0e8; border-radius: 9px; color: #20485f; background: white; font-size: 11px; }
.trend-chart-wrap { min-width: 0; }
.trend-line-chart { display: block; width: 100%; min-width: 520px; height: auto; overflow: visible; }
.trend-card .panel-body { overflow-x: auto; }
.trend-grid-line { stroke: #e3edf2; stroke-width: 1; }
.trend-axis-text { fill: #77909f; font-size: 9px; }
.trend-line { fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.trend-line.appointment { stroke: #227db3; }
.trend-line.completed { stroke: #f27a2a; }
.trend-point { stroke: white; stroke-width: 2; }
.trend-point.appointment { fill: #227db3; }
.trend-point.completed { fill: #f27a2a; }
.trend-value-label { font-size: 9px; font-weight: 800; }
.trend-value-label.appointment { fill: #176794; }
.trend-value-label.completed { fill: #c95c17; }
.trend-latest { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 5px; }
.trend-latest span { display: inline-flex; align-items: center; gap: 5px; padding: 7px 9px; border-radius: 8px; color: #526c7a; background: #f2f7fa; font-size: 10px; }
.trend-latest b { color: #173f57; font-size: 13px; }
.trend-latest em { font-style: normal; font-weight: 800; }
.trend-latest em.up { color: #15906f; }
.trend-latest em.down { color: #db5a54; }
.trend-latest em.flat { color: #708793; }
.statistics-deal-details { margin-top: 18px; }
.dispatch-thumbs { display: flex; flex-wrap: wrap; gap: 4px; width: 186px; min-width: 42px; }
.dispatch-thumbs button { width: 34px; height: 34px; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: white; cursor: zoom-in; }
.dispatch-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.attachment-panel { margin: 0 0 18px; }
.attachment-panel > strong, .binding-section > div > strong { display: block; margin-bottom: 5px; font-size: 13px; }
.attachment-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.attachment-item { display: grid; gap: 6px; padding: 9px; border: 1px solid var(--line); border-radius: 10px; }
.attachment-preview, .upload-preview-item > button { width: 100%; padding: 0; overflow: hidden; border: 0; border-radius: 7px; background: #edf2f3; cursor: zoom-in; }
.attachment-item img, .upload-preview-item img { width: 100%; aspect-ratio: 1 / 1; border-radius: 7px; object-fit: cover; transition: transform .2s ease; }
.attachment-item span { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.upload-preview { display: grid; gap: 8px; margin-top: 9px; }
.upload-preview > small { color: var(--muted); font-size: 10px; font-weight: 500; }
.upload-preview-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.upload-preview-item { display: grid; gap: 5px; min-width: 0; }
.upload-preview-item > span { color: var(--muted); font-size: 9px; text-align: center; }
.image-gallery-layer { position: fixed; inset: 0; z-index: 130; display: grid; place-items: center; padding: 22px; }
.image-gallery-backdrop { position: absolute; inset: 0; background: rgba(5,20,27,.82); backdrop-filter: blur(5px); }
.image-gallery-card { position: relative; width: min(980px, 100%); max-height: calc(100vh - 44px); display: grid; grid-template-rows: auto minmax(0, 1fr) auto; overflow: hidden; border-radius: 16px; background: #10242b; box-shadow: 0 30px 90px rgba(0,0,0,.45); }
.image-gallery-card header, .image-gallery-card footer { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 12px 16px; color: white; background: #17343d; }
.image-gallery-card footer > span, .image-gallery-card footer > small { min-width: 125px; color: #c9dadd; font-size: 10px; }
.image-gallery-card footer > small { text-align: right; }
.image-gallery-tools { display: flex; align-items: center; justify-content: center; gap: 8px; }
.image-gallery-tools button { display: inline-flex; align-items: center; gap: 5px; min-height: 34px; padding: 7px 12px; border: 1px solid rgba(255,255,255,.18); border-radius: 8px; color: white; background: rgba(255,255,255,.08); cursor: pointer; }
.image-gallery-tools button:hover { background: rgba(255,255,255,.18); }
.image-gallery-tools button b { font-size: 20px; line-height: 1; }
.image-gallery-stage { min-height: 430px; display: grid; grid-template-columns: 50px minmax(0, 1fr) 50px; place-items: center; overflow: hidden; padding: 18px; }
.image-gallery-stage > img { max-width: 100%; max-height: 68vh; object-fit: contain; transition: transform .22s ease; }
.image-gallery-stage > button { width: 42px; height: 68px; border: 0; border-radius: 10px; color: white; background: rgba(255,255,255,.12); font-size: 34px; cursor: pointer; }
.image-gallery-stage > button:disabled { opacity: .25; }
.binding-section { margin-bottom: 18px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #fbfdfd; }
.binding-section > div > small { display: block; margin-bottom: 12px; color: var(--muted); font-size: 11px; }
.consultant-checkbox-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; max-height: 230px; overflow-y: auto; padding-right: 3px; }
.consultant-check-row { display: flex; align-items: center; gap: 10px; margin: 0; padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: white; cursor: pointer; }
.consultant-check-row:has(input:checked) { border-color: var(--primary); background: #fff6ec; box-shadow: inset 0 0 0 1px var(--primary); }
.consultant-check-row > input { width: auto; }
.consultant-check-row span strong, .consultant-check-row span small { display: block; }
.consultant-check-row span small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.department-child::before { content: "↳"; margin-right: 7px; color: var(--primary); }
.doctor-binding-grid { display: grid; gap: 8px; }
.doctor-binding-row { display: grid; grid-template-columns: auto minmax(120px, 1fr) minmax(140px, 1fr); align-items: center; gap: 10px; margin: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; background: white; }
.doctor-binding-row > input[type="checkbox"] { width: auto; }
.doctor-binding-row > span strong, .doctor-binding-row > span small { display: block; }
.doctor-binding-row > span small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.doctor-binding-row > input[type="text"] { padding: 8px 10px; }
.moment-form { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.moment-form button { grid-column: 1 / -1; }
.business-overview { display: grid; gap: 18px; }
.overview-module { overflow: hidden; }
.overview-module .panel-header { align-items: center; }
.overview-module .panel-header > div:first-child { display: grid; grid-template-columns: auto 1fr; column-gap: 9px; align-items: center; }
.overview-module .panel-header h2 { grid-column: 2; }
.overview-module .panel-header small { grid-column: 2; }
.overview-index { grid-row: 1 / span 2; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: #fff; background: linear-gradient(135deg, #f47b20, #ffac68); font: 800 11px ui-monospace, monospace; }
.collection-layout { display: grid; grid-template-columns: minmax(280px, .72fr) minmax(0, 1.7fr); gap: 14px; }
.collection-total { grid-row: 1 / span 2; display: flex; flex-direction: column; justify-content: space-between; min-height: 224px; padding: 25px; border: 0; border-radius: 15px; color: white; background: linear-gradient(145deg, #f47a1f, #e65d09); box-shadow: 0 14px 34px rgba(230,93,9,.2); text-align: left; cursor: pointer; }
.collection-total:hover { transform: translateY(-2px); }
.collection-total span { font-size: 13px; font-weight: 800; letter-spacing: .08em; }
.collection-total strong { font: 800 clamp(31px, 3vw, 48px) ui-monospace, monospace; letter-spacing: -.07em; overflow-wrap: anywhere; }
.collection-total small { color: rgba(255,255,255,.78); }
.overview-card-grid { display: grid; gap: 10px; }
.collection-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.overview-stat { display: flex; flex-direction: column; min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: #fbfcfd; }
.overview-stat.featured { border-color: #ffd8ba; background: #fff7f0; }
.overview-stat span { color: var(--muted); font-size: 10px; font-weight: 750; }
.overview-stat strong { margin: 11px 0 8px; color: #173d47; font: 800 clamp(18px, 1.8vw, 26px) ui-monospace, monospace; letter-spacing: -.05em; overflow-wrap: anywhere; }
.overview-stat small { color: var(--muted); font-size: 9px; line-height: 1.5; }
.prediction-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); overflow: hidden; border: 1px solid var(--line); border-radius: 12px; }
.prediction-strip > div { padding: 12px 15px; border-right: 1px solid var(--line); }
.prediction-strip > div:last-child { border: 0; }
.prediction-strip span, .prediction-strip strong, .prediction-strip small { display: block; }
.prediction-strip span { color: var(--muted); font-size: 9px; }
.prediction-strip strong { margin: 6px 0 3px; font: 750 16px ui-monospace, monospace; }
.prediction-strip small { color: var(--orange); font-size: 9px; }
.overview-totals { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.overview-totals span { padding: 6px 9px; border-radius: 8px; color: var(--muted); background: #f3f6f7; font-size: 9px; }
.overview-totals b { margin-left: 3px; color: #173d47; font-size: 11px; }
.reception-header-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.overview-inline-filter { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 7px; }
.overview-inline-filter select { width: auto; min-width: 112px; padding: 7px 28px 7px 9px; font-size: 10px; }
.combined-chart { min-width: 0; }
.chart-legend { display: flex; justify-content: flex-end; gap: 16px; margin-bottom: 14px; color: var(--muted); font-size: 9px; }
.chart-legend span::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 5px; border-radius: 3px; }
.dispatch-dot::before { background: #2d83a0; }
.success-dot::before { background: #f47a1f; }
.rate-dot::before { background: #6dc9b6; }
.combined-chart-scroll { display: flex; align-items: stretch; gap: 8px; min-height: 236px; overflow-x: auto; padding: 8px 4px 3px; border-bottom: 1px solid var(--line); }
.combined-chart-group { width: 88px; min-width: 88px; display: grid; grid-template-rows: 180px auto auto; align-items: end; gap: 4px; text-align: center; }
.combined-chart-group > strong { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.combined-chart-group > small { color: var(--muted); font-size: 8px; }
.combined-bars { height: 170px; display: flex; align-items: end; justify-content: center; gap: 4px; }
.combined-bars i { position: relative; width: 20px; min-height: 4px; border-radius: 5px 5px 2px 2px; transition: height .25s ease; }
.combined-bars i b { position: absolute; left: 50%; bottom: calc(100% + 4px); transform: translateX(-50%); color: #53676e; font: 700 8px ui-monospace, monospace; white-space: nowrap; }
.dispatch-bar { background: linear-gradient(#6eb3c8, #2d83a0); }
.success-bar { background: linear-gradient(#ffb375, #f47a1f); }
.rate-bar { background: linear-gradient(#a1e1d3, #48ad98); }
.value-chart { display: grid; gap: 10px; }
.value-chart-row { display: grid; grid-template-columns: 90px minmax(100px, 1fr) 65px 45px; align-items: center; gap: 10px; }
.value-chart-row > span { color: #29474f; font-size: 10px; font-weight: 750; }
.value-chart-row > div { height: 20px; overflow: hidden; border-radius: 6px; background: #f1f4f5; }
.value-chart-row i { display: block; height: 100%; min-width: 2px; border-radius: inherit; }
.value-chart-row strong { font: 750 10px ui-monospace, monospace; }
.value-chart-row small { color: var(--muted); font-size: 9px; }
.value-bar-0 { background: #f47a1f; }
.value-bar-1 { background: #efad42; }
.value-bar-2 { background: #5598ae; }
.value-bar-3 { background: #9ba8ad; }
.overview-bottom-grid { display: grid; grid-template-columns: minmax(320px, .8fr) minmax(480px, 1.2fr); gap: 18px; }
.two-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.three-columns { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.booking-totals { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.booking-totals > div { padding: 14px 16px; border-radius: 12px; color: white; background: linear-gradient(135deg, #235f73, #174755); }
.booking-totals span, .booking-totals strong, .booking-totals em { display: block; }
.booking-totals span { color: rgba(255,255,255,.75); font-size: 9px; }
.booking-totals strong { margin: 7px 0 4px; font: 800 24px ui-monospace, monospace; }
.booking-totals strong small { font-size: 10px; }
.booking-totals em { color: rgba(255,255,255,.72); font-size: 8px; font-style: normal; }

@media (max-width: 1100px) {
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .metrics.metrics-5 { grid-template-columns: repeat(2, 1fr); }
  .consultant-metrics { grid-template-columns: repeat(2, 1fr); }
  .consultant-hero-grid, .admin-hero-grid, .ranking-grid { grid-template-columns: 1fr; }
  .consultant-revenue-hero { height: 190px; }
  .consultant-kpi-grid { height: auto; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: auto; }
  .consultant-kpi-grid.has-five { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .consultant-kpi-grid .metric-card:last-child { grid-column: auto; }
  .admin-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: auto; }
  .admin-kpi-grid .metric-card:nth-child(5) { grid-column: auto; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .comparison-grid { grid-template-columns: 1fr; }
  .collection-layout, .overview-bottom-grid { grid-template-columns: 1fr; }
  .collection-total { grid-row: auto; min-height: 190px; }
  .login-story { padding: 44px; }
  .story-points div { min-width: 0; }
}
@media (max-width: 800px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-story { display: none; }
  .login-panel { min-height: 100vh; padding: 32px 22px; }
  .mobile-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 55px; font-size: 19px; font-weight: 800; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; transform: translateX(-100%); width: 252px; transition: transform .25s ease; }
  .sidebar.open { transform: translateX(0); }
  .workspace { width: 100%; margin-left: 0; }
  .mobile-overlay { position: fixed; inset: 0; z-index: 18; display: block; background: rgba(6,29,36,.45); }
  .menu-button { display: grid; }
  .topbar { padding: 0 18px; }
  .crumb > span, .server-clock { display: none; }
  .scope-switch span { display: none; }
  .page-root { padding: 23px 18px 50px; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .user-copy { display: none; }
  .settings-grid, .ai-hero { grid-template-columns: 1fr; }
  .comparison-section { padding: 14px; }
  .comparison-heading { align-items: stretch; flex-direction: column; }
  .comparison-switch { align-self: flex-start; }
  .collection-cards, .three-columns { grid-template-columns: 1fr; }
  .ai-visual { min-height: 240px; }
}
@media (max-width: 560px) {
  .metrics { grid-template-columns: 1fr; }
  .metrics.metrics-5 { grid-template-columns: 1fr; }
  .consultant-metrics, .moment-form { grid-template-columns: 1fr; }
  .attachment-grid, .upload-preview-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .image-gallery-stage { min-height: 340px; grid-template-columns: 38px minmax(0, 1fr) 38px; padding: 8px; }
  .image-gallery-card footer { flex-wrap: wrap; justify-content: center; }
  .image-gallery-card footer > span, .image-gallery-card footer > small { min-width: 0; flex: 1 1 80px; }
  .image-gallery-tools { order: 3; width: 100%; }
  .image-gallery-tools button { flex: 1; justify-content: center; padding-inline: 7px; font-size: 10px; }
  .consultant-kpi-grid { grid-template-columns: 1fr; }
  .consultant-kpi-grid.has-five { grid-template-columns: 1fr; }
  .consultant-kpi-grid .metric-card:last-child { grid-column: auto; }
  .admin-kpi-grid { grid-template-columns: 1fr; }
  .admin-schedule-item { grid-template-columns: 1fr; }
  .admin-schedule-status { justify-content: flex-start; }
  .consultant-intention-row { grid-template-columns: 1fr; }
  .intention-breakdown { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-ranking-row { grid-template-columns: 28px 1fr; }
  .ranking-bars { grid-column: 1 / -1; }
  .doctor-binding-row { grid-template-columns: auto 1fr; }
  .doctor-binding-row > input[type="text"] { grid-column: 1 / -1; }
  .form-grid { grid-template-columns: 1fr; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .toolbar select, .search-box { width: 100%; max-width: none; }
  .heading-actions { width: 100%; }
  .heading-actions .button { flex: 1; }
  .period-form { width: 100%; flex-wrap: wrap; }
  .period-form label { flex: 1; min-width: 120px; }
  .period-form input { width: 100%; }
  .prediction-strip, .two-columns, .booking-totals { grid-template-columns: 1fr; }
  .prediction-strip > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .value-chart-row { grid-template-columns: 75px minmax(80px, 1fr) 55px; }
  .value-chart-row small { display: none; }
  .modal-layer { padding: 0; place-items: end center; }
  .modal-card { max-height: 92vh; border-radius: 18px 18px 0 0; }
}
