:root {
  font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #17334d;
  background: #f4f7fa;
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: grid; grid-template-columns: 238px 1fr; }
body.locked { overflow: hidden; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.login-screen { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; padding: 24px; background: linear-gradient(145deg, #eff8ff, #f8fbfd 58%, #e9f4fb); }
.login-card { width: min(410px, 100%); padding: 38px; border: 1px solid #dbe8f1; border-radius: 22px; background: white; box-shadow: 0 30px 80px rgba(11,53,88,.14); }
.login-card label { display: grid; gap: 7px; margin-top: 18px; color: #557087; font-size: 13px; font-weight: 600; }
.login-mark { margin-bottom: 24px; }
.login-help { margin-top: 12px; color: #71869a; font-size: 13px; line-height: 1.7; }
.login-button { width: 100%; margin-top: 22px; }
.development-hint { display: block; margin-top: 14px; color: #8a9baa; text-align: center; }
.login-error { min-height: 20px; margin-top: 12px; color: #b43838; text-align: center; font-size: 13px; }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 28px 20px; background: #0b3558; color: white; display: flex; flex-direction: column; }
.brand { display: flex; gap: 12px; align-items: center; padding: 0 10px 30px; }
.brand-mark { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: white; color: #1479c9; font-family: Georgia, serif; font-weight: 700; border: 3px solid #72c5ee; }
.brand strong, .brand span { display: block; }
.brand strong { font-family: Georgia, "Songti SC", serif; font-size: 18px; letter-spacing: 1px; }
.brand span { margin-top: 3px; color: #9eb9ce; font-size: 12px; }
nav { display: grid; gap: 8px; }
.nav-item { border: 0; border-radius: 10px; padding: 13px 16px; color: #bcd0df; background: transparent; text-align: left; }
.nav-item:hover, .nav-item.active { background: rgba(255,255,255,.11); color: white; }
.sidebar-note { margin-top: auto; padding: 14px 10px 0; color: #7898b0; font-size: 12px; border-top: 1px solid rgba(255,255,255,.1); }
main { min-width: 0; padding: 0 42px 48px; }
.topbar { height: 112px; display: flex; align-items: center; justify-content: space-between; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.user-chip { padding: 8px 11px; border-radius: 999px; color: #315975; background: #e9f4fb; font-size: 12px; }
h1, h2, p { margin: 0; }
h1 { font-family: Georgia, "Songti SC", serif; font-size: 28px; color: #0b3558; }
h2 { font-family: Georgia, "Songti SC", serif; font-size: 22px; color: #0b3558; }
.eyebrow { margin-bottom: 7px; color: #1782cf; font-size: 12px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }
.today { font-size: 13px; color: #668096; }
.view { display: none; }
.view.active { display: block; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin-bottom: 20px; }
.metric, .panel { border: 1px solid #e0e8ee; background: white; border-radius: 16px; box-shadow: 0 10px 28px rgba(11,53,88,.05); }
.metric { padding: 24px; min-height: 154px; }
.metric span, .metric small { display: block; color: #71869a; }
.metric strong { display: block; margin: 15px 0 12px; font: 42px/1 Georgia, serif; color: #0b3558; }
.metric small { font-size: 12px; }
.metric.accent { background: #147fcf; border-color: #147fcf; }
.metric.accent span, .metric.accent small, .metric.accent strong { color: white; }
.panel { padding: 26px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.text-button, .icon-button { border: 0; background: transparent; color: #147fcf; }
.status-chip { border-radius: 999px; padding: 8px 12px; color: #237352; background: #ecf9f2; font-size: 12px; }
.status-chip.warning { color: #9b5c22; background: #fff1df; }
.task-list, .followup-list, .doctor-list { display: grid; gap: 10px; }
.task, .followup-card, .doctor-row { display: flex; align-items: center; gap: 16px; padding: 15px 16px; border: 1px solid #e5ebf0; border-radius: 12px; }
.task-avatar, .doctor-avatar { flex: 0 0 auto; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: white; background: #70bfe4; font-family: Georgia, serif; }
.task-main, .followup-main { min-width: 0; flex: 1; }
.task-main strong, .followup-main strong { display: block; margin-bottom: 4px; }
.task-main span, .followup-main span, .doctor-meta span { color: #76899b; font-size: 13px; }
.tag { flex: 0 0 auto; border-radius: 999px; padding: 6px 10px; font-size: 12px; color: #97651e; background: #fff6e7; }
.tag.done { color: #237352; background: #ecf9f2; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 15px 12px; text-align: left; border-bottom: 1px solid #edf1f4; font-size: 13px; white-space: nowrap; }
th { color: #7890a5; font-weight: 600; background: #f8fafc; }
.empty { display: none; padding: 45px 10px 20px; color: #8394a3; text-align: center; }
.empty.visible { display: block; }
.filter-row { display: flex; gap: 10px; }
.filter-row input { width: 130px; padding: 9px 10px; }
.attention-filter { display: inline-flex !important; align-items: center; gap: 7px; margin: 0 !important; white-space: nowrap; color: #60788c; font-size: 12px; }
.attention-filter input { width: auto; }
select, input, textarea { width: 100%; border: 1px solid #d7e0e7; border-radius: 9px; padding: 11px 12px; color: #17334d; background: white; outline: none; }
select:focus, input:focus, textarea:focus { border-color: #147fcf; box-shadow: 0 0 0 3px rgba(20,127,207,.11); }
.filter-row select { width: 150px; padding: 9px 10px; }
.primary, .secondary { border: 1px solid #147fcf; border-radius: 9px; padding: 11px 18px; }
.primary { color: white; background: #147fcf; }
.primary:hover { background: #0d6fb8; }
.primary.small { padding: 9px 14px; }
.secondary { color: #274860; background: white; border-color: #d7e0e7; }
.danger { border: 1px solid #efcaca; border-radius: 9px; padding: 11px 18px; color: #a93737; background: #fffafa; }
.danger:hover { border-color: #d88d8d; background: #fff3f3; }
.danger.small { padding: 9px 14px; }
.followup-card { align-items: flex-start; }
.followup-quality { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: -4px 0 18px; }
.followup-quality > div { padding: 14px 16px; border: 1px solid #e4ebf1; border-radius: 12px; background: #f7fafc; }
.followup-quality span, .followup-quality strong { display: block; }
.followup-quality span { color: #72879a; font-size: 12px; }
.followup-quality strong { margin-top: 5px; color: #0b3558; font: 22px/1.2 Georgia, serif; }
.followup-card .meta-grid { display: flex; flex-wrap: wrap; gap: 7px 18px; margin-top: 8px; color: #71869a; font-size: 12px; }
.overdue { color: #b43838 !important; font-weight: 700; }
.followup-card button { align-self: center; }
.settings-grid { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(320px, .92fr); gap: 20px; }
.configuration-workflow { margin-bottom: 20px; border-top: 3px solid #147ec9; }
.configuration-workflow-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.configuration-workflow h3 { margin: 0 0 10px; color: #163d5d; font-size: 14px; }
.workflow-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.compact-list { display: grid; gap: 8px; max-height: 190px; overflow: auto; }
.compact-list > div { padding: 9px 10px; border-radius: 9px; background: #f4f8fb; color: #536c80; font-size: 12px; line-height: 1.5; }
.compact-list .critical { border-left: 3px solid #cc3f3f; background: #fff4f4; color: #9d2c2c; }
.configuration-history { margin-top: 18px; padding-top: 16px; border-top: 1px solid #e5ebf0; }
.version-list { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.version-item { min-width: 210px; padding: 11px 12px; border: 1px solid #e1e9ef; border-radius: 10px; background: #fff; }
.version-item strong, .version-item span { display: block; }
.version-item span { margin-top: 4px; color: #72869a; font-size: 11px; line-height: 1.45; }
.version-item button { margin-top: 9px; }
.form-panel label, dialog label { display: grid; gap: 7px; margin-bottom: 16px; color: #557087; font-size: 13px; font-weight: 600; }
.two-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.template-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; margin: 4px 0 18px; padding: 14px; border-radius: 10px; background: #f6f9fb; }
.template-fields strong { grid-column: 1 / -1; color: #315975; font-size: 13px; }
.template-fields label { margin: 0; }
.template-fields .wide { grid-column: 1 / -1; }
.helper { margin: -10px 0 20px; color: #7a8e9e; font-size: 12px; line-height: 1.7; }
.permission-editor { margin-top: 6px; padding: 14px; border: 1px solid #dde7ee; border-radius: 10px; background: #f7fafc; }
.permission-editor .helper { margin: 0 0 12px; }
.permission-editor select[multiple] { min-height: 160px; padding: 6px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; }
.permission-editor select[multiple] option { padding: 5px 7px; border-radius: 5px; }
.doctor-row { justify-content: space-between; }
.doctor-schedule { position: relative; display: block; }
.doctor-schedule .doctor-avatar { display: none; }
.doctor-schedule > .switch { position: absolute; top: 18px; right: 18px; }
.doctor-meta { flex: 1; }
.doctor-schedule .doctor-meta { width: 100%; padding-right: 58px; }
.doctor-meta strong, .doctor-meta span { display: block; }
.doctor-meta span { margin-top: 4px; }
.schedule-fields { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 14px; }
.doctor-profile-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; padding: 14px; border-radius: 10px; background: #f6f9fb; }
.doctor-profile-fields label { display: grid; gap: 6px; color: #60788c; font-size: 12px; }
.doctor-profile-fields .wide { grid-column: 1 / -1; }
.profile-check { grid-column: 1 / -1; display: flex !important; align-items: center; gap: 8px !important; }
.profile-check input { width: auto; }
.schedule-fields label { display: grid; gap: 6px; color: #60788c; font-size: 12px; }
.schedule-fields .wide { grid-column: 1 / -1; }
.save-doctor-schedule { margin-top: 10px; }
.appointment-action { display: grid; grid-template-columns: 128px 180px auto auto; gap: 7px; min-width: 520px; }
.appointment-action select, .appointment-action input { padding: 8px 9px; font-size: 12px; }
.reception-heading { align-items: flex-start; }
.reception-filters { display: grid; grid-template-columns: 150px minmax(180px, 1fr) 140px auto auto; gap: 8px; }
.reception-filters input, .reception-filters select, .reception-filters button { padding: 9px 10px; }
.reception-summary { display: flex; flex-wrap: wrap; gap: 10px; margin: -6px 0 18px; }
.reception-summary span { padding: 8px 12px; border-radius: 999px; color: #557087; background: #f1f6fa; font-size: 12px; }
.reception-summary strong { color: #0b3558; }
.reception-action { display: grid; grid-template-columns: 105px 170px auto; gap: 7px; min-width: 380px; }
.reception-action select, .reception-action input { padding: 8px; font-size: 12px; }
.health-warning { max-width: 360px; margin-top: 6px; padding: 6px 8px; border-radius: 7px; color: #884e18; background: #fff5e7; font-size: 11px; white-space: normal; }
.muted-action { color: #8a9baa; font-size: 12px; }
.article-helper { margin: -8px 0 22px; color: #71869a; font-size: 13px; line-height: 1.7; }
.article-admin-list { display: grid; gap: 12px; }
.article-admin-card { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 20px; border: 1px solid #e5ebf0; border-radius: 13px; }
.article-admin-main { min-width: 0; flex: 1; }
.article-admin-main > strong { display: block; margin: 10px 0 7px; color: #0b3558; font-family: Georgia, "Songti SC", serif; font-size: 19px; }
.article-admin-main > p { max-width: 780px; margin: 0; overflow: hidden; color: #657d91; font-size: 13px; line-height: 1.7; text-overflow: ellipsis; white-space: nowrap; }
.article-admin-main > small { display: block; margin-top: 10px; color: #8a9baa; }
.article-admin-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; color: #7c90a1; font-size: 12px; }
.article-admin-actions { display: flex; flex: 0 1 460px; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.schedule-panel { margin-top: 20px; }
.exception-form { display: grid; grid-template-columns: 160px 180px minmax(220px, 1fr) auto; gap: 12px; align-items: end; }
.exception-form label { display: grid; gap: 7px; color: #557087; font-size: 13px; font-weight: 600; }
.exception-list { display: grid; gap: 10px; margin-top: 20px; }
.exception-item { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 16px; border: 1px solid #e5ebf0; border-radius: 12px; }
.exception-item strong, .exception-item span { display: block; }
.exception-item span { margin-top: 4px; color: #76899b; font-size: 12px; }
.service-plan-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.service-plan { display: grid; gap: 12px; padding: 16px; border: 1px solid #e5ebf0; border-radius: 12px; }
.service-plan strong, .service-plan span { display: block; }
.service-plan span { margin-top: 4px; color: #76899b; font-size: 12px; }
.service-plan label { display: grid; gap: 6px; color: #60788c; font-size: 12px; }
.notification-list { display: grid; gap: 10px; }
.notification-template-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; margin-bottom: 18px; }
.notification-template { padding: 14px; border: 1px solid #dfe8ef; border-radius: 12px; background: #f7fafc; }
.notification-template strong, .notification-template span, .notification-template small { display: block; }
.notification-template span, .notification-template small { margin-top: 5px; color: #71869a; font-size: 12px; }
.notification-template button { margin-top: 10px; }
.notification-item { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; border: 1px solid #e5ebf0; border-radius: 12px; }
.notification-item strong, .notification-item span, .notification-item small { display: block; }
.notification-item span { margin-top: 4px; color: #76899b; font-size: 12px; }
.notification-item small { margin-top: 4px; color: #b43838; }
.source-chip { border-radius: 999px; padding: 6px 9px; color: #315975; background: #eef5f9; font-size: 11px; }
.schedule-heading { align-items: flex-start; }
.schedule-toolbar, .patient-search { display: flex; gap: 8px; align-items: center; }
.schedule-toolbar input { width: 160px; }
.patient-search input { width: 240px; }
.schedule-legend { display: flex; gap: 18px; margin: -8px 0 18px; color: #708699; font-size: 12px; }
.schedule-legend span { display: flex; align-items: center; gap: 6px; }
.legend-dot { width: 9px; height: 9px; border-radius: 50%; background: #e9a63d; }
.legend-dot.arrived { background: #39a979; }
.legend-dot.closed { background: #d26a6a; }
.calendar-wrap { overflow-x: auto; padding-bottom: 8px; }
.schedule-grid { display: grid; min-width: 1120px; border: 1px solid #e2e9ee; border-radius: 13px; overflow: hidden; background: #e2e9ee; gap: 1px; }
.schedule-corner, .schedule-date, .schedule-doctor, .schedule-cell { min-height: 82px; padding: 12px; background: white; }
.schedule-corner, .schedule-date { min-height: auto; color: #60788c; background: #f6f9fb; font-size: 12px; }
.schedule-date strong, .schedule-date span, .schedule-doctor strong, .schedule-doctor span { display: block; }
.schedule-date span, .schedule-doctor span { margin-top: 4px; color: #8496a4; font-size: 11px; }
.schedule-cell { display: grid; align-content: start; gap: 7px; }
.schedule-cell.is-closed { background: #fff6f6; }
.schedule-booking { width: 100%; border: 1px solid #f1d29d; border-radius: 8px; padding: 8px; color: #6f4d18; background: #fff8eb; text-align: left; }
.schedule-booking.is-arrived { border-color: #bde4d2; color: #226247; background: #eefaf4; }
.schedule-booking strong, .schedule-booking span { display: block; font-size: 11px; }
.schedule-booking span { margin-top: 3px; opacity: .76; }
.schedule-empty-cell { color: #a1afb9; font-size: 11px; text-align: center; padding-top: 18px; }
.closed-note { color: #a44747; font-size: 11px; }
.waitlist-list, .patient-list, .staff-list, .backup-list { display: grid; gap: 10px; }
.waitlist-item, .patient-card, .staff-card, .backup-item { display: flex; align-items: center; gap: 14px; padding: 16px; border: 1px solid #e5ebf0; border-radius: 12px; }
.backup-item > div:first-child { min-width: 0; flex: 1; }
.backup-item strong, .backup-item span, .backup-item small { display: block; }
.backup-item span, .backup-item small { margin-top: 4px; color: #718596; font-size: 12px; overflow-wrap: anywhere; }
.waitlist-item > div:first-child, .patient-main, .staff-main, .backup-item > div { flex: 1; min-width: 0; }
.waitlist-item > div:last-child, .staff-actions { display: flex; align-items: center; gap: 8px; }
.waitlist-item strong, .waitlist-item span, .waitlist-item small, .patient-main strong, .patient-main span, .patient-main small, .staff-main strong, .staff-main span, .staff-main small, .backup-item strong, .backup-item span { display: block; }
.waitlist-item span, .patient-main span, .staff-main span, .backup-item span { margin-top: 4px; color: #708699; font-size: 12px; }
.waitlist-item small, .patient-main small, .staff-main small { display: block; margin-top: 5px; color: #91a0ac; font-size: 11px; }
.staff-status { width: 10px; height: 10px; border-radius: 50%; background: #c7d1d9; }
.staff-status.is-enabled { background: #38aa78; box-shadow: 0 0 0 4px #e8f7f0; }
.panel-subheading { display: flex; align-items: end; justify-content: space-between; margin: 26px 0 12px; padding-top: 22px; border-top: 1px solid #e8eef3; }
.panel-subheading h3 { margin: 3px 0 0; color: #173e5f; font-size: 16px; }
.integration-connection-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.integration-connection-item { min-width: 0; padding: 14px 16px; border: 1px solid #dce7ef; border-radius: 11px; background: #f7fbfd; }
.integration-connection-item span, .integration-connection-item strong { display: block; }
.integration-connection-item span { margin-bottom: 6px; color: #73889a; font-size: 11px; }
.integration-connection-item strong { overflow-wrap: anywhere; color: #173e5f; font-size: 13px; line-height: 1.5; }
.integration-category-fieldset { display: grid; gap: 10px; margin: 0 0 16px; padding: 16px; border: 1px solid #dce5ec; border-radius: 11px; }
.integration-category-fieldset legend { padding: 0 7px; color: #557087; font-size: 13px; font-weight: 700; }
.integration-category-fieldset label { display: flex; align-items: center; gap: 9px; margin: 0; }
.integration-category-fieldset input { width: auto; }
.credential-dialog { width: min(760px, calc(100vw - 32px)); padding: 30px; }
.credential-secret { display: grid; gap: 10px; margin-top: 18px; }
.credential-secret-row { padding: 13px 15px; border: 1px solid #dce6ed; border-radius: 10px; background: #f7fafc; }
.credential-secret-row span, .credential-secret-row code { display: block; max-width: none; }
.credential-secret-row span { margin-bottom: 6px; color: #768b9b; font-size: 11px; }
.credential-secret-row code { overflow-wrap: anywhere; color: #123d60; font: 600 13px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: normal; }
.ops-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.ops-card { min-height: 140px; padding: 22px; border: 1px solid #e0e8ee; border-radius: 15px; background: white; box-shadow: 0 10px 28px rgba(11,53,88,.05); }
.ops-card span, .ops-card small { display: block; color: #708699; font-size: 12px; }
.ops-card strong { display: block; margin: 17px 0 9px; font: 24px/1.2 Georgia, "Songti SC", serif; }
.ops-card.is-ok strong { color: #23825a; }
.ops-card.is-warning strong { color: #b47723; }
.timeline { position: relative; display: grid; gap: 0; max-height: 310px; overflow: auto; margin: 18px 0; padding: 4px 2px; }
.timeline-item { position: relative; display: grid; grid-template-columns: 18px 1fr; gap: 10px; padding-bottom: 18px; }
.timeline-item::before { content: ""; position: absolute; left: 5px; top: 13px; bottom: 0; width: 1px; background: #dbe5ec; }
.timeline-item:last-child::before { display: none; }
.timeline-item i { z-index: 1; width: 11px; height: 11px; margin-top: 3px; border-radius: 50%; background: #43a5d7; box-shadow: 0 0 0 4px #edf7fc; }
.timeline-item strong, .timeline-item span, .timeline-item small { display: block; }
.timeline-item span { margin-top: 4px; color: #60788c; font-size: 12px; }
.timeline-item small { margin-top: 4px; color: #94a3ad; font-size: 11px; }
.merge-box { margin-top: 18px; padding: 14px; border-radius: 10px; background: #fff8f8; }
.merge-box strong { display: block; margin-bottom: 10px; color: #8f4545; font-size: 13px; }
.merge-box > div { display: grid; grid-template-columns: minmax(160px, 1fr) minmax(200px, 1.4fr) auto; gap: 8px; }
#appointment-form, #waitlist-form, #patient-form, #staff-form, #role-form, #password-form, #security-incident-form, #vendor-form, #compliance-review-form, #visit-form, #payment-form, #refund-form { max-height: min(90vh, 900px); overflow-y: auto; padding: 28px; }
.notice-card { margin-bottom: 18px; padding: 14px 16px; border: 1px solid #cfe1ee; border-radius: 10px; background: #f3f9fd; }
.notice-card strong, .notice-card p, .notice-card span, .notice-card small { display: block; margin: 0; }
.notice-card p { margin-top: 5px; color: #60788c; font-size: 13px; line-height: 1.6; }
.notice-card span, .notice-card small { margin-top: 6px; color: #60788c; font-size: 12px; line-height: 1.6; }
.charge-editor { margin-top: 18px; padding: 16px; border: 1px solid #dfe8ef; border-radius: 12px; background: #f8fbfd; }
.charge-editor .panel-heading { margin-bottom: 12px; }
.charge-editor h3 { margin: 0; color: #173e5f; font-size: 15px; }
.charge-item-row { display: grid; grid-template-columns: minmax(160px, 1fr) 80px 130px auto; gap: 8px; margin-top: 8px; }
.charge-item-row input, .charge-item-row button { padding: 9px 10px; }
.charge-total { margin-top: 14px; color: #61798c; text-align: right; }
.charge-total strong { margin-left: 10px; color: #0b3558; font: 24px/1 Georgia, serif; }
.funnel-grid { display: grid; grid-template-columns: repeat(7, minmax(110px, 1fr)); gap: 10px; overflow-x: auto; margin: 8px 0 26px; padding-bottom: 4px; }
.funnel-step { position: relative; min-width: 110px; padding: 18px 15px; border: 1px solid #dfe8ef; border-radius: 12px; background: linear-gradient(145deg, #f8fbfd, #eef7fc); }
.funnel-step:not(:last-child)::after { position: absolute; top: 50%; right: -9px; color: #77aecd; content: "›"; transform: translateY(-50%); }
.funnel-step span, .funnel-step small { display: block; color: #72879a; font-size: 11px; }
.funnel-step strong { display: block; margin: 10px 0 8px; color: #0b3558; font: 30px/1 Georgia, serif; }
.analytics-money-grid .metric strong { font-size: 30px; }
.analytics-rates { margin-top: 0; }
code { max-width: 360px; display: inline-block; overflow: hidden; color: #587084; text-overflow: ellipsis; vertical-align: bottom; }
.switch { position: relative; width: 44px; height: 25px; }
.switch input { opacity: 0; position: absolute; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: #c8d4dd; transition: .2s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 19px; height: 19px; border-radius: 50%; background: white; box-shadow: 0 2px 5px rgba(0,0,0,.15); transition: .2s; }
.switch input:checked + span { background: #147fcf; }
.switch input:checked + span::after { transform: translateX(19px); }
dialog { width: min(620px, calc(100vw - 32px)); border: 0; border-radius: 18px; padding: 0; color: #17334d; box-shadow: 0 28px 70px rgba(10,39,63,.25); }
#session-dialog { padding: 28px; }
#article-dialog { width: min(980px, calc(100vw - 32px)); }
.article-preview-dialog { width: min(860px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow-y: auto; padding: 36px 46px; }
.article-preview-heading { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; }
.article-preview-heading h2 { margin: 4px 0 0; color: #0b3558; font: 34px/1.3 Georgia, "Songti SC", serif; }
.article-preview-summary { color: #6d8192; line-height: 1.8; }
.article-preview-content { margin-top: 30px; color: #2d4254; font: 17px/1.95 Georgia, "Songti SC", serif; overflow-wrap: anywhere; }
.article-preview-content img { display: block; max-width: 100%; height: auto; margin: 28px auto; }
.article-preview-content blockquote { margin: 24px 0; padding: 18px 20px; border-left: 4px solid #147fcf; background: #f1f7fb; }
.article-preview-warning { margin: 34px 0 0; padding: 14px 16px; border-radius: 8px; color: #765626; background: #fff8e7; font-size: 12px; line-height: 1.7; }
dialog::backdrop { background: rgba(7,28,45,.48); }
#followup-form, #article-form, #seo-integration-form { padding: 28px; }
#article-form { max-height: min(90vh, 920px); overflow-y: auto; }
.article-editor-field { margin-bottom: 16px; }
.article-editor-label { display: block; margin-bottom: 7px; color: #557087; font-size: 13px; font-weight: 600; }
.rich-editor-shell { overflow: hidden; border: 1px solid #d7e0e7; border-radius: 11px; background: white; }
.rich-editor-shell:focus-within { border-color: #147fcf; box-shadow: 0 0 0 3px rgba(20,127,207,.11); }
.rich-editor-toolbar { position: sticky; top: 0; z-index: 2; display: flex; flex-wrap: wrap; gap: 5px; padding: 9px; border-bottom: 1px solid #e2e9ee; background: #f7fafc; }
.rich-editor-toolbar button { min-height: 32px; border: 1px solid transparent; border-radius: 7px; padding: 6px 9px; color: #38566e; background: transparent; font-size: 12px; }
.rich-editor-toolbar button:hover, .rich-editor-toolbar button:focus-visible { border-color: #c8d9e5; color: #0e6faf; background: white; outline: none; }
.rich-editor-toolbar .toolbar-image-button { color: white; background: #147fcf; }
.rich-editor-toolbar .toolbar-image-button:hover { color: white; background: #0d6fb8; }
.toolbar-divider { width: 1px; margin: 4px 2px; background: #d9e3ea; }
.article-content-input { min-height: 330px; padding: 22px; color: #253f54; line-height: 1.85; outline: none; }
.article-content-input:empty::before { color: #9baab6; content: attr(data-placeholder); pointer-events: none; }
.article-content-input h2 { margin: 26px 0 12px; color: #0b3558; font: 700 26px/1.45 Georgia, "Songti SC", serif; }
.article-content-input h3 { margin: 22px 0 10px; color: #173e5f; font: 700 20px/1.5 Georgia, "Songti SC", serif; }
.article-content-input p { margin: 0 0 14px; }
.article-content-input ul, .article-content-input ol { margin: 12px 0 18px; padding-left: 28px; }
.article-content-input blockquote { margin: 18px 0; padding: 12px 16px; border-left: 3px solid #41a5d8; color: #557087; background: #f2f8fc; }
.article-content-input a { color: #147fcf; text-decoration: underline; }
.article-content-input figure { margin: 24px 0; }
.article-content-input img { display: block; max-width: 100%; height: auto; margin: 22px auto 8px; border-radius: 10px; }
.article-content-input figcaption { color: #7c8d9b; font-size: 12px; text-align: center; }
.article-editor-help { display: flex; justify-content: space-between; gap: 16px; margin-top: 8px; color: #8193a2; font-size: 12px; line-height: 1.6; }
#article-image-status { flex: 0 0 auto; color: #147fcf; font-weight: 600; }
.dialog-heading { display: flex; justify-content: space-between; align-items: start; margin-bottom: 24px; }
.icon-button { font-size: 28px; color: #6b8092; line-height: 1; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
.toast { position: fixed; right: 24px; bottom: 24px; transform: translateY(30px); opacity: 0; transition: .2s; padding: 12px 16px; border-radius: 9px; color: white; background: #17334d; pointer-events: none; }
.toast.show { transform: translateY(0); opacity: 1; }
@media (max-width: 980px) {
  body { grid-template-columns: 78px 1fr; }
  .brand > div:last-child, .nav-item { font-size: 0; }
  .nav-item::first-letter { font-size: 16px; }
  .sidebar-note { display: none; }
  main { padding-inline: 24px; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .configuration-workflow-grid { grid-template-columns: 1fr; }
  .reception-filters { grid-template-columns: 1fr 1fr; }
  .service-plan-list { grid-template-columns: 1fr; }
  .exception-form { grid-template-columns: 1fr 1fr; }
  .ops-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 1180px) {
  .topbar .today { display: none; }
}
@media (max-width: 640px) {
  body { display: block; }
  #article-dialog { width: calc(100vw - 16px); }
  #article-form { padding: 18px; }
  .article-content-input { min-height: 300px; padding: 16px; }
  .article-editor-help { display: block; }
  #article-image-status { display: block; margin-top: 4px; }
  .sidebar { position: fixed; z-index: 5; inset: auto 0 0; width: auto; height: 64px; padding: 8px; }
  .brand, .sidebar-note { display: none; }
  nav { display: flex; gap: 4px; overflow-x: auto; }
  .nav-item { flex: 0 0 76px; padding: 13px 4px; text-align: center; font-size: 12px; }
  main { padding: 0 14px 84px; }
  .topbar { height: 96px; }
  .today, .user-chip, #create-backup, #change-password { display: none; }
  .metric-grid, .two-columns { grid-template-columns: 1fr; }
  .integration-connection-grid { grid-template-columns: 1fr; }
  .followup-quality { grid-template-columns: 1fr 1fr; }
  .metric-grid { gap: 10px; }
  .metric { min-height: 120px; }
  .panel { padding: 18px; }
  .panel-heading { align-items: flex-start; }
  .filter-row { display: grid; }
  .followup-card { flex-wrap: wrap; }
  .exception-form, .schedule-fields { grid-template-columns: 1fr; }
  .reception-filters, .doctor-profile-fields, .template-fields { grid-template-columns: 1fr; }
  .template-fields strong { grid-column: auto; }
  .doctor-profile-fields .wide, .profile-check { grid-column: auto; }
  .schedule-fields .wide { grid-column: auto; }
  .topbar-actions { gap: 6px; }
  .login-card { padding: 28px 22px; }
  .article-admin-card { align-items: flex-start; flex-direction: column; }
  .article-admin-main > p { white-space: normal; }
  .article-admin-actions { width: 100%; flex-basis: auto; justify-content: stretch; }
  .article-admin-actions button { flex: 1 1 120px; }
  .schedule-toolbar, .patient-search { width: 100%; flex-wrap: wrap; }
  .schedule-toolbar input, .patient-search input { flex: 1; min-width: 150px; }
  .ops-grid { grid-template-columns: 1fr; }
  .charge-item-row { grid-template-columns: 1fr 72px; }
  .charge-item-row .charge-price { grid-column: 1 / 2; }
.staff-card, .waitlist-item { align-items: flex-start; flex-direction: column; }
  .staff-actions { width: 100%; flex-wrap: wrap; }
  .staff-actions button { flex: 1; }
  .merge-box > div { grid-template-columns: 1fr; }
}
