:root{--navy:#122545;--ink:#192945;--muted:#596a84;--blue:#255de2;--blue-dark:#1949ba;--line:#e3e9f2;--surface:#fff;--bg:#f3f6fb;--sidebar:236px;--radius:16px;--shadow:0 3px 9px #182f5c06;font-family:"Inter", "Segoe UI",system-ui,sans-serif;color:var(--ink);background:var(--bg);font-synthesis:none}
*{box-sizing:border-box}body{margin:0}h1,h2,h3,p{margin-top:0}h1,h2,h3,strong,th{font-weight:400}h1,h2,h3{letter-spacing:-.035em}a{color:inherit;text-decoration:none}button,input,select,textarea{font:inherit}button,a,input,select,textarea{outline-offset:3px}button{cursor:pointer}button:disabled{cursor:default;opacity:.5}svg{vertical-align:middle;flex-shrink:0}small{display:block}.shell{min-height:100vh}.sidebar{width:var(--sidebar);height:100dvh;position:fixed;inset:0 auto 0 0;background:#fff;border-right:1px solid var(--line);display:flex;flex-direction:column;z-index:5}.brand{display:flex;align-items:center;gap:11px;padding:25px 19px 24px;font-size:22px;font-weight:400;letter-spacing:-.055em;line-height:1.12}.brand>span:nth-child(2)>span{color:var(--blue)}.brand small{font-size:12px;color:var(--muted);font-weight:400;letter-spacing:0;margin-top:4px}.brand-icon{display:grid;place-items:center;width:39px;height:39px;border-radius:12px;color:#fff;background:var(--blue);box-shadow:0 4px 10px #255de233}.sidebar nav{overflow:auto;padding:0 12px 8px;flex:1}.nav-group{margin:0 0 15px}.nav-title{padding:0 10px;margin:0 0 7px;color:#65768e;font-size:11px;font-weight:400;letter-spacing:.105em;text-transform:uppercase}.nav-link{font-size:14px;font-weight:400;display:flex;align-items:center;gap:10px;color:#435571;border-radius:8px;padding:8px 10px;margin:2px 0}.nav-link:hover{background:#f1f5fb}.nav-link[aria-current=page]{background:#e9efff;color:var(--blue-dark)}.nav-link svg{width:17px;height:17px}.workspace{margin-left:var(--sidebar);min-height:100vh;display:flex;flex-direction:column}.topbar{min-height:70px;display:flex;justify-content:space-between;align-items:center;gap:12px;padding:10px clamp(16px,3vw,34px);background:#fff;border-bottom:1px solid var(--line)}.top-left,.top-right,.profile,.branch-select{display:flex;align-items:center;gap:13px}.top-right{gap:16px}.top-separator{width:1px;height:28px;background:var(--line)}#breadcrumbs{display:flex;gap:9px;align-items:center;color:var(--muted);font-size:14px}#breadcrumbs strong{color:var(--ink);font-weight:400}.branch-select{background:#f8faff;border:1px solid #dce6f9;border-radius:9px;padding:0 9px;gap:6px;color:var(--blue-dark)}.branch-select select{border:0;background:transparent;color:var(--ink);font-size:14px;font-weight:400;padding:8px 22px 8px 1px;min-width:0}.profile{gap:8px;white-space:nowrap}.profile strong{font-size:13px}.profile small{font-size:11px;color:var(--muted);margin-top:2px}.avatar{display:inline-grid;place-items:center;border-radius:50%;background:#e7eeff;color:var(--blue-dark);width:36px;height:36px;font-weight:400;font-size:12px;flex-shrink:0}.mobile-menu{display:none!important}
main{padding:29px clamp(16px,3vw,34px) 16px;width:100%;max-width:1720px;margin:0 auto;flex:1}.page-head{display:flex;align-items:flex-end;justify-content:space-between;gap:16px;margin:0 0 22px}.page-head h1{font-size:clamp(28px,3vw,38px);margin:0 0 4px;line-height:1.12}.page-head p,.muted{color:var(--muted)}.page-head p{margin:0;font-size:15px}.actions,.toolbar,.tabs{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.button,.icon-button{display:inline-flex;align-items:center;justify-content:center;gap:7px;border:1px solid #dbe4f1;background:#fff;color:var(--ink);border-radius:9px;padding:9px 13px;font-size:14px;font-weight:400;white-space:nowrap;min-height:39px}.button:hover,.icon-button:hover{background:#edf3ff}.button.primary{background:var(--blue);border-color:var(--blue);color:white;box-shadow:0 2px 4px #255de226}.button.primary:hover{background:var(--blue-dark)}.button.danger{color:#a22c44}.button.small{min-height:33px;padding:6px 9px}.button.active{color:var(--blue-dark);background:#ebf1ff;border-color:#bed0fc}.icon-button{padding:7px;min-width:37px}.tag{display:inline-flex;align-items:center;gap:5px;background:#eaf0ff;color:#244eac;border-radius:99px;padding:4px 9px;font-size:12px;font-weight:400;white-space:nowrap}.tag.green{background:#e2f5ec;color:#16664e}.tag.amber{background:#fff1d8;color:#82510a}.tag.red{background:#fce8eb;color:#992e44}.tag.gray{background:#edf1f6;color:#4e607a}.tag.purple{background:#eee8ff;color:#613eaa}
.hero{isolation:isolate;min-height:154px;position:relative;overflow:hidden;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:26px 28px;margin-bottom:0;border-radius:18px;background:linear-gradient(109deg,#132d75 0%,#1745af 58%,#3369e4 100%);color:#fff;box-shadow:0 6px 15px #1550bd23}.hero h2{font-size:clamp(24px,3vw,33px);margin:8px 0 6px}.hero p{margin:0;color:#e1ebff;font-size:14px}.hero .tag{background:#ffffff21;border:1px solid #ffffff3c;color:#fff}.hero-art{position:absolute;z-index:-1;right:4%;top:-73px;width:360px;height:300px;color:#b5ccff;opacity:.35;pointer-events:none}
.metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin-bottom:18px}.metric,.panel{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);min-width:0}.metric{padding:15px;display:flex;flex-direction:column;gap:6px}.metric-top{display:flex;align-items:center;justify-content:space-between;gap:4px;color:#4f627f;font-size:13px;font-weight:400}.metric-icon{display:grid;place-items:center;width:32px;height:32px;border-radius:9px;background:#e9f0ff;color:#2559d0;flex:none}.metric-icon.green{background:#e1f5ec;color:#128160}.metric-icon.purple{background:#eee9ff;color:#7251bf}.metric-icon.amber{background:#fff2dc;color:#a36718}.metric strong{font-size:clamp(21px,2.3vw,29px);letter-spacing:-.06em;line-height:1.12}.metric small{font-size:12px;color:var(--muted)}.grid-analytics{display:grid;grid-template-columns:minmax(0,1.7fr) minmax(0,1fr);gap:16px;margin-bottom:16px}.panel{padding:18px;margin-bottom:16px}.grid-analytics>.panel,.two-col>.panel{margin:0}.panel-head{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;margin-bottom:15px}.panel h2,.panel-head h2{font-size:21px;margin:0 0 3px}.panel-head p{color:var(--muted);font-size:13px;margin:0}.chart-wrap svg{width:100%;height:auto;display:block}.chart-wrap text{font-family:inherit;fill:var(--muted);font-size:12px}.branch-bars{display:flex;flex-direction:column;gap:17px;padding:5px 0 9px}.branch-bar>div:first-child{display:flex;justify-content:space-between;gap:7px;font-size:14px;margin-bottom:7px}.track{height:8px;border-radius:100px;background:#edf2fa;overflow:hidden}.track span{display:block;height:100%;border-radius:inherit}.legend{display:flex;align-items:center;gap:8px;flex-wrap:wrap;color:var(--muted);font-size:12px}.legend span{display:inline-block;width:8px;height:8px;border-radius:50%;background:var(--blue)}
.table-wrap{overflow:auto}.table-wrap table{border-collapse:collapse;width:100%;text-align:left;font-size:14px}th,td{padding:12px 10px;border-bottom:1px solid var(--line);vertical-align:middle}th{color:#4c607e;font-size:12px;font-weight:400;background:#f5f8fd;white-space:nowrap}th:first-child{border-radius:8px 0 0 8px}th:last-child{border-radius:0 8px 8px 0}tbody tr:last-child td{border-bottom:0}tbody tr:hover{background:#f9fbff}.cell-person{display:flex;align-items:center;gap:9px;white-space:nowrap}.cell-person .avatar{width:31px;height:31px}.avatar img{width:100%;height:100%;object-fit:cover;border-radius:50%}.cell-person small,.cell-detail{color:var(--muted);font-size:12px;margin-top:2px}.table-actions{text-align:right;white-space:nowrap}.link-button{border:0;background:none;color:var(--blue-dark);font-size:14px;font-weight:400;padding:3px 2px}.link-button:hover{text-decoration:underline}.empty{text-align:center;padding:30px 12px;color:var(--muted)}.toolbar{justify-content:space-between;margin-bottom:14px}.toolbar-group{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.search{display:flex;align-items:center;gap:7px;border:1px solid #dbe4f1;border-radius:9px;background:white;padding:0 10px;color:var(--muted)}.search input{border:0;background:none;padding:9px 0;font-size:14px;min-width:175px;max-width:100%;color:var(--ink)}.search input:focus{outline:none}.search:focus-within{outline:2px solid #a7c0ff}.field{display:grid;gap:5px;min-width:0}.field span{font-size:14px;font-weight:400}.field input,.field select,.field textarea,.control{width:100%;padding:8px 10px;border:1px solid #dbe4f1;border-radius:8px;color:var(--ink);background:#fff;min-height:39px}.control{width:auto}.field textarea{min-height:75px;resize:vertical}.field.wide{grid-column:1/-1}.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:13px}.two-col{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin-bottom:16px}.subpanels{margin-top:16px}.person-head{display:flex;align-items:center;gap:14px}.person-head .avatar{width:50px;height:50px;font-size:16px}.person-head h2{margin:0 0 3px}.person-head p{margin:0;color:var(--muted);font-size:14px}.tabs{margin-top:16px}.note{padding:10px 12px;background:#edf3ff;border-radius:9px;color:#284c99;font-size:14px;margin-top:12px}.list-stack{display:grid;gap:10px}.list-item{padding:12px;border:1px solid var(--line);border-radius:9px;font-size:14px}.list-item p{margin:5px 0 0;color:var(--muted);white-space:pre-wrap}.footer{display:flex;justify-content:space-between;gap:10px;padding:0 clamp(16px,3vw,34px) 18px;color:var(--muted);font-size:12px}.footer span:first-child{font-weight:400}
.dental-panel{overflow:hidden}.dental-scroll{overflow:auto;padding:4px 0 9px}.dental-board{min-width:736px;padding:18px 14px;background:#f6f9fe;border:1px solid #e3eaf6;border-radius:12px}.arch-label{font-size:13px;color:#49607e;text-align:center;font-weight:400;margin:3px 0 8px}.arch{display:grid;grid-template-columns:repeat(16,1fr);gap:3px}.tooth{text-align:center;color:#416080;font-size:12px;font-weight:400;min-width:0}.tooth svg{width:100%;max-width:53px;display:block;margin:0 auto}.tooth path[role=button]{stroke:#9bb0cc;stroke-width:1;cursor:pointer;transition:fill .12s}.tooth path[role=button]:hover,.tooth path[role=button]:focus{stroke:#193b87;stroke-width:2;outline:none}.tooth path.selected{stroke:#172b62;stroke-width:2}.divider{height:1px;background:#dce6f4;margin:12px 0}.treatment-chip{display:inline-flex;align-items:center;gap:6px}.swatch{width:10px;height:10px;border-radius:4px;display:inline-block}.dental-detail{background:#f8fbff;border:1px solid #e0eafa;border-radius:10px;padding:14px;margin-top:12px}.dental-detail h3{font-size:18px;margin:0 0 10px}.dental-tools{margin-bottom:10px}
.calendar-scroll{overflow:auto}.calendar-grid{display:grid;grid-template-columns:repeat(7,minmax(113px,1fr));min-width:800px;gap:1px;background:var(--line);border:1px solid var(--line);border-radius:9px;overflow:hidden}.calendar-grid.daily{grid-template-columns:1fr;min-width:0}.calendar-title,.calendar-day{background:#fff;padding:8px}.calendar-title{font-size:12px;font-weight:400;color:var(--muted);text-align:center;background:#f5f8fd}.calendar-day{min-height:112px;font-size:13px}.calendar-day.dim{background:#f7f9fc;color:#667891}.calendar-day.today>strong{color:var(--blue-dark)}.calendar-event{border:0;display:block;text-align:left;width:100%;color:#24458a;background:#e8efff;border-radius:5px;margin:4px 0;padding:5px;font-size:12px}.calendar-event.green{background:#e1f5ec;color:#16664e}.calendar-event.red{background:#fce8eb;color:#992e44}.calendar-event.amber{background:#fff1d8;color:#82510a}
dialog{border:1px solid var(--line);border-radius:17px;width:min(650px,calc(100% - 28px));max-height:calc(100dvh - 28px);padding:0;color:var(--ink);box-shadow:0 24px 90px #14234850}dialog::backdrop{background:#182b48a1}.dialog-inner{padding:21px}.dialog-title{display:flex;justify-content:space-between;align-items:center;gap:8px;margin-bottom:16px}.dialog-title h2{margin:0;font-size:23px}.dialog-actions{display:flex;justify-content:flex-end;gap:8px;flex-wrap:wrap;margin-top:16px}.error{color:#a32238;font-size:14px;margin:8px 0 0}.toast{position:fixed;z-index:12;right:20px;bottom:20px;background:#18335d;color:#fff;border-radius:10px;padding:12px 16px;box-shadow:0 4px 17px #152e6033;font-size:14px}.print-area{font-size:15px}.print-area .panel{box-shadow:none}.print-area h3{margin-bottom:8px}
select{appearance:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='m2 4 4 4 4-4' fill='none' stroke='%23596a84' stroke-width='1.5'/%3E%3C/svg%3E")!important;background-position:right 8px center!important;background-repeat:no-repeat!important;padding-right:25px!important}
@media(max-width:1150px){:root{--sidebar:205px}.topbar{gap:6px}.profile div{display:none}.metric{padding:12px}}
@media(max-width:900px){.grid-analytics,.two-col{grid-template-columns:1fr}.grid-analytics>.panel,.two-col>.panel{min-width:0}.metrics{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:710px){.workspace{margin-left:0}.sidebar{transform:translateX(-100%);transition:transform .2s;box-shadow:0 10px 30px #172d5124}.sidebar.open{transform:translateX(0)}.mobile-menu{display:inline-flex!important}.topbar{min-height:59px}.top-separator,.profile,#breadcrumbs .bread-root,#breadcrumbs .slash{display:none}.top-right,.top-left{gap:7px}main{padding-top:19px}.hero{padding:19px;align-items:flex-start;flex-direction:column}.page-head{align-items:flex-start;flex-direction:column;gap:10px}.panel{padding:13px}.metrics{gap:8px}.metric strong{font-size:22px}.metric-icon{width:25px;height:25px}.metric-icon svg{width:14px}.metric-top{font-size:12px}.button{font-size:13px}.form-grid{grid-template-columns:1fr}.form-grid.compact{grid-template-columns:1fr 1fr}}
@media(max-width:365px){.branch-select select{max-width:137px}.branch-select>span{display:none}}
@media print{body{background:#fff}.shell,#toast{display:none!important}dialog[open]{position:static;display:block;width:100%;max-height:none;box-shadow:none;border:0;margin:0}dialog::backdrop{display:none}.dialog-title button,.dialog-actions{display:none}.dialog-inner{padding:0}.dental-scroll{overflow:visible}.dental-board{min-width:0}}
#theme-toggle{min-width:37px}
@media(max-width:450px){
  .topbar{padding-inline:11px}
  .top-left,.top-right{gap:6px}
  #breadcrumbs strong{font-size:13px}
  .branch-select{padding-inline:6px}
  .branch-select>span{display:none}
  .branch-select select{max-width:148px;font-size:12px}
}
@media screen{
  :root[data-theme=dark]{
    color-scheme:dark;
    --ink:#e6edf8;
    --muted:#aabbd2;
    --blue:#3d6ce0;
    --blue-dark:#a5bfff;
    --line:#2e3c55;
    --surface:#182337;
    --bg:#101827;
    --inset:#131e31;
    --hover:#202e47;
    --wash:#22375a;
    --chart-grid:#2e3c55;
    --tooth-fill:#202f49;
    --shadow:0 3px 10px #080d1780;
  }
  [data-theme=dark] .sidebar,
  [data-theme=dark] .topbar,
  [data-theme=dark] .button,
  [data-theme=dark] .icon-button,
  [data-theme=dark] .search,
  [data-theme=dark] dialog{background:var(--surface)}
  [data-theme=dark] .nav-title,
  [data-theme=dark] .nav-link,
  [data-theme=dark] .metric-top,
  [data-theme=dark] th,
  [data-theme=dark] .arch-label,
  [data-theme=dark] .tooth,
  [data-theme=dark] .calendar-day.dim{color:var(--muted)}
  [data-theme=dark] .brand>span:nth-child(2)>span,
  [data-theme=dark] .branch-select{color:var(--blue-dark)}
  [data-theme=dark] .nav-link:hover,
  [data-theme=dark] .button:hover,
  [data-theme=dark] .icon-button:hover,
  [data-theme=dark] tbody tr:hover,
  [data-theme=dark] .track{background:var(--hover)}
  [data-theme=dark] .nav-link[aria-current=page],
  [data-theme=dark] .button.active,
  [data-theme=dark] #theme-toggle[aria-pressed=true],
  [data-theme=dark] .avatar,
  [data-theme=dark] .metric-icon,
  [data-theme=dark] .tag,
  [data-theme=dark] .calendar-event,
  [data-theme=dark] .note{background:var(--wash);color:var(--blue-dark)}
  [data-theme=dark] .hero .tag{background:#ffffff21;color:#fff}
  [data-theme=dark] .button.primary{background:#2c59c6;border-color:#537be5;color:#fff}
  [data-theme=dark] .button.primary:hover{background:#315fd1}
  [data-theme=dark] .button.danger,
  [data-theme=dark] .error{color:#ff9faf}
  [data-theme=dark] .button,
  [data-theme=dark] .icon-button,
  [data-theme=dark] .branch-select,
  [data-theme=dark] .search,
  [data-theme=dark] .field input,
  [data-theme=dark] .field select,
  [data-theme=dark] .field textarea,
  [data-theme=dark] .control,
  [data-theme=dark] .dental-board,
  [data-theme=dark] .dental-detail{border-color:var(--line)}
  [data-theme=dark] .branch-select,
  [data-theme=dark] .field input,
  [data-theme=dark] .field select,
  [data-theme=dark] .field textarea,
  [data-theme=dark] .control,
  [data-theme=dark] th,
  [data-theme=dark] .calendar-title,
  [data-theme=dark] .calendar-day.dim,
  [data-theme=dark] .dental-board,
  [data-theme=dark] .dental-detail{background:var(--inset)}
  [data-theme=dark] .calendar-day{background:var(--surface)}
  [data-theme=dark] .divider{background:var(--line)}
  [data-theme=dark] .search input::placeholder,
  [data-theme=dark] .field input::placeholder{color:var(--muted)}
  [data-theme=dark] .tag.green,
  [data-theme=dark] .metric-icon.green,
  [data-theme=dark] .calendar-event.green{background:#173b35;color:#8bddc0}
  [data-theme=dark] .tag.amber,
  [data-theme=dark] .metric-icon.amber,
  [data-theme=dark] .calendar-event.amber{background:#43331e;color:#ffd189}
  [data-theme=dark] .tag.red,
  [data-theme=dark] .calendar-event.red{background:#492936;color:#ffb0bf}
  [data-theme=dark] .tag.purple,
  [data-theme=dark] .metric-icon.purple{background:#34294e;color:#d5baff}
  [data-theme=dark] .tag.gray{background:#303c51;color:#c2cee2}
  [data-theme=dark] .tooth path[role=button]{stroke:#8498b5}
  [data-theme=dark] .tooth path[role=button]:hover,
  [data-theme=dark] .tooth path[role=button]:focus,
  [data-theme=dark] .tooth path.selected{stroke:#e0eaff}
  [data-theme=dark] select{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='m2 4 4 4 4-4' fill='none' stroke='%23aabbd2' stroke-width='1.5'/%3E%3C/svg%3E")!important}
}
.dashboard-top{display:grid;grid-template-columns:minmax(0,1fr) minmax(240px,30%);gap:14px;margin-bottom:19px}
.clock-widget{display:flex;flex-direction:column;justify-content:center;gap:6px;min-height:154px;padding:16px 20px;border:1px solid var(--line);border-radius:18px;background:var(--surface);box-shadow:var(--shadow)}
.clock-digits{display:block;font-size:clamp(38px,4.4vw,56px);font-weight:400;line-height:1.02;letter-spacing:-.06em;font-variant-numeric:tabular-nums;color:var(--ink)}
.clock-date{display:block;font-size:14px;color:var(--muted)}
.clock-date::first-letter{text-transform:uppercase}
@media(max-width:710px){
  .dashboard-top{grid-template-columns:1fr;gap:10px;margin-bottom:12px}
  .dashboard-top .hero{min-height:0}
  .clock-widget{grid-row:1;min-height:120px;padding:13px 17px}
}
.top-clock{display:flex;align-items:center;gap:7px;flex:none;min-height:39px;padding:4px 9px;border:1px solid var(--line);border-radius:9px;background:var(--inset,var(--bg))}
.top-clock-icon{color:var(--muted)}
.top-clock time{display:block;white-space:nowrap}
#top-time{color:var(--ink);font-size:17px;font-variant-numeric:tabular-nums;line-height:1.05}
#top-date{color:var(--muted);font-size:11px;line-height:1.15}
@media(max-width:1000px){
  #breadcrumbs .bread-root,#breadcrumbs .slash{display:none}
  .top-right{gap:9px}
}
@media(max-width:450px){
  #breadcrumbs{display:none}
  .top-right{gap:6px}
  .top-clock{gap:5px;padding-inline:6px}
  .branch-select select{max-width:125px}
}
