:root {
  --bg: #f4f6fa;
  --card: #ffffff;
  --text: #182230;
  --muted: #667085;
  --border: #dfe5ec;
  --primary: #2457c5;
  --primary-dark: #19449e;
  --sidebar: #152238;
  --success: #087443;
  --success-bg: #eaf8f0;
  --warning: #9a6700;
  --warning-bg: #fff7df;
  --danger: #b42318;
  --danger-bg: #fff0ee;
  --shadow: 0 18px 50px rgba(22, 34, 55, .09);
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input, select { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 23px; letter-spacing: -.04em; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: var(--primary); color: #fff; font-size: 15px; box-shadow: 0 9px 24px rgba(36, 87, 197, .24); }

.login-page { min-height: 100vh; display: grid; place-items: center; padding: 28px; background: radial-gradient(circle at 12% 12%, rgba(36, 87, 197, .13), transparent 28%), var(--bg); }
.login-shell { width: min(980px, 100%); display: grid; grid-template-columns: 1fr 400px; gap: 52px; align-items: center; }
.login-intro h1 { max-width: 620px; margin: 28px 0 14px; font-size: clamp(36px, 5vw, 58px); line-height: 1.03; letter-spacing: -.055em; }
.login-intro p { max-width: 560px; margin: 0; font-size: 18px; line-height: 1.6; color: var(--muted); }
.login-card { padding: 28px; background: var(--card); border: 1px solid var(--border); border-radius: 22px; box-shadow: var(--shadow); }
h1, h2, p { margin-top: 0; }
.login-card h2, .panel h2, .welcome-card h2, dialog h2 { margin-bottom: 6px; letter-spacing: -.025em; }
label { display: block; margin: 15px 0 7px; font-size: 13px; font-weight: 700; }
input, select { width: 100%; border: 1px solid var(--border); border-radius: 11px; padding: 11px 12px; color: var(--text); background: #fff; outline: none; }
input:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(36, 87, 197, .12); }
.muted { color: var(--muted); line-height: 1.55; }

.button { display: inline-flex; justify-content: center; align-items: center; min-height: 42px; border: 0; border-radius: 11px; padding: 10px 15px; font-weight: 750; }
.login-card .button { width: 100%; margin-top: 20px; }
.button.primary { color: #fff; background: var(--primary); }
.button.primary:hover { background: var(--primary-dark); }
.button.secondary { color: #344054; background: #eef1f5; }
.button.outline { color: var(--primary); background: #fff; border: 1px solid #b9c9eb; }

.message { display: none; margin: 14px 0; padding: 11px 13px; border-radius: 10px; font-size: 14px; }
.message.error { display: block; color: var(--danger); background: var(--danger-bg); border: 1px solid #ffc7c2; }
.message.ok { display: block; color: var(--success); background: var(--success-bg); border: 1px solid #a8e1c3; }
.message.info { display: block; color: #174ea6; background: #edf4ff; border: 1px solid #bdd2f7; }

.app { min-height: 100vh; display: grid; grid-template-columns: 230px minmax(0, 1fr); }
.mobile-menu-button,
.mobile-menu-overlay { display: none; }
body.mobile-menu-open { overflow: hidden; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 22px 16px; background: var(--sidebar); color: #fff; }
.sidebar-brand { padding: 0 9px 20px; }
.nav { display: grid; gap: 5px; margin-top: 16px; }
.nav-item { width: 100%; padding: 11px 12px; border: 0; border-radius: 10px; text-align: left; color: #c7d1df; background: transparent; font-weight: 650; }
.nav-item.active { color: #fff; background: rgba(255,255,255,.11); }
.nav-item:disabled { cursor: default; opacity: .5; }
.logout { margin-top: auto; width: 100%; color: #fff !important; background: rgba(255,255,255,.10) !important; }

.content { min-width: 0; padding: 28px 34px 44px; }
.topbar { display: flex; justify-content: space-between; gap: 24px; align-items: center; margin-bottom: 26px; }
.topbar h1 { margin: 0; font-size: 30px; letter-spacing: -.04em; }
.eyebrow { margin-bottom: 5px; color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.clinic-select-label { margin: 0; color: var(--muted); }
#clinicSelect { width: 220px; }
.user-chip { display: flex; align-items: center; gap: 9px; padding-left: 5px; }
.user-chip > span { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: #dfe9ff; color: var(--primary-dark); font-size: 12px; font-weight: 800; }
.user-chip strong, .user-chip small { display: block; max-width: 180px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip small { margin-top: 2px; color: var(--muted); }

.welcome-card, .panel { background: var(--card); border: 1px solid var(--border); border-radius: 17px; box-shadow: 0 7px 25px rgba(22,34,55,.04); }
.welcome-card { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 24px; margin-bottom: 18px; }
.welcome-card p:last-child { margin-bottom: 0; }
.grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(310px, .8fr); gap: 18px; }
.panel { padding: 22px; }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 17px; }
.status { display: inline-flex; border-radius: 999px; padding: 6px 9px; font-size: 12px; font-weight: 750; }
.status.neutral { color: #475467; background: #f0f2f5; }
.status.ok { color: var(--success); background: var(--success-bg); }
.status.warning { color: var(--warning); background: var(--warning-bg); }
.check-list { display: grid; gap: 9px; }
.check-item { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid #eef1f4; }
.check-item:last-child { border-bottom: 0; }
.check-mark { color: var(--success); font-weight: 900; }
.check-mark.warning { color: var(--warning); }
.details { display: grid; margin: 0; }
.details > div { display: grid; grid-template-columns: 140px 1fr; gap: 14px; padding: 11px 0; border-bottom: 1px solid #eef1f4; }
.details > div:last-child { border-bottom: 0; }
.details dt { color: var(--muted); }
.details dd { margin: 0; font-weight: 700; text-align: right; overflow-wrap: anywhere; }
.next-step { margin-top: 18px; }
.next-step p:last-child { margin-bottom: 0; }

dialog { width: min(480px, calc(100% - 32px)); border: 0; border-radius: 18px; padding: 0; box-shadow: 0 30px 90px rgba(0,0,0,.22); }
dialog::backdrop { background: rgba(12, 20, 34, .48); }
.dialog-form { padding: 23px; }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; }
.icon-button { width: 34px; height: 34px; border: 0; border-radius: 9px; background: #eef1f5; color: #344054; font-size: 22px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }

@media (max-width: 900px) {
  .login-shell { grid-template-columns: 1fr; max-width: 560px; gap: 30px; }
  .app { grid-template-columns: 82px minmax(0, 1fr); }
  .sidebar { padding-inline: 11px; }
  .sidebar-brand span:last-child, .nav-item, .logout { font-size: 0; }
  .nav-item::before { content: "•"; display: block; text-align: center; font-size: 23px; }
  .logout::before { content: "↪"; font-size: 19px; }
  .grid { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .app { display: block; }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1002;
    width: min(82vw, 300px);
    height: 100dvh;
    padding: 20px 16px;
    overflow-y: auto;
    transform: translateX(-102%);
    transition: transform .2s ease;
    box-shadow: 18px 0 45px rgba(6, 15, 29, .28);
  }
  .sidebar.mobile-open { transform: translateX(0); }
  .sidebar-brand { padding: 0 9px 20px; }
  .sidebar-brand span:last-child { font-size: 23px; }
  .nav { display: grid; }
  .nav-item { font-size: 15px; }
  .nav-item::before { content: none; }
  .logout { width: 100%; margin-top: auto; padding-inline: 12px; font-size: 14px; }
  .logout::before { content: none; }
  .mobile-menu-button {
    display: inline-grid;
    flex: 0 0 auto;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 1px solid var(--border);
    border-radius: 11px;
    color: #23324a;
    background: #fff;
    box-shadow: 0 4px 12px rgba(22,34,55,.06);
    font-size: 23px;
    line-height: 1;
  }
  .mobile-menu-button:focus-visible { outline: 3px solid rgba(36, 87, 197, .22); outline-offset: 2px; }
  .mobile-menu-overlay:not(.hidden) {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 1001;
    background: rgba(8, 17, 31, .5);
    backdrop-filter: blur(1px);
  }
  .content { padding: 16px 14px 34px; }
  .topbar { align-items: center; flex-direction: row; flex-wrap: wrap; gap: 10px 12px; margin-bottom: 18px; }
  .topbar-title { flex: 1; min-width: 0; }
  .topbar h1 { font-size: 26px; }
  .topbar-actions { width: 100%; flex-wrap: wrap; padding-left: 54px; }
  #clinicSelect { flex: 1; min-width: 180px; }
  .user-chip { width: 100%; padding: 2px 0 0; }
  .welcome-card { align-items: flex-start; flex-direction: column; }
  .details > div { grid-template-columns: 1fr; gap: 4px; }
  .details dd { text-align: left; }
}

@media (max-width: 420px) {
  .topbar-actions { padding-left: 0; }
  .user-chip strong, .user-chip small { max-width: calc(100vw - 92px); }
}

textarea { width: 100%; resize: vertical; border: 1px solid var(--border); border-radius: 11px; padding: 11px 12px; color: var(--text); background: #fff; outline: none; font: inherit; line-height: 1.45; }
textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(36, 87, 197, .12); }
input:disabled, textarea:disabled, select:disabled { color: #667085; background: #f4f6f8; cursor: not-allowed; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }

.patients-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; padding: 15px; }
.patient-search-wrap { flex: 1; }
#patientSearch { min-width: 260px; }
.compact-check { display: flex; align-items: center; gap: 8px; margin: 0; padding: 0 4px; white-space: nowrap; color: var(--muted); font-size: 14px; }
.compact-check input { width: 17px; height: 17px; margin: 0; accent-color: var(--primary); }
.patient-list-panel { min-height: 360px; }
.patients-head { align-items: center; }
.table-wrap { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { padding: 10px 12px; border-bottom: 1px solid var(--border); color: var(--muted); font-size: 12px; text-align: left; text-transform: uppercase; letter-spacing: .035em; }
.data-table td { padding: 13px 12px; border-bottom: 1px solid #edf0f3; vertical-align: middle; }
.data-table tbody tr { transition: background .15s ease; cursor: pointer; outline: none; }
.data-table tbody tr:hover, .data-table tbody tr:focus { background: #f6f8fc; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.patient-code { color: var(--muted); font-size: 13px; font-weight: 750; white-space: nowrap; }
.patient-name { min-width: 190px; font-weight: 750; }
.mini-status { display: inline-flex; margin-left: 8px; border-radius: 999px; padding: 3px 6px; color: #667085; background: #eef1f4; font-size: 10px; font-weight: 750; vertical-align: middle; }
.inactive-row { opacity: .68; }
.table-action { width: 1%; text-align: right; }
.open-row-button { border: 0; border-radius: 9px; padding: 7px 10px; color: var(--primary); background: #edf3ff; font-weight: 700; }
.empty-state { display: grid; place-items: center; min-height: 250px; color: var(--muted); }

.patient-dialog { width: min(1040px, calc(100% - 28px)); max-height: calc(100vh - 28px); overflow: hidden; }
.patient-form { display: flex; flex-direction: column; max-height: calc(100vh - 28px); background: #fff; }
.patient-dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 22px 24px 15px; border-bottom: 1px solid var(--border); }
.patient-dialog-head h2 { margin: 0; font-size: 25px; letter-spacing: -.03em; }
.dialog-head-actions { display: flex; align-items: center; gap: 10px; }
.patient-tabs { display: flex; gap: 5px; padding: 10px 24px 0; border-bottom: 1px solid var(--border); background: #fbfcfe; }
.patient-tab { border: 0; border-bottom: 2px solid transparent; padding: 11px 13px 10px; color: var(--muted); background: transparent; font-weight: 750; }
.patient-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.patient-tab-panel { overflow-y: auto; padding: 20px 24px 26px; }
.patient-form > .message { margin: 14px 24px 0; }
.form-grid { display: grid; gap: 15px 18px; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid label { margin-top: 0; }
.span-two { grid-column: 1 / -1; }
.form-section-title { margin: 23px 0 12px; padding-top: 18px; border-top: 1px solid #edf0f3; font-weight: 800; }
.alert-field textarea { border-color: #e7b5af; background: #fffafa; }
.patient-dialog-footer { display: flex; align-items: center; gap: 10px; padding: 14px 24px; border-top: 1px solid var(--border); background: #fbfcfe; }
.footer-spacer { flex: 1; }
.button.danger { color: var(--danger); background: var(--danger-bg); }
.button.danger:hover { background: #ffe1dd; }
.button.ghost { border: 1px solid #f3bbb5; }
.button:disabled { cursor: wait; opacity: .65; }

@media (max-width: 800px) {
  .patients-toolbar { align-items: stretch; flex-wrap: wrap; }
  .patient-search-wrap { flex-basis: 100%; }
  #patientSearch { min-width: 0; }
  .patients-toolbar .button { margin-left: auto; }
  .patient-dialog { width: calc(100% - 14px); max-height: calc(100vh - 14px); }
  .patient-form { max-height: calc(100vh - 14px); }
  .form-grid.two { grid-template-columns: 1fr; }
  .span-two { grid-column: auto; }
  .patient-dialog-head, .patient-tab-panel, .patient-dialog-footer { padding-left: 16px; padding-right: 16px; }
  .patient-tabs { padding-left: 10px; padding-right: 10px; overflow-x: auto; }
  .patient-tab { white-space: nowrap; }
}

@media (max-width: 600px) {
  .patient-dialog-footer { flex-wrap: wrap; }
  .patient-dialog-footer .footer-spacer { display: none; }
  .patient-dialog-footer .button { flex: 1; }
  .patient-dialog-footer .danger { flex-basis: 100%; }
}

/* Calendar and doctor settings */
.calendar-toolbar,
.settings-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding: 15px;
}
.calendar-nav,
.calendar-filters,
.settings-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}
.calendar-filters select { width: 190px; }
.compact-button { width: 42px; padding-inline: 0; font-size: 22px; }
.calendar-range-label { margin-left: 7px; white-space: nowrap; }
.calendar-panel { padding: 15px; overflow: hidden; }
.doctor-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; min-height: 28px; padding: 2px 6px 12px; }
.doctor-legend-item { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 13px; font-weight: 700; }
.doctor-color-dot { display: inline-block; width: 13px; height: 13px; flex: 0 0 13px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }
.calendar-week { width: 100%; overflow: auto; border: 1px solid var(--border); border-radius: 13px; background: #fff; }
.calendar-week-header,
.calendar-week-body { display: grid; grid-template-columns: 66px repeat(7, minmax(135px, 1fr)); min-width: 1080px; }
.calendar-week-header { position: sticky; top: 0; z-index: 8; border-bottom: 1px solid var(--border); background: #f8fafc; }
.calendar-week-header > div { min-height: 62px; border-right: 1px solid var(--border); }
.calendar-day-header { display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--muted); }
.calendar-day-header strong { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 50%; color: var(--text); font-size: 15px; }
.calendar-day-header.today strong { color: #fff; background: var(--primary); }
.calendar-time-rail { position: relative; border-right: 1px solid var(--border); background: #fbfcfe; }
.calendar-time-rail span { position: absolute; right: 8px; transform: translateY(-50%); color: #7a8494; font-size: 11px; }
.calendar-day-column { position: relative; border-right: 1px solid var(--border); background: repeating-linear-gradient(to bottom, transparent 0, transparent 29px, rgba(226,231,238,.45) 30px); }
.calendar-day-column.today { background-color: #fbfdff; }
.calendar-hour-line { position: absolute; left: 0; right: 0; height: 1px; background: #dfe5ec; pointer-events: none; }
.calendar-appointment { position: absolute; left: 4px; right: 4px; z-index: 3; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; overflow: hidden; border: 0; border-left: 4px solid rgba(0,0,0,.2); border-radius: 8px; padding: 5px 7px; text-align: left; box-shadow: 0 3px 10px rgba(25,34,51,.16); }
.calendar-appointment strong { font-size: 12px; }
.calendar-appointment span { width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 800; }
.calendar-appointment small { width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; opacity: .9; }
.calendar-appointment.status-cancelled,
.calendar-appointment.status-no_show { opacity: .48; text-decoration: line-through; }
.calendar-appointment.status-completed { opacity: .72; }

.doctor-list-panel { min-height: 330px; }
.settings-toolbar h2 { margin: 0; }
.doctor-dialog { width: min(980px, calc(100% - 28px)); max-height: calc(100vh - 28px); overflow: hidden; }
.doctor-form { display: flex; flex-direction: column; max-height: calc(100vh - 28px); background: #fff; }
.doctor-form > .message { margin: 14px 24px 0; }
.doctor-form-body { overflow-y: auto; padding: 20px 24px 26px; }
.color-input { min-height: 43px; padding: 5px; }
.clinic-choice-grid { display: flex; flex-wrap: wrap; gap: 9px; }
.clinic-choice { display: inline-flex; align-items: center; gap: 8px; margin: 0; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: #fff; }
.clinic-choice:has(input:checked) { border-color: #9eb8ed; background: #f2f6ff; }
.clinic-choice input { width: 17px; height: 17px; margin: 0; accent-color: var(--primary); }
.schedule-head { display: flex; align-items: end; justify-content: space-between; gap: 14px; margin: 24px 0 10px; padding-top: 18px; border-top: 1px solid #edf0f3; }
.schedule-head h3 { margin: 0; }
.schedule-head select { width: 260px; }
.schedule-grid { display: grid; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.schedule-row { display: grid; grid-template-columns: minmax(160px, 1fr) 145px 145px; align-items: center; gap: 12px; padding: 9px 12px; border-bottom: 1px solid #edf0f3; }
.schedule-row:last-child { border-bottom: 0; }
.schedule-row.schedule-off { background: #f7f8fa; }
.schedule-day { display: flex; align-items: center; gap: 9px; margin: 0; }
.schedule-day input { width: 17px; height: 17px; margin: 0; accent-color: var(--primary); }
.schedule-row input[type="time"] { padding-block: 8px; }

.appointment-dialog {
  width: min(920px, calc(100% - 24px));
  max-height: calc(100dvh - 20px);
  overflow: hidden;
}
.appointment-dialog .dialog-form {
  display: flex;
  flex-direction: column;
  max-height: calc(100dvh - 20px);
  overflow: hidden;
  padding: 16px 18px 15px;
}
.appointment-dialog .dialog-head { align-items: center; }
.appointment-dialog .dialog-head h2 { margin-bottom: 0; font-size: 22px; }
.appointment-dialog .eyebrow { margin-bottom: 2px; }
.appointment-dialog .message { margin: 8px 0 0; padding: 8px 10px; font-size: 13px; }
.appointment-form-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 9px 12px;
  margin-top: 5px;
}
.appointment-form-grid label { margin: 0 0 5px; font-size: 12px; }
.appointment-form-grid input,
.appointment-form-grid select { min-height: 38px; padding: 8px 10px; border-radius: 9px; }
.appointment-form-grid textarea { min-height: 58px; max-height: 58px; resize: none; padding: 8px 10px; border-radius: 9px; }
.appointment-patient-field { grid-column: 1 / -1; }
.appointment-col-2 { grid-column: span 2; }
.appointment-col-3 { grid-column: span 3; }
.appointment-dialog-actions { margin-top: 11px; padding-bottom: 0; }
.appointment-dialog-actions .button { min-height: 38px; padding-block: 8px; }
.patient-picker { position: relative; }
.patient-picker-results { position: absolute; left: 0; right: 0; top: calc(100% - 2px); z-index: 20; overflow-y: auto; max-height: 260px; border: 1px solid var(--border); border-radius: 11px; background: #fff; box-shadow: var(--shadow); }
.patient-picker-results button { display: flex; flex-direction: column; gap: 3px; width: 100%; border: 0; border-bottom: 1px solid #edf0f3; padding: 10px 12px; text-align: left; background: #fff; }
.patient-picker-results button:last-child { border-bottom: 0; }
.patient-picker-results button:hover { background: #f5f8fd; }
.patient-picker-results small { color: var(--muted); }
.selected-patient { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; border: 1px solid #afc4ee; border-radius: 10px; padding: 9px 11px; color: var(--primary-dark); background: #f2f6ff; font-weight: 750; }
.patient-picker-clear { width: 28px; height: 28px; border: 0; border-radius: 8px; color: #475467; background: #e5ebf5; font-size: 18px; }

@media (max-width: 980px) {
  .calendar-toolbar { align-items: stretch; flex-direction: column; }
  .calendar-nav, .calendar-filters { flex-wrap: wrap; }
  .calendar-filters select { flex: 1; min-width: 180px; }
}

@media (max-width: 700px) {
  .settings-toolbar { align-items: flex-start; flex-direction: column; }
  .settings-toolbar-actions { width: 100%; justify-content: space-between; }
  .doctor-dialog { width: calc(100% - 14px); max-height: calc(100vh - 14px); }
  .doctor-form { max-height: calc(100vh - 14px); }
  .doctor-form-body { padding-left: 16px; padding-right: 16px; }
  .schedule-head { align-items: stretch; flex-direction: column; }
  .schedule-head select { width: 100%; }
  .schedule-row { grid-template-columns: 1fr 110px 110px; gap: 7px; padding-inline: 9px; }
  .appointment-dialog { width: calc(100% - 14px); }
  .appointment-dialog .dialog-form { max-height: calc(100dvh - 14px); }
}

@media (max-width: 700px) {
  .appointment-dialog { max-height: calc(100dvh - 14px); overflow-y: auto; }
  .appointment-dialog .dialog-form { max-height: none; overflow: visible; padding: 14px; }
  .appointment-form-grid { grid-template-columns: 1fr; }
  .appointment-patient-field,
  .appointment-col-2,
  .appointment-col-3 { grid-column: 1; }
  .appointment-form-grid textarea { min-height: 72px; max-height: none; resize: vertical; }
}

@media (max-width: 520px) {
  .calendar-filters { align-items: stretch; flex-direction: column; }
  .calendar-filters select, .calendar-filters .button { width: 100%; }
  .calendar-nav { display: grid; grid-template-columns: 42px 1fr 42px; }
  .calendar-range-label { grid-column: 1 / -1; margin: 5px 0 0; text-align: center; }
  .schedule-row { grid-template-columns: 1fr 1fr; }
  .schedule-day { grid-column: 1 / -1; }
}

/* Calendar refinements and clinic management */
.clinic-settings-panel { margin-bottom: 18px; padding: 0; overflow: hidden; }
.settings-section-head { padding: 18px 20px; border-bottom: 1px solid var(--border); }
.settings-section-head h2 { margin: 0; }
.clinic-default-row { display: flex; align-items: center; gap: 14px; padding: 14px 20px; border-bottom: 1px solid var(--border); background: #fbfcfe; }
.clinic-default-row label { margin: 0; color: var(--muted); font-size: 13px; font-weight: 800; }
.clinic-default-row select { width: min(320px, 100%); }
.clinic-actions { display: flex; justify-content: flex-end; gap: 7px; white-space: nowrap; }
.small-button { min-height: 34px; padding: 7px 10px; font-size: 12px; }
.confirm-dialog { width: min(520px, calc(100% - 28px)); }
.warning-box { margin: 14px 0; border: 1px solid #f1c5a5; border-radius: 10px; padding: 12px 13px; color: #7a4218; background: #fff8f1; font-size: 13px; }

.calendar-week {
  max-height: calc(100vh - 245px);
  min-height: 520px;
  overflow: auto;
  scrollbar-gutter: stable;
}
.calendar-week-header {
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: 0 2px 5px rgba(25,34,51,.08);
}
.calendar-appointment-compact { padding-inline: 5px; }
.calendar-appointment-compact small { display: none; }
.calendar-appointment-compact strong,
.calendar-appointment-compact span { font-size: 10px; }

.schedule-warning {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 9px 0 0;
  border: 1px solid #efba86;
  border-radius: 10px;
  padding: 9px 11px;
  color: #703d13;
  background: #fff8ef;
}
.schedule-warning p { margin: 3px 0 0; font-size: 13px; }
.schedule-warning-actions { display: flex; flex: 0 0 auto; gap: 8px; }

@media (max-width: 760px) {
  .clinic-default-row { align-items: stretch; flex-direction: column; }
  .clinic-default-row select { width: 100%; }
  .clinic-actions { flex-direction: column; }
  .schedule-warning { align-items: stretch; flex-direction: column; }
  .schedule-warning-actions { justify-content: flex-end; }
  .calendar-week { max-height: calc(100vh - 270px); min-height: 430px; }
}

/* Appointment safety */
.appointment-delete-button { margin-right: auto; }

/* Dental chart and treatment planning */
.patient-dialog { width: min(1260px, calc(100% - 28px)); }
.dental-tab-panel { background: #f7f9fc; }
.dental-workspace {
  display: grid;
  grid-template-columns: minmax(560px, 1.35fr) minmax(360px, .85fr);
  gap: 18px;
  align-items: start;
}
.dental-chart-card,
.dental-editor-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(31, 48, 76, .06);
}
.dental-chart-card { padding: 18px; }
.dental-editor-card { padding: 18px; position: sticky; top: 0; }
.dental-section-head,
.dental-editor-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.dental-section-head h3,
.dental-editor-head h3 { margin: 1px 0 0; font-size: 18px; }
.dental-fdi-label,
.dental-target-code {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 5px 9px;
  color: #526078;
  background: #edf1f7;
  font-size: 11px;
  font-weight: 800;
}
.dental-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 15px;
  margin: 14px 0 12px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}
.dental-legend span { display: inline-flex; align-items: center; gap: 6px; }
.dental-legend-dot {
  width: 12px;
  height: 12px;
  border: 1px solid #bfc8d5;
  border-radius: 4px;
  background: #fff;
}
.dental-legend-dot.state-untreated { border-color: #3b82f6; background: #60a5fa; }
.dental-legend-dot.state-in-progress { border-color: #d4a61f; background: #facc15; }
.dental-legend-dot.state-completed { border-color: #2f9e68; background: #4ade80; }

.dental-anatomy {
  overflow-x: auto;
  border: 1px solid #e7ebf1;
  border-radius: 14px;
  padding: 15px 12px 17px;
  background:
    radial-gradient(circle at 50% 43%, rgba(223, 235, 248, .45), transparent 35%),
    linear-gradient(180deg, #fbfdff, #f6f9fd);
}
.dental-sinus-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 46px;
  width: min(430px, 80%);
  margin: 0 auto 7px;
}
.dental-target {
  border: 0;
  padding: 0;
  color: #4c596d;
  background: transparent;
  font: inherit;
  cursor: pointer;
}
.dental-target:focus-visible { outline: 3px solid rgba(45, 101, 207, .25); outline-offset: 3px; }
.dental-target.sinus {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 750;
}
.sinus-shape {
  display: block;
  width: 78px;
  height: 34px;
  border: 2px solid #aeb9c8;
  border-radius: 55% 55% 38% 38% / 70% 70% 36% 36%;
  background: #fff;
  box-shadow: inset 0 -7px 12px rgba(75, 100, 132, .06);
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
}
.dental-target.sinus:hover .sinus-shape { transform: translateY(-2px); }
.dental-target.jaw {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: min(470px, 88%);
  margin: 0 auto;
  font-size: 10px;
  font-weight: 750;
}
.jaw-shape {
  display: block;
  width: 100%;
  height: 24px;
  border: 5px solid #b7c2cf;
  background: #fff;
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
}
.upper-jaw .jaw-shape {
  border-bottom: 0;
  border-radius: 52% 52% 0 0 / 100% 100% 0 0;
}
.lower-jaw .jaw-shape {
  border-top: 0;
  border-radius: 0 0 52% 52% / 0 0 100% 100%;
}
.dental-target.jaw:hover .jaw-shape { transform: scale(1.015); }
.dental-teeth-row {
  display: grid;
  grid-template-columns: repeat(16, minmax(38px, 1fr));
  gap: 1px;
  min-width: 650px;
  width: 100%;
  margin: 4px auto;
}
.dental-target.tooth {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
  min-width: 0;
  border-radius: 10px;
  padding: 3px 1px 4px;
  transition: background .15s ease, transform .15s ease, box-shadow .15s ease;
}
.lower-teeth .dental-target.tooth { flex-direction: column-reverse; }
.dental-target.tooth:hover { background: #eef4ff; transform: translateY(-1px); }
.tooth-number { color: #647188; font-size: 9px; font-weight: 850; line-height: 1; }
.tooth-shape {
  --tooth-fill: #fff;
  --tooth-stroke: #8f9caf;
  --tooth-detail: #97a3b4;
  display: block;
  width: 34px;
  height: 61px;
  transition: transform .15s ease, filter .15s ease;
}
.tooth-shape.incisor-central { width: 32px; height: 62px; }
.tooth-shape.incisor-lateral { width: 30px; height: 60px; }
.tooth-shape.canine { width: 33px; height: 64px; }
.tooth-shape.premolar-upper,
.tooth-shape.premolar-lower { width: 36px; height: 62px; }
.tooth-shape.molar-upper,
.tooth-shape.molar-lower { width: 40px; height: 62px; }
.tooth-shape svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.tooth-body {
  fill: var(--tooth-fill);
  stroke: var(--tooth-stroke);
  stroke-width: 1.25;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  transition: fill .15s ease, stroke .15s ease;
}
.tooth-detail {
  fill: none;
  stroke: var(--tooth-detail);
  stroke-width: .95;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  opacity: .78;
  transition: stroke .15s ease;
}
.lower-teeth .tooth-shape { transform: rotate(180deg); }
.dental-target.tooth:hover .tooth-shape { filter: brightness(1.01); }

.dental-mouth-line {
  width: 58%;
  height: 1px;
  margin: 12px auto;
  background: linear-gradient(90deg, transparent, #cbd4df 20%, #cbd4df 80%, transparent);
}
.dental-target.state-untreated .tooth-shape {
  --tooth-fill: #67aaf9; --tooth-stroke: #2874d4; --tooth-detail: #195faa;
}
.dental-target.state-untreated .sinus-shape { border-color: #2874d4; background: #67aaf9; }
.dental-target.state-untreated .jaw-shape { border-color: #2874d4; background: #67aaf9; }
.dental-target.state-in-progress .tooth-shape {
  --tooth-fill: #f6cf37; --tooth-stroke: #b98b00; --tooth-detail: #8a6800;
}
.dental-target.state-in-progress .sinus-shape { border-color: #b98b00; background: #f6cf37; }
.dental-target.state-in-progress .jaw-shape { border-color: #b98b00; background: #f6cf37; }
.dental-target.state-completed .tooth-shape {
  --tooth-fill: #56cf86; --tooth-stroke: #238353; --tooth-detail: #17663f;
}
.dental-target.state-completed .sinus-shape { border-color: #238353; background: #56cf86; }
.dental-target.state-completed .jaw-shape { border-color: #238353; background: #56cf86; }
.dental-target.selected { background: #e8f0ff; box-shadow: 0 0 0 2px #2d65cf inset; }
.dental-target.sinus.selected,
.dental-target.jaw.selected { border-radius: 10px; padding: 4px; }

.dental-editor-empty {
  display: grid;
  place-items: center;
  min-height: 360px;
  margin-top: 13px;
  border: 1px dashed #cad2de;
  border-radius: 13px;
  color: var(--muted);
  background: #fafbfd;
  text-align: center;
}
.dental-status-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin: 14px 0 13px;
}
.dental-status-choice {
  min-height: 42px;
  border: 1px solid #d7dde7;
  border-radius: 10px;
  padding: 7px 8px;
  color: #536074;
  background: #fff;
  font-size: 11px;
  font-weight: 800;
}
.dental-status-choice.untreated.active { border-color: #2676dc; color: #125bb5; background: #eaf3ff; }
.dental-status-choice.in-progress.active { border-color: #d4a415; color: #806100; background: #fff8d8; }
.dental-status-choice.completed.active { border-color: #2d9a62; color: #167145; background: #e9faef; }
.dental-entry-audit {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 8px;
  margin: 13px 0 10px;
  border: 1px solid #e2e7ef;
  border-radius: 10px;
  padding: 9px 10px;
  color: #42516a;
  background: #f7f9fc;
  font-size: 11px;
}
.dental-entry-audit-label { color: var(--muted); font-weight: 750; }
.dental-last-entry {
  width: 100%;
  color: var(--muted);
  font-size: 10px;
}
.dental-meta-grid { gap: 10px 12px; margin-bottom: 10px; }
.dental-meta-grid label,
.voice-field label { margin: 0 0 5px; font-size: 12px; }
.dental-meta-grid input,
.dental-meta-grid select { min-height: 38px; padding: 8px 9px; }
.voice-field { margin-top: 9px; }
.voice-field textarea { min-height: 72px; resize: vertical; }
.voice-field-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.voice-button {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid #ccd5e2;
  border-radius: 9px;
  color: #315d9f;
  background: #f4f7fb;
  font-size: 14px;
}
.voice-button.listening { border-color: #df5a54; color: #a62721; background: #fff0ef; animation: voicePulse 1s infinite; }
@keyframes voicePulse { 50% { box-shadow: 0 0 0 5px rgba(214, 67, 58, .12); } }
.dental-editor-actions { display: flex; align-items: center; gap: 8px; margin-top: 13px; }
.dental-history {
  overflow-y: auto;
  max-height: 300px;
  margin-top: 14px;
  border-top: 1px solid #e7ebf1;
  padding-top: 10px;
}
.dental-history-card { padding: 10px 0; border-bottom: 1px solid #edf0f4; }
.dental-history-card:last-child { border-bottom: 0; }
.dental-history-head { display: flex; justify-content: space-between; gap: 10px; }
.dental-history-head span,
.dental-history-card small { color: var(--muted); font-size: 10px; }
.dental-history-head span { white-space: nowrap; }
.dental-history-card small { display: block; margin: 3px 0 6px; font-weight: 650; }
.dental-history-card p { margin: 4px 0; color: #465368; font-size: 12px; white-space: pre-wrap; }

@media (max-width: 1080px) {
  .dental-workspace { grid-template-columns: 1fr; }
  .dental-editor-card { position: static; }
}
@media (max-width: 700px) {
  .dental-chart-card, .dental-editor-card { padding: 13px; }
  .dental-status-grid { grid-template-columns: 1fr; }
  .dental-meta-grid { grid-template-columns: 1fr; }
  .dental-editor-actions { flex-wrap: wrap; }
  .dental-editor-actions .footer-spacer { display: none; }
  .dental-editor-actions .button { flex: 1; }
}
.patient-dialog.dental-mode .patient-dialog-footer { display: none; }

/* Branding, patient card and finance v1 */
.login-brand { display: block; width: min(360px, 88vw); }
.login-brand img { display: block; width: 100%; height: auto; }
.sidebar-brand { gap: 9px; color: #fff; font-size: 22px; }
.sidebar-brand-icon { width: 42px; height: 42px; border-radius: 11px; object-fit: contain; background: #fff; box-shadow: 0 8px 22px rgba(0,0,0,.18); }
.mobile-topbar-logo { display: none; width: 38px; height: 38px; border-radius: 10px; object-fit: contain; background: #fff; }

.patient-dialog {
  width: min(1380px, calc(100vw - 28px));
  height: min(900px, calc(100dvh - 28px));
  max-height: none;
}
.patient-form { height: 100%; max-height: none; min-height: 0; }
.patient-tab-panel { flex: 1 1 auto; min-height: 0; }
.patient-dialog.dental-mode .patient-tab-panel[data-patient-panel="dental"],
.patient-dialog.finance-mode .patient-tab-panel[data-patient-panel="finance"] { overflow: auto; }
.patient-dialog.finance-mode .patient-dialog-footer { display: none; }

.guardian-section { margin-top: 4px; }
.minor-age-badge { display: inline-flex; margin-left: 8px; border-radius: 999px; padding: 3px 8px; color: #174ea6; background: #edf4ff; font-size: 11px; vertical-align: middle; }
.contact-input-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.contact-action-button { min-width: 74px; border: 1px solid #b8c9ea; border-radius: 10px; padding: 8px 11px; color: var(--primary-dark); background: #f0f5ff; font-weight: 750; }
.contact-action-button:disabled { cursor: default; opacity: .45; }
.contact-action-button:not(:disabled):hover { background: #e4edff; }

.voice-enabled-wrap { position: relative; }
.voice-enabled-wrap > input,
.voice-enabled-wrap > textarea { padding-right: 46px; }
.voice-inline-button {
  position: absolute;
  top: 50%;
  right: 8px;
  z-index: 2;
  display: inline-grid;
  place-items: center;
  width: 31px;
  height: 31px;
  transform: translateY(-50%);
  border: 1px solid #ccd5e2;
  border-radius: 9px;
  color: #315d9f;
  background: #f4f7fb;
  font-size: 14px;
}
.voice-enabled-wrap.textarea-wrap .voice-inline-button { top: 10px; transform: none; }
.voice-inline-button.listening,
.voice-button.listening { border-color: #df5a54; color: #a62721; background: #fff0ef; animation: voicePulse 1s infinite; }
.voice-status-toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 4000;
  max-width: min(420px, calc(100vw - 30px));
  border: 1px solid #bdd2f7;
  border-radius: 12px;
  padding: 11px 14px;
  color: #174ea6;
  background: #edf4ff;
  box-shadow: 0 14px 40px rgba(22,34,55,.2);
  font-size: 13px;
  font-weight: 700;
}
.voice-status-toast.error { border-color: #ffc7c2; color: var(--danger); background: var(--danger-bg); }
.voice-status-toast.listening { border-color: #f0c8c4; color: #9f2f29; background: #fff5f4; }

.finance-tab-panel { background: #f8fafc; }
.finance-summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.finance-summary-card { border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; background: #fff; }
.finance-summary-card span { display: block; color: var(--muted); font-size: 12px; font-weight: 750; }
.finance-summary-card strong { display: block; margin-top: 7px; font-size: 26px; letter-spacing: -.03em; }
.finance-summary-card.balance { border-color: #afc4ee; background: #f2f6ff; }
.finance-summary-card.balance strong { color: var(--primary-dark); }
.finance-summary-card.balance.negative { border-color: #f0b9b4; background: #fff3f2; }
.finance-summary-card.balance.negative strong { color: var(--danger); }
.finance-toolbar { display: flex; align-items: center; justify-content: flex-end; gap: 14px; margin: 15px 0; }
.finance-entry-editor { margin-bottom: 16px; border: 1px solid #c9d6ec; border-radius: 14px; padding: 16px; background: #fff; box-shadow: 0 8px 24px rgba(22,34,55,.06); }
.finance-entry-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.finance-entry-head h3 { margin: 0; }
.finance-entry-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px 12px; }
.finance-entry-grid > div { grid-column: span 2; }
.finance-entry-grid > .span-two { grid-column: span 6; }
.finance-entry-grid label { margin-top: 0; }
.finance-entry-actions { margin-top: 14px; }
.finance-empty { min-height: 220px; border: 1px dashed #cfd7e2; border-radius: 13px; background: #fff; }
.finance-table { background: #fff; }
.finance-table td { font-size: 13px; }
.finance-description strong, .finance-description small { display: block; }
.finance-description small, .finance-provider small { margin-top: 3px; color: var(--muted); }
.finance-money { white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; }
.finance-money.debit { color: #9b2c24; font-weight: 750; }
.finance-money.credit { color: var(--success); font-weight: 750; }
.finance-balance { color: #344054; font-weight: 800; }
.finance-voided-row { opacity: .55; text-decoration: line-through; }
.finance-voided-badge { display: inline-flex; margin-top: 4px; border-radius: 999px; padding: 2px 6px; color: #667085; background: #eef1f4; font-size: 10px; }
.finance-row-action { border: 0; border-radius: 8px; padding: 6px 8px; color: var(--danger); background: var(--danger-bg); font-size: 12px; font-weight: 750; }

@media (max-width: 900px) {
  .login-brand { width: min(320px, 80vw); }
  .finance-summary-grid { grid-template-columns: 1fr; }
  .finance-entry-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .finance-entry-grid > div { grid-column: span 1; }
  .finance-entry-grid > .span-two { grid-column: 1 / -1; }
}

@media (max-width: 800px) {
  .patient-dialog { width: calc(100% - 10px); height: calc(100dvh - 10px); }
  .patient-form { height: 100%; }
}

@media (max-width: 680px) {
  .mobile-topbar-logo { display: block; }
  .topbar-title { min-width: 140px; }
  .sidebar-brand-icon { width: 42px; height: 42px; }
  .finance-toolbar { align-items: stretch; flex-direction: column-reverse; }
  .finance-toolbar .button { width: 100%; }
  .finance-entry-grid { grid-template-columns: 1fr; }
  .finance-entry-grid > div, .finance-entry-grid > .span-two { grid-column: 1; }
  .voice-status-toast { right: 10px; bottom: 10px; }
}

/* Access, dashboard & support v1 */
.login-created-by {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 24px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.login-created-by img { width: 168px; height: auto; }

.app-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-top: 30px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}
.app-footer img { width: 124px; height: auto; }

.dashboard-toolbar,
.support-toolbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  padding: 12px;
  margin-bottom: 18px;
}
.dashboard-toolbar select,
.support-toolbar select { width: min(220px, 100%); }

.dashboard-clock-card {
  position: relative;
  width: min(680px, 100%);
  margin: 18px auto 24px;
  overflow: hidden;
  border: 1px solid rgba(75, 133, 221, .38);
  border-radius: 24px;
  padding: 28px 24px 25px;
  text-align: center;
  background:
    linear-gradient(135deg, rgba(29, 67, 130, .98), rgba(16, 38, 72, .98)),
    #102748;
  box-shadow: 0 20px 56px rgba(16, 39, 73, .24), inset 0 0 48px rgba(68, 164, 255, .08);
}
.dashboard-clock-card::before,
.dashboard-clock-card::after {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  border: 1px solid rgba(99, 188, 255, .18);
  border-radius: 50%;
}
.dashboard-clock-card::before { left: -120px; top: -130px; }
.dashboard-clock-card::after { right: -130px; bottom: -145px; }
.dashboard-clock {
  position: relative;
  z-index: 2;
  color: #e8f7ff;
  font-family: "Segoe UI", ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: clamp(48px, 8vw, 88px);
  font-weight: 260;
  line-height: 1;
  letter-spacing: .08em;
  text-shadow: 0 0 26px rgba(83, 200, 255, .45);
  font-variant-numeric: tabular-nums;
}
.dashboard-date {
  position: relative;
  z-index: 2;
  margin-top: 12px;
  color: #8fcaef;
  font-size: 14px;
  font-weight: 750;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.dashboard-clock-lines {
  position: absolute;
  inset: 0;
  opacity: .25;
  background-image:
    linear-gradient(rgba(92, 176, 235, .14) 1px, transparent 1px),
    linear-gradient(90deg, rgba(92, 176, 235, .12) 1px, transparent 1px);
  background-size: 38px 38px;
  mask-image: linear-gradient(to bottom, transparent, #000 35%, #000 65%, transparent);
}

.dashboard-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}
.dashboard-kpi {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px 18px;
  background: #fff;
  box-shadow: 0 8px 28px rgba(22, 34, 55, .045);
}
.dashboard-kpi span { display: block; color: var(--muted); font-size: 12px; font-weight: 750; }
.dashboard-kpi strong { display: block; margin-top: 5px; font-size: 32px; letter-spacing: -.04em; }
.dashboard-comparison-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.dashboard-panel { min-height: 260px; }
.dashboard-panel .panel-head h2 { margin: 0; }
.dashboard-bars { display: grid; gap: 13px; }
.dashboard-bar-row { display: grid; grid-template-columns: minmax(110px, 1fr) minmax(130px, 2.2fr) auto; gap: 10px; align-items: center; }
.dashboard-bar-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 750; }
.dashboard-bar-track { height: 10px; overflow: hidden; border-radius: 999px; background: #edf1f6; }
.dashboard-bar-fill { height: 100%; min-width: 3px; border-radius: inherit; background: var(--primary); }
.dashboard-bar-value { min-width: 38px; text-align: right; font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; }
.dashboard-months { display: flex; align-items: flex-end; gap: 8px; min-height: 190px; padding-top: 10px; overflow-x: auto; }
.dashboard-month-item { flex: 1 0 42px; display: grid; grid-template-rows: 1fr auto auto; gap: 5px; height: 180px; text-align: center; }
.dashboard-month-bar-wrap { display: flex; align-items: flex-end; justify-content: center; }
.dashboard-month-bar { width: min(30px, 70%); min-height: 3px; border-radius: 7px 7px 2px 2px; background: linear-gradient(180deg, #4c8feb, #2457c5); }
.dashboard-month-value { font-size: 11px; font-weight: 800; }
.dashboard-month-label { color: var(--muted); font-size: 10px; white-space: nowrap; }
.dashboard-daily { max-height: 240px; overflow: auto; }
.dashboard-day-row { display: grid; grid-template-columns: 1fr auto auto; gap: 14px; padding: 9px 2px; border-bottom: 1px solid #edf0f4; font-size: 13px; }
.dashboard-day-row strong { font-variant-numeric: tabular-nums; }

.finance-toolbar-actions { display: flex; gap: 9px; }

.support-list-panel { min-height: 300px; }
.support-status,
.support-priority { display: inline-flex; border-radius: 999px; padding: 4px 8px; font-size: 11px; font-weight: 800; white-space: nowrap; }
.support-status.open { color: #174ea6; background: #edf4ff; }
.support-status.in_progress { color: #7a4b00; background: #fff3cf; }
.support-status.waiting_user { color: #6b3bc4; background: #f3edff; }
.support-status.resolved { color: var(--success); background: var(--success-bg); }
.support-status.closed { color: #667085; background: #eef1f4; }
.support-priority.low { color: #667085; background: #eef1f4; }
.support-priority.normal { color: #174ea6; background: #edf4ff; }
.support-priority.high { color: #9a6700; background: #fff3cf; }
.support-priority.urgent { color: var(--danger); background: var(--danger-bg); }
.support-ticket-dialog { width: min(700px, calc(100vw - 24px)); }
.support-detail-dialog { width: min(900px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); }
.support-detail-meta { display: flex; flex-wrap: wrap; gap: 7px; margin: 5px 0 12px; }
.support-message-card,
.support-reply-card { border: 1px solid var(--border); border-radius: 13px; padding: 13px 15px; background: #f9fafb; white-space: pre-wrap; line-height: 1.55; }
.support-replies { display: grid; gap: 10px; max-height: 300px; margin: 12px 0; overflow: auto; }
.support-reply-card.staff { border-color: #bfd3f5; background: #f2f7ff; }
.support-reply-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 6px; color: var(--muted); font-size: 11px; }
.support-manage-controls { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; margin: 12px 0; }

#usersSettingsPanel,
#rolesSettingsPanel { margin-top: 18px; }
.user-dialog,
.role-dialog { width: min(980px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); }
.user-dialog .dialog-form,
.role-dialog .dialog-form { max-height: calc(100dvh - 56px); overflow: auto; }
.user-active-check { align-self: end; margin-bottom: 10px; }
.permission-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.permission-group { border: 1px solid var(--border); border-radius: 13px; padding: 12px; }
.permission-group h4 { margin: 0 0 8px; font-size: 13px; }
.permission-choice { display: flex; align-items: flex-start; gap: 8px; margin: 7px 0; font-size: 12px; font-weight: 650; }
.permission-choice input { width: auto; margin: 2px 0 0; }
.temporary-password-value { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 18px; font-weight: 800; letter-spacing: .04em; text-align: center; }

@media (max-width: 1000px) {
  .dashboard-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-comparison-grid { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .login-created-by { justify-content: center; }
  .dashboard-toolbar,
  .support-toolbar { align-items: stretch; flex-direction: column; }
  .dashboard-toolbar select,
  .support-toolbar select { width: 100%; }
  .dashboard-clock-card { border-radius: 18px; padding: 24px 12px 21px; }
  .dashboard-clock { font-size: clamp(38px, 13vw, 60px); letter-spacing: .04em; }
  .dashboard-date { font-size: 11px; letter-spacing: .08em; }
  .dashboard-kpi-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .dashboard-kpi { padding: 13px; }
  .dashboard-kpi strong { font-size: 26px; }
  .dashboard-bar-row { grid-template-columns: minmax(82px, 1fr) minmax(80px, 1.5fr) auto; gap: 6px; }
  .finance-toolbar-actions { display: grid; grid-template-columns: 1fr; }
  .permission-groups { grid-template-columns: 1fr; }
  .support-manage-controls { grid-template-columns: 1fr; }
  .app-footer { margin-top: 22px; }
}


/* DigiSteps exact logo fix v1 */
.login-created-by img {
  display: block;
  width: min(260px, 72vw);
  height: auto;
  object-fit: contain;
}
.app-footer img {
  display: block;
  width: min(190px, 42vw);
  height: auto;
  object-fit: contain;
}
/* End DigiSteps exact logo fix v1 */

/* eClinic circular clock 2 and gray footer v1 */
.dashboard-clock-card.dashboard-clock-card-circular {
  position: relative;
  width: min(500px, 100%);
  min-height: 238px;
  box-sizing: border-box;
  display: grid;
  place-items: center;
  margin: 16px auto 24px;
  overflow: hidden;
  border: 1px solid rgba(67, 119, 174, .34);
  border-radius: 24px;
  padding: 20px;
  text-align: center;
  background:
    radial-gradient(circle at 50% 45%, rgba(28, 74, 111, .44), transparent 45%),
    linear-gradient(145deg, #12283c 0%, #0c1d2d 58%, #091725 100%);
  box-shadow:
    0 18px 46px rgba(14, 35, 55, .22),
    inset 0 0 44px rgba(62, 220, 220, .045);
}
.dashboard-clock-card.dashboard-clock-card-circular::before,
.dashboard-clock-card.dashboard-clock-card-circular::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 72px;
  height: 7px;
  border: 0;
  border-radius: 0;
  opacity: .68;
  transform: translateY(-50%);
  background: radial-gradient(circle, rgba(75, 230, 226, .92) 0 2px, transparent 2.4px) 0 50% / 14px 7px repeat-x;
  filter: drop-shadow(0 0 5px rgba(66, 225, 221, .28));
}
.dashboard-clock-card.dashboard-clock-card-circular::before { left: 34px; }
.dashboard-clock-card.dashboard-clock-card-circular::after { right: 34px; }
.dashboard-clock-orbit {
  position: relative;
  width: 194px;
  height: 194px;
  display: grid;
  place-items: center;
}
.dashboard-clock-ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  transform: rotate(-90deg);
}
.dashboard-clock-track,
.dashboard-clock-progress {
  fill: none;
  stroke-width: 5;
}
.dashboard-clock-track { stroke: rgba(82, 155, 190, .28); }
.dashboard-clock-progress {
  stroke: #48e2dd;
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  filter: drop-shadow(0 0 6px rgba(72, 226, 221, .68));
  transition: stroke-dashoffset .24s linear;
}
.dashboard-clock-core {
  position: relative;
  z-index: 2;
  width: 142px;
  height: 142px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(113, 191, 215, .09);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(24, 55, 77, .5), rgba(8, 24, 38, .16) 68%, transparent 69%);
}
.dashboard-clock-card .dashboard-clock {
  position: relative;
  z-index: 2;
  color: #f1f8fb;
  font-family: "Segoe UI", ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 42px;
  font-weight: 300;
  line-height: 1;
  letter-spacing: .015em;
  text-shadow: 0 0 18px rgba(72, 226, 221, .22);
  font-variant-numeric: tabular-nums;
}
.dashboard-clock-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-top: 12px;
  white-space: nowrap;
}
.dashboard-clock-card .dashboard-date,
.dashboard-day {
  position: static;
  z-index: auto;
  margin: 0;
  color: #9bb1bf;
  font-size: 11px;
  font-weight: 650;
  line-height: 1;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.dashboard-clock-separator {
  width: 1px;
  height: 13px;
  background: rgba(129, 173, 195, .38);
}

.app-footer {
  width: 100%;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(18px, 2.5vw, 38px);
  margin-top: 30px;
  padding: 18px 26px;
  border: 1px solid #e3e8ef;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  box-shadow: 0 8px 24px rgba(31, 52, 79, .08);
  color: #68778c;
  font-size: 13px;
  font-weight: 500;
}
.app-footer-item,
.app-footer-created {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-width: 0;
  white-space: nowrap;
}
.app-footer-created { color: #5f6e82; }
.app-footer .app-footer-created img {
  display: block;
  width: 116px;
  max-width: none;
  height: auto;
  object-fit: contain;
}
.app-footer-divider {
  flex: 0 0 1px;
  width: 1px;
  height: 34px;
  background: #dfe5ec;
}
.app-footer svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  fill: none;
  stroke: #788ba2;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (max-width: 900px) {
  .app-footer {
    flex-wrap: wrap;
    row-gap: 14px;
    padding: 17px 20px;
  }
  .app-footer-divider { display: none; }
}

@media (max-width: 680px) {
  .dashboard-clock-card.dashboard-clock-card-circular {
    width: min(430px, 100%);
    min-height: 210px;
    border-radius: 20px;
    padding: 14px;
  }
  .dashboard-clock-card.dashboard-clock-card-circular::before,
  .dashboard-clock-card.dashboard-clock-card-circular::after {
    width: 42px;
    background-size: 12px 7px;
  }
  .dashboard-clock-card.dashboard-clock-card-circular::before { left: 14px; }
  .dashboard-clock-card.dashboard-clock-card-circular::after { right: 14px; }
  .dashboard-clock-orbit { width: 174px; height: 174px; }
  .dashboard-clock-core { width: 128px; height: 128px; }
  .dashboard-clock-card .dashboard-clock { font-size: 37px; }
  .dashboard-clock-card .dashboard-date,
  .dashboard-day { font-size: 10px; }
  .app-footer {
    flex-direction: column;
    gap: 11px;
    border-radius: 14px;
    padding: 16px;
  }
  .app-footer .app-footer-created img { width: 108px; }
}
/* End eClinic circular clock 2 and gray footer v1 */

/* eClinic transparent clock and toolbar-below v1 */
.dashboard-clock-card.dashboard-clock-card-circular.dashboard-clock-card-transparent {
  position: relative;
  width: min(380px, 100%);
  min-height: 188px;
  display: grid;
  place-items: center;
  margin: 6px auto 8px;
  padding: 2px 0 4px;
  overflow: visible;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}
.dashboard-clock-card.dashboard-clock-card-circular.dashboard-clock-card-transparent::before,
.dashboard-clock-card.dashboard-clock-card-circular.dashboard-clock-card-transparent::after {
  display: none !important;
  content: none !important;
}
.dashboard-clock-card.dashboard-clock-card-circular.dashboard-clock-card-transparent .dashboard-clock-orbit {
  position: relative;
  width: 176px;
  height: 176px;
  display: grid;
  place-items: center;
}
.dashboard-clock-card.dashboard-clock-card-circular.dashboard-clock-card-transparent .dashboard-clock-ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  transform: rotate(-90deg);
}
.dashboard-clock-card.dashboard-clock-card-circular.dashboard-clock-card-transparent .dashboard-clock-track,
.dashboard-clock-card.dashboard-clock-card-circular.dashboard-clock-card-transparent .dashboard-clock-progress {
  fill: none;
  stroke-width: 5;
}
.dashboard-clock-card.dashboard-clock-card-circular.dashboard-clock-card-transparent .dashboard-clock-track {
  stroke: rgba(48, 108, 140, .16);
}
.dashboard-clock-card.dashboard-clock-card-circular.dashboard-clock-card-transparent .dashboard-clock-progress {
  stroke: #20c8cf;
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  filter: drop-shadow(0 0 7px rgba(32, 200, 207, .42));
  transition: stroke-dashoffset .24s linear;
}
.dashboard-clock-card.dashboard-clock-card-circular.dashboard-clock-card-transparent .dashboard-clock-core {
  position: relative;
  z-index: 2;
  width: 126px;
  height: 126px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(39, 138, 165, .10);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .52) 0%, rgba(235, 248, 250, .16) 60%, transparent 73%);
  box-shadow: inset 0 0 24px rgba(32, 200, 207, .035);
  backdrop-filter: blur(1px);
}
.dashboard-clock-card.dashboard-clock-card-circular.dashboard-clock-card-transparent .dashboard-clock {
  position: relative;
  z-index: 2;
  color: #163a55;
  font-family: "Segoe UI", ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 36px;
  font-weight: 300;
  line-height: 1;
  letter-spacing: .02em;
  text-shadow: 0 0 13px rgba(32, 200, 207, .12);
  font-variant-numeric: tabular-nums;
}
.dashboard-clock-card.dashboard-clock-card-circular.dashboard-clock-card-transparent .dashboard-clock-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
  white-space: nowrap;
}
.dashboard-clock-card.dashboard-clock-card-circular.dashboard-clock-card-transparent .dashboard-date,
.dashboard-clock-card.dashboard-clock-card-circular.dashboard-clock-card-transparent .dashboard-day {
  position: static;
  margin: 0;
  color: #607b8f;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.dashboard-clock-card.dashboard-clock-card-circular.dashboard-clock-card-transparent .dashboard-clock-separator {
  width: 1px;
  height: 12px;
  background: rgba(65, 118, 144, .28);
}
#overviewView > .dashboard-toolbar {
  width: min(540px, 100%);
  box-sizing: border-box;
  margin: 0 auto 20px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
#overviewView > .dashboard-toolbar select {
  min-width: 170px;
}
@media (max-width: 680px) {
  .dashboard-clock-card.dashboard-clock-card-circular.dashboard-clock-card-transparent {
    width: min(100%, 340px);
    min-height: 164px;
    margin: 1px auto 8px;
  }
  .dashboard-clock-card.dashboard-clock-card-circular.dashboard-clock-card-transparent .dashboard-clock-orbit {
    width: 154px;
    height: 154px;
  }
  .dashboard-clock-card.dashboard-clock-card-circular.dashboard-clock-card-transparent .dashboard-clock-core {
    width: 112px;
    height: 112px;
  }
  .dashboard-clock-card.dashboard-clock-card-circular.dashboard-clock-card-transparent .dashboard-clock {
    font-size: 31px;
  }
  #overviewView > .dashboard-toolbar {
    width: min(100%, 360px);
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  #overviewView > .dashboard-toolbar select,
  #overviewView > .dashboard-toolbar button {
    width: 100%;
  }
}
/* End eClinic transparent clock and toolbar-below v1 */

/* eClinic sticky footer v1 */
#appView.app {
  min-height: 100vh;
  min-height: 100dvh;
  align-items: stretch;
}

#appView.app > .content {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: visible;
}

#appView.app > .content > .app-footer {
  flex: 0 0 auto;
  margin-top: auto;
}
/* End eClinic sticky footer v1 */


/* Organization settings, mail and print v1 */
.organization-settings-panel { margin-bottom: 16px; }
.organization-settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.settings-card {
  border: 1px solid #e2e7ee;
  border-radius: 14px;
  padding: 16px;
  background: #fbfcfe;
}
.settings-card h3 { margin: 0 0 14px; font-size: 16px; }
.settings-card > label:not(.compact-check) { display: block; margin-top: 10px; }
.settings-card input,
.settings-card select,
.settings-card textarea { width: 100%; }
.compact-settings-grid { gap: 10px; }
.organization-logo-row { display: flex; gap: 12px; align-items: center; margin-top: 7px; }
.organization-logo-preview {
  width: 150px;
  height: 82px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px dashed #c9d2df;
  border-radius: 12px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
}
.organization-logo-preview img { max-width: 132px; max-height: 64px; object-fit: contain; }
.organization-logo-actions { display: grid; gap: 8px; }
.settings-main-switch { margin-top: 13px; }
.settings-check-list { display: grid; gap: 10px; }
.reminder-hours-row {
  display: grid;
  grid-template-columns: 1fr 92px;
  align-items: center;
  gap: 12px;
  margin: 14px 0;
}
.organization-settings-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; }
.patient-consent-box {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 22px;
  padding: 11px 12px;
  border: 1px solid #e2e7ee;
  border-radius: 11px;
  background: #f8fafc;
}
@media (max-width: 1100px) {
  .organization-settings-grid { grid-template-columns: 1fr 1fr; }
  .organization-settings-grid .settings-card:last-child { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .organization-settings-grid { grid-template-columns: 1fr; }
  .organization-settings-grid .settings-card:last-child { grid-column: auto; }
  .organization-logo-row { align-items: stretch; flex-direction: column; }
  .organization-logo-preview { width: 100%; }
  .organization-logo-actions { grid-template-columns: 1fr 1fr; }
  .organization-settings-actions { display: grid; grid-template-columns: 1fr; }
  .patient-consent-box { display: grid; gap: 10px; }
}
/* End organization settings, mail and print v1 */


/* eClinic mobile polish and voice input v1 */
.voice-inline-button,
.voice-button {
  touch-action: manipulation;
  user-select: none;
}

.voice-enabled-wrap > input,
.voice-enabled-wrap > textarea {
  min-width: 0;
}

@media (max-width: 680px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  body {
    -webkit-text-size-adjust: 100%;
  }

  input,
  select,
  textarea {
    min-height: 44px;
    font-size: 16px;
  }

  textarea {
    min-height: 92px;
  }

  .button {
    min-height: 44px;
  }

  #appView.app > .content {
    padding: 8px 10px 20px;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 90;
    flex-wrap: nowrap;
    gap: 8px;
    margin: 0 -2px 14px;
    padding: 8px 2px 10px;
    border-bottom: 1px solid rgba(216, 224, 234, .9);
    background: rgba(244, 246, 250, .94);
    backdrop-filter: blur(12px);
  }

  .mobile-menu-button {
    width: 40px;
    height: 40px;
  }

  .mobile-topbar-logo {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
  }

  .topbar-title {
    min-width: 0;
    flex: 1 1 auto;
  }

  .topbar-title .eyebrow {
    max-width: 100%;
    margin-bottom: 2px;
    overflow: hidden;
    font-size: 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .topbar h1 {
    max-width: 100%;
    overflow: hidden;
    font-size: 21px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .topbar-actions {
    width: auto;
    flex: 0 0 auto;
    padding-left: 0;
  }

  .user-chip {
    width: auto;
    padding: 0;
  }

  .user-chip > span {
    width: 38px;
    height: 38px;
  }

  .user-chip > div {
    display: none;
  }

  .panel,
  .welcome-card {
    border-radius: 14px;
    padding: 14px;
  }

  .panel-head {
    gap: 10px;
    margin-bottom: 12px;
  }

  .panel-head h2 {
    font-size: 19px;
  }

  .patients-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 10px;
  }

  .patient-search-wrap {
    grid-column: 1 / -1;
  }

  .patients-toolbar .compact-check,
  .patients-toolbar .button {
    width: 100%;
    margin: 0;
  }

  .patients-toolbar .compact-check {
    min-height: 44px;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: #fff;
  }

  .table-wrap {
    width: calc(100% + 8px);
    margin-inline: -4px;
    overflow-x: auto;
    border-radius: 10px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }

  .data-table {
    min-width: 680px;
  }

  .data-table th,
  .data-table td {
    padding: 10px 9px;
  }

  .calendar-toolbar {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
    padding: 10px;
  }

  .calendar-nav {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) 42px;
    gap: 8px;
  }

  .calendar-range-label {
    grid-column: 1 / -1;
    grid-row: 1;
    margin: 0 0 2px;
    text-align: center;
  }

  #calendarPrev { grid-column: 1; grid-row: 2; }
  #calendarToday { grid-column: 2; grid-row: 2; }
  #calendarNext { grid-column: 3; grid-row: 2; }

  .calendar-filters {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
  }

  .calendar-filters select {
    width: 100%;
    min-width: 0;
  }

  .calendar-filters .button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .calendar-panel {
    padding: 8px;
  }

  .doctor-legend {
    flex-wrap: nowrap;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  .calendar-week {
    min-height: 400px;
    max-height: calc(100dvh - 290px);
  }

  .dashboard-kpi-grid {
    gap: 8px;
  }

  .dashboard-kpi {
    padding: 12px;
  }

  .dashboard-kpi strong {
    font-size: 24px;
  }

  .dashboard-comparison-grid {
    gap: 10px;
    margin-bottom: 10px;
  }

  .dashboard-panel {
    min-height: 220px;
  }

  .dashboard-bar-row {
    grid-template-columns: minmax(78px, 1fr) minmax(70px, 1.35fr) auto;
  }

  dialog:not(.patient-dialog) {
    width: calc(100% - 10px);
    max-width: none;
    max-height: calc(100dvh - 10px);
    border-radius: 14px;
  }

  dialog:not(.patient-dialog) .dialog-form {
    max-height: calc(100dvh - 10px);
    overflow-y: auto;
    padding: 16px;
    overscroll-behavior: contain;
  }

  .dialog-head {
    position: sticky;
    top: -16px;
    z-index: 4;
    margin: -16px -16px 12px;
    padding: 14px 16px 10px;
    border-bottom: 1px solid var(--border);
    background: #fff;
  }

  .dialog-actions {
    position: sticky;
    bottom: -16px;
    z-index: 4;
    flex-wrap: wrap;
    margin: 16px -16px -16px;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--border);
    background: #fff;
  }

  .dialog-actions .button {
    flex: 1 1 130px;
  }

  .patient-dialog {
    width: 100%;
    height: 100dvh;
    max-width: none;
    max-height: 100dvh;
    margin: 0;
    border-radius: 0;
  }

  .patient-form {
    height: 100dvh;
    max-height: 100dvh;
  }

  .patient-dialog-head {
    position: sticky;
    top: 0;
    z-index: 8;
    padding: 12px 12px 10px;
    background: #fff;
  }

  .patient-dialog-head h2 {
    font-size: 21px;
  }

  .patient-tabs {
    flex: 0 0 auto;
    padding: 6px 8px 0;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .patient-tabs::-webkit-scrollbar {
    display: none;
  }

  .patient-tab {
    min-height: 42px;
    padding: 10px 11px;
    scroll-snap-align: start;
  }

  .patient-tab-panel {
    padding: 14px 12px 20px;
    overscroll-behavior: contain;
  }

  .patient-dialog-footer {
    position: sticky;
    bottom: 0;
    z-index: 8;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  }

  .finance-summary-grid {
    gap: 8px;
  }

  .finance-summary-card {
    padding: 12px 14px;
  }

  .finance-summary-card strong {
    font-size: 22px;
  }

  .finance-entry-editor {
    padding: 12px;
  }

  .finance-table {
    min-width: 790px;
  }

  .organization-settings-grid,
  .permission-groups {
    gap: 10px;
  }

  .settings-card,
  .permission-group {
    padding: 13px;
  }

  .organization-logo-actions {
    grid-template-columns: 1fr;
  }

  .schedule-grid {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .schedule-row {
    min-width: 360px;
  }

  .voice-enabled-wrap > input,
  .voice-enabled-wrap > textarea {
    padding-right: 54px;
  }

  .voice-inline-button,
  .voice-button {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    font-size: 16px;
  }

  .voice-inline-button {
    right: 7px;
  }

  .voice-enabled-wrap.textarea-wrap .voice-inline-button {
    top: 7px;
  }

  .voice-status-toast {
    right: 8px;
    bottom: calc(8px + env(safe-area-inset-bottom));
    max-width: calc(100vw - 16px);
  }
}

@media (max-width: 390px) {
  .mobile-topbar-logo {
    display: none;
  }

  .topbar h1 {
    font-size: 19px;
  }

  .dashboard-kpi-grid {
    grid-template-columns: 1fr;
  }

  .patients-toolbar {
    grid-template-columns: 1fr;
  }

  .patient-search-wrap {
    grid-column: 1;
  }

  .calendar-filters {
    grid-template-columns: 1fr;
  }

  .calendar-filters .button {
    grid-column: 1;
  }
}
/* End eClinic mobile polish and voice input v1 */


/* Calendar views, 24-hour appointment time and compact settings v1 */
.calendar-view-switch {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 3px;
  background: #f4f7fb;
}
.calendar-view-button {
  min-height: 34px;
  border: 0;
  border-radius: 8px;
  padding: 7px 11px;
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}
.calendar-view-button:hover { color: var(--primary); background: #fff; }
.calendar-view-button.active {
  color: #fff;
  background: var(--primary);
  box-shadow: 0 2px 7px rgba(36,87,197,.22);
}
.calendar-week-header,
.calendar-week-body {
  grid-template-columns: 66px repeat(var(--calendar-days, 7), minmax(135px, 1fr));
}
.calendar-week.calendar-days-7 .calendar-week-header,
.calendar-week.calendar-days-7 .calendar-week-body { min-width: 1080px; }
.calendar-week.calendar-days-3 .calendar-week-header,
.calendar-week.calendar-days-3 .calendar-week-body { min-width: 760px; }
.calendar-week.calendar-days-1 .calendar-week-header,
.calendar-week.calendar-days-1 .calendar-week-body { min-width: 520px; }
.calendar-week.calendar-days-3 .calendar-appointment,
.calendar-week.calendar-days-1 .calendar-appointment {
  gap: 2px;
  padding: 7px 9px;
}
.calendar-week.calendar-days-3 .calendar-appointment strong,
.calendar-week.calendar-days-3 .calendar-appointment span,
.calendar-week.calendar-days-1 .calendar-appointment strong,
.calendar-week.calendar-days-1 .calendar-appointment span { font-size: 13px; }
.calendar-week.calendar-days-3 .calendar-appointment small,
.calendar-week.calendar-days-1 .calendar-appointment small {
  font-size: 11px;
  white-space: normal;
  line-height: 1.2;
}
.calendar-card-clinic::before { content: "Ιατρείο: "; font-weight: 800; }
.calendar-card-reason::before { content: "Αιτία: "; font-weight: 800; }
.time-24-input {
  font-variant-numeric: tabular-nums;
  letter-spacing: .04em;
}
.field-hint {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}
.settings-check-list { gap: 8px; }
.settings-check-list .compact-check {
  width: 100%;
  min-height: 42px;
  justify-content: flex-start;
  gap: 10px;
  border: 1px solid #e2e7ee;
  border-radius: 10px;
  padding: 9px 11px;
  color: var(--text);
  background: #fff;
  white-space: normal;
}
.settings-card .compact-check input,
.settings-check-list .compact-check input {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}
.settings-check-list .compact-check span { flex: 1; }
.settings-main-switch {
  min-height: 40px;
  justify-content: flex-start;
  gap: 10px;
  border-top: 1px solid #e2e7ee;
  padding: 12px 2px 0;
  color: var(--text);
}
.admin-identity-cell {
  min-width: 260px;
  white-space: normal;
  overflow-wrap: anywhere;
}
@media (max-width: 1100px) {
  .calendar-filters { flex-wrap: wrap; justify-content: flex-end; }
  .calendar-view-switch { order: -1; }
}
@media (max-width: 680px) {
  .calendar-view-switch {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }
  .calendar-view-button { width: 100%; padding-inline: 6px; }
  .calendar-filters .calendar-view-switch { grid-column: 1 / -1; }
  .calendar-week.calendar-days-3 .calendar-week-header,
  .calendar-week.calendar-days-3 .calendar-week-body { min-width: 680px; }
  .calendar-week.calendar-days-1 .calendar-week-header,
  .calendar-week.calendar-days-1 .calendar-week-body { min-width: 360px; }
}
/* End calendar views, 24-hour appointment time and compact settings v1 */


/* Calendar half-hour adaptive grid v1 */
.calendar-week {
  min-height: 0;
  max-height: calc(100dvh - 210px);
  overscroll-behavior: contain;
}
.calendar-week-header > div { min-height: 56px; }
.calendar-week-body.calendar-half-hour-grid { align-items: start; }
.calendar-time-rail,
.calendar-day-column { background: #f4f6f9; }
.calendar-time-rail span {
  z-index: 4;
  right: 7px;
  padding: 0 2px;
  background: rgba(244,246,249,.92);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.calendar-time-rail .calendar-hour-label {
  color: #5f6b7a;
  font-size: 11px;
  font-weight: 800;
}
.calendar-time-rail .calendar-half-hour-label {
  color: #9aa3af;
  font-size: 9px;
}
.calendar-day-column {
  overflow: hidden;
  background-image: none;
}
.calendar-day-column.today { background-color: #eef4ff; }
.calendar-working-band {
  position: absolute;
  inset-inline: 0;
  z-index: 0;
  background: rgba(255,255,255,.92);
  box-shadow: inset 0 1px 0 rgba(96,113,137,.08), inset 0 -1px 0 rgba(96,113,137,.08);
  pointer-events: none;
}
.calendar-day-column.today .calendar-working-band { background: rgba(251,253,255,.96); }
.calendar-slot-line {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 1;
  height: 1px;
  pointer-events: none;
}
.calendar-slot-line-major { background: #d7dee8; }
.calendar-slot-line-minor { background: #e9edf3; }
.calendar-appointment {
  z-index: 3;
  min-height: 0;
  gap: 0;
  border-radius: 7px;
  padding: 3px 6px;
  line-height: 1.05;
}
.calendar-appointment strong,
.calendar-appointment span,
.calendar-appointment small { line-height: 1.08; }
.calendar-appointment strong { font-size: 11px; }
.calendar-appointment span { font-size: 11px; }
.calendar-appointment small { margin-top: 2px; font-size: 9px; }
.calendar-appointment-short {
  justify-content: center;
  padding-block: 2px;
}
.calendar-appointment-short strong,
.calendar-appointment-short span {
  line-height: 1.05;
}
.calendar-appointment-short strong { font-size: 10px; }
.calendar-appointment-short span { font-size: 10px; }
.calendar-week.calendar-days-3 .calendar-appointment,
.calendar-week.calendar-days-1 .calendar-appointment { padding: 4px 7px; }
.calendar-week.calendar-days-3 .calendar-appointment strong,
.calendar-week.calendar-days-3 .calendar-appointment span { font-size: 12px; }
.calendar-week.calendar-days-1 .calendar-appointment strong,
.calendar-week.calendar-days-1 .calendar-appointment span { font-size: 13px; }
.calendar-week.calendar-days-3 .calendar-appointment-short strong,
.calendar-week.calendar-days-3 .calendar-appointment-short span { font-size: 11px; }
.calendar-week.calendar-days-1 .calendar-appointment-short strong,
.calendar-week.calendar-days-1 .calendar-appointment-short span { font-size: 12px; }
.calendar-week.calendar-days-3 .calendar-appointment small,
.calendar-week.calendar-days-1 .calendar-appointment small {
  font-size: 10px;
  line-height: 1.1;
}
@media (min-width: 761px) {
  .calendar-panel { padding-bottom: 8px; }
  .calendar-toolbar { margin-bottom: 10px; padding-block: 11px; }
  .doctor-legend { padding-bottom: 8px; }
}
@media (max-width: 760px) {
  .calendar-week { min-height: 0; max-height: calc(100dvh - 280px); }
  .calendar-time-rail .calendar-half-hour-label { display: none; }
}
/* End calendar half-hour adaptive grid v1 */


/* Calendar taller half-hour slots v1 */
.calendar-appointment-short {
  justify-content: flex-start;
}
.calendar-week.calendar-days-3 .calendar-appointment-short,
.calendar-week.calendar-days-1 .calendar-appointment-short {
  padding-top: 5px;
  padding-bottom: 5px;
}
.calendar-week.calendar-days-3 .calendar-appointment-short small,
.calendar-week.calendar-days-1 .calendar-appointment-short small {
  display: block;
  margin-top: 1px;
}
/* End calendar taller half-hour slots v1 */


/* eClinic compact secure login v1 */
.login-access {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.login-security-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  min-height: 58px;
  padding: 10px 14px;
  border: 1px solid rgba(8, 116, 67, .22);
  border-radius: 15px;
  color: #075b39;
  background: linear-gradient(180deg, #f3fcf7 0%, #eaf8f0 100%);
  box-shadow: 0 8px 24px rgba(8, 116, 67, .08);
}
.login-security-badge svg {
  width: 27px;
  height: 27px;
  flex: 0 0 27px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.login-security-badge div { min-width: 0; }
.login-security-badge strong,
.login-security-badge span { display: block; }
.login-security-badge strong { font-size: 14px; line-height: 1.2; }
.login-security-badge span { margin-top: 2px; color: #39745c; font-size: 10px; line-height: 1.3; }

.login-created-by {
  justify-content: center;
  gap: 7px;
  margin: 0;
  min-height: 25px;
  color: #78869a;
  font-size: 9px;
  font-weight: 650;
}
.login-created-by img {
  width: 104px !important;
  max-width: 104px;
}

.app-footer-secure {
  padding: 7px 11px;
  border: 1px solid rgba(8, 116, 67, .18);
  border-radius: 999px;
  color: #087443;
  background: #eaf8f0;
  font-weight: 800;
}
.app-footer .app-footer-secure svg { stroke: #087443; }
.app-footer .app-footer-created img { width: 98px; }

@media (max-width: 900px) {
  .login-shell { gap: 18px; }
  .login-intro { text-align: center; }
  .login-brand { margin-inline: auto; }
  .login-intro h1 { margin-top: 15px; }
  .login-intro p { margin-inline: auto; }
}

@media (max-width: 680px) {
  .login-page {
    min-height: 100svh;
    height: 100svh;
    display: block;
    overflow: hidden;
    padding: 10px 12px max(8px, env(safe-area-inset-bottom));
  }
  .login-shell {
    width: min(430px, 100%);
    height: 100%;
    min-height: 0;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
  }
  .login-intro { flex: 0 0 auto; }
  .login-brand { width: min(185px, 50vw); }
  .login-intro h1 {
    max-width: none;
    margin: 5px 0 3px;
    font-size: clamp(21px, 6.4vw, 27px);
    line-height: 1.04;
    letter-spacing: -.045em;
  }
  .login-intro p {
    max-width: 360px;
    font-size: 11px;
    line-height: 1.35;
  }
  .login-access {
    flex: 0 1 auto;
    gap: 7px;
  }
  .login-card {
    padding: 13px 15px;
    border-radius: 16px;
  }
  .login-card h2 { margin-bottom: 2px; font-size: 21px; }
  .login-card .muted { margin-bottom: 4px; font-size: 11px; line-height: 1.3; }
  .login-card label { margin: 7px 0 3px; font-size: 11px; }
  .login-card input {
    min-height: 37px;
    padding: 8px 10px;
    border-radius: 9px;
    font-size: 14px;
  }
  .login-card .button {
    min-height: 39px;
    margin-top: 10px;
    padding-block: 8px;
  }
  .login-card .message { margin-top: 7px; padding: 7px 9px; font-size: 11px; }
  .login-security-badge {
    min-height: 44px;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 12px;
  }
  .login-security-badge svg { width: 22px; height: 22px; flex-basis: 22px; }
  .login-security-badge strong { font-size: 12px; }
  .login-security-badge span { font-size: 9px; }
  .login-created-by { min-height: 21px; font-size: 8px; }
  .login-created-by img { width: 88px !important; max-width: 88px; }
  .app-footer .app-footer-created img { width: 88px; }
}

@media (max-width: 680px) and (max-height: 700px) {
  .login-page { padding-top: 6px; }
  .login-shell { gap: 5px; }
  .login-brand { width: min(145px, 42vw); }
  .login-intro h1 { margin: 2px 0; font-size: 19px; }
  .login-intro p { display: none; }
  .login-card { padding: 10px 13px; }
  .login-card h2 { font-size: 19px; }
  .login-card .muted { display: none; }
  .login-card label { margin-top: 5px; }
  .login-card input { min-height: 34px; padding-block: 6px; }
  .login-card .button { min-height: 35px; margin-top: 7px; }
  .login-security-badge { min-height: 39px; padding-block: 5px; }
  .login-created-by { min-height: 18px; }
}
/* End eClinic compact secure login v1 */


/* eClinic Authenticator 2FA + balanced mobile login v1 */
.login-otp-row.hidden { display: none; }
.login-security-badge strong { letter-spacing: .015em; }
.app-footer-secure { color: #0b6f50; font-weight: 800; }
.app-footer-secure svg { stroke-width: 2.15; }

.security-settings-panel { overflow: hidden; }
.two-factor-overview,
.two-factor-enabled-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #f8fbff;
}
.two-factor-overview p,
.two-factor-enabled-summary p { margin: 5px 0 0; color: var(--muted); line-height: 1.45; }
.two-factor-setup {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 24px;
  margin-top: 18px;
  padding: 20px;
  border: 1px solid #bcd0f6;
  border-radius: 18px;
  background: #f7faff;
}
.two-factor-qr-card {
  display: grid;
  place-items: center;
  align-self: start;
  min-height: 220px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
}
.two-factor-qr-card img { display: block; width: 196px; height: 196px; }
.two-factor-setup-details h3,
.two-factor-manage h3 { margin: 0 0 5px; }
.copy-field { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.copy-field input { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .08em; }
.two-factor-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 15px; }
.two-factor-enabled { margin-top: 18px; }
.two-factor-manage { margin-top: 12px; border: 1px solid var(--border); border-radius: 14px; background: #fff; }
.two-factor-manage summary { cursor: pointer; padding: 13px 16px; font-weight: 800; }
.two-factor-manage-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; padding: 4px 16px 18px; }
.two-factor-manage-grid button { margin-top: 12px; }
.two-factor-danger-zone { padding-left: 22px; border-left: 1px solid var(--border); }
.two-factor-recovery-dialog { width: min(560px, calc(100vw - 28px)); }
.two-factor-recovery-codes {
  margin: 12px 0;
  padding: 16px;
  border: 1px dashed #9bb3df;
  border-radius: 13px;
  background: #f6f9ff;
  font: 700 15px/1.8 ui-monospace, SFMono-Regular, Consolas, monospace;
  text-align: center;
  white-space: pre-wrap;
  user-select: all;
}
.admin-user-2fa-state { margin-top: 12px; padding: 10px 12px; border-radius: 11px; background: #f5f8fd; color: var(--muted); font-size: 13px; }

@media (max-width: 680px) {
  .login-page {
    padding: 8px 12px max(7px, env(safe-area-inset-bottom));
  }
  .login-shell {
    min-height: calc(100svh - 15px);
    height: auto;
    justify-content: flex-start;
    gap: 0;
  }
  .login-intro { padding-top: 2px; }
  .login-access {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: clamp(8px, 1.5vh, 16px);
  }
  .login-created-by {
    margin-top: auto;
    padding-top: 9px;
    padding-bottom: 1px;
  }
  .login-brand { width: min(178px, 47vw); }
  .login-intro h1 { margin-top: 4px; }
  .login-security-badge { margin-top: 1px; }
  .security-settings-panel .panel-head { align-items: flex-start; }
  .two-factor-overview,
  .two-factor-enabled-summary { align-items: stretch; flex-direction: column; padding: 14px; }
  .two-factor-overview .button { width: 100%; }
  .two-factor-setup { grid-template-columns: 1fr; padding: 14px; gap: 15px; }
  .two-factor-qr-card { min-height: 190px; }
  .two-factor-qr-card img { width: 176px; height: 176px; }
  .copy-field { grid-template-columns: 1fr; }
  .two-factor-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .two-factor-manage-grid { grid-template-columns: 1fr; }
  .two-factor-danger-zone { padding: 18px 0 0; border-left: 0; border-top: 1px solid var(--border); }
}

@media (max-width: 680px) and (max-height: 700px) {
  .login-shell { min-height: calc(100svh - 10px); }
  .login-access { padding-top: 4px; gap: 5px; }
  .login-created-by { padding-top: 4px; }
}
/* End eClinic Authenticator 2FA + balanced mobile login v1 */


/* eClinic mandatory Authenticator 2FA v2 */
.two-factor-enforcement-banner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  margin: 0 0 16px;
  padding: 14px 16px;
  border: 1px solid rgba(29, 78, 216, .22);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(239, 246, 255, .98), rgba(248, 250, 252, .98));
  box-shadow: 0 10px 28px rgba(15, 23, 42, .07);
}
.two-factor-enforcement-banner p { margin: 3px 0 0; color: var(--muted); }
.two-factor-enforcement-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; background: #dbeafe; font-size: 22px; }
.two-factor-mandatory-note { display: flex; gap: 8px 14px; align-items: baseline; flex-wrap: wrap; margin: 0 0 16px; padding: 12px 14px; border-radius: 13px; background: #eff6ff; color: #1e3a8a; }
.two-factor-mandatory-note span { color: #475569; }
.app.two-factor-setup-only .sidebar .nav-item:not(#navSettings) { display: none !important; }
.app.two-factor-setup-only #settingsView > .panel:not(#securitySettingsPanel) { display: none !important; }
.app.two-factor-setup-only .content { background: linear-gradient(180deg, #f8fbff 0%, #f8fafc 100%); }
.app.two-factor-setup-only #securitySettingsPanel { max-width: 920px; margin-inline: auto; }
.app.two-factor-setup-only #twoFactorEnforcementBanner { position: sticky; top: 8px; z-index: 5; }
.admin-reset-target { padding: 12px 14px; border-radius: 12px; background: #fff7ed; color: #9a3412; line-height: 1.5; }
.admin-reset-2fa-dialog { width: min(560px, calc(100vw - 28px)); }

@media (max-width: 680px) {
  .two-factor-enforcement-banner { grid-template-columns: auto 1fr; }
  .two-factor-enforcement-banner .button { grid-column: 1 / -1; width: 100%; }
  .app.two-factor-setup-only .mobile-menu-button { visibility: hidden; }
  .app.two-factor-setup-only .security-settings-panel { padding: 16px; }
  .app.two-factor-setup-only .two-factor-setup { grid-template-columns: 1fr; }
}

/* eClinic patient tab icons v1 */
.patient-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.patient-tab-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: .88;
}

.patient-tab.active .patient-tab-icon {
  opacity: 1;
}

@media (max-width: 600px) {
  .patient-tab {
    gap: 6px;
  }

  .patient-tab-icon {
    width: 17px;
    height: 17px;
    flex-basis: 17px;
  }
}



/* Appointment QR check-in and richer attendance dashboard v1 */
.dashboard-kpi-grid-six { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.dashboard-bar-row-rich { grid-template-columns: minmax(190px, 1.35fr) minmax(130px, 2fr) auto; align-items: center; }
.dashboard-bar-label-wrap { min-width: 0; }
.dashboard-bar-meta { margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dashboard-day-row-rich { grid-template-columns: minmax(92px, 1.3fr) repeat(4, auto); gap: 10px; }
.dashboard-doctor-daily-panel { margin-top: 18px; }
.dashboard-doctor-daily { max-height: 360px; overflow: auto; border: 1px solid var(--border); border-radius: 13px; }
.dashboard-doctor-daily-row { display: grid; grid-template-columns: 115px minmax(170px, 1.6fr) repeat(4, minmax(88px, .7fr)); gap: 10px; align-items: center; padding: 11px 13px; border-bottom: 1px solid var(--border); font-size: 13px; font-variant-numeric: tabular-nums; }
.dashboard-doctor-daily-row:last-child { border-bottom: 0; }
.dashboard-doctor-daily-row span:nth-child(n+3) { text-align: right; font-weight: 750; }
.dashboard-doctor-daily-head { position: sticky; top: 0; z-index: 2; background: #f7f9fc; color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }

@media (max-width: 1180px) {
  .dashboard-kpi-grid-six { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dashboard-bar-row-rich { grid-template-columns: minmax(150px, 1.2fr) minmax(100px, 1.4fr) auto; }
}
@media (max-width: 760px) {
  .dashboard-kpi-grid-six { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-bar-row-rich { grid-template-columns: minmax(0, 1fr) auto; gap: 7px; }
  .dashboard-bar-row-rich .dashboard-bar-track { grid-column: 1 / -1; grid-row: 2; }
  .dashboard-bar-value { grid-column: 2; grid-row: 1; }
  .dashboard-day-row-rich { grid-template-columns: 1fr auto auto; }
  .dashboard-day-row-rich strong:nth-of-type(3), .dashboard-day-row-rich strong:nth-of-type(4) { display: none; }
  .dashboard-doctor-daily { overflow-x: auto; }
  .dashboard-doctor-daily-row { min-width: 720px; }
}

/* eClinic temporary appointment patient flow v1 */
.appointment-patient-mode {
  display: inline-flex;
  gap: 4px;
  margin-bottom: 9px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: #f5f7fa;
}
.appointment-patient-mode button {
  min-height: 32px;
  border: 0;
  border-radius: 8px;
  padding: 6px 12px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 800;
}
.appointment-patient-mode button.active {
  color: var(--primary-dark);
  background: #fff;
  box-shadow: 0 1px 4px rgba(16, 47, 79, .13);
}
.appointment-patient-source { position: relative; }
.appointment-guest-fields {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px 12px;
  border: 1px solid #d8e4f1;
  border-radius: 12px;
  padding: 11px;
  background: #f8fbff;
}
.appointment-guest-consent {
  grid-column: 1 / -1;
  width: fit-content;
  margin: 0;
}
.appointment-guest-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 2px;
}
.appointment-guest-link-panel {
  flex: 1 1 520px;
  min-width: 0;
  border: 1px solid #cbd8e7;
  border-radius: 12px;
  padding: 10px;
  background: #fff;
}
.appointment-guest-link-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.appointment-guest-matches {
  display: grid;
  gap: 7px;
  margin-bottom: 9px;
}
.appointment-guest-match {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 10px;
}
.appointment-guest-match > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.appointment-guest-match small {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.appointment-guest-no-match { padding: 7px 2px; }
.calendar-guest-patient-badge {
  align-self: flex-start;
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 1px 5px;
  font-size: 9px;
  font-weight: 850;
  line-height: 1.3;
  opacity: .86;
}

@media (max-width: 760px) {
  .appointment-patient-mode { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .appointment-guest-fields { grid-template-columns: 1fr 1fr; }
  .appointment-guest-actions { display: grid; }
}
@media (max-width: 520px) {
  .appointment-guest-fields { grid-template-columns: 1fr; }
  .appointment-guest-consent,
  .appointment-guest-actions { grid-column: 1; }
  .appointment-guest-match { align-items: stretch; flex-direction: column; }
  .appointment-guest-match .button { width: 100%; }
}

/* eClinic guest patient icon label v1 */
.calendar-appointment-patient {
  display: flex;
  align-items: center;
  gap: 5px;
  width: 100%;
  min-width: 0;
}

.calendar-appointment-patient-name {
  flex: 1 1 auto;
  min-width: 0;
}

.calendar-guest-patient-icon,
.calendar-guest-patient-inline svg {
  width: 12px;
  height: 12px;
  flex: 0 0 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: .92;
}

.calendar-week.calendar-days-1 .calendar-guest-patient-icon,
.calendar-week.calendar-days-3 .calendar-guest-patient-icon,
.calendar-week.calendar-days-1 .calendar-guest-patient-inline svg,
.calendar-week.calendar-days-3 .calendar-guest-patient-inline svg {
  width: 13px;
  height: 13px;
  flex-basis: 13px;
}

.calendar-guest-patient-inline {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  margin-top: 1px;
  opacity: .92;
}

.calendar-guest-patient-inline span {
  width: auto;
  max-width: calc(100% - 16px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: inherit;
  font-weight: 750;
}

.calendar-week.calendar-days-3 .calendar-guest-patient-inline,
.calendar-week.calendar-days-1 .calendar-guest-patient-inline {
  font-size: 10px;
}

/* eClinic guest patient icon size v1a */
.calendar-appointment-patient {
  gap: 6px;
}

.calendar-guest-patient-icon,
.calendar-guest-patient-inline svg {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  stroke-width: 2.1;
}

.calendar-week.calendar-days-1 .calendar-guest-patient-icon,
.calendar-week.calendar-days-3 .calendar-guest-patient-icon,
.calendar-week.calendar-days-1 .calendar-guest-patient-inline svg,
.calendar-week.calendar-days-3 .calendar-guest-patient-inline svg {
  width: 16px;
  height: 16px;
  flex-basis: 16px;
}

/* eClinic live arrivals and automatic no-show v1 */
.arrival-notification-button {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid #dce4ee;
  border-radius: 13px;
  background: #fff;
  color: #52637a;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, color .18s ease;
}
.arrival-notification-button svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.arrival-notification-button:hover { border-color: #8fb6dc; color: #1769aa; transform: translateY(-1px); }
.arrival-notification-button.has-new-arrival {
  color: #0d6fad;
  border-color: #61a6d6;
  box-shadow: 0 0 0 5px rgba(49,139,196,.12), 0 8px 22px rgba(28,100,146,.16);
  animation: arrivalBellPulse 1.45s ease-in-out infinite;
}
.arrival-notification-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #e13e4f;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  line-height: 16px;
  text-align: center;
}
@keyframes arrivalBellPulse {
  0%, 100% { transform: rotate(0); }
  15% { transform: rotate(7deg); }
  30% { transform: rotate(-6deg); }
  45% { transform: rotate(4deg); }
  60% { transform: rotate(0); }
}

.dashboard-arrivals-panel {
  margin-bottom: 16px;
  overflow: hidden;
  border-color: #d9e7f2;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.dashboard-arrivals-panel.has-new-arrival {
  border-color: #64a8d4;
  box-shadow: 0 0 0 4px rgba(48,139,195,.09), var(--shadow-soft, 0 12px 30px rgba(22,39,61,.08));
}
.dashboard-arrivals-head { margin-bottom: 10px; }
.dashboard-arrivals-head .eyebrow { margin-bottom: 2px; }
.dashboard-arrivals-actions { display: flex; align-items: center; gap: 9px; }
.dashboard-arrivals-list { display: grid; gap: 7px; }
.dashboard-arrival-row {
  display: grid;
  grid-template-columns: 5px 92px minmax(170px, 1.3fr) minmax(150px, 1fr) minmax(120px, auto) 18px;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 66px;
  padding: 8px 12px 8px 0;
  border: 1px solid #e3e9f1;
  border-radius: 12px;
  background: #fff;
  color: #203047;
  text-align: left;
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.dashboard-arrival-row:hover {
  transform: translateY(-1px);
  border-color: #a9c8df;
  box-shadow: 0 8px 22px rgba(28,72,105,.09);
}
.dashboard-arrival-row.unread { background: #f2f9fd; border-color: #8bc1e0; }
.dashboard-arrival-color { align-self: stretch; border-radius: 11px 0 0 11px; }
.dashboard-arrival-time,
.dashboard-arrival-identity,
.dashboard-arrival-place { display: flex; min-width: 0; flex-direction: column; gap: 2px; }
.dashboard-arrival-time strong { font-size: 17px; color: #123c60; }
.dashboard-arrival-row small { overflow: hidden; color: #718096; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-arrival-identity strong,
.dashboard-arrival-place strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-arrival-identity strong { font-size: 14px; }
.dashboard-arrival-place strong { font-size: 12px; color: #354a62; }
.dashboard-arrival-wait {
  justify-self: end;
  border-radius: 999px;
  padding: 5px 9px;
  background: #eaf6ee;
  color: #27814b;
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}
.dashboard-arrival-arrow { justify-self: end; color: #7790a7; font-size: 25px; line-height: 1; }

.arrival-toast {
  position: fixed;
  z-index: 2000;
  top: 82px;
  right: 22px;
  display: grid;
  grid-template-columns: 38px minmax(190px, 1fr) auto 28px;
  align-items: center;
  gap: 10px;
  width: min(470px, calc(100vw - 30px));
  padding: 12px;
  border: 1px solid #8fc2df;
  border-radius: 15px;
  background: rgba(248,253,255,.98);
  box-shadow: 0 18px 48px rgba(21,69,101,.22);
  color: #163b58;
}
.arrival-toast-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #dff4e7;
  color: #27804a;
  font-size: 20px;
  font-weight: 900;
}
.arrival-toast > div:nth-child(2) { display: flex; min-width: 0; flex-direction: column; gap: 2px; }
.arrival-toast span { overflow: hidden; color: #5f7184; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.arrival-toast-open { border: 0; border-radius: 9px; padding: 7px 10px; background: #196ea8; color: #fff; font-weight: 800; cursor: pointer; }
.arrival-toast-close { border: 0; background: transparent; color: #718096; font-size: 22px; cursor: pointer; }
.arrival-toast-pulse { animation: arrivalToastIn .32s ease-out; }
@keyframes arrivalToastIn {
  from { opacity: 0; transform: translateY(-10px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 900px) {
  .dashboard-arrival-row { grid-template-columns: 5px 74px minmax(130px, 1fr) minmax(100px, .8fr) 18px; gap: 9px; }
  .dashboard-arrival-wait { display: none; }
}
@media (max-width: 620px) {
  .arrival-notification-button { width: 38px; height: 38px; border-radius: 11px; }
  .dashboard-arrivals-actions .button { display: none; }
  .dashboard-arrival-row { grid-template-columns: 5px 61px minmax(0, 1fr) 16px; min-height: 62px; padding-right: 8px; }
  .dashboard-arrival-place { display: none; }
  .dashboard-arrival-time strong { font-size: 14px; }
  .dashboard-arrival-identity strong { font-size: 13px; }
  .arrival-toast { top: 66px; right: 10px; grid-template-columns: 34px minmax(0, 1fr) 25px; width: calc(100vw - 20px); }
  .arrival-toast-open { grid-column: 2; justify-self: start; }
  .arrival-toast-close { grid-column: 3; grid-row: 1; }
}

/* eClinic doctor day workspace v1a */
.doctor-day-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
  padding: 18px 20px;
}
.doctor-day-hero h2 { margin: 2px 0 4px; font-size: clamp(23px, 2.3vw, 32px); }
.doctor-day-hero-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.doctor-day-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}
.doctor-day-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 70px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  padding: 14px 16px;
  box-shadow: 0 8px 22px rgba(15, 43, 70, .06);
}
.doctor-day-summary span { color: var(--muted); font-weight: 750; }
.doctor-day-summary strong { font-size: 28px; color: var(--ink); }
.doctor-day-summary.waiting { border-left: 5px solid #f59e0b; }
.doctor-day-summary.upcoming { border-left: 5px solid #3b82f6; }
.doctor-day-summary.completed { border-left: 5px solid #10b981; }
.doctor-day-summary.no-show { border-left: 5px solid #ef4444; }
.doctor-day-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 14px; }
.doctor-day-panel { min-width: 0; }
.doctor-day-waiting-panel.has-new-arrival { animation: doctor-day-panel-pulse 1.15s ease-in-out 3; }
.doctor-day-list { display: grid; gap: 8px; }
.doctor-day-row {
  position: relative;
  display: grid;
  grid-template-columns: 5px minmax(105px, .7fr) minmax(180px, 1.4fr) auto auto;
  align-items: center;
  gap: 12px;
  min-width: 0;
  border: 1px solid #dfe6ef;
  border-radius: 12px;
  background: #fff;
  padding: 10px 11px;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.doctor-day-row:hover { transform: translateY(-1px); border-color: #b8c8dc; box-shadow: 0 8px 20px rgba(20, 49, 78, .09); }
.doctor-day-row.status-arrived { background: #fffaf0; border-color: #f5dca4; }
.doctor-day-row.status-completed { background: #f2fbf7; }
.doctor-day-row.status-no_show { background: #fff5f5; }
.doctor-day-row.status-cancelled { opacity: .62; }
.doctor-day-color { width: 5px; height: 42px; border-radius: 999px; }
.doctor-day-time, .doctor-day-identity { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.doctor-day-time strong, .doctor-day-identity strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doctor-day-time small, .doctor-day-identity small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.doctor-day-row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.doctor-day-finished-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.doctor-day-finished-list .doctor-day-row { grid-template-columns: 5px minmax(95px, .65fr) minmax(150px, 1.2fr) auto auto; }
.confirmation-dialog { width: min(510px, calc(100vw - 28px)); border: 0; border-radius: 18px; padding: 0; box-shadow: 0 24px 70px rgba(12, 35, 58, .28); }
.confirmation-dialog::backdrop { background: rgba(9, 28, 48, .44); backdrop-filter: blur(2px); }
.confirmation-dialog-body { padding: 24px; }
.confirmation-dialog-icon { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 14px; border-radius: 50%; background: #e8f8f1; color: #078552; font-size: 24px; font-weight: 900; }
@keyframes doctor-day-panel-pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(245,158,11,0); } 50% { box-shadow: 0 0 0 8px rgba(245,158,11,.16); } }
@media (max-width: 980px) {
  .doctor-day-grid { grid-template-columns: 1fr; }
  .doctor-day-finished-list { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .doctor-day-hero { align-items: stretch; flex-direction: column; padding: 15px; }
  .doctor-day-hero-actions { justify-content: stretch; }
  .doctor-day-hero-actions .button { flex: 1 1 145px; }
  .doctor-day-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .doctor-day-summary { min-height: 62px; padding: 11px 13px; }
  .doctor-day-summary strong { font-size: 24px; }
  .doctor-day-row,
  .doctor-day-finished-list .doctor-day-row {
    grid-template-columns: 5px 76px minmax(0, 1fr) auto;
    gap: 8px;
    padding: 9px;
  }
  .doctor-day-row > .status { grid-column: 2 / 4; justify-self: start; }
  .doctor-day-row-actions { grid-column: 2 / -1; width: 100%; }
  .doctor-day-row-actions .button { flex: 1 1 auto; }
}



/* eClinic doctor day admin selector v1a */
.doctor-day-doctor-picker { display:grid; gap:4px; min-width:210px; color:var(--muted); font-size:12px; font-weight:750; }
.doctor-day-doctor-picker select { min-height:38px; border:1px solid var(--border); border-radius:9px; padding:7px 10px; background:#fff; color:var(--text); font:inherit; }
@media (max-width:760px) { .doctor-day-doctor-picker { min-width:100%; width:100%; } .doctor-day-doctor-picker select { width:100%; } }

/* eClinic doctor user link completion v1 */
.doctor-user-link-field small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}
.doctor-linked-user {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}
.doctor-linked-user.missing { color: #b45309; }



/* eClinic multi-role doctor users v1 */
.user-role-choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}
.user-role-choice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 12px;
  background: #fff;
  cursor: pointer;
}
.user-role-choice:has(input:checked) {
  border-color: #8bb7e5;
  background: #f2f8ff;
  box-shadow: 0 0 0 2px rgba(38,116,190,.08);
}
.user-role-choice input { margin-top: 3px; flex: 0 0 auto; }
.user-role-choice > span { display: grid; gap: 2px; min-width: 0; }
.user-role-choice strong { font-size: 13px; }
.user-role-choice small { color: var(--muted); font-size: 10px; line-height: 1.25; }
.user-doctor-profile {
  margin-top: 14px;
  border: 1px solid #cfe0f0;
  border-radius: 16px;
  padding: 15px;
  background: linear-gradient(180deg, #f7fbff, #fff);
}
.user-doctor-profile-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.user-doctor-profile-head h3 { margin: 2px 0 0; }
.user-dialog { width: min(920px, calc(100vw - 24px)); }
@media (max-width: 680px) {
  .user-role-choice-grid { grid-template-columns: 1fr; }
  .user-doctor-profile { padding: 12px; }
  .user-doctor-profile-head { align-items: flex-start; }
}

/* eClinic multi-role doctor users v1a */
.user-role-choice-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  align-items: stretch;
}

.user-role-choice {
  width: auto;
  min-height: 72px;
  margin: 0;
  overflow: hidden;
}

.user-role-choice input[type="checkbox"] {
  width: 18px !important;
  min-width: 18px;
  height: 18px;
  padding: 0;
  margin: 2px 0 0;
  flex: 0 0 18px;
  accent-color: var(--primary);
}

.user-role-choice > span {
  width: auto;
  min-width: 0;
  overflow: visible;
}

.user-role-choice strong,
.user-role-choice small {
  display: block;
  width: auto;
  max-width: 100%;
  overflow: visible;
  white-space: normal;
  word-break: normal;
}

.user-role-choice strong {
  color: var(--text);
  font-size: 14px;
  line-height: 1.25;
}

.user-role-choice small {
  margin-top: 3px;
  font-size: 11px;
  line-height: 1.35;
}

/* Οι ιατροί διαχειρίζονται αποκλειστικά μέσα από τους Χρήστες. */
#doctorSettingsToolbar,
#doctorSettingsPanel {
  display: none !important;
}

@media (max-width: 760px) {
  .user-role-choice-grid {
    grid-template-columns: 1fr;
  }
}

/* eClinic role based dashboard v1 */
#overviewView {
  position: relative;
  isolation: isolate;
}

#overviewView > :not(.dashboard-ambient-backdrop) {
  position: relative;
  z-index: 2;
}

.dashboard-ambient-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  min-height: 100%;
  border: 1px solid rgba(153, 164, 181, .24);
  border-radius: 24px;
  background: linear-gradient(145deg, #e7eaee 0%, #d9dee5 100%);
}

.dashboard-ambient-backdrop.has-logo {
  background:
    radial-gradient(circle at center, rgba(255,255,255,.84) 0%, rgba(239,243,247,.68) 50%, rgba(219,225,232,.86) 100%);
}

.dashboard-ambient-logo {
  width: min(84%, 1120px);
  height: min(76%, 720px);
  object-fit: contain;
  opacity: .28;
  filter: saturate(.88) contrast(.96);
  user-select: none;
  pointer-events: none;
}

#overviewView[data-dashboard-mode="ambient"] {
  min-height: calc(100dvh - 150px);
  display: grid;
  place-items: center;
  padding: 24px;
}

#overviewView[data-dashboard-mode="ambient"] > .dashboard-clock-card {
  grid-area: 1 / 1;
  align-self: center;
  justify-self: center;
  margin: 0;
}

#overviewView[data-dashboard-mode="ambient"] .dashboard-clock-orbit {
  border-radius: 50%;
  background: rgba(248, 250, 252, .82);
  box-shadow: 0 18px 55px rgba(47, 63, 84, .18);
  backdrop-filter: blur(8px);
}

#overviewView[data-dashboard-mode="doctor"] {
  display: block;
}

#overviewView[data-dashboard-mode="doctor"] .dashboard-arrivals-panel {
  margin-top: 0;
}

#appView.dashboard-ambient-active > .content > .app-footer {
  display: none;
}

@media (max-width: 760px) {
  #overviewView[data-dashboard-mode="ambient"] {
    min-height: calc(100dvh - 112px);
    padding: 12px;
  }

  .dashboard-ambient-backdrop {
    border-radius: 18px;
  }

  .dashboard-ambient-logo {
    width: 92%;
    height: 72%;
    opacity: .24;
  }
}
/* End eClinic role based dashboard v1 */


/* eClinic user password self-service v1 */
.password-settings-panel { max-width: 1120px; }
.password-change-form { margin-top: 4px; }
.password-change-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.password-change-grid > div { display: grid; gap: 7px; }
.password-change-grid small { color: var(--muted); line-height: 1.35; }
.password-change-actions { display: flex; justify-content: flex-end; margin-top: 18px; }
.password-mandatory-note { display: flex; gap: 8px 14px; align-items: baseline; flex-wrap: wrap; margin: 0 0 16px; padding: 12px 14px; border-radius: 13px; background: #fff7ed; color: #9a3412; }
.password-mandatory-note span { color: #475569; }
.app.password-change-only .sidebar .nav-item:not(#navSettings) { display: none !important; }
.app.password-change-only #settingsView > .panel:not(#passwordSettingsPanel) { display: none !important; }
.app.password-change-only .content { background: linear-gradient(180deg, #fffaf5 0%, #f8fafc 100%); }
.app.password-change-only #passwordSettingsPanel { max-width: 920px; margin-inline: auto; }
.app.password-change-only #twoFactorEnforcementBanner { position: sticky; top: 8px; z-index: 5; }
@media (max-width: 860px) { .password-change-grid { grid-template-columns: 1fr; } }
@media (max-width: 680px) {
  .app.password-change-only .mobile-menu-button { visibility: hidden; }
  .app.password-change-only .password-settings-panel { padding: 16px; }
  .password-change-actions .button { width: 100%; }
}
