
/* ===== V134 SOURCE: index-C_ddANNj.css ===== */
:root{--nav:#172033;--nav-soft:#222d43;--ink:#182136;--muted:#6d778b;--soft-muted:#9aa3b4;--brand:#ef6a45;--brand-dark:#d95330;--brand-soft:#fff0eb;--surface:#fff;--canvas:#f4f6fa;--line:#e5e9f1;--line-dark:#d7dce7;--success:#18845f;--success-soft:#e7f8f1;--warning:#a86700;--warning-soft:#fff4dc;--danger:#c63e50;--danger-soft:#ffeaed;--blue:#3d70c9;--blue-soft:#edf4ff;--purple:#7551b4;--purple-soft:#f3efff;--shadow:0 12px 32px #18213612;--shadow-deep:0 24px 70px #0d152638}*{box-sizing:border-box}html,body{min-height:100%;margin:0}body{background:var(--canvas);color:var(--ink);font-family:var(--font-geist-sans), Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;font-size:14px}button,input,select,textarea{color:inherit;font:inherit}button,a{-webkit-tap-highlight-color:transparent}button{cursor:pointer}button:disabled{cursor:not-allowed;opacity:.45}a{color:inherit;text-decoration:none}svg{flex:none}.loading-screen{background:var(--nav);color:#fff;flex-direction:column;justify-content:center;align-items:center;gap:16px;min-height:100vh;display:flex}.brand-symbol{background:linear-gradient(145deg, #f6805e, var(--brand-dark));color:#fff;border-radius:13px;flex:none;justify-content:center;align-items:center;width:43px;height:43px;font-size:21px;font-weight:850;display:inline-flex;box-shadow:0 8px 20px #ef6a4542}.brand-symbol-large{border-radius:17px;width:60px;height:60px;font-size:30px}.login-page{background:var(--nav);grid-template-columns:minmax(460px,1.1fr) minmax(460px,.9fr);min-height:100vh;display:grid}.login-hero{color:#fff;background:radial-gradient(circle at 20% 10%,#ef6a452b,#0000 26%),radial-gradient(circle at 90% 80%,#4d71af38,#0000 34%),linear-gradient(145deg,#151e31,#202c44);flex-direction:column;justify-content:space-between;padding:clamp(34px,6vw,78px);display:flex;position:relative;overflow:hidden}.login-hero:after{content:"";border:1px solid #ffffff12;border-radius:50%;width:520px;height:520px;position:absolute;top:14%;right:-210px}.login-brand{z-index:1;align-items:center;gap:15px;display:flex;position:relative}.login-brand div{gap:4px;display:grid}.login-brand strong{font-size:18px}.login-brand small{color:#aab5c9}.login-copy{z-index:1;max-width:650px;padding:90px 0;position:relative}.eyebrow,.login-kicker{color:var(--brand);letter-spacing:.13em;text-transform:uppercase;font-size:11px;font-weight:800}.login-copy h1{letter-spacing:-.045em;margin:18px 0 24px;font-size:clamp(40px,5vw,68px);line-height:1.03}.login-copy p{color:#b7c1d3;max-width:560px;margin:0;font-size:17px;line-height:1.7}.login-features{flex-wrap:wrap;gap:22px;margin-top:36px;display:flex}.login-features span{color:#e6eaf1;font-size:13px;font-weight:650}.login-panel{background:#f7f8fb;justify-content:center;align-items:center;padding:36px;display:flex}.login-card{border:1px solid var(--line);background:#fff;border-radius:24px;gap:18px;width:100%;max-width:440px;padding:clamp(30px,5vw,50px);display:grid;box-shadow:0 28px 75px #1720331c}.login-card h2{letter-spacing:-.03em;margin:-5px 0 -12px;font-size:30px}.login-card>p{color:var(--muted);margin:0 0 4px;line-height:1.6}.first-access{background:#f7f8fb;border-radius:11px;justify-content:space-between;align-items:center;padding:12px 14px;font-size:12px;display:flex}.first-access span{color:var(--muted)}.clinic-app{grid-template-columns:252px minmax(0,1fr);min-height:100vh;display:grid}.sidebar{background:var(--nav);color:#fff;z-index:50;flex-direction:column;height:100vh;display:flex;position:sticky;top:0;overflow:hidden}.brand{border-bottom:1px solid #ffffff12;align-items:center;gap:12px;min-height:82px;padding:16px 18px;display:flex}.brand>span:nth-child(2){gap:3px;min-width:0;display:grid}.brand strong{text-overflow:ellipsis;white-space:nowrap;max-width:154px;font-size:13px;line-height:1.25;display:block;overflow:hidden}.brand small{color:#949fb4;text-transform:uppercase;font-size:10px}.brand .icon-button{margin-left:auto;display:none}.sidebar-nav{scrollbar-color:#3a455a transparent;scrollbar-width:thin;gap:3px;padding:17px 12px;display:grid;overflow-y:auto}.sidebar-nav button{color:#b8c1d2;text-align:left;background:0 0;border:0;border-radius:10px;align-items:center;gap:12px;width:100%;padding:10px 12px;font-size:12.5px;font-weight:590;transition:all .15s;display:flex}.sidebar-nav button svg{width:18px;height:18px}.sidebar-nav button:hover,.sidebar-nav button.active{color:#fff;background:#ffffff17}.sidebar-nav button.active{box-shadow:inset 3px 0 0 var(--brand)}.sidebar-footer{border-top:1px solid #ffffff12;margin-top:auto;padding:14px}.sidebar-profile{align-items:center;gap:9px;display:flex}.sidebar-profile>span,.profile-pill>span{color:var(--purple);background:#f0eaff;border-radius:50%;justify-content:center;align-items:center;width:34px;height:34px;font-weight:800;display:flex}.sidebar-profile div{gap:1px;display:grid}.sidebar-profile strong{font-size:11px}.sidebar-profile small{color:#8f9aaf;font-size:10px}.sidebar-footer>button{color:#9aa5b9;background:0 0;border:0;align-items:center;gap:6px;margin:10px 0 0 42px;padding:0;font-size:11px;display:flex}.sidebar-footer>button svg{width:14px;height:14px}.workspace{min-width:0}.topbar{-webkit-backdrop-filter:blur(14px);backdrop-filter:blur(14px);border-bottom:1px solid var(--line);z-index:30;background:#fffffff0;justify-content:space-between;align-items:center;height:68px;padding:0 28px;display:flex;position:sticky;top:0}.topbar-title{align-items:center;gap:10px;display:flex}.topbar-title>.icon-button{display:none}.topbar-title>div{display:grid}.topbar-title span{font-size:16px;font-weight:760}.topbar-title small{color:var(--muted);text-transform:capitalize;font-size:10px}.topbar-actions{align-items:center;gap:10px;display:flex}.connection{color:var(--muted);align-items:center;gap:6px;margin-right:4px;font-size:11px;display:inline-flex}.connection i{background:var(--success);box-shadow:0 0 0 3px var(--success-soft);border-radius:50%;width:7px;height:7px}.connection.offline i{background:var(--warning);box-shadow:0 0 0 3px var(--warning-soft)}.icon-button{border:1px solid var(--line);color:var(--muted);background:#fff;border-radius:9px;justify-content:center;align-items:center;width:34px;height:34px;padding:0;transition:all .12s;display:inline-flex}.icon-button:hover{border-color:var(--line-dark);color:var(--ink)}.icon-button svg{width:17px;height:17px}.profile-pill{border:1px solid var(--line);background:#fff;border-radius:99px;align-items:center;gap:7px;padding:4px 10px 4px 4px;display:flex}.profile-pill>span{width:28px;height:28px;font-size:11px}.profile-pill b{font-size:11px}.page-content{max-width:1550px;margin:auto;padding:28px}.page-stack{gap:20px;display:grid}.welcome-row,.module-header{justify-content:space-between;align-items:flex-end;gap:20px;display:flex}.module-actions{flex-wrap:wrap;gap:8px;display:flex}.welcome-row h1,.module-header h1{letter-spacing:-.04em;margin:6px 0 4px;font-size:clamp(26px,3vw,36px)}.welcome-row p,.module-header p{color:var(--muted);margin:0;line-height:1.55}.button{border:1px solid var(--line);border-radius:9px;justify-content:center;align-items:center;gap:7px;min-height:38px;padding:9px 14px;font-size:12px;font-weight:720;transition:all .14s;display:inline-flex}.button:hover{transform:translateY(-1px);box-shadow:0 7px 18px #18213614}.button svg{width:16px;height:16px}.button-primary{background:var(--brand);border-color:var(--brand);color:#fff}.button-primary:hover{background:var(--brand-dark)}.button-ghost{background:#fff}.button-soft{background:var(--brand-soft);color:var(--brand-dark);border-color:#fed7cb}.button-small{min-height:31px;padding:6px 9px;font-size:10px}.button-block{width:100%}.metrics-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;display:grid}.metrics-three{grid-template-columns:repeat(3,minmax(0,1fr))}.metric-card{border:1px solid var(--line);box-shadow:var(--shadow);background:#fff;border-radius:14px;align-items:flex-start;gap:13px;min-width:0;padding:17px;display:flex}.metric-icon,.quick-icon,.document-icon{border-radius:11px;flex:none;justify-content:center;align-items:center;width:40px;height:40px;display:inline-flex}.metric-orange .metric-icon,.quick-icon.orange,.document-icon{background:var(--brand-soft);color:var(--brand)}.metric-blue .metric-icon,.quick-icon.blue{background:var(--blue-soft);color:var(--blue)}.metric-green .metric-icon,.quick-icon.green{background:var(--success-soft);color:var(--success)}.metric-purple .metric-icon,.quick-icon.purple{background:var(--purple-soft);color:var(--purple)}.metric-card>div{min-width:0;display:grid}.metric-card p{color:var(--muted);text-transform:uppercase;margin:0 0 4px;font-size:10px;font-weight:700}.metric-card strong{letter-spacing:-.035em;font-size:23px}.metric-card small{color:var(--soft-muted);text-overflow:ellipsis;white-space:nowrap;margin-top:4px;font-size:10px;overflow:hidden}.panel{border:1px solid var(--line);box-shadow:var(--shadow);background:#fff;border-radius:14px;min-width:0}.dashboard-grid{grid-template-columns:minmax(0,1.55fr) minmax(330px,.75fr);gap:16px;display:grid}.dashboard-lower{grid-template-columns:1fr 1fr;gap:16px;display:grid}.panel-header{border-bottom:1px solid var(--line);justify-content:space-between;align-items:center;min-height:65px;padding:14px 18px;display:flex}.panel-header h2{margin:0 0 3px;font-size:14px}.panel-header p{color:var(--muted);margin:0;font-size:10px}.text-button{color:var(--brand-dark);background:0 0;border:0;font-size:10px;font-weight:720}.appointment-list{padding:6px 18px 12px;display:grid}.appointment-row{border:0;border-bottom:1px solid var(--line);text-align:left;background:#fff;grid-template-columns:54px 3px minmax(0,1fr) auto;align-items:center;gap:11px;width:100%;padding:13px 0;display:grid}.appointment-row:last-child{border-bottom:0}.appointment-row time{display:grid}.appointment-row time strong{font-size:13px}.appointment-row time span{color:var(--soft-muted);font-size:9px}.appointment-row>i{border-radius:99px;height:29px}.appointment-person{gap:2px;min-width:0;display:grid}.appointment-person strong{text-overflow:ellipsis;white-space:nowrap;font-size:11px;overflow:hidden}.appointment-person small{color:var(--muted);text-overflow:ellipsis;white-space:nowrap;font-size:9px;overflow:hidden}.badge{color:var(--muted);white-space:nowrap;background:#eef1f6;border-radius:99px;align-items:center;padding:5px 8px;font-size:9px;font-weight:760;display:inline-flex}.badge-success{background:var(--success-soft);color:var(--success)}.badge-warning{background:var(--warning-soft);color:var(--warning)}.badge-danger{background:var(--danger-soft);color:var(--danger)}.quick-action-grid{grid-template-columns:1fr 1fr;gap:8px;padding:14px;display:grid}.quick-action-grid>button{border:1px solid var(--line);text-align:left;background:#fbfcfe;border-radius:11px;place-items:center start;min-height:108px;padding:13px;transition:all .14s;display:grid}.quick-action-grid>button:hover{box-shadow:var(--shadow);background:#fff;transform:translateY(-2px)}.quick-action-grid strong{margin-top:7px;font-size:10px}.quick-action-grid small{color:var(--muted);font-size:9px}.quick-icon{width:34px;height:34px}.quick-icon svg{width:17px;height:17px}.offline-card{background:var(--warning-soft);border:1px solid #f6dfad;border-radius:10px;align-items:center;gap:10px;margin:0 14px 14px;padding:10px;display:flex}.offline-card.online-card{background:var(--success-soft);border-color:#c8eedf}.offline-card>span{background:var(--warning);color:#fff;border-radius:50%;flex:none;justify-content:center;align-items:center;width:22px;height:22px;font-size:10px;font-weight:800;display:inline-flex}.offline-card.online-card>span{background:var(--success)}.offline-card div{display:grid}.offline-card strong{font-size:9px}.offline-card small{color:var(--muted);font-size:8px}.attention-list{padding:6px 17px 12px;display:grid}.attention-list button{border:0;border-bottom:1px solid var(--line);text-align:left;background:#fff;grid-template-columns:36px 1fr auto;align-items:center;gap:12px;padding:12px 0;display:grid}.attention-list button:last-child{border-bottom:0}.attention-number{background:var(--brand-soft);color:var(--brand-dark);border-radius:10px;justify-content:center;align-items:center;height:36px;font-size:13px;font-weight:800;display:flex}.attention-list button>span:nth-child(2){display:grid}.attention-list strong{font-size:10px}.attention-list small{color:var(--muted);font-size:9px}.attention-list b{color:var(--brand)}.activity-list{padding:7px 18px 13px;display:grid}.activity-list>div{border-bottom:1px solid var(--line);grid-template-columns:8px 1fr auto;align-items:flex-start;gap:11px;padding:11px 0;display:grid}.activity-list>div:last-child{border-bottom:0}.activity-list>div>span{background:var(--brand);border-radius:50%;width:7px;height:7px;margin-top:4px}.activity-list p{gap:2px;margin:0;display:grid}.activity-list strong{font-size:10px}.activity-list small,.activity-list time{color:var(--muted);font-size:9px}.empty-state{color:var(--muted);text-align:center;flex-direction:column;justify-content:center;align-items:center;min-height:210px;padding:28px;display:flex}.empty-icon{background:var(--brand-soft);color:var(--brand);border-radius:16px;justify-content:center;align-items:center;width:54px;height:54px;margin-bottom:13px;display:flex}.empty-state strong{color:var(--ink);font-size:13px}.empty-state p{max-width:430px;margin:7px 0 15px;line-height:1.55}.form-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;display:grid}.field{gap:6px;min-width:0;display:grid}.field-full{grid-column:1/-1}.field>span{color:#4f5a70;font-size:10px;font-weight:750}.field>small{color:var(--muted);font-size:9px}.field input,.field select,.field textarea,.budget-line input,.input-combo input,.input-combo select{border:1px solid var(--line-dark);background:#fff;border-radius:9px;outline:none;width:100%;min-height:40px;padding:9px 11px}.field textarea{resize:vertical;min-height:78px}.field input:focus,.field select:focus,.field textarea:focus,.budget-line input:focus,.search-field:focus-within{border-color:var(--brand);box-shadow:0 0 0 3px var(--brand-soft)}.form-error{color:var(--danger);margin:2px 0 0;font-size:11px}.inline-alert{background:var(--warning-soft);color:var(--warning);border-radius:8px;margin:14px 0 0;padding:10px;font-size:10px}.contact-match{background:var(--success-soft);color:var(--success);border:2px solid #18845f4d;border-radius:12px;gap:5px;padding:14px 16px;display:grid}.contact-match strong{font-size:13px;line-height:1.25}.contact-match span{font-size:12px;line-height:1.5}.contact-match-new{background:var(--blue-soft);color:var(--blue);border-color:#3d70c92e}.contact-match-error{background:var(--danger-soft);color:var(--danger);border-color:#c63e506b}.contact-match-inline{border-radius:9px;align-self:start;gap:3px;min-height:64px;padding:10px 12px}.contact-match-inline strong{font-size:12px}.contact-match-inline span{font-size:10px;line-height:1.35}.modal-backdrop{z-index:100;background:#0e162694;justify-content:center;align-items:center;padding:20px;display:flex;position:fixed;inset:0}.modal{box-shadow:var(--shadow-deep);background:#fff;border-radius:17px;width:100%;max-width:760px;max-height:94vh;overflow:auto}.modal-wide{max-width:1110px}.modal-header{border-bottom:1px solid var(--line);z-index:3;background:#fff;justify-content:space-between;align-items:flex-start;padding:17px 20px;display:flex;position:sticky;top:0}.modal-header h2{margin:0 0 3px;font-size:16px}.modal-header p{color:var(--muted);margin:0;font-size:10px}.modal-body{padding:20px}.modal-footer{border-top:1px solid var(--line);z-index:3;background:#fff;flex-wrap:wrap;justify-content:flex-end;gap:8px;padding:14px 20px;display:flex;position:sticky;bottom:0}.segmented{background:#eef1f6;border-radius:9px;gap:2px;margin-bottom:16px;padding:3px;display:inline-flex}.segmented-full{width:100%;display:flex}.segmented button{color:var(--muted);background:0 0;border:0;border-radius:7px;min-height:31px;padding:6px 12px;font-size:10px;font-weight:680}.segmented-full button{flex:1}.segmented button.active{color:var(--ink);background:#fff;box-shadow:0 2px 7px #1821361a}.calendar-toolbar,.list-toolbar{border-bottom:1px solid var(--line);justify-content:space-between;align-items:center;gap:12px;padding:13px 16px;display:flex}.calendar-toolbar .segmented{margin:0}.date-nav{align-items:center;gap:6px;display:flex}.date-nav .button{min-height:32px;padding:6px 10px}.date-nav strong{text-transform:capitalize;margin-left:5px;font-size:12px}.search-field{border:1px solid var(--line-dark);background:#fff;border-radius:9px;align-items:center;gap:7px;min-width:220px;max-width:330px;padding:0 10px;display:flex}.search-field svg{color:var(--soft-muted);width:15px;height:15px}.search-field input{background:0 0;border:0;outline:0;width:100%;min-width:0;height:37px;font-size:11px}.week-calendar{max-height:630px;display:grid;overflow:auto}.calendar-corner,.calendar-day-head,.calendar-hour,.calendar-cell{border-bottom:1px solid var(--line);border-right:1px solid var(--line)}.calendar-corner,.calendar-day-head{z-index:2;background:#fafbfc;min-height:55px;padding:9px;position:sticky;top:0}.calendar-corner{color:var(--muted);z-index:3;align-items:center;font-size:9px;display:flex;left:0}.calendar-day-head{flex-direction:column;align-items:center;gap:3px;display:flex}.calendar-day-head span{color:var(--muted);text-transform:uppercase;font-size:9px}.calendar-day-head strong{border-radius:50%;justify-content:center;align-items:center;width:26px;height:26px;font-size:13px;display:flex}.calendar-day-head.today strong{background:var(--brand);color:#fff}.calendar-hour{color:var(--muted);z-index:1;background:#fafbfc;min-height:68px;padding:8px;font-size:9px;position:sticky;left:0}.calendar-cell{min-height:68px;padding:3px}.calendar-event{background:var(--brand-soft);border:0;border-left:3px solid var(--brand);text-align:left;border-radius:6px;width:100%;margin-bottom:3px;padding:5px 6px;display:grid;overflow:hidden}.calendar-event time,.calendar-event small{color:var(--muted);font-size:8px}.calendar-event strong{text-overflow:ellipsis;white-space:nowrap;font-size:9px;overflow:hidden}.month-calendar{grid-template-columns:repeat(7,minmax(110px,1fr));display:grid;overflow:auto}.month-head{border-bottom:1px solid var(--line);border-right:1px solid var(--line);color:var(--muted);text-align:center;text-transform:uppercase;background:#fafbfc;padding:9px;font-size:9px;font-weight:750}.month-day{border-bottom:1px solid var(--line);border-right:1px solid var(--line);gap:3px;min-height:110px;padding:7px;display:grid}.month-day>strong{border-radius:50%;justify-content:center;align-items:center;width:23px;height:23px;font-size:10px;display:flex}.month-day.today>strong{background:var(--brand);color:#fff}.month-day.outside{color:#b8bfcb;background:#fbfcfd}.month-day button{background:var(--brand-soft);color:var(--brand-dark);text-align:left;text-overflow:ellipsis;white-space:nowrap;border:0;border-radius:5px;padding:4px;font-size:8px;overflow:hidden}.month-day small{color:var(--muted);font-size:8px}.mobile-appointment-list{display:none}.record-count{color:var(--muted);font-size:10px}.data-table-wrap{overflow:auto}.data-table{border-collapse:collapse;width:100%;min-width:830px}.data-table th,.data-table td{border-bottom:1px solid var(--line);text-align:left;vertical-align:middle;padding:12px 14px}.data-table th{color:var(--muted);letter-spacing:.04em;text-transform:uppercase;background:#fafbfc;font-size:9px;font-weight:780}.data-table td{font-size:10px}.data-table td>small{color:var(--muted);margin-top:2px;font-size:8px;display:block}.data-table tbody tr:hover{background:#fcfcfd}.person-cell{text-align:left;background:0 0;border:0;align-items:center;gap:9px;padding:0;display:flex}.person-cell span,.lead-avatar{background:var(--blue-soft);color:var(--blue);border-radius:50%;flex:none;justify-content:center;align-items:center;width:30px;height:30px;font-weight:800;display:inline-flex}.drawer-backdrop{z-index:90;background:#0e162666;position:fixed;inset:0}.patient-drawer{background:#fff;width:min(720px,92vw);max-width:720px;height:100%;margin-left:auto;overflow:auto;box-shadow:-20px 0 65px #0e162638}.drawer-header{border-bottom:1px solid var(--line);justify-content:space-between;align-items:center;padding:22px;display:flex}.patient-identity{align-items:center;gap:13px;display:flex}.patient-identity>span{background:var(--brand-soft);color:var(--brand-dark);border-radius:50%;justify-content:center;align-items:center;width:52px;height:52px;font-size:20px;font-weight:800;display:flex}.patient-identity h2{margin:0 0 4px;font-size:18px}.patient-identity p{color:var(--muted);margin:0;font-size:10px}.drawer-actions{gap:8px;padding:14px 22px 0;display:flex}.drawer-tabs{border-bottom:1px solid var(--line);gap:5px;padding:15px 22px 0;display:flex;overflow:auto}.drawer-tabs button{color:var(--muted);white-space:nowrap;background:0 0;border:0;border-bottom:2px solid #0000;padding:9px 10px;font-size:10px;font-weight:680}.drawer-tabs button.active{border-color:var(--brand);color:var(--ink)}.drawer-body{padding:22px}.mini-metrics{grid-template-columns:repeat(4,1fr);gap:10px;display:grid}.mini-metrics>div{border:1px solid var(--line);background:#f8f9fb;border-radius:10px;gap:5px;padding:11px;display:grid}.mini-metrics span,.info-grid span{color:var(--muted);text-transform:uppercase;font-size:8px}.mini-metrics strong{font-size:14px}.info-grid{grid-template-columns:1fr 1fr;gap:11px;margin-top:16px;display:grid}.info-grid>div{border-bottom:1px solid var(--line);gap:5px;padding:11px 2px;display:grid}.info-grid strong,.info-grid p{margin:0;font-size:10px}.info-full{grid-column:1/-1}.timeline{display:grid}.timeline>div{border-left:1px solid var(--line-dark);gap:4px;margin-left:5px;padding:0 0 24px 22px;display:grid;position:relative}.timeline i{background:var(--brand);box-shadow:0 0 0 1px var(--brand);border:3px solid #fff;border-radius:50%;width:11px;height:11px;position:absolute;top:2px;left:-6px}.timeline time,.timeline p{color:var(--muted);margin:0;font-size:9px}.timeline strong{font-size:11px}.simple-list{display:grid}.simple-list>div{border-bottom:1px solid var(--line);justify-content:space-between;align-items:center;padding:13px 0;display:flex}.simple-list>div>span{gap:3px;display:grid}.simple-list>div>span:last-child{justify-items:end}.simple-list strong,.simple-list b{font-size:10px}.simple-list small{color:var(--muted);font-size:9px}.drawer-empty{color:var(--muted);text-align:center;padding:45px 10px}.funnel-summary{grid-template-columns:repeat(5,1fr);gap:10px;display:grid}.funnel-summary div{border:1px solid var(--line);background:#fff;border-radius:11px;justify-content:space-between;padding:12px;display:flex}.funnel-summary span{color:var(--muted);font-size:9px}.funnel-summary strong{font-size:13px}.lead-board{grid-template-columns:repeat(5,minmax(220px,1fr));gap:11px;padding-bottom:7px;display:grid;overflow:auto}.lead-column{background:#eceff5;border:1px solid #e1e5ed;border-radius:12px;min-height:460px;overflow:hidden}.lead-column>header{background:#f4f5f8;border-bottom:1px solid #dde2eb;justify-content:space-between;align-items:center;padding:12px;display:flex}.lead-column>header strong{text-transform:uppercase;font-size:9px}.lead-column>header span{background:#fff;border-radius:99px;justify-content:center;align-items:center;width:21px;height:21px;font-size:9px;display:flex}.lead-column>div{gap:8px;padding:8px;display:grid}.lead-card{background:#fff;border:1px solid #e1e5ed;border-radius:10px;overflow:hidden;box-shadow:0 4px 14px #1821360a}.lead-card-main{text-align:left;background:#fff;border:0;gap:3px;width:100%;padding:11px;display:grid}.lead-avatar{width:27px;height:27px;margin-bottom:3px}.lead-card-main strong{font-size:10px}.lead-card-main small,.lead-card-main p,.lead-card-meta{color:var(--muted);margin:0;font-size:8px}.lead-card-meta{border-top:1px solid var(--line);gap:3px;padding:8px 11px;display:grid}.lead-card-actions{gap:5px;padding:0 11px 10px;display:flex}.column-empty{color:var(--muted);text-align:center;padding:30px 10px;font-size:9px}.row-actions{gap:5px;display:flex}.text-danger{color:var(--danger)}.budget-builder{border:1px solid var(--line);background:#fafbfc;border-radius:11px;gap:8px;margin:18px 0;padding:13px;display:grid}.budget-builder-head,.budget-line{grid-template-columns:minmax(210px,1.8fr) minmax(90px,.7fr) 65px 115px 105px 34px;align-items:center;gap:7px;display:grid}.budget-builder-head{color:var(--muted);text-transform:uppercase;padding:0 5px;font-size:8px;font-weight:750}.budget-line input{min-height:37px;font-size:10px}.budget-line strong{text-align:right;font-size:10px}.budget-summary{grid-template-columns:1fr 260px;align-items:start;gap:20px;display:grid}.budget-summary aside{background:var(--nav);color:#fff;border-radius:12px;grid-template-columns:1fr auto;gap:7px;padding:18px;display:grid}.budget-summary aside span{color:#aeb8c9;font-size:9px}.budget-summary aside strong{font-size:10px}.budget-total-label{border-top:1px solid #ffffff21;margin-top:8px;padding-top:12px}.budget-summary aside b{color:#ff9a7e;border-top:1px solid #ffffff21;margin-top:8px;padding-top:9px;font-size:18px}.input-combo{grid-template-columns:65px 1fr;display:grid}.input-combo select{border-radius:9px 0 0 9px}.input-combo input{border-left:0;border-radius:0 9px 9px 0}.budget-cards{grid-template-columns:repeat(3,minmax(260px,1fr));gap:12px;padding:16px;display:grid}.budget-cards article{border:1px solid var(--line);border-radius:12px;overflow:hidden}.budget-cards article>header{border-bottom:1px solid var(--line);grid-template-columns:38px minmax(0,1fr) auto;align-items:center;gap:10px;padding:13px;display:grid}.document-icon{width:36px;height:36px}.document-icon svg{width:17px;height:17px}.budget-cards header>div{gap:3px;min-width:0;display:grid}.budget-cards header strong{text-overflow:ellipsis;white-space:nowrap;font-size:10px;overflow:hidden}.budget-cards header small{color:var(--muted);font-size:8px}.budget-card-body{gap:5px;padding:14px;display:grid}.budget-card-body span,.budget-card-body small{color:var(--muted);font-size:8px}.budget-card-body b{font-size:20px}.budget-cards article>footer{border-top:1px solid var(--line);flex-wrap:wrap;gap:5px;padding:10px 13px;display:flex}.signature-pad{border:1px dashed #b8c0ce;border-radius:11px;overflow:hidden}.signature-pad canvas{touch-action:none;width:100%;height:170px;display:block}.signature-actions{border-top:1px solid var(--line);background:#f8f9fb;justify-content:space-between;align-items:center;padding:8px 10px;display:flex}.signature-actions small{color:var(--muted);font-size:9px}.toast{background:var(--nav);box-shadow:var(--shadow-deep);color:#fff;z-index:130;border-radius:10px;max-width:min(380px,100vw - 32px);padding:12px 15px;font-size:11px;position:fixed;bottom:20px;right:20px}.toast-error{background:#872b3a}.clinical-toolbar{justify-content:space-between;align-items:center;gap:18px;padding:13px 16px;display:flex}.clinical-toolbar .segmented{margin:0}.patient-selector{align-items:center;gap:10px;min-width:min(480px,70%);display:flex}.patient-selector>span{color:var(--muted);text-transform:uppercase;font-size:9px;font-weight:750}.patient-selector select{border:1px solid var(--line-dark);background:#fff;border-radius:9px;width:min(390px,100%);min-height:39px;padding:8px 10px}.clinical-form{overflow:hidden}.clinical-section{border-bottom:1px solid var(--line);padding:20px}.clinical-section h3,.signature-grid h3{margin:0 0 14px;font-size:12px}.check-grid{grid-template-columns:repeat(3,1fr);gap:8px;display:grid}.check-grid label,.check-card{border:1px solid var(--line);background:#fafbfc;border-radius:9px;align-items:center;gap:9px;min-height:40px;padding:9px 11px;display:flex}.check-grid label span{font-size:10px}.clinical-extra{margin-top:14px}.form-footer{justify-content:flex-end;padding:15px 20px;display:flex}.clinical-timeline{padding:22px;display:grid}.clinical-timeline>article{grid-template-columns:145px 1fr;gap:18px;padding-bottom:18px;display:grid}.timeline-date{text-align:right;justify-items:end;gap:4px;padding-top:12px;display:grid}.timeline-date strong{font-size:10px}.timeline-date span{color:var(--muted);font-size:8px}.evolution-card{border:1px solid var(--line);border-left:3px solid var(--brand);border-radius:10px;padding:14px;position:relative}.evolution-card:before{background:var(--brand);box-shadow:0 0 0 1px var(--brand);content:"";border:3px solid #fff;border-radius:50%;width:11px;height:11px;position:absolute;top:18px;left:-28px}.evolution-card>header,.evolution-card>footer{justify-content:space-between;align-items:center;gap:10px;display:flex}.evolution-card>header>div{gap:3px;display:grid}.evolution-card header strong{font-size:11px}.evolution-card header small,.evolution-card footer{color:var(--muted);font-size:8px}.evolution-card>p{margin:12px 0;line-height:1.6}.evolution-note{background:#f7f8fb;border-radius:8px;padding:10px}.evolution-note strong{font-size:9px}.evolution-note p{color:var(--muted);white-space:pre-wrap;margin:4px 0 0;font-size:9px}.odontogram-panel{overflow:hidden}.odontogram-legend{border-bottom:1px solid var(--line);flex-wrap:wrap;gap:12px;padding:12px 18px;display:flex}.odontogram-legend span{color:var(--muted);align-items:center;gap:5px;font-size:8px;display:inline-flex}.odontogram-legend i,.condition-grid i{border:1px solid #cfd5df;border-radius:3px;width:10px;height:10px}.tooth-arches{padding:26px 18px;overflow-x:auto}.arch-label{color:var(--muted);text-transform:uppercase;justify-content:space-around;min-width:970px;padding:5px;font-size:8px;display:flex}.tooth-row{grid-template-columns:repeat(16,minmax(55px,1fr));gap:5px;min-width:970px;display:grid}.tooth-button{background:#fff;border:1px solid #0000;border-radius:9px;justify-items:center;gap:2px;padding:6px 2px;display:grid}.tooth-button:hover,.tooth-button.tooth-issue{border-color:var(--line);background:#fafbfc}.tooth-shape{background:var(--tooth-color);border:2px solid #9ca5b5;border-radius:45% 45% 38% 38%;justify-content:center;align-items:center;width:29px;height:38px;display:flex;position:relative}.tooth-shape:after{content:"";border-bottom:13px solid #9ca5b5;border-left:4px solid #0000;border-right:4px solid #0000;position:absolute;bottom:-12px;left:8px}.tooth-shape i{border:1px solid #b7beca;border-radius:50%;width:14px;height:11px}.tooth-button strong{margin-top:8px;font-size:9px}.tooth-button small{color:var(--muted);text-overflow:ellipsis;white-space:nowrap;max-width:52px;font-size:6px;overflow:hidden}.midline{grid-template-columns:1fr auto 1fr;align-items:center;gap:9px;min-width:970px;padding:22px 0;display:grid}.midline span{border-top:1px dashed var(--line-dark)}.midline b{color:var(--soft-muted);text-transform:uppercase;font-size:7px}.odontogram-summary{border-top:1px solid var(--line);background:#fafbfc;gap:10px;padding:14px 18px;display:grid}.odontogram-summary>strong{font-size:10px}.odontogram-summary>div{flex-wrap:wrap;gap:13px;display:flex}.odontogram-summary span{color:var(--muted);font-size:8px}.tooth-editor-main{grid-template-columns:250px 1fr;align-items:center;gap:25px;margin-bottom:20px;display:grid}.face-diagram{grid-template-columns:repeat(3,68px);grid-template-areas:".v.""m o d"".l.";justify-content:center;gap:3px;display:grid}.face-diagram button{border:2px solid #aab2c0;border-radius:12px;height:68px;font-size:11px;font-weight:800}.face-diagram button.selected{box-shadow:0 0 0 4px var(--brand-soft);border-color:var(--brand)}.face-v{grid-area:v}.face-m{grid-area:m}.face-o{grid-area:o;border-radius:50%!important}.face-d{grid-area:d}.face-l{grid-area:l}.face-info>span{color:var(--muted);text-transform:uppercase;font-size:8px}.face-info>strong{margin:3px 0 12px;font-size:13px;display:block}.condition-grid{grid-template-columns:1fr 1fr;gap:6px;display:grid}.condition-grid button{border:1px solid var(--line);background:#fff;border-radius:7px;align-items:center;gap:6px;min-height:31px;padding:6px;font-size:8px;display:flex}.condition-grid button.active{border-color:var(--brand);box-shadow:0 0 0 2px var(--brand-soft)}.document-grid{grid-template-columns:repeat(3,1fr);gap:12px;padding:16px;display:grid}.document-grid article{border:1px solid var(--line);border-radius:11px;grid-template-columns:40px 1fr auto;align-items:center;gap:10px;padding:13px;display:grid}.document-grid article>div{gap:3px;min-width:0;display:grid}.document-grid strong{text-overflow:ellipsis;white-space:nowrap;font-size:10px;overflow:hidden}.document-grid small{color:var(--muted);font-size:8px}.document-grid footer{grid-column:1/-1;gap:6px;display:flex}.document-content{font-family:var(--font-geist-sans), Arial, sans-serif;line-height:1.6}.signature-grid{grid-template-columns:1fr 1fr;gap:18px;margin-top:20px;display:grid}.signature-grid>section>img{border:1px solid var(--line);object-fit:contain;border-radius:8px;max-width:100%;height:110px;margin-top:8px;display:block}.camera-upload{border:1px solid var(--line);background:#fafbfc;border-radius:8px;justify-content:space-between;align-items:center;margin-top:8px;padding:8px;font-size:8px;display:flex}.camera-upload input{max-width:180px;font-size:8px}.legal-note{background:var(--warning-soft);color:var(--warning);border-radius:8px;margin:18px 0 0;padding:10px;font-size:8px;line-height:1.5}.finance-toolbar{border-bottom:1px solid var(--line);justify-content:space-between;align-items:center;padding:13px 16px;display:flex}.finance-toolbar .segmented{margin:0}.cash-summary>div{grid-template-columns:repeat(3,1fr);gap:10px;padding:16px;display:grid}.cash-summary>div>span{border:1px solid var(--line);color:var(--muted);background:#fafbfc;border-radius:9px;justify-content:space-between;align-items:center;padding:11px;font-size:9px;display:flex}.cash-summary span strong{color:var(--ink);font-size:10px}.team-grid{grid-template-columns:repeat(3,1fr);gap:12px;padding:16px;display:grid}.team-grid article{border:1px solid var(--line);border-radius:12px;overflow:hidden}.team-grid article>header{grid-template-columns:38px 1fr auto;align-items:center;gap:10px;padding:14px;display:grid}.team-grid article>header>span:first-child{border-radius:50%;justify-content:center;align-items:center;width:36px;height:36px;font-weight:800;display:flex}.team-grid header>div{gap:2px;display:grid}.team-grid header strong{font-size:10px}.team-grid header small{color:var(--muted);font-size:8px}.role-line{border-top:1px solid var(--line);justify-content:space-between;padding:11px 14px;font-size:9px;display:flex}.role-line span{color:var(--muted)}.permission-list{flex-wrap:wrap;gap:5px;padding:0 14px 14px;display:flex}.permission-list span{color:var(--muted);background:#f1f3f7;border-radius:99px;padding:4px 6px;font-size:7px}.team-grid footer{border-top:1px solid var(--line);background:#fafbfc;justify-content:space-between;align-items:center;padding:10px 14px;display:flex}.team-grid footer>span{color:var(--muted);font-size:8px}.check-card{align-items:flex-start}.check-card>span{gap:2px;display:grid}.check-card strong{font-size:9px}.check-card small{color:var(--muted);font-size:8px}.reports-grid{grid-template-columns:1fr 1fr;gap:16px;display:grid}.bar-chart{gap:12px;padding:18px;display:grid}.bar-chart>div{grid-template-columns:120px 1fr 35px;align-items:center;gap:10px;display:grid}.bar-chart span{color:var(--muted);font-size:9px}.bar-chart i{background:#eef1f6;border-radius:99px;height:10px;overflow:hidden}.bar-chart i b{background:linear-gradient(90deg, var(--brand), #ff987d);border-radius:99px;height:100%;display:block}.bar-chart strong{text-align:right;font-size:9px}.chart-empty{color:var(--muted);text-align:center;padding:50px 20px}.financial-result{gap:10px;padding:18px;display:grid}.financial-result>div{border-bottom:1px dashed var(--line-dark);justify-content:space-between;align-items:center;padding:8px 0 14px;display:flex}.financial-result span{color:var(--muted);font-size:9px}.financial-result strong{font-size:14px}.settings-grid{grid-template-columns:minmax(0,1.4fr) minmax(330px,.6fr);align-items:start;gap:16px;display:grid}.settings-side{gap:16px;display:grid}.settings-body{padding:18px}.settings-body>p{color:var(--muted);margin:0 0 14px;font-size:9px;line-height:1.6}.settings-actions{flex-wrap:wrap;gap:7px;display:flex}.security-notes{gap:9px;display:grid}.security-notes p{border:1px solid var(--line);background:#fafbfc;border-radius:8px;margin:0;padding:10px}.public-booking-page{background:#f5f6f9;min-height:100vh}.public-booking-brand{border-bottom:1px solid var(--line);background:#fff;justify-content:space-between;align-items:center;height:78px;padding:0 max(26px,50vw - 590px);display:flex}.public-booking-brand>a{align-items:center;gap:11px;display:flex}.public-booking-brand>a>span:last-child{gap:2px;display:grid}.public-booking-brand strong{font-size:13px}.public-booking-brand small{color:var(--muted);font-size:9px}.public-secure{color:var(--success);align-items:center;gap:5px;font-size:9px;display:inline-flex}.public-secure:before{background:var(--success);content:"";border-radius:50%;width:6px;height:6px}.public-booking-shell{grid-template-columns:.8fr 1.2fr;gap:clamp(35px,7vw,90px);max-width:1180px;margin:auto;padding:60px 28px;display:grid}.public-booking-copy{padding-top:35px}.public-booking-copy h1{letter-spacing:-.05em;margin:12px 0 20px;font-size:clamp(38px,5vw,62px);line-height:1.04}.public-booking-copy>p{color:var(--muted);margin:0;font-size:14px;line-height:1.7}.booking-benefits{gap:12px;margin-top:28px;display:grid}.booking-benefits span{align-items:center;gap:9px;font-size:10px;font-weight:650;display:flex}.booking-benefits svg{color:var(--brand);width:17px;height:17px}.booking-notice{background:var(--nav);color:#fff;border-radius:13px;margin-top:36px;padding:17px}.booking-notice strong{font-size:10px}.booking-notice p{color:#aeb8ca;margin:4px 0 0;font-size:9px;line-height:1.5}.public-booking-card{border:1px solid var(--line);background:#fff;border-radius:20px;min-height:560px;padding:clamp(26px,4vw,46px);overflow:hidden;box-shadow:0 25px 75px #1821361a}.public-booking-card form>header{margin-bottom:24px}.public-booking-card form>header>span{color:var(--brand);letter-spacing:.1em;text-transform:uppercase;font-size:9px;font-weight:800}.public-booking-card h2{letter-spacing:-.03em;margin:6px 0;font-size:25px}.public-booking-card form>header p,.privacy-line{color:var(--muted);margin:0;font-size:9px}.public-booking-card .button-block{margin-top:16px}.privacy-line{text-align:center;margin-top:10px;line-height:1.5;display:block}.booking-honeypot{width:0;height:0;position:absolute;left:-10000px;overflow:hidden}.booking-success{text-align:center;flex-direction:column;justify-content:center;align-items:center;min-height:470px;display:flex}.booking-success>span{background:var(--success-soft);color:var(--success);border-radius:50%;justify-content:center;align-items:center;width:70px;height:70px;margin-bottom:12px;font-size:25px;font-weight:800;display:flex}.booking-success p{color:var(--muted);margin:4px 0;line-height:1.6}.booking-success .button{margin-top:18px}.patient-form-page{background:#f3f5f9;min-height:100vh}.patient-form-brand{background:var(--nav);color:#fff;align-items:center;gap:11px;min-height:78px;padding:14px max(22px,50vw - 425px);display:flex}.patient-form-brand>span:last-child{gap:2px;display:grid}.patient-form-brand strong{font-size:13px}.patient-form-brand small{color:#9ba6ba;font-size:9px}.patient-form-shell{max-width:850px;margin:auto;padding:38px 22px 70px}.patient-form-card{border:1px solid var(--line);background:#fff;border-radius:18px;padding:clamp(24px,5vw,48px);overflow:hidden;box-shadow:0 25px 70px #18213617}.patient-form-card>header>span{color:var(--brand);letter-spacing:.1em;text-transform:uppercase;font-size:9px;font-weight:800}.patient-form-card>header h1{letter-spacing:-.04em;margin:7px 0 10px;font-size:clamp(28px,5vw,42px)}.patient-form-card>header p{color:var(--muted);margin:0;line-height:1.6}.patient-form-document{border:1px solid var(--line);background:#f8f9fb;border-radius:11px;margin:25px 0;padding:17px}.patient-form-document>strong{text-transform:uppercase;margin-bottom:8px;font-size:9px;display:block}.patient-form-document>p{white-space:pre-wrap;margin:0;line-height:1.7}.patient-form-section{border-top:1px solid var(--line);padding:25px 0}.patient-form-section h2{margin:0 0 16px;font-size:14px}.patient-confirmation{background:var(--warning-soft);border:1px solid #f2dfb7;border-radius:9px;align-items:flex-start;gap:9px;padding:12px;line-height:1.5;display:flex}.patient-confirmation span{font-size:10px}.patient-signature{border:1px dashed #adb6c6;border-radius:10px;margin-top:14px;overflow:hidden}.patient-signature canvas{touch-action:none;width:100%;height:190px;display:block}.patient-signature footer{border-top:1px solid var(--line);background:#f8f9fb;justify-content:space-between;align-items:center;padding:8px 10px;font-size:9px;display:flex}.patient-signature footer span{color:var(--muted)}.patient-signature footer button{border:1px solid var(--line);background:#fff;border-radius:7px;padding:5px 8px;font-size:8px}.patient-form-submit{margin-top:8px}.patient-form-privacy{color:var(--muted);text-align:center;max-width:520px;margin:9px auto 0;font-size:8px;line-height:1.5}.patient-form-message{text-align:center;flex-direction:column;justify-content:center;align-items:center;min-height:440px;display:flex}.patient-form-message h1{margin:12px 0 7px;font-size:28px}.patient-form-message p,.patient-form-message small{color:var(--muted)}.form-success-mark,.form-error-mark{background:var(--success-soft);color:var(--success);border-radius:50%;justify-content:center;align-items:center;width:64px;height:64px;font-size:24px;font-weight:850;display:flex}.form-error-mark{background:var(--danger-soft);color:var(--danger)}.form-spinner{border:3px solid var(--line);border-top-color:var(--brand);border-radius:50%;width:38px;height:38px;animation:.8s linear infinite spin}@keyframes spin{to{transform:rotate(360deg)}}@media (width<=1180px){.metrics-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.dashboard-grid,.dashboard-lower{grid-template-columns:1fr}.budget-cards{grid-template-columns:repeat(2,minmax(250px,1fr))}.document-grid,.team-grid{grid-template-columns:repeat(2,1fr)}}@media (width<=900px){.clinic-app{display:block}.sidebar{width:252px;transition:all .18s;position:fixed;left:-280px;box-shadow:18px 0 55px #0e16263d}.sidebar-open{left:0}.brand .icon-button{color:#fff;background:0 0;border-color:#ffffff1f;display:inline-flex}.menu-scrim{z-index:45;background:#0e16266b;border:0;position:fixed;inset:0}.topbar-title>.icon-button{display:inline-flex}.login-page{grid-template-columns:1fr}.login-hero{display:none}.login-panel{min-height:100vh}.calendar-panel{display:none}.mobile-appointment-list{padding:0 16px;display:block}.mobile-appointment-list .panel-header{margin:0 -16px}.funnel-summary{grid-template-columns:repeat(3,1fr)}.settings-grid,.public-booking-shell{grid-template-columns:1fr}.public-booking-copy{padding-top:0}.public-booking-copy h1{max-width:720px}}@media (width<=680px){.page-content{padding:18px 14px 28px}.topbar{padding:0 14px}.topbar-title small,.connection,.profile-pill b{display:none}.profile-pill{padding-right:4px}.welcome-row,.module-header{flex-direction:column;align-items:stretch}.welcome-row .button,.module-header>.button{align-self:flex-start}.metrics-grid,.metrics-three,.quick-action-grid,.form-grid,.mini-metrics,.info-grid,.budget-summary{grid-template-columns:1fr}.field-full,.info-full{grid-column:auto}.modal-backdrop{align-items:flex-end;padding:0}.modal{border-radius:18px 18px 0 0;max-height:94vh}.list-toolbar{flex-direction:column;align-items:stretch}.search-field{min-width:0;max-width:none}.funnel-summary{grid-template-columns:1fr 1fr}.budget-cards{grid-template-columns:1fr}.clinical-toolbar,.finance-toolbar{flex-direction:column;align-items:stretch}.patient-selector{flex-direction:column;align-items:stretch;min-width:0}.patient-selector select{width:100%}.check-grid,.document-grid,.signature-grid,.cash-summary>div,.team-grid,.reports-grid{grid-template-columns:1fr}.clinical-timeline{padding:15px}.clinical-timeline>article{grid-template-columns:1fr;gap:10px}.timeline-date{text-align:left;justify-items:start}.evolution-card:before{display:none}.tooth-editor-main{grid-template-columns:1fr}.public-booking-brand{padding:0 16px}.public-secure{display:none}.public-booking-shell{padding:36px 16px}.public-booking-card{padding:24px 18px}.budget-builder{overflow-x:auto}.budget-builder-head,.budget-line{min-width:810px}.patient-drawer{width:100vw}}@media print{.sidebar,.topbar,.button,.icon-button,.module-header{display:none!important}.clinic-app{display:block}.page-content{max-width:none;padding:0}.panel{box-shadow:none}}


/* ===== V134 SOURCE: v15-mobile.css ===== */
/* Agenda responsiva v15: no celular, Dia/Semana/Mês usam as grades reais. */
.calendar-cell,
.month-day {
  cursor: pointer;
}

.calendar-cell:focus-visible,
.month-day:focus-visible {
  outline: 3px solid #ef6a45;
  outline-offset: -3px;
}

.calendar-cell:hover,
.month-day:hover {
  background-color: rgba(239, 106, 69, 0.07);
}

/* Mantem os sete dias visiveis quando a barra lateral esta aberta. */
.calendar-week .week-calendar {
  grid-template-columns: 64px repeat(7, minmax(0, 1fr)) !important;
  width: 100%;
  overflow-x: hidden;
}

.calendar-week .calendar-corner,
.calendar-week .calendar-hour {
  min-width: 0;
}

@media (min-width: 681px) and (max-width: 1280px) {
  .page-content {
    padding-left: 20px;
    padding-right: 20px;
  }

  .calendar-week .calendar-day-head,
  .calendar-week .calendar-cell {
    min-width: 0;
  }
}

@media (max-width: 1100px) {
  .calendar-panel {
    display: block;
    overflow: hidden;
  }

  .mobile-appointment-list {
    display: none;
  }

  .calendar-toolbar {
    align-items: stretch;
    flex-wrap: wrap;
    padding: 12px;
  }

  .calendar-toolbar .date-nav {
    flex: 1 1 100%;
  }

  .calendar-toolbar .date-nav strong {
    margin-left: auto;
    text-align: right;
  }

  .calendar-toolbar .search-field {
    flex: 1 1 210px;
    min-width: 0;
    max-width: none;
  }

  .calendar-toolbar > .segmented {
    flex: 1 1 210px;
    margin: 0;
  }

  .calendar-toolbar > .segmented button {
    flex: 1;
  }
}

@media (max-width: 680px) {
  .calendar-toolbar .date-nav {
    display: grid;
    grid-template-columns: 36px 52px 36px minmax(0, 1fr);
  }

  .calendar-toolbar .date-nav .button {
    min-width: 0;
    padding: 6px;
  }

  .calendar-toolbar .date-nav strong {
    align-self: center;
    font-size: 10px;
    line-height: 1.25;
  }

  .calendar-day .week-calendar {
    grid-template-columns: 50px minmax(0, 1fr) !important;
    max-height: 62vh;
  }

  .calendar-week .week-calendar {
    grid-template-columns: 46px repeat(7, minmax(43px, 1fr)) !important;
    max-height: 62vh;
    overflow-x: hidden;
  }

  .calendar-week .calendar-corner,
  .calendar-week .calendar-day-head {
    min-height: 50px;
    padding: 6px 2px;
  }

  .calendar-week .calendar-corner {
    font-size: 7px;
  }

  .calendar-week .calendar-day-head span {
    font-size: 7px;
  }

  .calendar-week .calendar-day-head strong {
    width: 23px;
    height: 23px;
    font-size: 11px;
  }

  .calendar-week .calendar-hour {
    min-height: 64px;
    padding: 6px 3px;
    font-size: 8px;
  }

  .calendar-week .calendar-cell {
    min-height: 64px;
    padding: 2px;
  }

  .calendar-week .calendar-event {
    border-left-width: 2px;
    padding: 3px 2px;
  }

  .calendar-week .calendar-event time,
  .calendar-week .calendar-event small {
    font-size: 6px;
  }

  .calendar-week .calendar-event strong {
    font-size: 7px;
  }

  .calendar-month .month-calendar {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    overflow: hidden;
  }

  .calendar-month .month-head {
    padding: 7px 1px;
    font-size: 7px;
  }

  .calendar-month .month-day {
    align-content: start;
    gap: 2px;
    min-height: 72px;
    padding: 3px;
  }

  .calendar-month .month-day > strong {
    width: 20px;
    height: 20px;
    font-size: 9px;
  }

  .calendar-month .month-day button {
    padding: 3px 2px;
    font-size: 6px;
  }

  .calendar-month .month-day small {
    font-size: 6px;
  }
}


/* ===== V134 SOURCE: v18-patient.css ===== */
.patient-form-section-title {
  border-bottom: 1px solid var(--line);
  color: var(--brand-dark);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.09em;
  margin: 7px 0 2px;
  padding: 9px 0 8px;
  text-transform: uppercase;
}


/* ===== V134 SOURCE: v20-alertas.css ===== */
.dashboard-alerts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.dashboard-alert-card {
  overflow: hidden;
}

.dashboard-alert-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 70px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
}

