/* emalio v0.6.3 · Fluid clinic workspace, from compact phones to 27" 5K.
   Use CSS pixels (a 5120×2880 Retina panel often exposes ~2560×1440 CSS px).
   All typography remains legible; real overflow is confined to data grids. */
:root { --layout-gutter:clamp(16px,2.5vw,76px); --layout-gap:clamp(12px,1.25vw,26px); }
html { overflow-x:clip; }
body { min-width:0; }
#app { min-width:0; }
.app-shell { grid-template-columns:clamp(252px,17vw,306px) minmax(0,1fr); width:100%; min-height:100dvh; }
.main { width:100%; max-width:none; min-width:0; margin:0; padding:clamp(24px,2vw,52px) var(--layout-gutter) clamp(60px,5vw,115px); }
.main > * { min-width:0; }
.sidebar { overflow-y:auto; overflow-x:hidden; scrollbar-width:thin; overscroll-behavior:contain; }
.topbar { min-height:48px; margin-bottom:clamp(20px,2.1vw,35px); }
.page-heading { gap:clamp(12px,1vw,24px); }
.stats { gap:var(--layout-gap); }
.stat { min-width:0; }
.stat-num { overflow-wrap:anywhere; font-variant-numeric:tabular-nums; }
.grid-main { grid-template-columns:minmax(0,1.5fr) minmax(340px,.85fr); gap:var(--layout-gap); }
.two-col { grid-template-columns:minmax(285px,.72fr) minmax(0,1.55fr); gap:var(--layout-gap); }
.card, .cardbody, .cardhead, .patient-header, .patient-chart-panel { min-width:0; }
.cardhead, .page-heading, .top-actions, .actions { flex-wrap:wrap; }
.table-wrap { display:block; max-width:100%; min-width:0; overflow-x:auto; overscroll-behavior-inline:contain; -webkit-overflow-scrolling:touch; }
.table { min-width:680px; }
.week-grid { width:100%; min-width:720px; }
.card:has(.week-grid) { overflow-x:auto; overscroll-behavior-x:contain; }
.patient-list { max-height:clamp(520px,70dvh,1300px); }
.dialog { width:min(680px,calc(100vw - 32px)); max-height:calc(100dvh - 36px); }
.patient-odontogram-frame { height:clamp(1080px,85dvh,1700px); }
.patient-chart-panel.is-expanded .patient-odontogram-frame { height:calc(100dvh - 92px)!important; }
/* Wide displays: fill the workspace without stretching type to illegibility. */
@media(min-width:1800px) {
  .app-shell { grid-template-columns:clamp(282px,15vw,320px) minmax(0,1fr); }
  .main { max-width:none; }
  .page-heading h1 { font-size:clamp(38px,2vw,48px); }
  .stats { grid-template-columns:repeat(4,minmax(0,1fr)); }
  .stat { padding:clamp(22px,1.4vw,33px); }
  .grid-main { grid-template-columns:minmax(0,1.7fr) minmax(375px,.88fr); }
  .two-col { grid-template-columns:clamp(330px,22vw,500px) minmax(0,1fr); }
  .patient-odontogram-frame { min-height:1240px; }
}
@media(min-width:2700px) {
  .main { padding-left:clamp(50px,2.7vw,110px); padding-right:clamp(50px,2.7vw,110px); }
  .grid-main { grid-template-columns:minmax(0,1.85fr) minmax(440px,.85fr); }
  .two-col { grid-template-columns:clamp(420px,18vw,620px) minmax(0,1fr); }
  .stat-num { font-size:clamp(34px,1.65vw,45px); }
  .patient-list { max-height:min(75dvh,1600px); }
}
/* Mid-size laptops and tablets: preserve the existing full-size navigation. */
@media(max-width:1360px) {
  .app-shell { grid-template-columns:clamp(232px,22vw,276px) minmax(0,1fr); }
  .grid-main { grid-template-columns:minmax(0,1fr); }
  .two-col { grid-template-columns:minmax(0,1fr); }
  .main { padding-inline:clamp(18px,2.2vw,32px); }
}
@media(max-width:1170px) and (min-width:721px) {
  .stats { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .patient-list { max-height:380px; }
}
@media(max-width:720px) {
  .app-shell { display:block; width:100%; padding-bottom:calc(76px + env(safe-area-inset-bottom)); }
  .main { max-width:none; padding:clamp(15px,4.2vw,24px) clamp(12px,3.6vw,20px) 48px; }
  .sidebar { overflow-x:auto; overflow-y:visible; height:auto; width:100%; }
  .sidebar .nav { overflow-x:auto; overscroll-behavior-inline:contain; }
  .sidebar .nav-item { flex:1 0 auto; min-width:57px; min-height:60px; }
  .top-actions { max-width:100%; }
  .clinic-select { min-width:112px; max-width:min(45vw,210px); }
  .stats { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
  .stat { min-height:130px; padding:13px; }
  .stat-num { font-size:clamp(24px,6.5vw,29px); }
  .grid-main,.two-col { grid-template-columns:minmax(0,1fr); gap:12px; }
  .cardhead,.cardbody { padding:clamp(13px,3vw,19px); }
  .table { min-width:660px; }
  .patient-odontogram-frame { height:clamp(1050px,150dvh,1900px); }
  .patient-chart-panel.is-expanded { inset:5px 5px calc(75px + env(safe-area-inset-bottom))!important; }
  .patient-chart-panel.is-expanded .patient-odontogram-frame { height:calc(100dvh - 166px)!important; min-height:320px; }
  .form-actions { flex-wrap:wrap; }
}
@media(max-width:360px) {
  .stats { grid-template-columns:1fr; }
  .stat { min-height:100px; }
  .clinic-select { max-width:165px; }
  .page-heading h1 { font-size:clamp(27px,9vw,31px); }
  .sidebar .nav-item { font-size:10px; }
}
@media (hover:none) and (pointer:coarse) {
 .nav-item, .patient-button, .btn, .table button.link { touch-action:manipulation; }
}
/* Retina/5K comfort: keep clinical text readable at wider logical workspaces. */
@media(min-width:2400px){
 .main{font-size:18px}
 .sidebar .nav-item{font-size:18px}
 .table td,.table td strong,.list-item b,.patient-button strong{font-size:18px}
 .table th,.stat-label,.list-item p,.patient-button small{font-size:16px}
 .cardhead h2{font-size:23px}
 .btn:not(.small){font-size:18px}
 .page-heading h1{font-size:46px}
}
/* All six destinations stay reachable without horizontal paging on phones. */
@media(max-width:720px){
 .sidebar .nav{width:100%;justify-content:space-between;overflow-x:hidden}
 .sidebar .nav-item{min-width:0;flex:1 1 0;padding-inline:1px;font-size:clamp(9px,2.15vw,11px);letter-spacing:-.025em;white-space:nowrap}
}
@media(max-width:365px){.sidebar .nav-item{font-size:0;gap:0}.sidebar .nav-icon{width:26px;height:26px}}

/* 0.8.27: dashboard shortcuts and next appointments */
.dashboard-heading{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:26px}
.dashboard-heading h1{font-size:clamp(31px,3vw,42px);line-height:1.17;letter-spacing:-.045em;margin:0;font-weight:780}
.dashboard-heading p{font-size:16px;color:var(--muted);margin:8px 0 0;text-transform:capitalize}
.dashboard-stats{grid-template-columns:repeat(3,minmax(0,1fr))}
.dashboard-stat-link{position:relative;display:block;width:100%;text-align:left;color:var(--ink);font:inherit;cursor:pointer;transition:transform .16s ease,border-color .16s ease,box-shadow .16s ease}
.dashboard-stat-link:hover{transform:translateY(-2px);border-color:#b9d2f5;box-shadow:0 10px 26px rgba(30,82,148,.1)}
.dashboard-stat-link:focus-visible,.dashboard-quick-action:focus-visible{outline:3px solid #2379e5;outline-offset:3px}
.dashboard-stat-link .stat-label,.dashboard-stat-link .stat-num,.dashboard-stat-link .stat-hint{display:block}
.dashboard-stat-arrow{display:block;margin-top:11px;font-size:13px;font-weight:700;color:var(--blue)}
.dashboard-grid{align-items:start}
.dashboard-agenda .cardhead p{margin:5px 0 0}
.dashboard-agenda .table{min-width:720px}
.dashboard-agenda .table .link{max-width:190px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.dashboard-quick-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;padding:16px}
.dashboard-quick-action{display:flex;align-items:center;gap:12px;min-width:0;min-height:82px;padding:13px;border:1px solid #e1e9f4;border-radius:15px;background:#fff;color:var(--ink);text-align:left;cursor:pointer;transition:background .15s ease,border-color .15s ease,transform .15s ease}
.dashboard-quick-action:hover{background:#f6f9ff;border-color:#c7dcfb;transform:translateY(-1px)}
.dashboard-quick-action>span:nth-child(2){display:grid;gap:4px;min-width:0}
.dashboard-quick-action b{font-size:15px}
.dashboard-quick-action small{font-size:12px;line-height:1.35;color:var(--muted)}
.dashboard-quick-icon{flex:none;width:38px;height:38px;display:grid;place-items:center;border-radius:12px;background:#eaf2ff;color:#2674d4;font-size:22px;font-weight:800}
.dashboard-quick-arrow{margin-left:auto;color:#7d8da5;font-size:20px}
.dashboard-empty{display:grid;justify-items:center;text-align:center;gap:8px;padding:32px 16px 38px;color:var(--muted)}
.dashboard-empty>span{display:grid;place-items:center;width:44px;height:44px;border-radius:50%;background:#e7f8ef;color:#19865c;font-size:22px;font-weight:800}
.dashboard-empty strong{color:var(--ink);font-size:17px}
.dashboard-empty p{margin:0 0 8px;font-size:14px}
@media(min-width:1800px){.dashboard-stats{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:720px){
 .dashboard-heading{align-items:flex-start;flex-wrap:wrap;margin-bottom:19px}
 .dashboard-heading h1{font-size:31px}
 .dashboard-heading p{font-size:14px}
 .dashboard-heading>.btn{width:100%}
 .dashboard-stats{grid-template-columns:repeat(2,minmax(0,1fr))}
 .dashboard-stat-link{min-height:142px}
 .dashboard-grid{gap:12px}
 .dashboard-quick-actions{grid-template-columns:1fr;padding:12px}
 .dashboard-quick-action{min-height:70px}
 .dashboard-agenda .table{min-width:0}
}
@media(max-width:365px){.dashboard-stats{grid-template-columns:1fr}.dashboard-stat-link{min-height:118px}}

/* 0.7.7: mobile workspace with readable cards and touch-sized controls. */
.mobile-logout{display:none}
.dialog-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}
.dialog-heading h2{flex:1;min-width:0}
.dialog-heading button{flex-shrink:0;min-width:44px;min-height:44px;font-size:25px}
body.emalio-modal-open{overflow:hidden}
:focus-visible{outline:3px solid #2379e5;outline-offset:3px}
@media(max-width:720px){
 .mobile-logout{display:inline-flex;align-items:center;justify-content:center}
 .topbar{gap:10px;margin-bottom:16px}.top-actions{width:100%;justify-content:space-between;gap:10px}
 .clinic-select{flex:1;min-width:0;max-width:none;font-size:16px!important}
 .sidebar .nav{gap:2px}.sidebar .nav-item{font-size:11px;white-space:normal;line-height:1.15;letter-spacing:0;min-height:58px}
 .sidebar .nav-icon{width:23px;height:23px;display:grid;place-items:center}
 .sidebar .nav-item.active{box-shadow:none}
 .btn,.btn.small,.field,.switch-auth{min-height:44px}
 .field,.auth-form input,.auth-form select,.auth-form textarea{font-size:16px!important}
 .page-heading .actions{width:100%}.page-heading .actions>.btn{flex:1}
 .page-heading p{overflow-wrap:anywhere}
 .patient-list{max-height:260px;overflow-y:auto}
 .patient-header{flex-wrap:wrap;gap:12px}.patient-header>div{min-width:0}.patient-header h2{overflow-wrap:anywhere}
 .patient-header .inline-actions{margin-left:0;width:100%;flex-wrap:wrap;gap:8px}
 .patient-header .inline-actions .btn{flex:1 1 135px}
 .detail-grid,.clinical-summary{grid-template-columns:1fr}
 .sectionline{flex-wrap:wrap;gap:8px}
 .table-wrap{overflow:visible}.table{min-width:0!important;width:100%;display:block}
 .table thead{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
 .table tbody{display:grid;gap:12px;padding:12px}
 .table tr{display:grid;min-width:0;border:1px solid #dce5f2;border-radius:14px;padding:12px;background:#fff}
 .table td{display:block;padding:7px 0;border:0!important;min-width:0;overflow-wrap:anywhere;white-space:normal}
 .table td[data-label]::before{content:attr(data-label);display:block;font-size:11px;font-weight:700;letter-spacing:.03em;color:#70809a;margin-bottom:4px}
 .table td .inline-actions{flex-wrap:wrap;gap:6px}.table td .btn{flex:1 1 auto}
 .table td.empty{padding:18px 4px}
 .week-grid{display:grid;grid-template-columns:1fr;min-width:0!important}
 .week-day{display:grid;grid-template-columns:58px minmax(0,1fr);border-right:0;border-bottom:1px solid #e3eaf4;min-height:80px}
 .week-day-head{display:flex;flex-direction:column;align-items:center;justify-content:center;border-bottom:0}
 .week-slots{min-height:0;padding:8px;display:grid;gap:6px}
 .slot-event{margin:0;min-width:0}.slot-event span,.slot-event small{white-space:normal;overflow-wrap:anywhere}
 .slot-empty{padding:12px}.card:has(.week-grid){overflow:visible}
 .backdrop{padding:8px;align-items:end;z-index:50}
 .dialog{width:100%;max-height:calc(100dvh - 16px - env(safe-area-inset-top));padding:18px 16px calc(18px + env(safe-area-inset-bottom));border-radius:20px 20px 12px 12px;overscroll-behavior:contain}
 .form-actions{position:sticky;bottom:0;background:white;padding-top:12px;margin-top:4px;display:flex;gap:8px}
 .form-actions .btn{flex:1;min-width:0}
 .toast{left:12px;right:12px;max-width:none;bottom:calc(90px + env(safe-area-inset-bottom));z-index:60}
 .auth-page{padding:16px 12px;min-height:100dvh}.auth-card{padding:24px 20px}
 .toolbar{flex-wrap:wrap;gap:8px}.toolbar .field{width:100%;min-width:0}
 .treat-item{flex-wrap:wrap;gap:10px}.treat-item>div{min-width:0;overflow-wrap:anywhere}
}
@media(max-width:365px){.sidebar .nav-item{font-size:10px!important;gap:3px}.sidebar .nav-icon{width:22px;height:22px}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;transition:none!important;animation:none!important}}

.nav-mobile-label{display:none}
@media(max-width:720px){.sidebar .emal-clock{display:none!important}.nav-desktop-label{display:none}.nav-mobile-label{display:inline}.sidebar{padding-top:6px;padding-bottom:max(6px,env(safe-area-inset-bottom))}.sidebar .nav-item{min-height:58px;height:58px}.sidebar .nav-icon{flex-shrink:0}}

@media(max-width:720px){.sidebar .brand.brand-animated{display:none!important}.sidebar{height:auto!important}}

@media(min-width:721px) and (max-width:1000px){
 .table-wrap{overflow:visible}.table{min-width:0!important;width:100%;display:block}
 .table thead{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
 .table tbody{display:grid;gap:12px;padding:12px}
 .table tr{display:grid;min-width:0;border:1px solid #dce5f2;border-radius:14px;padding:12px;background:#fff}
 .table td{display:block;padding:7px 0;border:0!important;min-width:0;overflow-wrap:anywhere;white-space:normal}
 .table td[data-label]::before{content:attr(data-label);display:block;font-size:11px;font-weight:700;letter-spacing:.03em;color:#70809a;margin-bottom:4px}
 .table td .inline-actions{flex-wrap:wrap;gap:6px}.table td .btn{flex:1 1 auto}
 .table td.empty{padding:18px 4px}
}
@media(hover:none) and (pointer:coarse){.btn,.btn.small,.field{min-height:44px}.field{font-size:16px}}

@media(max-width:720px){body{padding-top:env(safe-area-inset-top)}.main{padding-left:max(12px,env(safe-area-inset-left));padding-right:max(12px,env(safe-area-inset-right))}.sidebar{padding-left:max(8px,env(safe-area-inset-left));padding-right:max(8px,env(safe-area-inset-right))}}

.patient-scans{margin:20px 0;padding:16px;border:1px solid #dce5f2;border-radius:16px;background:#f9fbff}.patient-scans .help{font-size:13px;line-height:1.5;color:#70809a}.scan-item{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px;padding:14px 0;border-top:1px solid #e3eaf4}.scan-info{flex:1;min-width:0;display:grid;gap:4px;overflow-wrap:anywhere}.scan-info small,.scan-info span{font-size:13px;color:#70809a}.scan-preview{width:100%;margin:0;padding:8px;border-radius:12px;background:#fff}.scan-preview img{display:block;max-width:100%;height:auto;margin:auto}.scan-item a.btn{text-decoration:none;display:inline-flex;align-items:center;justify-content:center}.patient-scans .sectionline{margin-top:0}@media(max-width:720px){.patient-scans{padding:12px}.scan-info{flex-basis:100%}.scan-item .inline-actions{width:100%;flex-wrap:wrap}.scan-item .inline-actions .btn{flex:1;min-height:44px}}

.scan-gallery{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:16px}.scan-card{min-width:0;padding:12px;display:grid;gap:12px;background:#fff;border:1px solid #dce5f2;border-radius:14px}.scan-thumbnail{height:210px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;width:100%;padding:8px;background:#eef3fb;border:0;border-radius:10px;cursor:zoom-in;color:#315987;font:inherit;overflow:hidden}.scan-thumbnail img{width:100%;height:100%;object-fit:contain}.scan-pdf-icon{display:grid;place-items:center;width:70px;height:88px;background:#fff;color:#cf4343;border:1px solid #dce5f2;border-radius:8px;font-size:24px;font-weight:800}.scan-card .inline-actions{display:flex;gap:8px;flex-wrap:wrap}.scan-card .btn{flex:1;min-height:44px}.scan-card a{text-decoration:none;text-align:center}.scan-viewer{width:min(1100px,96vw);height:92dvh;max-width:96vw;max-height:94dvh;padding:0;border:0;border-radius:16px;background:#fff;box-shadow:0 20px 80px #0005}.scan-viewer[open]{display:flex;flex-direction:column}.scan-viewer::backdrop{background:#142139bb}.scan-viewer header,.scan-viewer footer{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 16px;flex-shrink:0}.scan-viewer h2{font-size:18px;margin:0;overflow-wrap:anywhere}.scan-viewer-content{flex:1;min-height:0;overflow:auto;background:#e9eef6;display:flex;align-items:center;justify-content:center}.scan-viewer-content img{max-width:100%;max-height:100%;object-fit:contain}.scan-viewer-content iframe{width:100%;height:100%;border:0}.scan-viewer footer{justify-content:flex-end;flex-wrap:wrap}.scan-viewer a{text-decoration:none}@media(max-width:600px){.scan-gallery{grid-template-columns:1fr}.scan-viewer{width:100vw;height:100dvh;max-width:100vw;max-height:100dvh;border-radius:0}.scan-viewer header{align-items:flex-start}.scan-viewer header .btn{white-space:nowrap}.scan-viewer footer{padding-bottom:max(12px,env(safe-area-inset-bottom))}.scan-thumbnail{height:240px}}

/* A shared vertical time scale keeps every day's appointments aligned. */
.time-calendar-scroll{overflow:auto;max-height:75vh;border-top:1px solid #e0e7f2}.time-calendar{display:grid;grid-template-columns:64px repeat(7,minmax(150px,1fr));min-width:1120px}.time-day-head{height:64px;position:sticky;top:0;z-index:3;display:flex;gap:8px;align-items:center;justify-content:center;background:#f6f9fe;border-bottom:1px solid #dce5f2}.time-day{min-width:0;border-left:1px solid #dce5f2}.time-day-body{position:relative;background:repeating-linear-gradient(to bottom,transparent 0,transparent 35px,#eef2f8 35px,#eef2f8 36px,transparent 36px,transparent 71px,#dce5f2 71px,#dce5f2 72px)}.time-axis{position:sticky;left:0;background:white;z-index:4}.time-axis span{position:absolute;left:8px;font-size:12px;color:#657892;transform:translateY(-1px)}.time-event{position:absolute;display:flex;flex-direction:column;gap:2px;text-align:left;border:1px solid #dce5f2;border-left:4px solid var(--doctor-color);border-radius:7px;background:var(--doctor-color);color:var(--doctor-text,#000);padding:4px 6px;overflow:hidden;cursor:pointer;font:inherit;font-size:12px;line-height:1.25;min-height:0}.time-event b{font-size:11px}.time-event strong,.time-event span,.time-event small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex-shrink:0}.time-event:hover,.time-event:focus-visible{z-index:2;outline:2px solid var(--doctor-color)}.doctor-legend{display:flex;flex-wrap:wrap;gap:12px;padding:16px}.doctor-legend span{display:flex;align-items:center;gap:6px;font-size:14px}.doctor-legend i{width:10px;height:10px;border-radius:50%}

.time-event b,.time-event strong,.time-event span,.time-event small{color:inherit;opacity:1}

/* Fixed view switch and compact month grid for the clinic calendar. */
.calendar-toolbar{align-items:center;flex-wrap:wrap;gap:12px}
.calendar-view-buttons,.calendar-period-nav{display:flex;align-items:center;gap:6px;flex-wrap:nowrap}
.calendar-view-buttons{flex:none;padding:4px;border:1px solid #e0e7f2;border-radius:12px;background:#f4f7fc}
.calendar-view-buttons .btn{min-width:78px}
.calendar-view-buttons .btn.active{background:#fff;color:#216fd8;border-color:#cbdcf4;box-shadow:0 1px 4px #253c5b12}
.calendar-period-nav{margin-left:auto}
.calendar-period-nav strong{min-width:210px;text-align:center;font-size:15px}
.time-calendar.is-day{grid-template-columns:64px minmax(520px,1fr);min-width:640px}
.calendar-month-scroll{overflow-x:auto}.calendar-month-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));border-top:1px solid #e0e7f2;border-left:1px solid #e0e7f2}
.calendar-month-weekday{padding:10px 12px;background:#f6f9fe;color:#71829b;font-size:13px;font-weight:700;border-right:1px solid #e0e7f2;border-bottom:1px solid #e0e7f2}
.calendar-month-day{min-width:0;min-height:112px;padding:8px;text-align:left;vertical-align:top;border:0;border-right:1px solid #e0e7f2;border-bottom:1px solid #e0e7f2;background:#fff;color:var(--ink);overflow:hidden}
.calendar-month-day:hover{background:#f8fbff}
.calendar-month-day.is-outside{background:#f8f9fb;color:#9aa6b6}
.calendar-month-day.is-selected .calendar-month-date{background:#277cf1;color:white}
.calendar-month-date{display:grid;place-items:center;width:28px;height:28px;border-radius:9px;font-weight:700;margin-bottom:4px}
.calendar-month-event{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin:3px 0;padding:3px 5px;border-left:3px solid var(--doctor-color);border-radius:5px;background:color-mix(in srgb,var(--doctor-color) 17%,white);color:#26354c;font-size:11px}
.calendar-month-day>small{display:block;color:#71829b;font-size:10px;padding:2px 4px}
.finance-trend{height:150px;display:flex;align-items:stretch;justify-content:space-around;gap:14px;padding:10px 12px 0;border-bottom:1px solid #dfe7f2;background:repeating-linear-gradient(to bottom,transparent 0,transparent 47px,#eef2f7 48px)}
.finance-trend-month{flex:1;min-width:32px;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;gap:7px;color:#71829b;font-size:12px}
.finance-trend-bars{height:120px;max-width:70px;width:100%;display:flex;align-items:flex-end;justify-content:center;gap:4px}
.finance-trend-bars i{width:min(24px,27%);min-height:3px;border-radius:5px 5px 0 0}
.finance-trend-bars i.planned,.finance-trend-legend i.planned{background:#9aaac0}
.finance-trend-bars i.completed,.finance-trend-legend i.completed{background:#35aa89}
.finance-trend-bars i.paid,.finance-trend-legend i.paid{background:#287cf0}
.finance-trend-legend{display:flex;flex-wrap:wrap;gap:10px 20px;margin-top:14px;color:#71829b;font-size:13px}
.finance-trend-legend span{display:flex;align-items:center;gap:7px}
.finance-trend-legend i{width:9px;height:9px;border-radius:50%}
@media(max-width:720px){.calendar-toolbar{align-items:stretch}.calendar-view-buttons{width:100%;justify-content:stretch}.calendar-view-buttons .btn{flex:1;min-width:0}.calendar-period-nav{width:100%;justify-content:space-between;margin:0}.calendar-period-nav strong{min-width:0;flex:1;font-size:13px}.calendar-month-grid{min-width:680px}.calendar-month-day{min-height:95px;padding:5px}.calendar-month-event{font-size:10px}}

/* 0.8.34 — calendar controls stay in a single, predictable toolbar; appointments remain readable in each time column. */
.calendar-card{overflow:hidden;border-radius:18px}
.calendar-toolbar{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:14px;padding:15px 18px}
.calendar-view-buttons{position:sticky;left:0;z-index:5;box-shadow:0 2px 7px rgba(33,60,96,.06)}
.calendar-view-buttons .btn{min-width:82px;min-height:40px}
.calendar-period-nav{min-width:0;justify-content:flex-end;gap:8px}
.calendar-period-nav strong{min-width:clamp(150px,17vw,250px);white-space:nowrap}
.time-calendar-scroll{max-height:min(76vh,1050px);overscroll-behavior:contain}
.time-calendar{grid-template-columns:72px repeat(7,minmax(158px,1fr))}
.time-calendar.is-day{grid-template-columns:72px minmax(560px,1fr)}
.time-day-head{font-size:14px;font-variant-numeric:tabular-nums}
.time-day-head b{font-weight:750}
.time-day-head span{display:grid;place-items:center;min-width:28px;height:28px;padding-inline:5px;border-radius:9px;background:#eaf2ff;color:#2674d4;font-weight:750}
.time-event{border-radius:10px;padding:7px 9px;gap:3px;box-shadow:0 2px 6px rgba(31,54,88,.08)}
.time-event b{font-size:12px}.time-event strong{font-size:13px}.time-event span,.time-event small{font-size:12px}
.calendar-month-day{transition:background .14s ease,box-shadow .14s ease}
.calendar-month-day:focus-visible{position:relative;z-index:2;outline:3px solid #8dbdff;outline-offset:-3px}
.doctor-legend{gap:10px 18px;padding:14px 18px}
.doctor-legend span{border:1px solid #e4eaf2;border-radius:999px;background:#fff;padding:7px 11px;color:#5c708a}
.doctor-legend i{width:11px;height:11px;box-shadow:0 0 0 2px #fff,0 0 0 3px #e2e8f0}
.dashboard-status-action{display:inline-flex;align-items:center;gap:5px;padding:0;border:0;background:transparent;color:inherit;font:inherit;cursor:pointer}
.dashboard-status-action>span{font-size:13px;color:#7d8ea6}
.dashboard-status-action:hover .pill{box-shadow:0 0 0 2px #c9ddf7}
.dashboard-day-summary{box-shadow:0 7px 24px rgba(31,61,100,.04)}
.dashboard-agenda .cardhead{gap:14px}
@media(max-width:1000px){.calendar-toolbar{grid-template-columns:1fr}.calendar-view-buttons{position:static}.calendar-period-nav{justify-content:flex-start}}
@media(max-width:720px){.calendar-toolbar{padding:12px}.calendar-period-nav{gap:5px}.calendar-period-nav strong{min-width:0}.calendar-view-buttons .btn{min-height:42px}.time-calendar{grid-template-columns:58px repeat(7,minmax(150px,1fr))}.time-calendar.is-day{grid-template-columns:58px minmax(500px,1fr)}.time-event{padding:6px}.time-event b{font-size:11px}.time-event strong{font-size:12px}.dashboard-status-action{min-height:36px}}

/* The dashboard has one creation toolbar and a non-interactive daily summary. */
.dashboard-create-actions{display:flex;gap:10px;flex-wrap:wrap}
.dashboard-day-summary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));margin:0 0 24px;padding:22px 24px;border:1px solid #dce5f2;border-radius:18px;background:#fff;gap:24px}
.dashboard-day-summary>div{display:flex;align-items:center;gap:14px;min-width:0}
.dashboard-day-summary>div+div{border-left:1px solid #e5ebf4;padding-left:24px}
.dashboard-day-summary strong{font-size:30px;line-height:1.15;color:var(--ink)}
.dashboard-day-summary span{font-size:15px;color:var(--muted);line-height:1.4}
.dashboard-agenda .cardhead p{margin-bottom:0;line-height:1.5}
@media(max-width:720px){.dashboard-create-actions{width:100%}.dashboard-create-actions .btn{flex:1}.dashboard-day-summary{padding:16px 12px;gap:10px;margin-bottom:16px}.dashboard-day-summary>div{flex-direction:column;align-items:flex-start;gap:6px}.dashboard-day-summary>div+div{padding-left:10px}.dashboard-day-summary strong{font-size:26px}.dashboard-day-summary span{font-size:13px}}

.appointment-status-options{border:0;margin:0;padding:0;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.appointment-status-options legend{padding:0;margin-bottom:14px;color:var(--muted);font-weight:600}.appointment-status-options label{display:flex;align-items:center;gap:12px;padding:14px;border:1px solid #d3dff0;border-radius:12px;cursor:pointer;color:var(--ink)}.appointment-status-options label:has(input:checked){background:#eaf2ff;border-color:#2674d4}.appointment-status-options input{width:20px;height:20px;margin:0;accent-color:#2674d4;flex-shrink:0}.modal-save-error{color:#b42318;background:#fff1f0;padding:12px;border-radius:10px}.modal-save-error[hidden]{display:none}@media(max-width:480px){.appointment-status-options{grid-template-columns:1fr}}

.patient-visit-list{display:grid;gap:10px;max-height:55vh;overflow:auto}.patient-visit{font:inherit;display:flex;align-items:center;gap:14px;justify-content:space-between;text-align:left;padding:16px;border:1px solid #d3dff0;border-radius:12px;background:#fff;color:var(--ink);cursor:pointer}.patient-visit:hover{background:#f2f7ff;border-color:#2674d4}.patient-visit>span:first-child{display:grid;gap:5px;flex:1;min-width:0;overflow-wrap:anywhere}.patient-visit .pill{flex-shrink:0}@media(max-width:480px){.patient-visit{flex-wrap:wrap}.patient-visit>span:first-child{flex-basis:100%}}

.calendar-create-slot{position:absolute;left:0;width:100%;height:18px;padding:0 5px;border:0;background:transparent;text-align:left;cursor:pointer;color:#216bd0;z-index:0}
.calendar-create-slot span{opacity:0;font-size:11px;pointer-events:none}
.calendar-create-slot:hover,.calendar-create-slot:focus-visible{background:#e7f1ff;outline:2px solid #82b3ff;outline-offset:-2px}
.calendar-create-slot:hover span,.calendar-create-slot:focus-visible span{opacity:1}
.time-event{z-index:1}

.calendar-create-slot:disabled{cursor:default;pointer-events:none}

/* A persistent creation rail remains tappable beside overlapping week events. */
.has-create-rail .calendar-create-slot{left:auto;right:0;width:30px;border-left:1px solid #dce6f5;background:#f4f8ff;text-align:center;padding:0}
.has-create-rail .calendar-create-slot span{display:none}
.has-create-rail .calendar-create-slot:after{content:'+';font-size:15px;color:#5189ce;line-height:18px}
.has-create-rail .calendar-create-slot:hover,.has-create-rail .calendar-create-slot:focus-visible{background:#dcecff}

.time-event .time-event-heading{display:flex;align-items:baseline;gap:10px;min-width:0;width:100%;white-space:nowrap}
.time-event .time-event-heading b{flex:0 0 auto;margin:0}
.time-event .time-event-heading strong{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;margin:0}

.appointment-hover-card{position:fixed;z-index:99999;pointer-events:none;width:350px;max-width:calc(100vw - 20px);padding:20px 22px;border:1px solid #dce5f2;border-radius:22px;background:rgba(255,255,255,.96);backdrop-filter:blur(18px);box-shadow:0 12px 38px #233c612b;color:#223149;font-size:16px;line-height:1.45;overflow-wrap:anywhere}
.appointment-hover-card>strong{display:block;font-size:19px;line-height:1.3}
.appointment-hover-card>p{margin:8px 0 16px;color:#69809e;font-size:15px}
.appointment-hover-card dl{display:grid;grid-template-columns:75px minmax(0,1fr);gap:8px 12px;margin:0}
.appointment-hover-card dt{color:#7b8da6;font-size:14px}
.appointment-hover-card dd{margin:0;font-weight:500}

.time-event .time-event-heading strong{flex:0 1 auto;max-width:65%}
.time-event .time-event-heading .time-event-service{display:block;flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:inherit;font-weight:400;opacity:.85}

.settings-signout{display:flex;justify-content:flex-end;margin-top:24px;padding-bottom:12px}
