:root{
  --bg:#f4f8fc;
  --bg-soft:#eef4fa;
  --surface:#ffffff;
  --surface-2:#f8fbff;
  --surface-3:#edf4fb;

  --text:#102033;
  --text-2:#29415a;
  --muted:#6f8298;
  --muted-2:#8ea0b4;

  --line:#d9e5f0;
  --line-2:#e7eef6;

  --primary:#5da9ff;
  --primary-strong:#2f80ed;
  --primary-soft:#e8f3ff;

  --green:#22b573;
  --green-soft:#e8f8f0;

  --amber:#f4b740;
  --amber-soft:#fff5df;

  --red:#eb5b63;
  --red-soft:#ffecef;

  --cyan:#50b9d8;
  --cyan-soft:#e8f9fd;

  --shadow-sm:0 6px 16px rgba(21, 54, 88, .06);
  --shadow-md:0 16px 40px rgba(22, 53, 84, .10);
  --shadow-lg:0 24px 60px rgba(16, 42, 67, .12);

  --radius-xs:12px;
  --radius-sm:16px;
  --radius-md:20px;
  --radius-lg:26px;
  --radius-xl:32px;

  --safe-top:env(safe-area-inset-top);
  --safe-bottom:env(safe-area-inset-bottom);

  --nav-h:68px;
  --topbar-h:72px;

  --font:system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

*{
  box-sizing:border-box;
}

html,
body{
  margin:0;
  padding:0;
  width:100%;
  min-height:100%;
  font-family:var(--font);
  background:
    radial-gradient(1200px 700px at 50% -10%, rgba(93,169,255,.16), transparent 56%),
    linear-gradient(180deg, #f8fbff 0%, #f1f6fb 100%);
  color:var(--text);
  -webkit-text-size-adjust:100%;
  text-size-adjust:100%;
}

html,
body{
  overflow-x:hidden;
  overflow-y:auto;
}
body{
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
}

button,
input,
select,
textarea{
  font:inherit;
}

button{
  cursor:pointer;
  border:0;
  background:none;
  padding:0;
  color:inherit;
}

input,
select,
textarea{
  width:100%;
  border:1px solid var(--line);
  background:#fff;
  color:var(--text);
  border-radius:16px;
  outline:none;
  transition:border-color .18s ease, box-shadow .18s ease, background .18s ease;
  -webkit-appearance:none;
  appearance:none;
  font-size:16px;
}

input:focus,
select:focus,
textarea:focus{
  border-color:rgba(47,128,237,.38);
  box-shadow:0 0 0 4px rgba(47,128,237,.10);
}

input::placeholder,
textarea::placeholder{
  color:var(--muted-2);
}

textarea{
  min-height:110px;
  resize:vertical;
}

a{
  color:inherit;
  text-decoration:none;
}

.hidden{
  display:none !important;
}

.app-shell{
  min-height:100dvh;
  overflow-x:hidden;
  -webkit-overflow-scrolling:touch;
  padding:
    calc(var(--safe-top) + var(--topbar-h) + 22px)
    14px
    calc(var(--nav-h) + var(--safe-bottom) + 18px);
  scroll-behavior:smooth;
}
.app-shell::-webkit-scrollbar{
  width:0;
  height:0;
}

body.modal-open{
  overflow:hidden !important;
  touch-action:none !important;
}

body.modal-open .app-shell{
  overflow:hidden !important;
}

.topbar{
  position:fixed;
  top:0;
  left:50%;
  transform:translateX(-50%);
  width:min(calc(100vw - 24px), 860px);
  z-index:80;
  height:calc(var(--safe-top) + var(--topbar-h));
  display:grid;
  grid-template-columns:56px 1fr 56px;
  align-items:end;
  gap:10px;
  margin:0;
  padding:
    calc(var(--safe-top) + 0px)
    2px
    12px;
  border-bottom:1px solid rgba(217,229,240,.72);
  backdrop-filter:blur(16px);
  -webkit-backdrop-filter:blur(16px);
  background:linear-gradient(180deg, rgba(244,248,252,.96) 0%, rgba(244,248,252,.82) 70%, rgba(244,248,252,.12) 100%);
}

.topbar-left,
.topbar-right{
  display:flex;
  align-items:center;
}

.topbar-left{
  justify-content:flex-start;
}

.topbar-right{
  justify-content:flex-end;
}

.topbar-spacer{
  width:44px;
  height:44px;
}

.topbar-center{
  min-width:0;
}
.topbar-center h1{
  margin:0;
  text-align:center;
  font-size:22px;
  line-height:1;
  letter-spacing:.08em;
  font-weight:900;
  color:var(--text);
  text-transform:uppercase;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.only-home{
  visibility:hidden;
  pointer-events:none;
}

.app-shell:has(#page-home.active) .only-home{
  visibility:visible;
  pointer-events:auto;
}

.main-content{
  display:block;
}

.home-primary-action{
  margin:0 0 12px 0;
}

.home-primary-btn{
  width:100%;
  min-height:48px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
}

.page{
  display:none;
}

.page.active{
  display:block;
}

.icon-btn{
  width:44px;
  height:44px;
  min-width:44px;
  min-height:44px;
  border-radius:14px;
  display:grid;
  place-items:center;
  font-size:22px;
  line-height:1;
  user-select:none;
  -webkit-tap-highlight-color:transparent;
  transition:transform .15s ease, background .18s ease, border-color .18s ease, opacity .18s ease;
}

.icon-btn:active{
  transform:scale(.98);
}

.icon-btn.ghost{
  border:1px solid rgba(93,169,255,.15);
  background:rgba(255,255,255,.78);
  color:var(--text-2);
  box-shadow:var(--shadow-sm);
}

.icon-btn.primary{
  border:1px solid rgba(47,128,237,.10);
  background:linear-gradient(180deg, #6bb4ff 0%, #4d97f8 100%);
  color:#fff;
  box-shadow:0 14px 30px rgba(77,151,248,.28);
}

.solid-btn{
  min-height:42px;
  padding:0 14px;
  border-radius:14px;
  background:linear-gradient(180deg, #69b2ff 0%, #4d97f8 100%);
  color:#fff;
  font-size:14px;
  font-weight:800;
  letter-spacing:.02em;
  box-shadow:0 14px 26px rgba(77,151,248,.24);
  transition:transform .15s ease, opacity .18s ease;
}

.solid-btn:active{
  transform:scale(.985);
}

.solid-btn.wide{
  width:100%;
  min-height:48px;
  border-radius:16px;
  font-size:15px;
}

.text-btn{
  min-height:34px;
  padding:0 4px;
  color:var(--primary-strong);
  font-size:14px;
  font-weight:800;
  letter-spacing:.01em;
}

.chip-btn{
  min-width:38px;
  height:38px;
  border-radius:12px;
  border:1px solid var(--line);
  background:rgba(255,255,255,.88);
  color:var(--text);
  display:grid;
  place-items:center;
  font-weight:900;
  box-shadow:var(--shadow-sm);
}

.date-chip{
  min-width:128px;
  height:38px;
  padding:0 14px;
  border-radius:12px;
  border:1px solid var(--line);
  background:#fff;
  color:var(--text);
  font-size:14px;
  font-weight:800;
  box-shadow:var(--shadow-sm);
}

.field{
  min-height:46px;
  padding:0 14px;
  border-radius:15px;
  background:#fff;
}

.hero-card{
  position:relative;
  overflow:hidden;
  border:1px solid rgba(93,169,255,.14);
  border-radius:28px;
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(93,169,255,.18), transparent 42%),
    linear-gradient(180deg, rgba(255,255,255,.98) 0%, rgba(245,250,255,1) 100%);
  box-shadow:var(--shadow-md);
  padding:18px 16px 16px;
  margin:0 0 12px 0;
}

.hero-card::before{
  content:"";
  position:absolute;
  left:14px;
  right:14px;
  top:0;
  height:3px;
  border-radius:999px;
  background:linear-gradient(90deg, rgba(47,128,237,.92), rgba(47,128,237,0));
  opacity:.92;
}

.hero-card.compact{
  padding-top:16px;
}

.hero-card-top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
  margin-bottom:14px;
}

.eyebrow{
  font-size:11px;
  line-height:1;
  letter-spacing:.16em;
  font-weight:900;
  color:var(--muted);
  text-transform:uppercase;
  margin-bottom:8px;
}

.hero-title{
  font-size:24px;
  line-height:1.05;
  font-weight:900;
  letter-spacing:-.02em;
  color:var(--text);
}

.hero-main-label{
  font-size:13px;
  color:var(--muted);
  margin-bottom:8px;
  font-weight:700;
}

.hero-main-value{
  font-size:42px;
  line-height:.96;
  font-weight:900;
  letter-spacing:-.03em;
  color:var(--primary-strong);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.hero-main-sub{
  margin-top:8px;
  font-size:14px;
  line-height:1.25;
  color:var(--muted);
}

.status-pill{
  min-height:28px;
  padding:0 10px;
  border-radius:999px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  white-space:nowrap;
  font-size:11px;
  font-weight:800;
  letter-spacing:.04em;
}

.status-pill.info{
  color:var(--primary-strong);
  background:var(--primary-soft);
  border:1px solid rgba(47,128,237,.14);
}

.status-pill.success{
  color:var(--green);
  background:var(--green-soft);
  border:1px solid rgba(34,181,115,.14);
}

.status-pill.warn{
  color:#b57b0f;
  background:var(--amber-soft);
  border:1px solid rgba(244,183,64,.20);
}

.status-pill.danger{
  color:var(--red);
  background:var(--red-soft);
  border:1px solid rgba(235,91,99,.18);
}

.kpi-grid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:10px;
  margin:0 0 12px 0;
}

.kpi-card{
  position:relative;
  overflow:hidden;
  min-height:108px;
  padding:14px 14px 13px;
  border-radius:22px;
  background:rgba(255,255,255,.94);
  border:1px solid var(--line-2);
  box-shadow:var(--shadow-sm);
}

.kpi-card::before{
  content:"";
  position:absolute;
  left:12px;
  right:12px;
  top:0;
  height:3px;
  border-radius:999px;
}

.kpi-card.accent-blue::before{
  background:linear-gradient(90deg, rgba(47,128,237,.9), rgba(47,128,237,0));
}

.kpi-card.accent-green::before{
  background:linear-gradient(90deg, rgba(34,181,115,.92), rgba(34,181,115,0));
}

.kpi-card.accent-amber::before{
  background:linear-gradient(90deg, rgba(244,183,64,.96), rgba(244,183,64,0));
}

.kpi-card.accent-red::before{
  background:linear-gradient(90deg, rgba(235,91,99,.96), rgba(235,91,99,0));
}

.kpi-label{
  font-size:11px;
  line-height:1.1;
  letter-spacing:.14em;
  text-transform:uppercase;
  font-weight:900;
  color:var(--muted);
  margin-bottom:10px;
}

.kpi-value{
  font-size:30px;
  line-height:.95;
  font-weight:900;
  letter-spacing:-.03em;
  color:var(--text);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.kpi-sub{
  margin-top:8px;
  font-size:13px;
  line-height:1.2;
  color:var(--muted);
}

.panel-card{
  position:relative;
  overflow:hidden;
  padding:14px;
  margin:0 0 12px 0;
  border-radius:24px;
  border:1px solid rgba(217,229,240,.92);
  background:rgba(255,255,255,.95);
  box-shadow:var(--shadow-sm);
}

.sticky-panel{
  position:sticky;
  top:calc(var(--topbar-h) - 4px);
  z-index:50;
  backdrop-filter:blur(14px);
  -webkit-backdrop-filter:blur(14px);
}

.panel-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:12px;
}

.panel-title{
  min-width:0;
  font-size:12px;
  line-height:1.1;
  letter-spacing:.15em;
  text-transform:uppercase;
  font-weight:900;
  color:var(--muted);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.list-stack{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.empty-state{
  padding:16px 14px;
  border-radius:18px;
  border:1px dashed var(--line);
  background:linear-gradient(180deg, #fbfdff 0%, #f6faff 100%);
}

.empty-state-title{
  font-size:15px;
  font-weight:900;
  line-height:1.15;
  color:var(--text);
  margin-bottom:6px;
}

.empty-state-sub{
  font-size:13px;
  line-height:1.35;
  color:var(--muted);
}

.mini-stats-grid{
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:8px;
}

.mini-stat{
  min-width:0;
  min-height:72px;
  padding:12px 10px;
  border-radius:18px;
  border:1px solid var(--line-2);
  background:linear-gradient(180deg, #fbfdff 0%, #f4f9ff 100%);
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  text-align:center;
}

.mini-stat-k{
  width:100%;
  font-size:9px;
  line-height:1;
  letter-spacing:.16em;
  text-transform:uppercase;
  font-weight:900;
  color:var(--muted);
  margin-bottom:8px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.mini-stat-v{
  width:100%;
  font-size:22px;
  line-height:.95;
  font-weight:900;
  letter-spacing:-.03em;
  color:var(--text);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.segmented{
  display:inline-grid;
  grid-template-columns:repeat(3, 1fr);
  gap:4px;
  padding:4px;
  border-radius:16px;
  background:var(--surface-3);
  border:1px solid var(--line);
  width:100%;
}

.segmented-btn{
  min-height:38px;
  border-radius:12px;
  font-size:13px;
  font-weight:800;
  color:var(--muted);
  background:transparent;
  transition:background .18s ease, color .18s ease, box-shadow .18s ease;
}

.segmented-btn.active{
  color:var(--text);
  background:#fff;
  box-shadow:var(--shadow-sm);
}

.agenda-toolbar{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.agenda-date-row{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
}

.agenda-filters{
  margin-top:12px;
  display:grid;
  grid-template-columns:1fr;
  gap:10px;
}

.patients-toolbar{
  display:grid;
  grid-template-columns:1fr;
  gap:10px;
}

.cash-summary-grid{
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:8px;
}

.cash-summary-box{
  min-width:0;
  min-height:72px;
  border-radius:18px;
  border:1px solid var(--line-2);
  background:rgba(255,255,255,.88);
  padding:12px 10px;
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  text-align:center;
}

.cash-summary-k{
  width:100%;
  font-size:9px;
  line-height:1;
  letter-spacing:.16em;
  text-transform:uppercase;
  font-weight:900;
  color:var(--muted);
  margin-bottom:8px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.cash-summary-v{
  width:100%;
  font-size:21px;
  line-height:.95;
  font-weight:900;
  letter-spacing:-.03em;
  color:var(--text);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.settings-list{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.settings-row{
  min-height:54px;
  padding:0 14px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  border-radius:18px;
  border:1px solid var(--line-2);
  background:linear-gradient(180deg, #fbfdff 0%, #f6faff 100%);
  font-size:15px;
  font-weight:800;
  color:var(--text);
  box-shadow:var(--shadow-sm);
}

.settings-row.danger{
  color:var(--red);
}

.bottom-nav{
  position:fixed;
  left:0;
  right:0;
  bottom:0;
  height:calc(var(--nav-h) + var(--safe-bottom));
  padding:8px 10px calc(8px + var(--safe-bottom));
  display:grid;
  grid-template-columns:repeat(5, 1fr);
  gap:8px;
  background:rgba(255,255,255,.92);
  backdrop-filter:blur(18px);
  -webkit-backdrop-filter:blur(18px);
  border-top:1px solid rgba(217,229,240,.98);
  z-index:120;
  box-shadow:0 -10px 24px rgba(18, 51, 84, .06);
}

.nav-btn{
  min-width:0;
  border-radius:18px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:4px;
  color:var(--muted);
  transition:background .18s ease, color .18s ease, transform .15s ease;
  -webkit-tap-highlight-color:transparent;
}

.nav-btn:active{
  transform:scale(.985);
}

.nav-btn.active{
  background:linear-gradient(180deg, #eef6ff 0%, #e4f1ff 100%);
  color:var(--primary-strong);
}

.nav-ico{
  font-size:18px;
  line-height:1;
}

.nav-label{
  font-size:11px;
  line-height:1;
  font-weight:800;
  letter-spacing:.01em;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.modal{
  position:fixed;
  inset:0;
  z-index:300;
  display:flex;
  align-items:flex-end;
  justify-content:center;
  padding:12px;
  background:rgba(16, 32, 51, .30);
  backdrop-filter:blur(8px);
  -webkit-backdrop-filter:blur(8px);
}

.modal-sheet{
  width:min(720px, 100%);
  max-height:calc(100dvh - 24px);
  display:flex;
  flex-direction:column;
  overflow:hidden;
  border-radius:28px;
  border:1px solid rgba(255,255,255,.72);
  background:linear-gradient(180deg, rgba(255,255,255,.98) 0%, rgba(247,250,255,.98) 100%);
  box-shadow:var(--shadow-lg);
}

.modal-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:14px 14px 10px;
  border-bottom:1px solid var(--line-2);
}

.modal-title{
  min-width:0;
  font-size:13px;
  line-height:1.1;
  letter-spacing:.15em;
  text-transform:uppercase;
  font-weight:900;
  color:var(--muted);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.modal-body{
  flex:1 1 auto;
  min-height:0;
  overflow-y:auto;
  overflow-x:hidden;
  -webkit-overflow-scrolling:touch;
  padding:14px;
}

.modal-body::-webkit-scrollbar{
  width:0;
  height:0;
}

.drawer{
  width:min(88vw, 360px);
  height:100dvh;
  margin-right:auto;
  display:flex;
  flex-direction:column;
  border-right:1px solid rgba(255,255,255,.72);
  background:linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
  box-shadow:18px 0 44px rgba(14, 42, 68, .18);
  padding:calc(var(--safe-top) + 10px) 14px 18px;
}

.drawer-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
  padding:0 0 14px 0;
}

.drawer-brand{
  font-size:22px;
  line-height:1;
  font-weight:900;
  letter-spacing:-.02em;
  color:var(--text);
  margin-bottom:6px;
}

.drawer-sub{
  font-size:13px;
  line-height:1.3;
  color:var(--muted);
}

.drawer-body{
  display:flex;
  flex-direction:column;
  gap:8px;
  overflow-y:auto;
  -webkit-overflow-scrolling:touch;
  padding-bottom:8px;
}

.drawer-body::-webkit-scrollbar{
  width:0;
  height:0;
}

.drawer-link{
  min-height:48px;
  padding:0 14px;
  border-radius:16px;
  display:flex;
  align-items:center;
  color:var(--text);
  background:linear-gradient(180deg, #fbfdff 0%, #f4f9ff 100%);
  border:1px solid var(--line-2);
  box-shadow:var(--shadow-sm);
  font-size:15px;
  font-weight:800;
}

.drawer-divider{
  height:1px;
  margin:8px 0;
  background:var(--line-2);
}

.auth-card{
  width:min(520px, 100%);
  margin:auto;
  padding:26px 22px 22px;
  border-radius:30px;
  border:1px solid rgba(255,255,255,.74);
  background:linear-gradient(180deg, rgba(255,255,255,.98) 0%, rgba(246,250,255,.98) 100%);
  box-shadow:var(--shadow-lg);
  display:flex;
  flex-direction:column;
  gap:12px;
  align-items:center;
  justify-content:center;
  text-align:center;
}

.auth-logo{
  font-size:28px;
  line-height:1;
  font-weight:900;
  letter-spacing:-.02em;
  color:var(--text);
}

.auth-title{
  font-size:20px;
  line-height:1.08;
  font-weight:900;
  color:var(--text);
}

.auth-sub{
  font-size:14px;
  line-height:1.35;
  color:var(--muted);
  max-width:340px;
}

.auth-status{
  min-height:18px;
  font-size:13px;
  color:var(--muted);
}
/* LOGIN LOADING STATE */
#authGate.is-loading #loginBtn{
  display:none !important;
}

#authGate #loginBtn[disabled]{
  opacity:.6 !important;
  pointer-events:none !important;
}
#authGate{
  align-items:center !important;
  justify-content:center !important;
  padding:18px !important;
}

#authGate .auth-card{
  align-self:center !important;
  justify-self:center !important;
}
.toast{
  position:fixed;
  left:50%;
  top:calc(var(--safe-top) + 18px);
  transform:translateX(-50%);
  width:min(92vw, 420px);
  z-index:500;
  padding:13px 14px;
  border-radius:18px;
  border:1px solid rgba(255,255,255,.78);
  background:rgba(17, 42, 67, .94);
  color:#fff;
  font-size:14px;
  font-weight:800;
  line-height:1.25;
  box-shadow:0 20px 44px rgba(7, 25, 42, .28);
}

.form-grid{
  display:grid;
  grid-template-columns:1fr;
  gap:12px;
}

.form-block{
  display:flex;
  flex-direction:column;
  gap:8px;
}

.form-label{
  font-size:13px;
  line-height:1.2;
  font-weight:800;
  color:var(--text-2);
}

.form-help{
  font-size:12px;
  line-height:1.3;
  color:var(--muted);
  margin-top:-2px;
}

.form-row{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
}

.form-actions{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-top:6px;
}

.secondary-btn{
  min-height:42px;
  padding:0 14px;
  border-radius:14px;
  background:#fff;
  border:1px solid var(--line);
  color:var(--text);
  font-size:14px;
  font-weight:800;
  box-shadow:var(--shadow-sm);
}

.danger-btn{
  min-height:42px;
  padding:0 14px;
  border-radius:14px;
  background:linear-gradient(180deg, #ff848a 0%, #eb5b63 100%);
  color:#fff;
  font-size:14px;
  font-weight:800;
  box-shadow:0 14px 26px rgba(235,91,99,.24);
}

.card-item{
  position:relative;
  overflow:hidden;
  padding:13px;
  border-radius:20px;
  border:1px solid var(--line-2);
  background:linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow:var(--shadow-sm);
}

.card-item-top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
}

.card-item-left{
  min-width:0;
  flex:1 1 auto;
}

.card-item-right{
  flex:0 0 auto;
  display:flex;
  align-items:flex-start;
  justify-content:flex-end;
}

.card-item-title{
  min-width:0;
  font-size:16px;
  line-height:1.08;
  font-weight:900;
  color:var(--text);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.card-item-sub{
  margin-top:6px;
  font-size:13px;
  line-height:1.3;
  color:var(--muted);
}

.card-item-row{
  margin-top:10px;
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}

.badge{
  min-height:28px;
  padding:0 10px;
  border-radius:999px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:11px;
  font-weight:800;
  letter-spacing:.04em;
  white-space:nowrap;
}

.badge.pending{
  color:#976800;
  background:var(--amber-soft);
  border:1px solid rgba(244,183,64,.22);
}

.badge.confirmed{
  color:var(--primary-strong);
  background:var(--primary-soft);
  border:1px solid rgba(47,128,237,.16);
}

.badge.arrived{
  color:var(--cyan);
  background:var(--cyan-soft);
  border:1px solid rgba(80,185,216,.18);
}

.badge.attended{
  color:var(--green);
  background:var(--green-soft);
  border:1px solid rgba(34,181,115,.16);
}

.badge.cancelled,
.badge.no-show{
  color:var(--red);
  background:var(--red-soft);
  border:1px solid rgba(235,91,99,.18);
}

.badge.neutral{
  color:var(--text-2);
  background:#f2f6fa;
  border:1px solid var(--line);
}

.money{
  font-weight:900;
  letter-spacing:-.02em;
  white-space:nowrap;
}

.money.success{
  color:var(--green);
}

.money.primary{
  color:var(--primary-strong);
}

.money.danger{
  color:var(--red);
}

.card-actions{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:12px;
}

.action-chip{
  min-height:34px;
  padding:0 11px;
  border-radius:12px;
  background:#fff;
  border:1px solid var(--line);
  color:var(--text);
  font-size:12px;
  font-weight:800;
  box-shadow:var(--shadow-sm);
}

.action-chip.primary{
  color:var(--primary-strong);
  background:var(--primary-soft);
  border-color:rgba(47,128,237,.14);
}

.action-chip.success{
  color:var(--green);
  background:var(--green-soft);
  border-color:rgba(34,181,115,.16);
}

.action-chip.danger{
  color:var(--red);
  background:var(--red-soft);
  border-color:rgba(235,91,99,.16);
}

.divider{
  height:1px;
  background:var(--line-2);
  margin:12px 0;
}

.inline-note{
  font-size:12px;
  line-height:1.35;
  color:var(--muted);
}

.section-space{
  margin-top:14px;
}

@media (min-width: 700px){
  .app-shell{
    max-width:860px;
    margin:0 auto;
    padding-left:18px;
    padding-right:18px;
  }

  .topbar{
    grid-template-columns:56px 1fr 56px;
  }

  .agenda-filters{
    grid-template-columns:1.2fr .9fr .9fr;
  }

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

  .form-grid.two{
    grid-template-columns:1fr 1fr;
  }
}

@media (max-width: 420px){
  .app-shell{
    padding-left:12px;
    padding-right:12px;
  }

  .topbar{
    margin-bottom:10px;
  }

  .topbar-center h1{
    font-size:20px;
  }

  .hero-card{
    border-radius:24px;
    padding:16px 14px 14px;
  }

  .hero-title{
    font-size:22px;
  }

  .hero-main-value{
    font-size:36px;
  }

  .kpi-card{
    min-height:100px;
    border-radius:20px;
    padding:13px 12px 12px;
  }

  .kpi-value{
    font-size:26px;
  }

  .panel-card{
    border-radius:22px;
    padding:13px;
  }

  .mini-stats-grid,
  .cash-summary-grid{
    gap:7px;
  }

  .mini-stat,
  .cash-summary-box{
    min-height:68px;
    border-radius:16px;
    padding:10px 8px;
  }

  .mini-stat-v,
  .cash-summary-v{
    font-size:19px;
  }

  .nav-label{
    font-size:10px;
  }

  .modal{
    padding:10px;
  }

  .modal-sheet{
    border-radius:24px;
  }

  .auth-card{
    border-radius:26px;
    padding:24px 18px 20px;
  }

  .form-row{
    grid-template-columns:1fr;
  }
}

/* UTILIDADES PARA JS */
.is-hidden{
  display:none !important;
}

.is-disabled{
  opacity:.55 !important;
  pointer-events:none !important;
}

.is-click-lock{
  pointer-events:none !important;
}

.text-success{
  color:var(--green) !important;
}

.text-danger{
  color:var(--red) !important;
}

.text-primary{
  color:var(--primary-strong) !important;
}

.bg-success{
  background:var(--green-soft) !important;
}

.bg-danger{
  background:var(--red-soft) !important;
}

.bg-primary{
  background:var(--primary-soft) !important;
}