.dashboard-alert-header h2 {
  margin: 0 0 3px;
  font-size: 14px;
}

.dashboard-alert-header p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
}

.dashboard-alert-header > strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 10px;
  border-radius: 12px;
  font-size: 16px;
}

.dashboard-alert-list {
  display: grid;
  padding: 6px 17px 10px;
}

.dashboard-alert-list button {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 11px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
  text-align: left;
}

.dashboard-alert-list button:last-child {
  border-bottom: 0;
}

.dashboard-alert-list button > span:nth-child(2) {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.dashboard-alert-list button > span:nth-child(2) strong {
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-alert-list small {
  color: var(--muted);
  font-size: 9px;
}

.dashboard-alert-list b {
  font-size: 14px;
}

.dashboard-alert-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  font-size: 12px;
  font-weight: 800;
}

.alert-danger .dashboard-alert-header > strong,
.alert-danger .dashboard-alert-avatar {
  color: var(--danger);
  background: var(--danger-soft);
}

.alert-warning .dashboard-alert-header > strong,
.alert-warning .dashboard-alert-avatar {
  color: var(--warning);
  background: var(--warning-soft);
}

.alert-success .dashboard-alert-header > strong,
.alert-success .dashboard-alert-avatar {
  color: var(--success);
  background: var(--success-soft);
}

.alert-blue .dashboard-alert-header > strong,
.alert-blue .dashboard-alert-avatar {
  color: var(--blue);
  background: var(--blue-soft);
}

.alert-danger .dashboard-alert-list b { color: var(--danger); }
.alert-warning .dashboard-alert-list b { color: var(--warning); }
.alert-success .dashboard-alert-list b { color: var(--success); }
.alert-blue .dashboard-alert-list b { color: var(--blue); }

.dashboard-alert-empty {
  margin: 0;
  padding: 20px 18px;
  color: var(--muted);
  font-size: 11px;
}

.dashboard-alert-more {
  width: 100%;
  padding: 10px 16px;
  border: 0;
  border-top: 1px solid var(--line);
  background: #fbfcfe;
  color: var(--brand-dark);
  font-size: 10px;
  font-weight: 720;
}

@media (max-width: 760px) {
  .dashboard-alerts-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-alert-header {
    min-height: 64px;
    padding: 13px 15px;
  }

  .dashboard-alert-list {
    padding-inline: 15px;
  }
}


/* V88 — listas completas de alertas do painel */
.dashboard-alert-modal-body {
  display: grid;
  gap: 14px;
  max-height: min(72vh, 760px);
  overflow: hidden;
}

.dashboard-alert-modal-search {
  display: flex;
}

.dashboard-alert-modal-search input {
  width: min(100%, 520px);
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.dashboard-alert-modal-table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.dashboard-alert-modal-row {
  display: grid;
  grid-template-columns: minmax(230px, 1.7fr) minmax(130px, 1fr) minmax(130px, 1fr) minmax(140px, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-width: 900px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
}

.dashboard-alert-modal-row:last-child {
  border-bottom: 0;
}

.dashboard-alert-modal-head {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f8fafc;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.dashboard-alert-modal-patient {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.dashboard-alert-modal-patient strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-alert-status {
  font-weight: 760;
}

.dashboard-alert-status.alert-danger { color: var(--danger); }
.dashboard-alert-status.alert-warning { color: var(--warning); }
.dashboard-alert-status.alert-success { color: var(--success); }
.dashboard-alert-status.alert-blue { color: var(--blue); }

.dashboard-alert-open-patient {
  white-space: nowrap;
}

@media (max-width: 760px) {
  .dashboard-alert-modal-body {
    max-height: 70vh;
  }

  .dashboard-alert-modal-search input {
    width: 100%;
  }
}


/* ===== V134 SOURCE: v22-excluir-cadastro.css ===== */
.button-danger {
  background: var(--danger-soft);
  border-color: #f4b9c2;
  color: var(--danger);
}

.button-danger:hover {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

.patient-delete-button {
  margin-left: auto;
}

.patient-row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  white-space: nowrap;
}

.patient-delete-icon {
  color: var(--danger);
  border-color: #f4b9c2;
}

.patient-delete-icon:hover {
  color: #fff;
  border-color: var(--danger);
  background: var(--danger);
}

.patient-record-number {
  color: #40516d;
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.patient-record-number-drawer {
  display: inline-block;
  margin: 2px 0 1px;
  color: #ef6a45;
}

@media (max-width: 680px) {
  .patient-delete-button {
    margin-left: 0;
  }

  .patient-row-actions {
    justify-content: flex-start;
  }
}


/* ===== V134 SOURCE: v24-configuracoes.css ===== */
.settings-section-title {
  grid-column: 1 / -1;
  margin: 12px 0 2px;
  padding-top: 18px;
  border-top: 1px solid rgba(18, 92, 81, 0.16);
  color: #153b35;
  font-size: 1.05rem;
}

.settings-section-title:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

@media (max-width: 720px) {
  .settings-section-title {
    margin-top: 8px;
  }
}


/* ===== V134 SOURCE: v27-contratos.css ===== */
.contract-upload-button {
  cursor: pointer;
  position: relative;
}

.contract-upload-button input {
  height: 1px;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  position: absolute;
  width: 1px;
}

@media (max-width: 700px) {
  .document-grid article footer .contract-upload-button {
    width: 100%;
  }
}


/* ===== V134 SOURCE: v47-assinatura-ipad.css ===== */
/* V39: assinatura integrada somente à área Documentos. */
.signature-vault-page,
.signature-link-panel,
.contract-upload-button {
  display: none !important;
}

.patient-folder-actions{align-items:center;display:flex;gap:12px}
.document-grid article{position:relative}
.document-print-selector{align-items:center;background:#fff4ef;border:1px solid #ffc8b7;border-radius:999px;color:#d94f2b;cursor:pointer;display:flex;font-size:12px;font-weight:700;gap:6px;padding:6px 10px;position:absolute;right:14px;top:14px;z-index:2}
.document-print-selector input{accent-color:#ef6a45;height:16px;margin:0;width:16px}

@media (max-width:720px){
  .patient-folder-actions{align-items:stretch;flex-direction:column;width:100%}
  .patient-folder-actions .button{width:100%}
}

.global-signature-panel { padding: 22px; }
.global-signature-header {
  align-items: center;
  display: flex;
  gap: 20px;
  justify-content: space-between;
  margin-bottom: 18px;
}
.global-signature-header h2 { margin: 0 0 5px; }
.global-signature-header p,
.global-signature-note { color: var(--muted, #6f7788); margin: 0; }
.global-signature-grid { display: grid; gap: 18px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.global-signature-buttons { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
.global-signature-grid > section {
  border: 1px solid var(--border, #dfe4ec);
  border-radius: 14px;
  overflow: hidden;
}
.global-signature-grid h3 { padding: 14px 14px 0; }
.signature-pad canvas {
  background: #fff;
  border-bottom: 1px solid var(--border, #dfe4ec);
  border-top: 1px solid var(--border, #dfe4ec);
  cursor: crosshair;
  display: block;
  height: 230px;
  max-width: 100%;
  overscroll-behavior: contain;
  touch-action: none;
  user-select: none;
  width: 100%;
  -webkit-user-select: none;
}
.signature-actions {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 10px 12px;
}
.signature-pad:fullscreen,
.signature-pad.signature-pad-fullscreen-fallback {
  background: #f7f8fa;
  display: flex;
  flex-direction: column;
  inset: 0;
  padding: max(18px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
}
.signature-pad:fullscreen canvas,
.signature-pad.signature-pad-fullscreen-fallback canvas { flex: 1; height: auto; min-height: 60vh; }
.signature-pad.signature-pad-fullscreen-fallback { position: fixed; z-index: 99999; }
.global-signature-grid .camera-upload { margin: 0 12px 12px; }
.global-signature-note { margin-top: 14px; }
.document-delete-button { margin-left: auto; }

/* Busca de paciente ampla e padronizada em todos os módulos clínicos. */
.patient-selector-searchable { flex: 0 1 40%; width: 40%; max-width: 460px; min-width: min(320px, 100%); }
.patient-selector-searchable > input[type="search"] {
  border: 1px solid var(--line-dark); background: #fff; border-radius: 9px;
  width: 100%; min-width: 0; min-height: 44px; padding: 10px 14px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.patient-selector-searchable > input[type="search"]:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.button-whatsapp{background:#e8f8ef;border-color:#b8e8cb;color:#128c4a}
.button-whatsapp:hover{background:#d9f4e4}
.patient-file-upload{white-space:nowrap}
.patient-file-upload input{display:none}
.patient-folder-header{border-bottom:1px solid var(--line);display:flex;justify-content:space-between;align-items:center;padding:14px 16px}
.patient-folder-header strong{font-size:12px}
.patient-folder-header span{color:var(--muted);font-size:10px}

@media (max-width: 760px) {
  .global-signature-header { align-items: stretch; flex-direction: column; }
  .global-signature-header .button { width: 100%; }
  .global-signature-grid { grid-template-columns: 1fr; }
  .global-signature-buttons { justify-content: stretch; }
  .global-signature-buttons .button { flex: 1 1 180px; }
  .patient-selector-searchable { width: 100%; flex-basis: auto; min-width: 0; max-width: none; }
  .patient-folder-header{align-items:flex-start;gap:5px;flex-direction:column}
  .drawer-actions .button{flex:1 1 130px}
}


/* ===== V134 SOURCE: v128-permissoes-equipe.css ===== */
/* V12.8 — layout responsivo das permissões individuais da Equipe */
.modal:has(.permission-grid) {
  width: min(960px, calc(100vw - 32px));
  max-height: min(92vh, 880px);
}

.modal:has(.permission-grid) form {
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: calc(92vh - 82px);
}

.modal:has(.permission-grid) .modal-body {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-bottom: 22px;
}

.modal:has(.permission-grid) .modal-footer {
  position: sticky;
  bottom: 0;
  z-index: 2;
  flex: none;
  background: #fff;
  box-shadow: 0 -1px 0 var(--line);
}

.permission-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.permission-grid .check-card {
  min-width: 0;
  min-height: 58px;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
}

.permission-grid .check-card input[type="checkbox"] {
  appearance: auto;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: #1677ee;
}

.permission-grid .check-card span,
.permission-grid .check-card strong {
  min-width: 0;
}

.permission-grid .check-card strong {
  display: block;
  color: var(--ink);
  font-size: 11px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.permission-help {
  color: var(--muted);
  margin: 0;
  font-size: 10px;
  line-height: 1.5;
}

.user-modal-footer-spacer {
  flex: 1 1 auto;
}

.user-modal-footer .user-delete-button {
  margin-right: auto;
}

@media (max-width: 560px) {
  .user-modal-footer {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .user-modal-footer .user-delete-button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .user-modal-footer-spacer {
    display: none;
  }
}

@media (max-width: 820px) {
  .permission-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .modal:has(.permission-grid) { width: 100%; }
  .permission-grid { grid-template-columns: 1fr; }
  .permission-grid .check-card { min-height: 50px; }
}


/* ===== V134 SOURCE: v129-marca-login.css ===== */
/* V12.9 - identidade visual da tela de acesso */
.login-hero {
  justify-content: center;
  align-items: center;
  padding: clamp(42px, 7vw, 96px);
}

.login-hero::after {
  width: 620px;
  height: 620px;
  top: 50%;
  right: auto;
  left: 50%;
  transform: translate(-50%, -50%);
  border-color: #ffffff0d;
}

.login-brand {
  width: min(620px, 88%);
  flex-direction: column;
  justify-content: center;
  gap: 24px;
  text-align: center;
}

.login-jr-mark {
  display: block;
  width: min(560px, 100%);
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 18px 38px #00000035);
}

.login-brand > div {
  gap: 8px;
}

.login-brand strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(28px, 3.2vw, 46px);
  font-weight: 600;
  letter-spacing: -0.025em;
}

.login-brand small {
  color: #d1b46e;
  letter-spacing: .24em;
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 700;
}

.login-copy {
  display: none;
}

@media (max-width: 900px) {
  .login-hero {
    display: none;
  }
}


/* ===== V134 SOURCE: v130-marmore-dourado.css ===== */
/*
 * Clínica Dra. Joalla Rocha — Tema Mármore & Dourado v130
 * Camada somente visual. Não altera lógica, API, MySQL, agenda, pacientes ou PDFs.
 * Carregar por último no index.html.
 */

:root {
  --jr-ink: #251c15;
  --jr-ink-soft: #6d6258;
  --jr-ivory: #fffdf8;
  --jr-cream: #fbf5ea;
  --jr-cream-2: #f4ead8;
  --jr-gold: #b77a10;
  --jr-gold-2: #d7ab55;
  --jr-gold-3: #8f5c08;
  --jr-gold-line: rgba(183,122,16,.30);
  --jr-border: rgba(166,116,37,.20);
  --jr-border-strong: rgba(183,122,16,.42);
  --jr-shadow: 0 12px 30px rgba(92,61,20,.10), 0 2px 8px rgba(92,61,20,.06);
  --jr-shadow-soft: 0 7px 20px rgba(92,61,20,.08);
  --jr-radius: 18px;
  --jr-radius-sm: 13px;
}

html {
  color-scheme: light;
  background: var(--jr-cream);
}

body,
#root,
.clinic-app {
  background-color: var(--jr-cream) !important;
  color: var(--jr-ink) !important;
}

body {
  background-image:
    radial-gradient(ellipse at 12% 7%, rgba(200,156,80,.11) 0 1px, transparent 2px),
    radial-gradient(ellipse at 78% 22%, rgba(167,123,67,.08) 0 1px, transparent 2px),
    linear-gradient(118deg, rgba(255,255,255,.96), rgba(252,247,237,.94) 42%, rgba(255,252,245,.97));
  background-size: 120px 120px, 180px 180px, auto;
}

/* ===== ESTRUTURA GERAL ===== */
.clinic-app {
  min-height: 100vh;
}

.workspace,
.page-content {
  position: relative;
  isolation: isolate;
}

.workspace {
  background:
    radial-gradient(circle at 72% 3%, rgba(228,196,136,.14), transparent 31%),
    radial-gradient(circle at 35% 78%, rgba(194,151,84,.08), transparent 28%),
    linear-gradient(135deg, #fffdf8 0%, #f9f1e4 52%, #fffdfa 100%) !important;
}

/* veios suaves de mármore */
.workspace::after {
  content: "";
  position: fixed;
  inset: 0 0 0 auto;
  width: calc(100vw - 270px);
  pointer-events: none;
  z-index: -1;
  opacity: .42;
  background-image:
    linear-gradient(118deg, transparent 0 20%, rgba(183,122,16,.045) 20.3%, transparent 20.8% 45%, rgba(126,91,49,.035) 45.25%, transparent 45.7%),
    linear-gradient(42deg, transparent 0 66%, rgba(183,122,16,.032) 66.2%, transparent 66.8%);
}

/* arcos dourados decorativos, sem imagem externa */
.workspace::before {
  content: "";
  position: absolute;
  top: -86px;
  right: 5%;
  width: min(820px, 68vw);
  height: 210px;
  border-top: 2px solid rgba(183,122,16,.74);
  border-bottom: 1px solid rgba(215,171,85,.48);
  border-radius: 50%;
  transform: rotate(-7deg);
  pointer-events: none;
  z-index: 0;
  box-shadow: 0 -3px 0 rgba(255,255,255,.75), 0 -7px 0 rgba(183,122,16,.12);
}

.page-content {
  z-index: 1;
}

/* ===== TIPOGRAFIA ===== */
.module-header h1,
.module-header h2,
.panel-header h2,
.panel-header h3,
.topbar-title strong,
.login-card h1,
.drawer-header h2,
.modal-header h2,
.patient-identity h2,
.empty-state h2 {
  font-family: Georgia, "Times New Roman", serif !important;
  color: var(--jr-ink) !important;
  letter-spacing: -.02em;
}

.module-header h1 {
  font-weight: 700 !important;
}

.module-header p,
.panel-header p,
.topbar-title small,
.record-count,
small,
.field label,
.empty-state p {
  color: var(--jr-ink-soft);
}

.eyebrow {
  color: var(--jr-gold-3) !important;
  letter-spacing: .14em !important;
  font-weight: 800 !important;
  text-transform: uppercase;
}

/* ===== SIDEBAR ===== */
.sidebar {
  background:
    radial-gradient(circle at 18% 11%, rgba(220,181,112,.18), transparent 25%),
    linear-gradient(135deg, rgba(255,254,250,.99), rgba(247,237,220,.97)) !important;
  border-right: 1px solid rgba(183,122,16,.34) !important;
  color: var(--jr-ink) !important;
  box-shadow: 7px 0 24px rgba(99,66,18,.08) !important;
}

.sidebar::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .30;
  background-image:
    linear-gradient(132deg, transparent 0 39%, rgba(183,122,16,.10) 39.3%, transparent 39.8%),
    linear-gradient(72deg, transparent 0 72%, rgba(142,102,53,.07) 72.2%, transparent 72.7%);
}

.brand,
.sidebar-nav,
.sidebar-footer {
  position: relative;
  z-index: 1;
}

.brand {
  border-bottom: 1px solid rgba(183,122,16,.17) !important;
}

.brand-symbol {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(145deg, #fffef9, #f1dfbd) !important;
  border: 1px solid rgba(183,122,16,.34) !important;
  color: transparent !important;
  box-shadow: inset 0 0 18px rgba(255,255,255,.85), 0 7px 18px rgba(136,89,13,.15) !important;
  font-size: 0 !important;
}

.brand-symbol::before {
  content: "JR";
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 24px;
  line-height: 1;
  font-style: italic;
  font-weight: 600;
  letter-spacing: -5px;
  padding-right: 4px;
  color: var(--jr-gold-3);
  text-shadow: 0 1px 0 #fff, 0 2px 7px rgba(125,77,9,.18);
}

.brand strong,
.sidebar-profile strong {
  color: var(--jr-ink) !important;
}

.brand small,
.sidebar-profile small {
  color: #8f7b63 !important;
}

.sidebar-nav button,
.sidebar-footer > button {
  color: #4c4035 !important;
  border: 1px solid transparent !important;
  background: transparent !important;
  transition: background .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.sidebar-nav button svg,
.sidebar-footer > button svg {
  color: var(--jr-gold) !important;
  stroke: currentColor !important;
}

.sidebar-nav button:hover,
.sidebar-footer > button:hover {
  background: rgba(255,255,255,.65) !important;
  border-color: rgba(183,122,16,.18) !important;
}

.sidebar-nav button.active {
  color: #7b4d07 !important;
  background: linear-gradient(135deg, rgba(255,255,255,.93), rgba(248,238,220,.92)) !important;
  border-color: rgba(183,122,16,.45) !important;
  box-shadow: 0 8px 20px rgba(124,79,10,.11), inset 3px 0 0 var(--jr-gold) !important;
}

.sidebar-nav button.active svg {
  color: var(--jr-gold-3) !important;
}

.sidebar-profile {
  background: rgba(255,255,255,.52) !important;
  border: 1px solid rgba(183,122,16,.16) !important;
  border-radius: var(--jr-radius-sm) !important;
}

.sidebar-profile > span {
  background: linear-gradient(145deg,#fff,#f3dfb9) !important;
  color: var(--jr-gold-3) !important;
  border: 1px solid rgba(183,122,16,.23) !important;
}

/* ===== TOPBAR ===== */
.topbar {
  position: relative;
  z-index: 3;
  background: rgba(255,253,248,.90) !important;
  border-bottom: 1px solid rgba(183,122,16,.20) !important;
  box-shadow: 0 4px 16px rgba(91,59,18,.04) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.topbar-actions .icon-button,
.profile-pill {
  background: rgba(255,255,255,.72) !important;
  border-color: rgba(183,122,16,.25) !important;
  color: var(--jr-ink) !important;
  box-shadow: 0 4px 12px rgba(97,64,20,.05);
}

.profile-pill > span,
.topbar-actions .profile-pill > span {
  background: #fff7e7 !important;
  color: var(--jr-gold-3) !important;
}

.connection {
  color: #5f665f !important;
}

.connection::before,
.connection.online::before {
  box-shadow: 0 0 0 4px rgba(22,132,83,.08);
}

/* ===== CONTEÚDO / PAINÉIS ===== */
.page-content {
  background: transparent !important;
}

.panel,
.metric-card,
.quick-action-grid > *,
.appointment-row,
.lead-card,
.budget-cards article,
.settings-card,
.clinical-section,
.patient-form-card,
.patient-selector,
.dashboard-alert-card,
.activity-list > *,
.simple-list > *,
.timeline > *,
.document-card,
.signature-pad,
.check-card,
.tooth-editor-main,
.face-diagram,
.odontogram-summary,
.drawer-body > section {
  border-color: var(--jr-border) !important;
}

.panel,
.metric-card,
.quick-action-grid > *,
.lead-card,
.budget-cards article,
.settings-card,
.clinical-section,
.patient-form-card,
.dashboard-alert-card,
.patient-drawer,
.modal,
.calendar-panel,
.login-card {
  background: linear-gradient(145deg, rgba(255,255,255,.93), rgba(252,247,238,.91)) !important;
  border: 1px solid var(--jr-border) !important;
  box-shadow: var(--jr-shadow) !important;
}

.panel,
.metric-card,
.settings-card,
.dashboard-alert-card,
.calendar-panel {
  border-radius: var(--jr-radius) !important;
}

.panel-header {
  border-color: rgba(183,122,16,.15) !important;
}

.metric-card:hover,
.quick-action-grid > *:hover,
.lead-card:hover,
.budget-cards article:hover {
  border-color: rgba(183,122,16,.36) !important;
  box-shadow: 0 12px 26px rgba(107,69,17,.12) !important;
}

.metric-icon,
.quick-icon,
.empty-icon,
.document-icon {
  background: linear-gradient(145deg,#fffaf0,#f5e7cc) !important;
  color: var(--jr-gold-3) !important;
  border: 1px solid rgba(183,122,16,.18) !important;
}

/* ===== BOTÕES ===== */
.button {
  border-radius: 12px !important;
  font-weight: 700 !important;
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease, background .15s ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button-primary {
  color: #fffdf7 !important;
  background: linear-gradient(180deg, #d9ad54 0%, #b77a10 58%, #965f08 100%) !important;
  border: 1px solid #a86b0a !important;
  box-shadow: 0 7px 16px rgba(143,89,7,.27), inset 0 1px 0 rgba(255,255,255,.42) !important;
  text-shadow: 0 1px 1px rgba(73,44,4,.18);
}

.button-primary:hover:not(:disabled) {
  filter: saturate(1.05) brightness(1.025);
  box-shadow: 0 9px 20px rgba(143,89,7,.32), inset 0 1px 0 rgba(255,255,255,.5) !important;
}

.button-soft,
.button-ghost {
  background: rgba(255,255,255,.78) !important;
  border-color: rgba(183,122,16,.24) !important;
  color: #77500d !important;
}

.button-soft:hover:not(:disabled),
.button-ghost:hover:not(:disabled) {
  background: #fff8ea !important;
  border-color: rgba(183,122,16,.42) !important;
}

.button-whatsapp {
  background: #eefaf3 !important;
  border-color: #9ed7b4 !important;
  color: #167245 !important;
}

.button-danger,
.patient-delete-button {
  background: #fff3f3 !important;
  color: #b52a3a !important;
  border-color: #efb9c0 !important;
}

.text-button {
  color: var(--jr-gold-3) !important;
}

/* ===== CAMPOS ===== */
input,
select,
textarea,
.search-field,
.input-combo,
.patient-selector-searchable {
  background-color: rgba(255,255,255,.86) !important;
  color: var(--jr-ink) !important;
  border-color: rgba(161,116,43,.24) !important;
}

input:focus,
select:focus,
textarea:focus,
.search-field:focus-within,
.patient-selector-searchable:focus-within {
  border-color: rgba(183,122,16,.62) !important;
  box-shadow: 0 0 0 3px rgba(183,122,16,.11) !important;
  outline: none !important;
}

input::placeholder,
textarea::placeholder {
  color: #a09488 !important;
}

.segmented {
  background: rgba(239,232,220,.72) !important;
  border-color: rgba(183,122,16,.12) !important;
}

.segmented button {
  color: #66594c !important;
}

.segmented button.active,
.segmented .active {
  background: rgba(255,255,255,.95) !important;
  color: #6f4808 !important;
  box-shadow: 0 4px 13px rgba(95,63,17,.09) !important;
}

/* ===== TABELAS / LISTAS ===== */
.data-table-wrap {
  border-color: var(--jr-border) !important;
  background: rgba(255,255,255,.65) !important;
}

.data-table thead,
.data-table th {
  background: rgba(249,242,230,.82) !important;
  color: #7c674f !important;
}

.data-table td,
.data-table th,
.appointment-row,
.activity-list > *,
.simple-list > *,
.timeline > * {
  border-color: rgba(165,119,48,.13) !important;
}

.data-table tbody tr:hover {
  background: rgba(255,248,235,.72) !important;
}

.record-count {
  color: #796c5f !important;
}

/* ===== AGENDA ===== */
.calendar-toolbar,
.week-calendar,
.month-calendar,
.mobile-appointment-list {
  background: rgba(255,255,255,.72) !important;
  border-color: var(--jr-border) !important;
}

.calendar-corner,
.calendar-day-head,
.calendar-hour,
.calendar-cell,
.month-head,
.month-day {
  border-color: rgba(158,117,52,.15) !important;
}

.calendar-day-head,
.month-head {
  background: rgba(251,246,237,.82) !important;
}

.calendar-day-head.today,
.month-day.today {
  background: rgba(255,246,229,.95) !important;
}

.calendar-event {
  box-shadow: 0 3px 8px rgba(75,54,28,.06) !important;
  border-radius: 10px !important;
}

.date-nav button,
.calendar-toolbar .icon-button {
  background: rgba(255,255,255,.78) !important;
  border-color: rgba(183,122,16,.22) !important;
  color: #684707 !important;
}

/* ===== INTERESSADOS / FUNIL ===== */
.funnel-summary > * {
  background: rgba(255,255,255,.75) !important;
  border-color: var(--jr-border) !important;
  box-shadow: var(--jr-shadow-soft) !important;
}

.lead-board {
  gap: 12px !important;
}

.lead-column {
  background: rgba(252,247,238,.58) !important;
  border-color: var(--jr-border) !important;
}

.lead-column > header {
  border-color: rgba(183,122,16,.16) !important;
}

.lead-avatar {
  background: #fff5df !important;
  color: #9a6208 !important;
}

/* ===== PACIENTES / DRAWER ===== */
.patient-drawer {
  border-left-color: rgba(183,122,16,.34) !important;
}

.drawer-header,
.drawer-tabs {
  background: rgba(255,252,245,.86) !important;
  border-color: rgba(183,122,16,.15) !important;
}

.drawer-tabs button.active {
  color: var(--jr-gold-3) !important;
  border-bottom-color: var(--jr-gold) !important;
}

.patient-record-number {
  color: var(--jr-gold-3) !important;
}

.patient-row-actions button,
.row-actions button {
  border-color: rgba(183,122,16,.20) !important;
}

/* ===== DOCUMENTOS / ASSINATURAS ===== */
.signature-pad,
.patient-selector,
.clinical-form,
.odontogram-panel {
  background: rgba(255,255,255,.77) !important;
}

.signature-pad canvas {
  background: rgba(255,255,255,.94) !important;
}

.document-icon {
  color: #b36812 !important;
}

/* ===== ODONTOGRAMA ===== */
.tooth-button {
  background: rgba(255,255,255,.62) !important;
  border-color: rgba(183,122,16,.14) !important;
}

.tooth-button:hover {
  background: #fffaf0 !important;
  border-color: rgba(183,122,16,.35) !important;
}

.odontogram-legend,
.odontogram-summary,
.face-diagram {
  background: rgba(255,255,255,.64) !important;
}

/* ===== MODAIS ===== */
.modal-backdrop,
.drawer-backdrop {
  background: rgba(41,32,24,.48) !important;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.modal {
  border-radius: 24px !important;
  overflow: hidden;
}

.modal-header,
.modal-footer {
  background: rgba(255,253,248,.93) !important;
  border-color: rgba(183,122,16,.15) !important;
}

.modal-body {
  background: linear-gradient(155deg, rgba(255,255,255,.91), rgba(252,247,238,.90)) !important;
}

.icon-button {
  border-color: rgba(183,122,16,.20) !important;
  color: #77634d !important;
}

/* ===== DASHBOARD ===== */
.dashboard-grid .metric-card,
.dashboard-lower .panel,
.dashboard-alerts-grid .panel {
  overflow: hidden;
}

.attention-number {
  color: #bb3347 !important;
}

.dashboard-alert-avatar {
  background: #fff3dc !important;
  color: #9b6309 !important;
}

.dashboard-alert-card.alert-danger .dashboard-alert-avatar,
.dashboard-alert-status.alert-danger {
  background: #fff0f1 !important;
  color: #bd3448 !important;
}

.dashboard-alert-card.alert-warning .dashboard-alert-avatar,
.dashboard-alert-status.alert-warning {
  background: #fff5de !important;
  color: #a66b09 !important;
}

/* ===== BADGES / STATUS ===== */
.badge {
  border: 1px solid rgba(0,0,0,.06) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45);
}

/* ===== LOGIN ===== */
.login-page {
  background:
    radial-gradient(circle at 20% 18%, rgba(205,164,90,.18), transparent 26%),
    linear-gradient(135deg, #fffdf8, #f6ead6) !important;
}

.login-hero {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(255,253,247,.98), rgba(246,235,216,.96)) !important;
  color: var(--jr-ink) !important;
  border-right: 1px solid rgba(183,122,16,.25) !important;
}

.login-hero::after {
  content: "";
  position: absolute;
  width: 520px;
  height: 180px;
  top: 8%;
  right: -180px;
  border: 2px solid rgba(183,122,16,.55);
  border-radius: 50%;
  transform: rotate(-13deg);
  pointer-events: none;
}

.login-brand,
.login-copy,
.login-features {
  position: relative;
  z-index: 1;
}

.login-jr-mark {
  background: linear-gradient(145deg,#fff,#f1dfb7) !important;
  color: var(--jr-gold-3) !important;
  border: 1px solid rgba(183,122,16,.35) !important;
  box-shadow: var(--jr-shadow) !important;
}

.login-card {
  border-radius: 24px !important;
}

.login-kicker {
  color: var(--jr-gold-3) !important;
}

.trusted-device-option,
.first-access {
  background: rgba(250,244,233,.70) !important;
  border-color: rgba(183,122,16,.17) !important;
}

/* ===== TOASTS: mantém avisos de erro visíveis ===== */
.toast {
  box-shadow: 0 13px 30px rgba(61,39,13,.18) !important;
  border-radius: 14px !important;
}

.toast:not(.error) {
  border-color: rgba(183,122,16,.22) !important;
}

/* ===== SCROLL ===== */
* {
  scrollbar-color: rgba(183,122,16,.35) rgba(242,233,220,.55);
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  background: rgba(242,233,220,.55);
}

*::-webkit-scrollbar-thumb {
  background: linear-gradient(#d7ab55,#a96f0c);
  border-radius: 999px;
  border: 2px solid rgba(255,255,255,.70);
}

/* ===== RESPONSIVO ===== */
@media (max-width: 1100px) {
  .workspace::after {
    width: 100vw;
  }

  .workspace::before {
    width: 82vw;
    right: -10%;
    opacity: .72;
  }
}

@media (max-width: 760px) {
  .sidebar {
    box-shadow: 12px 0 30px rgba(71,49,21,.18) !important;
  }

  .topbar {
    background: rgba(255,253,248,.96) !important;
  }

  .workspace::before {
    top: -110px;
    right: -42%;
    width: 120vw;
    opacity: .45;
  }

  .panel,
  .metric-card,
  .calendar-panel,
  .modal,
  .patient-drawer {
    border-radius: 15px !important;
  }

  .button {
    min-height: 44px;
  }
}

@media print {
  .workspace,
  .page-content,
  body {
    background: #fff !important;
    background-image: none !important;
  }

  .workspace::before,
  .workspace::after,
  .sidebar::after {
    display: none !important;
  }
}


/* ===== V134 SOURCE: v131-marmore-dourado-original.css ===== */
/*
 * Clínica Dra. Joalla Rocha — Tema Mármore & Dourado v131 ORIGINAL
 * Ajuste visual baseado diretamente na imagem de referência enviada pelo usuário.
 * Camada estritamente visual: não altera JavaScript, API, MySQL, PDFs, assinaturas ou regras do app.
 * Deve ser carregada por último, após v130-marmore-dourado.css.
 */

:root {
  --jr131-bg: #fbf7ef;
  --jr131-surface: rgba(255,253,248,.92);
  --jr131-surface-strong: rgba(255,254,251,.97);
  --jr131-ink: #211813;
  --jr131-muted: #6c6259;
  --jr131-gold: #bd7d0f;
  --jr131-gold-mid: #d7a94b;
  --jr131-gold-light: #f0d18a;
  --jr131-gold-deep: #8f5b08;
  --jr131-line: rgba(188,125,15,.28);
  --jr131-line-soft: rgba(188,125,15,.15);
  --jr131-shadow: 0 12px 24px rgba(87,58,18,.10), 0 2px 7px rgba(87,58,18,.05);
  --jr131-shadow-button: 0 8px 16px rgba(126,78,5,.29), inset 0 1px 0 rgba(255,255,255,.52);
  --jr131-radius: 16px;
  --jr131-marble: url('/assets/jr-marble-original.png');
}

html,
body,
#root,
.clinic-app {
  background: var(--jr131-bg) !important;
  color: var(--jr131-ink) !important;
}

body {
  background-image:
    linear-gradient(rgba(255,252,246,.78), rgba(255,252,246,.78)),
    var(--jr131-marble) !important;
  background-repeat: repeat, repeat !important;
  background-size: auto, 480px 380px !important;
}

/* Estrutura de mármore exatamente no espírito da referência */
.workspace {
  position: relative !important;
  isolation: isolate !important;
  background-image:
    linear-gradient(135deg, rgba(255,255,255,.46), rgba(250,245,236,.28)),
    var(--jr131-marble) !important;
  background-repeat: repeat, repeat !important;
  background-size: auto, 480px 380px !important;
  background-color: var(--jr131-bg) !important;
}

.workspace::before {
  content: "" !important;
  position: fixed !important;
  inset: 0 0 0 0 !important;
  width: auto !important;
  height: auto !important;
  border: 0 !important;
  border-radius: 0 !important;
  transform: none !important;
  box-shadow: none !important;
  background: url('/assets/jr-gold-ribbons.svg') center top / cover no-repeat !important;
  opacity: .96 !important;
  pointer-events: none !important;
  z-index: 0 !important;
}

.workspace::after {
  content: "" !important;
  position: fixed !important;
  inset: 0 !important;
  width: auto !important;
  background:
    radial-gradient(circle at 77% 18%, rgba(255,255,255,.44), transparent 33%),
    linear-gradient(110deg, transparent 0 36%, rgba(157,104,36,.026) 36.2%, transparent 36.6% 71%, rgba(196,145,64,.026) 71.2%, transparent 71.6%) !important;
  opacity: .75 !important;
  pointer-events: none !important;
  z-index: 0 !important;
}

.page-content,
.topbar,
.sidebar {
  position: relative !important;
  z-index: 1 !important;
}

/* Tipografia */
.module-header h1,
.module-header h2,
.panel-header h2,
.panel-header h3,
.topbar-title strong,
.login-card h1,
.drawer-header h2,
.modal-header h2,
.patient-identity h2,
.empty-state h2,
.metric-card strong,
.metric-card b {
  font-family: Georgia, "Times New Roman", serif !important;
  color: var(--jr131-ink) !important;
}

.module-header h1 { letter-spacing: -.032em !important; }
.eyebrow {
  color: #a96807 !important;
  letter-spacing: .17em !important;
  font-weight: 800 !important;
}

/* Sidebar clara em mármore, como a imagem original */
.sidebar {
  background-image:
    linear-gradient(rgba(255,253,248,.70), rgba(252,247,239,.77)),
    var(--jr131-marble) !important;
  background-repeat: repeat, repeat !important;
  background-size: auto, 390px 310px !important;
  background-color: #fbf6ec !important;
  color: var(--jr131-ink) !important;
  border-right: 1px solid rgba(177,111,7,.34) !important;
  box-shadow: 5px 0 18px rgba(93,62,21,.06) !important;
}
.sidebar::after { display: none !important; }

.brand {
  border-bottom: 1px solid rgba(188,125,15,.14) !important;
}
.brand-symbol {
  background-image: url('/assets/jr-logo-original.png') !important;
  background-size: cover !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  background-color: #fffaf0 !important;
  border: 1px solid rgba(188,125,15,.28) !important;
  color: transparent !important;
  box-shadow: 0 8px 17px rgba(121,76,8,.13) !important;
}
.brand-symbol::before { content: "" !important; }
.brand strong,
.sidebar-profile strong { color: #302219 !important; }
.brand small,
.sidebar-profile small { color: #8a6b3e !important; }

.sidebar-nav button,
.sidebar-footer > button {
  color: #4a3828 !important;
  border-radius: 13px !important;
  border: 1px solid transparent !important;
}
.sidebar-nav button svg,
.sidebar-footer > button svg {
  color: var(--jr131-gold) !important;
  stroke: currentColor !important;
}
.sidebar-nav button:hover,
.sidebar-footer > button:hover {
  background: rgba(255,255,255,.57) !important;
  border-color: rgba(188,125,15,.16) !important;
}
.sidebar-nav button.active {
  background: rgba(255,255,255,.79) !important;
  color: #744706 !important;
  border: 1px solid rgba(190,126,16,.52) !important;
  box-shadow: 0 7px 18px rgba(98,61,10,.10), inset 3px 0 0 #c38210 !important;
}
.sidebar-profile {
  background: rgba(255,255,255,.51) !important;
  border: 1px solid rgba(188,125,15,.18) !important;
  border-radius: 14px !important;
}

/* Topbar */
.topbar {
  background-image:
    linear-gradient(rgba(255,253,248,.87), rgba(255,253,248,.87)),
    var(--jr131-marble) !important;
  background-repeat: repeat, repeat !important;
  background-size: auto, 480px 380px !important;
  border-bottom: 1px solid rgba(188,125,15,.16) !important;
  box-shadow: 0 3px 12px rgba(90,56,10,.035) !important;
  backdrop-filter: blur(9px) !important;
  -webkit-backdrop-filter: blur(9px) !important;
}
.topbar-actions .icon-button,
.profile-pill {
  background: rgba(255,255,255,.69) !important;
  border: 1px solid rgba(188,125,15,.23) !important;
  color: #4d3928 !important;
  box-shadow: 0 3px 10px rgba(91,58,13,.045) !important;
}

/* Superfícies e cartões */
.panel,
.metric-card,
.quick-action-grid > *,
.lead-card,
.budget-cards article,
.settings-card,
.clinical-section,
.patient-form-card,
.dashboard-alert-card,
.patient-drawer,
.modal,
.calendar-panel,
.login-card,
.signature-pad,
.patient-selector,
.odontogram-panel,
.face-diagram,
.odontogram-summary,
.document-card,
.data-table-wrap {
  background: linear-gradient(145deg, rgba(255,255,255,.91), rgba(252,248,241,.90)) !important;
  border-color: rgba(188,125,15,.20) !important;
  box-shadow: var(--jr131-shadow) !important;
}

.panel,
.metric-card,
.settings-card,
.dashboard-alert-card,
.calendar-panel,
.patient-selector,
.signature-pad,
.odontogram-panel,
.document-card {
  border-radius: var(--jr131-radius) !important;
}

.panel-header,
.drawer-header,
.drawer-tabs,
.modal-header,
.modal-footer {
  border-color: rgba(188,125,15,.14) !important;
}

.metric-icon,
.quick-icon,
.empty-icon,
.document-icon {
  background: linear-gradient(145deg, #fffdfa, #f4e7cb) !important;
  color: #ad6b08 !important;
  border: 1px solid rgba(188,125,15,.20) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.85) !important;
}

/* Botão dourado da referência */
.button-primary {
  background: linear-gradient(180deg, #e2bd66 0%, #bd7b0d 57%, #956008 100%) !important;
  border: 1px solid #9e6507 !important;
  color: #fffdf7 !important;
  box-shadow: var(--jr131-shadow-button) !important;
  text-shadow: 0 1px 1px rgba(76,42,0,.20) !important;
}
.button-primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #e8c873 0%, #c58713 57%, #9a6308 100%) !important;
  box-shadow: 0 10px 20px rgba(126,78,5,.32), inset 0 1px 0 rgba(255,255,255,.58) !important;
}
.button-soft,
.button-ghost {
  background: rgba(255,255,255,.73) !important;
  border-color: rgba(188,125,15,.23) !important;
  color: #744b0c !important;
}
.text-button { color: #9b6008 !important; }

/* Campos */
input,
select,
textarea,
.search-field,
.input-combo,
.patient-selector-searchable {
  background: rgba(255,255,255,.83) !important;
  border-color: rgba(159,105,25,.25) !important;
  color: var(--jr131-ink) !important;
}
input:focus,
select:focus,
textarea:focus,
.search-field:focus-within,
.patient-selector-searchable:focus-within {
  border-color: rgba(190,126,16,.62) !important;
  box-shadow: 0 0 0 3px rgba(190,126,16,.10) !important;
}

/* Agenda e tabelas */
.calendar-toolbar,
.week-calendar,
.month-calendar,
.mobile-appointment-list,
.data-table-wrap {
  background: rgba(255,255,255,.66) !important;
  border-color: rgba(188,125,15,.18) !important;
}
.calendar-corner,
.calendar-day-head,
.calendar-hour,
.calendar-cell,
.month-head,
.month-day,
.data-table td,
.data-table th,
.appointment-row,
.activity-list > *,
.simple-list > *,
.timeline > * {
  border-color: rgba(151,104,40,.14) !important;
}
.calendar-day-head,
.month-head,
.data-table thead,
.data-table th {
  background: rgba(250,246,238,.78) !important;
}
.calendar-event {
  border-radius: 8px !important;
  box-shadow: 0 3px 8px rgba(83,55,21,.055) !important;
}

/* Interessados */
.funnel-summary > * {
  background: rgba(255,255,255,.70) !important;
  border-color: rgba(188,125,15,.19) !important;
  box-shadow: 0 7px 17px rgba(90,58,18,.07) !important;
}
.lead-column {
  background: rgba(252,248,241,.58) !important;
  border-color: rgba(188,125,15,.18) !important;
}
.lead-avatar { background: #fff4db !important; color: #9e6208 !important; }

/* Pacientes / documentos / odontograma */
.patient-drawer {
  border-left: 1px solid rgba(188,125,15,.30) !important;
}
.drawer-tabs button.active {
  color: #985d08 !important;
  border-bottom-color: #c38010 !important;
}
.patient-record-number { color: #9b5f08 !important; }
.signature-pad canvas { background: rgba(255,255,255,.95) !important; }
.tooth-button {
  background: rgba(255,255,255,.65) !important;
  border-color: rgba(188,125,15,.15) !important;
}
.tooth-button:hover {
  background: #fff9ed !important;
  border-color: rgba(188,125,15,.35) !important;
}

/* Modais */
.modal-backdrop,
.drawer-backdrop {
  background: rgba(39,31,24,.43) !important;
  backdrop-filter: blur(2px) !important;
  -webkit-backdrop-filter: blur(2px) !important;
}
.modal { border-radius: 22px !important; }
.modal-header,
.modal-footer {
  background: rgba(255,253,248,.94) !important;
}
.modal-body {
  background-image:
    linear-gradient(rgba(255,253,248,.84), rgba(255,253,248,.84)),
    var(--jr131-marble) !important;
  background-size: auto, 480px 380px !important;
}

/* Login */
.login-page,
.login-hero {
  background-image:
    linear-gradient(rgba(255,252,246,.68), rgba(249,242,230,.73)),
    var(--jr131-marble) !important;
  background-size: auto, 480px 380px !important;
  color: var(--jr131-ink) !important;
}
.login-hero::after {
  background: url('/assets/jr-gold-ribbons.svg') 55% top / 1150px auto no-repeat !important;
  border: 0 !important;
  width: 100% !important;
  height: 100% !important;
  inset: 0 !important;
  transform: none !important;
  opacity: .75 !important;
}

/* Preserve avisos funcionais, mas harmoniza sem esconder estados */
.toast {
  border-radius: 13px !important;
  box-shadow: 0 12px 28px rgba(64,42,14,.17) !important;
}

/* Rolagem */
* { scrollbar-color: rgba(188,125,15,.36) rgba(245,237,225,.58); }
*::-webkit-scrollbar-track { background: rgba(245,237,225,.58) !important; }
*::-webkit-scrollbar-thumb {
  background: linear-gradient(#dfb65d,#ad6f0a) !important;
  border-radius: 999px !important;
  border: 2px solid rgba(255,255,255,.74) !important;
}

@media (max-width: 1100px) {
  .workspace::before { background-size: 1500px auto !important; background-position: 45% top !important; }
}

@media (max-width: 760px) {
  .workspace::before {
    opacity: .52 !important;
    background-size: 1220px auto !important;
    background-position: 48% top !important;
  }
  .sidebar { background-size: auto, 360px 285px !important; }
  .topbar { background-size: auto, 400px 317px !important; }
  .panel,
  .metric-card,
  .calendar-panel,
  .modal,
  .patient-drawer { border-radius: 14px !important; }
}

@media print {
  body,
  .workspace,
  .page-content {
    background: #fff !important;
    background-image: none !important;
  }
  .workspace::before,
  .workspace::after { display: none !important; }
}


/* ===== V134 SOURCE: v132-correcoes-layout-modal.css ===== */
/*
 * Clínica Dra. Joalla Rocha — v132
 * Correções de layout do tema Mármore Dourado v131.
 * Mantém integralmente cores, texturas e funções; corrige apenas posicionamento.
 */

:root {
  --jr132-sidebar-width: 252px;
}

/*
 * v131 aplicava position:relative à barra lateral e ao topo para controlar
 * a camada decorativa. Isso anulava o comportamento sticky/fixed original.
 * Restauramos o comportamento estrutural do aplicativo.
 */
.sidebar {
  position: sticky !important;
  top: 0 !important;
  z-index: 50 !important;
  height: 100vh !important;
}

.topbar {
  position: sticky !important;
  top: 0 !important;
  z-index: 30 !important;
}

.page-content {
  position: relative !important;
  z-index: 1 !important;
}

/*
 * Modais pertencem à área principal do aplicativo. Em desktop, a camada
 * começa após a sidebar para que o formulário inteiro fique visível e
 * nenhuma parte do título/campos fique escondida atrás do menu lateral.
 */
.modal-backdrop {
  left: var(--jr132-sidebar-width) !important;
  right: 0 !important;
  width: auto !important;
  padding: 20px 22px !important;
  z-index: 100 !important;
  overflow: hidden !important;
}

.modal {
  width: 100% !important;
  max-width: min(760px, calc(100vw - var(--jr132-sidebar-width) - 44px)) !important;
  max-height: calc(100vh - 40px) !important;
  margin: 0 auto !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
}

.modal.modal-wide,
.modal-wide {
  max-width: min(1110px, calc(100vw - var(--jr132-sidebar-width) - 44px)) !important;
}

.modal-header,
.modal-body,
.modal-footer {
  width: 100% !important;
  max-width: 100% !important;
}

.modal-header {
  padding-left: 22px !important;
  padding-right: 22px !important;
}

.modal-body {
  padding-left: 22px !important;
  padding-right: 22px !important;
  overflow-x: hidden !important;
}

.modal-footer {
  padding-left: 22px !important;
  padding-right: 22px !important;
}

/* Evita que grids/formulários forcem largura além do modal. */
.modal .form-grid,
.modal .field,
.modal input,
.modal select,
.modal textarea,
.modal .segmented,
.modal .segmented-full {
  min-width: 0 !important;
  max-width: 100% !important;
}

/* Mantém o drawer na área útil sem prejudicar a sidebar. */
.drawer-backdrop {
  z-index: 90 !important;
}

/* Tablet / menu lateral recolhível. */
@media (max-width: 900px) {
  .sidebar {
    position: fixed !important;
    top: 0 !important;
    left: -280px !important;
    z-index: 50 !important;
    width: 252px !important;
    height: 100vh !important;
  }

  .sidebar.sidebar-open,
  .sidebar-open {
    left: 0 !important;
  }

  .modal-backdrop {
    left: 0 !important;
    right: 0 !important;
    width: auto !important;
  }

  .modal,
  .modal.modal-wide,
  .modal-wide {
    max-width: min(1110px, calc(100vw - 40px)) !important;
  }
}

/* Celular: mantém o comportamento original de modal tipo folha inferior. */
@media (max-width: 680px) {
  .modal-backdrop {
    left: 0 !important;
    padding: 0 !important;
    align-items: flex-end !important;
    overflow: hidden !important;
  }

  .modal,
  .modal.modal-wide,
  .modal-wide {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 94vh !important;
    margin: 0 !important;
    border-radius: 18px 18px 0 0 !important;
  }

  .modal-header,
  .modal-body,
  .modal-footer {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
}


/* ===== V134 SOURCE: v133-apple-professional.css ===== */
/*
 * Clínica Dra. Joalla Rocha — v133 Apple Professional
 * Camada de acabamento UX/UI inspirada nos princípios atuais do Apple HIG:
 * clareza, hierarquia, legibilidade, áreas de toque confortáveis, foco visível,
 * responsividade, redução de movimento e bom comportamento em Safari/iPhone/iPad/macOS.
 *
 * IMPORTANTE: camada visual/comportamental de interface. Não altera API, MySQL,
 * regras de pacientes, agenda, PDFs, assinaturas, financeiro ou permissões.
 * Carregar DEPOIS de v132-correcoes-layout-modal.css.
 */

:root {
  color-scheme: light;

  /* Identidade original preservada */
  --jr-pro-bg: #fbf7ef;
  --jr-pro-surface: rgba(255, 254, 250, .92);
  --jr-pro-surface-solid: #fffdf9;
  --jr-pro-ink: #211813;
  --jr-pro-ink-2: #493c31;
  --jr-pro-muted: #6b5f54;
  --jr-pro-gold: #b8780b;
  --jr-pro-gold-2: #d7aa4c;
  --jr-pro-gold-3: #8d5805;
  --jr-pro-line: rgba(173, 112, 16, .25);
  --jr-pro-line-strong: rgba(164, 102, 8, .42);
  --jr-pro-danger: #b42335;
  --jr-pro-success: #137a53;
  --jr-pro-warning: #9c6105;
  --jr-pro-info: #2768b1;

  /* Ritmo de interface */
  --jr-pro-radius-xs: 9px;
  --jr-pro-radius-sm: 12px;
  --jr-pro-radius-md: 16px;
  --jr-pro-radius-lg: 22px;
  --jr-pro-control-h: 44px;
  --jr-pro-control-h-compact: 36px;
  --jr-pro-page-gap: clamp(14px, 1.5vw, 24px);
  --jr-pro-section-gap: clamp(12px, 1.25vw, 20px);

  /* Profundidade discreta: superfície nítida, sem excesso de blur */
  --jr-pro-shadow-1: 0 1px 2px rgba(58, 39, 14, .05), 0 7px 18px rgba(58, 39, 14, .07);
  --jr-pro-shadow-2: 0 2px 6px rgba(58, 39, 14, .07), 0 18px 42px rgba(58, 39, 14, .12);
  --jr-pro-shadow-button: 0 1px 1px rgba(255,255,255,.5) inset, 0 8px 18px rgba(130, 78, 4, .23);
  --jr-pro-focus: 0 0 0 3px rgba(183, 120, 11, .18), 0 0 0 1px rgba(137, 85, 4, .68);

  --jr-pro-font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Helvetica, Arial, sans-serif;
  --jr-pro-font-display: ui-serif, "New York", Georgia, "Times New Roman", serif;
  --jr-pro-ease: cubic-bezier(.2, .75, .25, 1);
  --jr-pro-speed: 160ms;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  background: var(--jr-pro-bg);
}

body,
button,
input,
select,
textarea {
  font-family: var(--jr-pro-font) !important;
  font-feature-settings: "kern" 1, "liga" 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
}

.clinic-app,
.workspace {
  min-height: 100vh;
  min-height: 100dvh;
}

::selection {
  background: rgba(215, 170, 76, .30);
  color: var(--jr-pro-ink);
}

/* Títulos mantêm a personalidade clássica da marca; corpo usa fonte do sistema Apple. */
.module-header h1,
.module-header h2,
.panel-header h2,
.panel-header h3,
.topbar-title strong,
.login-card h1,
.drawer-header h2,
.modal-header h2,
.patient-identity h2,
.empty-state h2,
.metric-card strong,
.metric-card b,
.patient-form-section-title,
.settings-section-title {
  font-family: var(--jr-pro-font-display) !important;
  text-wrap: balance;
}

.module-header h1 {
  font-size: clamp(30px, 3.1vw, 48px) !important;
  line-height: 1.04 !important;
  letter-spacing: -.035em !important;
}

.module-header p,
.panel-header p,
.empty-state p,
.login-copy,
.patient-form-message {
  line-height: 1.5 !important;
}

.eyebrow {
  font-size: 12px !important;
  line-height: 1.25 !important;
  letter-spacing: .16em !important;
}

small,
.record-count,
.field label,
label {
  line-height: 1.35;
}

/* ========== INTERAÇÃO E ACESSIBILIDADE ========== */
a,
button,
[role="button"],
input,
select,
textarea,
summary {
  -webkit-tap-highlight-color: rgba(184, 120, 11, .12);
}

button,
[role="button"],
a,
select,
input[type="checkbox"],
input[type="radio"] {
  touch-action: manipulation;
}

button,
.button,
.icon-button,
.text-button,
.sidebar-nav button,
.drawer-tabs button,
.segmented button,
.segmented-full button {
  transition:
    background-color var(--jr-pro-speed) var(--jr-pro-ease),
    border-color var(--jr-pro-speed) var(--jr-pro-ease),
    color var(--jr-pro-speed) var(--jr-pro-ease),
    box-shadow var(--jr-pro-speed) var(--jr-pro-ease),
    transform var(--jr-pro-speed) var(--jr-pro-ease),
    opacity var(--jr-pro-speed) var(--jr-pro-ease) !important;
}

:where(button, a, input, select, textarea, [role="button"], [tabindex]):focus-visible {
  outline: 2px solid rgba(142, 87, 5, .95) !important;
  outline-offset: 2px !important;
  box-shadow: var(--jr-pro-focus) !important;
}

:where(button, input, select, textarea):disabled,
.button:disabled,
[aria-disabled="true"] {
  opacity: .52 !important;
  cursor: not-allowed !important;
  filter: saturate(.68) !important;
}

/* Feedback físico discreto apenas para mouse/trackpad. */
@media (hover: hover) and (pointer: fine) {
  .button-primary:hover:not(:disabled),
  .button-secondary:hover:not(:disabled),
  .button-soft:hover:not(:disabled),
  .button-ghost:hover:not(:disabled),
  .icon-button:hover:not(:disabled),
  .quick-action-grid > *:hover,
  .metric-card:hover {
    transform: translateY(-1px);
  }

  .button-primary:active:not(:disabled),
  .button-secondary:active:not(:disabled),
  .button-soft:active:not(:disabled),
  .button-ghost:active:not(:disabled),
  .icon-button:active:not(:disabled) {
    transform: translateY(0) scale(.985);
  }
}

/* ========== CONTROLES ========== */
.button,
button.button,
.button-primary,
.button-secondary,
.button-soft,
.button-ghost,
.button-danger,
.button-whatsapp,
.signature-save-button,
.contract-upload-button,
.patient-form-submit {
  min-height: var(--jr-pro-control-h) !important;
  border-radius: 12px !important;
  padding-inline: 16px !important;
  font-size: 14px !important;
  font-weight: 650 !important;
  letter-spacing: -.006em;
  white-space: nowrap;
}

.button-small {
  min-height: var(--jr-pro-control-h-compact) !important;
  padding-inline: 12px !important;
  border-radius: 10px !important;
}

.icon-button {
  width: var(--jr-pro-control-h) !important;
  min-width: var(--jr-pro-control-h) !important;
  height: var(--jr-pro-control-h) !important;
  min-height: var(--jr-pro-control-h) !important;
  border-radius: 12px !important;
  display: inline-grid !important;
  place-items: center !important;
}

.button-primary {
  box-shadow: var(--jr-pro-shadow-button) !important;
}

.button-danger,
.patient-delete-button,
.user-delete-button,
.document-delete-button {
  color: var(--jr-pro-danger) !important;
  border-color: rgba(180, 35, 53, .28) !important;
  background: rgba(255, 246, 247, .92) !important;
}

.button-danger:hover:not(:disabled),
.patient-delete-button:hover:not(:disabled),
.user-delete-button:hover:not(:disabled),
.document-delete-button:hover:not(:disabled) {
  background: #fff0f2 !important;
  border-color: rgba(180, 35, 53, .45) !important;
}

input,
select,
textarea,
.search-field,
.input-combo,
.patient-selector-searchable {
  min-height: var(--jr-pro-control-h) !important;
  border-radius: 11px !important;
  font-size: 15px !important;
  line-height: 1.35 !important;
  box-shadow: inset 0 1px 1px rgba(82, 54, 16, .025) !important;
  transition: border-color var(--jr-pro-speed) ease, box-shadow var(--jr-pro-speed) ease, background-color var(--jr-pro-speed) ease !important;
}

textarea {
  min-height: 108px !important;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: #91867c !important;
  opacity: 1;
}

input:focus,
select:focus,
textarea:focus,
.search-field:focus-within,
.patient-selector-searchable:focus-within,
.input-combo:focus-within {
  background: rgba(255, 255, 255, .96) !important;
  border-color: var(--jr-pro-line-strong) !important;
  box-shadow: var(--jr-pro-focus) !important;
  outline: none !important;
}

.field {
  gap: 7px !important;
}

.field > label,
.field label {
  color: #504338 !important;
  font-size: 13px !important;
  font-weight: 650 !important;
}

.form-grid {
  gap: 16px !important;
}

.form-error,
.contact-match-error {
  color: #9d2634 !important;
  line-height: 1.4 !important;
}

.form-success-mark,
.form-error-mark {
  min-width: 44px;
  min-height: 44px;
}

/* ========== NAVEGAÇÃO ========== */
.sidebar {
  min-width: var(--jr132-sidebar-width, 252px);
  overflow: hidden auto !important;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.brand {
  padding-block: 18px !important;
}

.brand-symbol {
  flex: 0 0 auto;
}

.sidebar-nav {
  padding-block: 10px !important;
  gap: 5px !important;
}

.sidebar-nav button,
.sidebar-footer > button {
  min-height: 44px !important;
  padding-block: 9px !important;
  padding-inline: 14px !important;
  font-size: 14px !important;
  font-weight: 620 !important;
}

.sidebar-nav button.active {
  font-weight: 720 !important;
}

.sidebar-footer {
  padding-bottom: max(14px, env(safe-area-inset-bottom)) !important;
}

.sidebar-profile {
  min-height: 58px;
}

.topbar {
  min-height: 72px !important;
  padding-top: max(0px, env(safe-area-inset-top));
}

.topbar-title strong {
  font-size: 20px !important;
  line-height: 1.1 !important;
}

.topbar-title small {
  margin-top: 3px;
  font-size: 12px !important;
}

.profile-pill {
  min-height: 44px !important;
  border-radius: 14px !important;
}

/* ========== LAYOUT, CARTÕES E HIERARQUIA ========== */
.page-content {
  padding: var(--jr-pro-page-gap) !important;
}

.page-stack {
  gap: var(--jr-pro-section-gap) !important;
}

.module-header {
  gap: 14px !important;
  margin-bottom: 2px;
}

.module-actions {
  gap: 10px !important;
  flex-wrap: wrap;
}

.panel,
.metric-card,
.settings-card,
.dashboard-alert-card,
.calendar-panel,
.patient-selector,
.signature-pad,
.odontogram-panel,
.document-card,
.data-table-wrap,
.lead-card,
.patient-form-card,
.quick-action-grid > * {
  border-width: 1px !important;
  border-style: solid !important;
  box-shadow: var(--jr-pro-shadow-1) !important;
}

.panel:hover,
.metric-card:hover,
.document-card:hover,
.lead-card:hover {
  border-color: rgba(173, 112, 16, .30) !important;
}

.panel-header {
  padding: 16px 18px !important;
}

.panel-header h2,
.panel-header h3 {
  line-height: 1.18 !important;
}

.metrics-grid,
.metrics-three,
.mini-metrics,
.quick-action-grid,
.dashboard-grid,
.dashboard-lower,
.reports-grid,
.settings-grid,
.permission-grid,
.team-grid,
.info-grid,
.check-grid {
  gap: 14px !important;
}

.metric-card {
  min-height: 112px;
  padding: 16px !important;
}

.metric-card strong,
.metric-card b {
  line-height: 1.05 !important;
}

.metric-icon,
.quick-icon,
.empty-icon,
.document-icon {
  border-radius: 13px !important;
}

.quick-action-grid > * {
  min-height: 92px;
  border-radius: 14px !important;
}

/* ========== TABELAS E LISTAS ========== */
.data-table-wrap,
.dashboard-alert-modal-table-wrap {
  overflow: auto !important;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-gutter: stable both-edges;
}

.data-table {
  border-collapse: separate !important;
  border-spacing: 0 !important;
  width: 100% !important;
}

.data-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  font-size: 12px !important;
  letter-spacing: .015em;
  color: #67584b !important;
}

.data-table th,
.data-table td {
  padding-block: 13px !important;
  vertical-align: middle !important;
}

.data-table tbody tr {
  transition: background-color var(--jr-pro-speed) ease;
}

@media (hover: hover) and (pointer: fine) {
  .data-table tbody tr:hover {
    background: rgba(255, 250, 240, .72) !important;
  }
}

.row-actions,
.patient-row-actions,
.lead-card-actions,
.signature-actions,
.drawer-actions,
.settings-actions,
.finance-toolbar,
.clinical-toolbar {
  gap: 8px !important;
}

.simple-list > *,
.activity-list > *,
.appointment-row,
.timeline > * {
  min-height: 48px;
}

/* ========== AGENDA ========== */
.calendar-toolbar {
  padding: 12px !important;
  gap: 10px !important;
  border-radius: 15px 15px 0 0 !important;
}

.calendar-panel,
.week-calendar,
.month-calendar {
  overflow: hidden;
}

.calendar-cell,
.calendar-hour,
.calendar-corner,
.calendar-day-head,
.month-day,
.month-head {
  min-width: 0;
}

.calendar-event {
  min-height: 38px;
  padding: 6px 8px !important;
  line-height: 1.25 !important;
  cursor: pointer;
}

.date-nav button,
.segmented button,
.segmented-full button,
.mobile-agenda-views button {
  min-height: 38px !important;
  border-radius: 10px !important;
}

.segmented,
.segmented-full,
.mobile-agenda-views {
  border-radius: 12px !important;
  padding: 3px !important;
}

/* ========== PACIENTES / DRAWER ========== */
.drawer-backdrop,
.modal-backdrop {
  backdrop-filter: blur(5px) saturate(.92) !important;
  -webkit-backdrop-filter: blur(5px) saturate(.92) !important;
}

.patient-drawer {
  width: min(960px, 74vw) !important;
  max-width: calc(100vw - var(--jr132-sidebar-width, 252px) - 18px) !important;
  height: 100dvh !important;
  border-radius: 22px 0 0 22px !important;
  box-shadow: -14px 0 42px rgba(45, 31, 15, .17) !important;
  overflow: hidden !important;
}

.drawer-header {
  padding: 18px 20px !important;
}

.drawer-tabs {
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.drawer-tabs::-webkit-scrollbar { display: none !important; }

.drawer-tabs button {
  min-height: 42px !important;
  padding-inline: 12px !important;
  white-space: nowrap;
}

.drawer-body {
  overflow: auto !important;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.patient-identity {
  min-width: 0;
}
.patient-identity h2 {
  overflow-wrap: anywhere;
}

/* ========== MODAIS ========== */
.modal-backdrop {
  padding-top: max(20px, env(safe-area-inset-top)) !important;
  padding-bottom: max(20px, env(safe-area-inset-bottom)) !important;
}

.modal {
  max-height: calc(100dvh - 40px) !important;
  border-radius: var(--jr-pro-radius-lg) !important;
  box-shadow: var(--jr-pro-shadow-2) !important;
  overscroll-behavior: contain;
}

.modal-header {
  position: sticky !important;
  top: 0 !important;
  z-index: 4 !important;
  min-height: 72px;
  backdrop-filter: blur(14px) saturate(1.08) !important;
  -webkit-backdrop-filter: blur(14px) saturate(1.08) !important;
}

.modal-header h2 {
  font-size: clamp(22px, 2.2vw, 28px) !important;
  line-height: 1.1 !important;
}

.modal-body {
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.modal-footer,
.form-footer,
.user-modal-footer {
  position: sticky !important;
  bottom: 0 !important;
  z-index: 4 !important;
  min-height: 72px;
  gap: 10px !important;
  padding-bottom: max(14px, env(safe-area-inset-bottom)) !important;
  backdrop-filter: blur(14px) saturate(1.08) !important;
  -webkit-backdrop-filter: blur(14px) saturate(1.08) !important;
}

.modal-footer .button-primary,
.form-footer .button-primary,
.patient-form-submit {
  min-width: 152px;
}

/* ========== DOCUMENTOS / ASSINATURA ========== */
.document-grid {
  gap: 14px !important;
}

.document-card {
  min-width: 0;
  border-radius: 15px !important;
}

.document-content {
  min-width: 0;
}

.document-content strong,
.document-content span {
  overflow-wrap: anywhere;
}

.global-signature-panel,
.signature-link-panel,
.signature-vault-page,
.signature-vault-card-actions,
.signature-vault-capture,
.signature-vault-list {
  border-radius: 16px !important;
}

.signature-pad,
.signature-vault-pad {
  overflow: hidden;
}

.signature-pad canvas,
.signature-vault-pad canvas {
  touch-action: none;
}

/* ========== INTERESSADOS / CRM ========== */
.lead-board {
  gap: 12px !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-inline: contain;
  scroll-snap-type: x proximity;
  padding-bottom: 8px;
}

.lead-column {
  min-width: min(320px, 86vw) !important;
  border-radius: 16px !important;
  scroll-snap-align: start;
}

.lead-card {
  border-radius: 13px !important;
}

.lead-card-main {
  min-width: 0;
}

/* ========== ODONTOGRAMA ========== */
.odontogram-panel,
.face-diagram,
.odontogram-summary,
.tooth-editor {
  border-radius: 16px !important;
}

.tooth-arches {
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-inline: contain;
  padding-bottom: 6px;
}

.tooth-row {
  min-width: 720px;
}

.tooth-shape,
.tooth-button {
  touch-action: manipulation;
}

/* ========== CONFIGURAÇÕES / EQUIPE / FINANCEIRO / RELATÓRIOS ========== */
.settings-card,
.clinical-section,
.permission-grid > *,
.team-grid > *,
.reports-grid > *,
.cash-summary,
.chart-panel,
.budget-builder,
.budget-card-body,
.budget-summary {
  border-radius: 16px !important;
}

.settings-side {
  position: sticky;
  top: 88px;
  align-self: start;
}

.permission-list,
.security-notes {
  line-height: 1.5;
}

/* ========== LOGIN / PÁGINAS PÚBLICAS ========== */
.login-page,
.public-booking-page,
.patient-form-page {
  min-height: 100vh !important;
  min-height: 100dvh !important;
}

.login-card,
.public-booking-card,
.patient-form-card {
  border-radius: 24px !important;
  box-shadow: var(--jr-pro-shadow-2) !important;
}

.login-card {
  width: min(460px, calc(100vw - 32px)) !important;
}

.login-card input,
.login-card select,
.login-card .button,
.public-booking-card input,
.public-booking-card select,
.public-booking-card textarea,
.patient-form-card input,
.patient-form-card select,
.patient-form-card textarea {
  min-height: 48px !important;
}

.public-booking-shell,
.patient-form-shell {
  width: min(1280px, calc(100% - 32px)) !important;
  margin-inline: auto !important;
}

/* ========== STATUS / AVISOS ========== */
.toast,
.booking-notice,
.patient-confirmation,
.contact-match,
.security-notes,
.legal-note,
.public-secure {
  border-radius: 13px !important;
  line-height: 1.42 !important;
}

.toast {
  max-width: min(480px, calc(100vw - 32px)) !important;
  padding: 14px 16px !important;
  box-shadow: var(--jr-pro-shadow-2) !important;
}

/* Estados continuam distinguíveis por texto/borda, não apenas pela cor. */
.green { color: var(--jr-pro-success) !important; }
.orange { color: var(--jr-pro-warning) !important; }
.blue { color: var(--jr-pro-info) !important; }

/* ========== RESPONSIVIDADE ========== */
@media (max-width: 1180px) {
  .page-content {
    padding: 16px !important;
  }

  .patient-drawer {
    width: min(900px, 82vw) !important;
  }

  .metrics-grid,
  .dashboard-grid,
  .reports-grid {
    gap: 12px !important;
  }

  .settings-grid {
    grid-template-columns: 1fr !important;
  }

  .settings-side {
    position: static;
  }
}

@media (max-width: 900px) {
  :root {
    --jr-pro-page-gap: 14px;
  }

  .topbar {
    min-height: 64px !important;
    padding-left: 14px !important;
    padding-right: 14px !important;
  }

  .patient-drawer {
    width: min(760px, 92vw) !important;
    max-width: 92vw !important;
  }

  .modal-backdrop {
    padding: 14px !important;
    padding-top: max(14px, env(safe-area-inset-top)) !important;
    padding-bottom: max(14px, env(safe-area-inset-bottom)) !important;
  }

  .modal,
  .modal.modal-wide,
  .modal-wide {
    max-width: calc(100vw - 28px) !important;
    max-height: calc(100dvh - 28px) !important;
  }
}

@media (max-width: 760px) {
  body {
    font-size: 15px !important;
  }

  .page-content {
    padding: 12px !important;
    padding-bottom: max(16px, env(safe-area-inset-bottom)) !important;
  }

  .module-header {
    align-items: stretch !important;
    gap: 12px !important;
  }

  .module-header h1 {
    font-size: clamp(28px, 9vw, 38px) !important;
  }

  .module-actions {
    width: 100%;
  }

  .module-actions > .button-primary,
  .module-actions > button.button-primary {
    width: 100%;
  }

  /* iOS Safari: 16px evita zoom automático ao focar campos. */
  input,
  select,
  textarea,
  .search-field,
  .input-combo,
  .patient-selector-searchable {
    font-size: 16px !important;
    min-height: 46px !important;
  }

  .button,
  button.button,
  .button-primary,
  .button-secondary,
  .button-soft,
  .button-ghost,
  .button-danger,
  .button-whatsapp,
  .icon-button {
    min-height: 44px !important;
  }

  .metrics-grid,
  .metrics-three,
  .mini-metrics,
  .dashboard-grid,
  .dashboard-lower,
  .reports-grid,
  .quick-action-grid,
  .info-grid,
  .check-grid,
  .permission-grid,
  .team-grid {
    grid-template-columns: 1fr !important;
  }

  .metric-card {
    min-height: 96px;
  }

  .patient-drawer {
    width: 100vw !important;
    max-width: 100vw !important;
    border-radius: 0 !important;
  }

  .drawer-header {
    padding-top: max(14px, env(safe-area-inset-top)) !important;
  }

  .modal-backdrop {
    padding: 0 !important;
    align-items: flex-end !important;
  }

  .modal,
  .modal.modal-wide,
  .modal-wide {
    max-height: 96dvh !important;
    min-height: 0 !important;
    border-radius: 22px 22px 0 0 !important;
    box-shadow: 0 -10px 40px rgba(43, 29, 13, .17) !important;
  }

  .modal-header {
    min-height: 66px;
    padding-top: 14px !important;
  }

  .modal-body {
    padding-top: 14px !important;
    padding-bottom: 14px !important;
  }

  .modal-footer,
  .form-footer,
  .user-modal-footer {
    min-height: 72px;
    padding-top: 10px !important;
    padding-bottom: max(10px, env(safe-area-inset-bottom)) !important;
    flex-wrap: wrap !important;
  }

  .modal-footer > *,
  .form-footer > * {
    flex: 1 1 auto;
  }

  .modal-footer .button-primary,
  .form-footer .button-primary {
    min-width: min(100%, 160px);
  }

  .form-grid {
    grid-template-columns: 1fr !important;
    gap: 13px !important;
  }

  .field,
  .field-full {
    grid-column: 1 / -1 !important;
  }

  .calendar-toolbar {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .calendar-toolbar::-webkit-scrollbar { display: none !important; }

  .data-table-wrap {
    border-radius: 14px !important;
  }

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

  .public-booking-shell,
  .patient-form-shell {
    width: min(100% - 20px, 760px) !important;
  }

  .login-card,
  .public-booking-card,
  .patient-form-card {
    border-radius: 20px !important;
  }
}

@media (max-width: 480px) {
  .topbar-title small {
    display: none;
  }

  .profile-pill {
    max-width: 148px;
  }

  .module-header h1 {
    font-size: 30px !important;
  }

  .modal-header,
  .modal-body,
  .modal-footer {
    padding-left: 14px !important;
    padding-right: 14px !important;
  }

  .modal-footer {
    display: grid !important;
    grid-template-columns: 1fr !important;
  }

  .modal-footer > * {
    width: 100% !important;
  }
}

/* ========== PREFERÊNCIAS DO SISTEMA ========== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

@media (prefers-contrast: more) {
  :root {
    --jr-pro-line: rgba(119, 73, 5, .48);
    --jr-pro-line-strong: rgba(97, 58, 3, .72);
  }

  input,
  select,
  textarea,
  .panel,
  .metric-card,
  .document-card,
  .lead-card,
  .settings-card,
  .patient-drawer,
  .modal {
    border-color: var(--jr-pro-line) !important;
  }

  .sidebar-nav button.active {
    border-width: 2px !important;
  }
}

@media (forced-colors: active) {
  .button-primary,
  .button-secondary,
  .button-soft,
  .button-ghost,
  .panel,
  .metric-card,
  .document-card,
  .lead-card,
  input,
  select,
  textarea {
    forced-color-adjust: auto;
  }
}

/* Impressão: documentos e tabelas limpos, sem ornamentos do app. */
@media print {
  .sidebar,
  .topbar,
  .module-actions,
  .icon-button,
  .toast,
  .modal-backdrop,
  .drawer-backdrop {
    box-shadow: none !important;
  }

  .page-content {
    padding: 0 !important;
  }
}


/* ===== V134 FINAL HARDENING ===== */
:root { --jr-release: "134"; }
html.jr-apple-professional { color-scheme: light; }
/* Mantém ações destrutivas visualmente distintas sem competir com a identidade dourada. */
.button-danger, .patient-delete-button, .document-delete-button, .user-delete-button { font-weight: 650 !important; }
/* Safe-area adicional em iPhone/iPad standalone. */
@supports (padding: max(0px)) {
  .sidebar { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
  .topbar { padding-top: max(0px, env(safe-area-inset-top)); }
}

/* ===== V136 OFFLINE PROFISSIONAL — CORREÇÕES V135 PRESERVADAS ===== */
:root { --jr-release: "135"; }

/* Drawer de pacientes: fica acima do topo da área principal, preservando a sidebar. */
body:has(.drawer-backdrop) .topbar {
  z-index: 0 !important;
}

@media (min-width: 901px) {
  .drawer-backdrop {
    left: var(--jr132-sidebar-width, 252px) !important;
  }
  .patient-drawer {
    width: min(1040px, calc(100vw - var(--jr132-sidebar-width, 252px) - 18px)) !important;
    max-width: calc(100vw - var(--jr132-sidebar-width, 252px) - 18px) !important;
  }
}

.drawer-header {
  position: sticky !important;
  top: 0 !important;
  z-index: 8 !important;
  background: rgba(255,253,248,.985) !important;
  backdrop-filter: blur(16px) saturate(1.04) !important;
  -webkit-backdrop-filter: blur(16px) saturate(1.04) !important;
}

.drawer-actions {
  flex-wrap: wrap !important;
  align-items: center !important;
  padding: 14px 20px !important;
  border-bottom: 1px solid rgba(183,122,16,.13) !important;
  background: rgba(255,252,246,.88) !important;
}

.drawer-actions .patient-delete-button {
  margin-left: auto !important;
}

.drawer-body {
  padding: 20px !important;
}

.info-grid strong,
.info-grid p {
  overflow-wrap: anywhere;
}

/* Identidade da clínica: não corta o nome em telas de notebook. */
.brand > span:nth-child(2) { flex: 1 1 auto !important; }
.brand strong {
  max-width: none !important;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  line-height: 1.18 !important;
}

/* Faixas douradas permanecem decorativas e nunca competem com controles. */
.module-header,
.module-actions,
.clinical-toolbar,
.patient-folder-header {
  position: relative;
  z-index: 2;
}

.module-actions .button:disabled,
.module-actions button:disabled {
  opacity: 1 !important;
  background: #fffaf2 !important;
  color: #aa9a84 !important;
  border-color: rgba(158,101,7,.18) !important;
  box-shadow: none !important;
  text-shadow: none !important;
}

/* Documentos: seletor e ações não sobrepõem mais títulos nem botões. */
.document-grid article {
  position: relative !important;
  grid-template-columns: 44px minmax(0, 1fr) auto !important;
  align-items: start !important;
  row-gap: 10px !important;
  padding: 15px !important;
}

.document-print-selector {
  position: static !important;
  grid-column: 1 / -1 !important;
  justify-self: end !important;
  margin: 0 0 2px !important;
  min-height: 36px !important;
  padding: 7px 11px !important;
  z-index: auto !important;
}

.document-grid strong {
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  line-height: 1.28 !important;
  padding-right: 4px;
}

.document-grid small {
  line-height: 1.35 !important;
}

.document-grid footer {
  grid-column: 1 / -1 !important;
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 8px !important;
  width: 100% !important;
}

.document-grid footer .button {
  flex: 0 1 auto !important;
  white-space: nowrap !important;
}

.document-grid footer .document-delete-button {
  margin-left: auto !important;
}

@media (max-width: 1450px) and (min-width: 761px) {
  .document-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

/* Prontuário: seção que corresponde exatamente à anamnese do PDF oficial. */
.anamnesis-pdf-section {
  background: linear-gradient(145deg, rgba(255,253,248,.93), rgba(250,244,233,.88)) !important;
  border-top: 1px solid rgba(183,122,16,.20) !important;
}

.clinical-section-help {
  margin: -7px 0 16px !important;
  color: var(--jr-pro-muted, #6b5f54) !important;
  font-size: 12px !important;
  line-height: 1.5 !important;
}

.anamnesis-pdf-checks {
  margin-bottom: 16px !important;
}

.anamnesis-pdf-checks label {
  min-height: 42px !important;
  align-items: center !important;
  background: rgba(255,255,255,.76) !important;
  border: 1px solid rgba(183,122,16,.15) !important;
  border-radius: 11px !important;
  padding: 9px 11px !important;
}

.anamnesis-footer {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  flex-wrap: wrap !important;
}

.anamnesis-footer-hint {
  margin-right: auto !important;
  max-width: 460px;
  color: var(--jr-pro-muted, #6b5f54) !important;
  font-size: 11px !important;
  line-height: 1.45 !important;
}

@media (max-width: 900px) {
  .drawer-backdrop { left: 0 !important; }
  body:has(.drawer-backdrop) .topbar { z-index: 30 !important; }
  .drawer-actions .patient-delete-button { margin-left: 0 !important; }
}

@media (max-width: 760px) {
  .document-grid article {
    grid-template-columns: 42px minmax(0, 1fr) !important;
  }
  .document-grid article > :not(.document-print-selector):not(footer):not(.document-icon) {
    min-width: 0;
  }
  .document-grid footer .button,
  .document-grid footer .document-delete-button {
    flex: 1 1 140px !important;
    margin-left: 0 !important;
  }
  .anamnesis-footer {
    align-items: stretch !important;
  }
  .anamnesis-footer-hint {
    flex: 1 0 100%;
    max-width: none;
    margin: 0 0 4px !important;
  }
  .anamnesis-footer .button {
    flex: 1 1 180px !important;
  }
}
