
/* ============================================================
   TOKENS
   ============================================================ */
:root{
  --brand:        #2456b8;
  --brand-2:      #2e6fe0;
  --brand-soft:   #3b82f6;

  --bg:           #0d131e;
  --bg-2:         #111a28;
  --surface:      #16202f;
  --surface-2:    #1c293b;
  --surface-3:    #233148;
  --border:       #283750;
  --border-soft:  #1e2a3d;

  --text:         #eaf1fb;
  --text-2:       #a9b8cf;
  --text-3:       #6f819b;

  --success:      #2ecc8f;
  --success-bg:   rgba(46,204,143,.12);
  --warning:      #f5b945;
  --warning-bg:   rgba(245,185,69,.12);
  --danger:       #f0556b;
  --danger-bg:    rgba(240,85,107,.12);
  --info:         #3b82f6;

  --radius:       16px;
  --radius-sm:    10px;
  --radius-xs:    8px;
  --radius-lg:    22px;

  --shadow:       0 16px 48px -12px rgba(0,0,0,.6);
  --shadow-soft:  0 4px 24px -8px rgba(0,0,0,.45);
  --shadow-card:  0 2px 12px -4px rgba(0,0,0,.35);
  --ring:         0 0 0 3px rgba(46,111,224,.28);

  --sidebar-w:    252px;
  --header-h:     60px;

  --font-display: 'Sora', system-ui, sans-serif;
  --font-body:    'Outfit', system-ui, sans-serif;

  --space-1: 6px;
  --space-2: 12px;
  --space-3: 18px;
  --space-4: 24px;
  --space-5: 32px;
  --space-6: 48px;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-image:
    radial-gradient(ellipse 1100px 500px at 90% -5%, rgba(46,111,224,.09), transparent 65%),
    radial-gradient(ellipse 800px 600px at -5% 105%, rgba(36,86,184,.08), transparent 65%);
  background-attachment: fixed;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -.015em;
  line-height: 1.25;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; }
input, select, textarea { font-family: inherit; }
svg { display: block; }
::selection { background: rgba(46,111,224,.38); }

/* Scrollbar */
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 99px; border: 2px solid var(--bg); }
*::-webkit-scrollbar-track { background: transparent; }

/* ============================================================
   UTILITIES
   ============================================================ */
.hidden  { display: none !important; }
.text-c  { text-align: center; }
.muted   { color: var(--text-2); }
.muted-3 { color: var(--text-3); }
.grow    { flex: 1; min-width: 0; }

.row     { display: flex; align-items: center; gap: var(--space-2); }
.row.wrap{ flex-wrap: wrap; }
.between { justify-content: space-between; }
.col     { display: flex; flex-direction: column; gap: var(--space-2); }

.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-display);
  font-weight: 800;
}
.brand img { height: 34px; width: auto; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: .9rem;
  line-height: 1;
  transition: background .15s, border-color .15s, transform .12s, box-shadow .15s, opacity .15s;
  white-space: nowrap;
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border);
  cursor: pointer;
  text-decoration: none;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.btn svg { flex-shrink: 0; }
.btn:hover:not(:disabled) { background: var(--surface-3); transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(0); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }

.btn-primary {
  background: linear-gradient(135deg, var(--brand-2) 0%, var(--brand) 100%);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 6px 20px -8px rgba(46,111,224,.65);
}
.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #3a7cf2 0%, #2a60cc 100%);
  box-shadow: 0 8px 28px -8px rgba(46,111,224,.75);
}

.btn-ghost  { background: transparent; border-color: var(--border); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); }

.btn-success { background: var(--success); color: #03210f; border-color: transparent; }
.btn-success:hover:not(:disabled) { background: #33e09f; }

.btn-danger  { background: var(--danger); color: #fff; border-color: transparent; }
.btn-danger:hover:not(:disabled) { background: #f4667a; }

.btn-warning { background: var(--warning); color: #3a2a05; border-color: transparent; }
.btn-warning:hover:not(:disabled) { background: #f7c455; }

.btn-wa { background: #25d366; color: #03200e; border-color: transparent; }
.btn-wa:hover:not(:disabled) { background: #2ee06f; }

.btn-sm    { padding: 7px 12px; font-size: .82rem; border-radius: var(--radius-xs); gap: 5px; }
.btn-block { width: 100%; }

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: linear-gradient(175deg, var(--surface) 0%, var(--bg-2) 100%);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}
.card-pad { padding: clamp(16px, 3vw, 24px); }

/* ============================================================
   STAT CARDS
   ============================================================ */
.stats {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}
.stat {
  position: relative;
  overflow: hidden;
  background: linear-gradient(155deg, var(--surface-2) 0%, var(--bg-2) 100%);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 20px;
  transition: border-color .15s, transform .15s;
}
.stat:hover { border-color: rgba(46,111,224,.25); transform: translateY(-1px); }
.stat::after {
  content: "";
  position: absolute;
  right: -24px; top: -24px;
  width: 100px; height: 100px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(46,111,224,.18), transparent 70%);
  pointer-events: none;
}
.stat .ico {
  width: 40px; height: 40px;
  border-radius: 11px;
  display: grid; place-items: center;
  background: rgba(46,111,224,.14);
  color: var(--brand-soft);
  margin-bottom: 14px;
}
.stat .ico svg { width: 20px; height: 20px; }
.stat .val {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 1.9rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.02em;
}
.stat .lbl {
  color: var(--text-2);
  font-size: .82rem;
  margin-top: 6px;
  font-weight: 500;
}

/* ============================================================
   FORMS
   ============================================================ */
.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-size: .8rem;
  color: var(--text-2);
  margin-bottom: 6px;
  font-weight: 600;
  letter-spacing: .01em;
}
.input,
.field input:not([type="checkbox"]):not([type="radio"]),
.field select,
.field textarea {
  width: 100%;
  padding: 10px 13px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .92rem;
  transition: border-color .15s, box-shadow .15s;
  appearance: none;
}
.input::placeholder,
.field input::placeholder,
.field textarea::placeholder { color: var(--text-3); }
.input:focus,
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--brand-2);
  box-shadow: var(--ring);
}
.field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236f819b' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 34px;
  cursor: pointer;
}
.field textarea { resize: vertical; min-height: 88px; line-height: 1.5; }
.field input[readonly] { color: var(--text-2); cursor: default; }

.grid-2 { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.grid-3 { display: grid; gap: 12px; grid-template-columns: repeat(3, 1fr); }

@media (max-width: 600px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

/* ============================================================
   BADGES
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .025em;
  white-space: nowrap;
  flex-shrink: 0;
}
.badge::before {
  content: "";
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.badge-trial     { background: var(--warning-bg);            color: var(--warning); }
.badge-active    { background: var(--success-bg);            color: var(--success); }
.badge-blocked   { background: var(--danger-bg);             color: var(--danger); }
.badge-agendada  { background: rgba(59,130,246,.14);         color: #7aa7ff; }
.badge-aguardando{ background: rgba(59,130,246,.14);         color: #7aa7ff; }
.badge-confirmada{ background: var(--success-bg);            color: var(--success); }
.badge-realizada { background: rgba(160,170,190,.1);         color: #9baccb; }
.badge-cancelada { background: var(--danger-bg);             color: var(--danger); }
.badge-falta     { background: rgba(245,185,69,.14);         color: var(--warning); }
.badge-pago      { background: var(--success-bg);            color: var(--success); }
.badge-pendente  { background: var(--warning-bg);            color: var(--warning); }
.badge-comprovante{ background: rgba(245,185,69,.14);        color: var(--warning); }

/* ============================================================
   TABLES
   ============================================================ */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border-soft);
  -webkit-overflow-scrolling: touch;
}
table.tbl {
  width: 100%;
  border-collapse: collapse;
  min-width: 520px;
}
table.tbl th {
  text-align: left;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-3);
  padding: 13px 16px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  white-space: nowrap;
}
table.tbl td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border-soft);
  font-size: .88rem;
  vertical-align: middle;
}
table.tbl tr:last-child td { border-bottom: none; }
table.tbl tr:hover td { background: rgba(46,111,224,.04); }

/* ============================================================
   APP SHELL — Sidebar + Topbar + Main
   ============================================================ */
.app { display: flex; min-height: 100dvh; }

/* ---- Sidebar ---- */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--bg-2);
  border-right: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 60;
  transform: translateX(0);
  transition: transform .25s cubic-bezier(.4,0,.2,1);
}

.sidebar .side-top {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-soft);
  flex-shrink: 0;
}
.sidebar .side-top .brand img {
  filter: brightness(0) invert(1);
  height: 34px;
}

.nav {
  padding: 12px 10px;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}
.nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text-2);
  font-weight: 500;
  font-size: .9rem;
  margin-bottom: 2px;
  transition: background .15s, color .15s;
  white-space: nowrap;
  overflow: hidden;
}
.nav a svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav a span { overflow: hidden; text-overflow: ellipsis; }
.nav a:hover { background: var(--surface); color: var(--text); }
.nav a.active {
  background: linear-gradient(135deg, rgba(46,111,224,.2), rgba(46,111,224,.06));
  color: #fff;
  box-shadow: inset 3px 0 0 var(--brand-2);
}

.side-foot {
  padding: 14px;
  border-top: 1px solid var(--border-soft);
  flex-shrink: 0;
}

/* ---- Main area ---- */
.main {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 clamp(14px, 3vw, 26px);
  border-bottom: 1px solid var(--border-soft);
  background: rgba(13,19,30,.75);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 40;
  flex-shrink: 0;
}
.topbar h1 {
  font-size: 1.1rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hamburger {
  display: none;
  background: var(--surface-2);
  border: 1px solid var(--border);
  width: 38px; height: 38px;
  border-radius: 9px;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .15s;
}
.hamburger:hover { background: var(--surface-3); }

.content {
  padding: clamp(16px, 3vw, 26px);
  flex: 1;
  min-width: 0;
  max-width: 100%;
  animation: fadeUp .22s ease both;
}

.page-head { margin-bottom: 20px; }
.page-head h2 { font-size: clamp(1.3rem, 3vw, 1.6rem); }
.page-head p { color: var(--text-2); margin-top: 5px; font-size: .92rem; }

.avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-3);
  border: 2px solid var(--border);
  flex-shrink: 0;
}

.scrim {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 55;
  backdrop-filter: blur(2px);
}

/* Mobile breakpoint */
@media (max-width: 960px) {
  .sidebar {
    transform: translateX(-100%);
    box-shadow: var(--shadow);
  }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .hamburger { display: flex; }
  .scrim.show { display: block; }
}

/* ============================================================
   MODAL
   ============================================================ */
.modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(5,9,18,.72);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  display: none;
  align-items: flex-start;
  justify-content: center;
  z-index: 100;
  padding: clamp(14px, 4vw, 28px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.modal-bg.open { display: flex; }

.modal {
  width: 100%;
  max-width: 550px;
  margin: auto;
  animation: pop .2s cubic-bezier(.34,1.56,.64,1) both;
  background: linear-gradient(175deg, var(--surface) 0%, var(--bg-2) 100%);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.modal.lg { max-width: 740px; }

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-soft);
}
.modal-head h3 { font-size: 1.1rem; }

.modal-body {
  padding: 20px;
  max-height: 68vh;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.modal-foot {
  padding: 14px 20px;
  border-top: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.x-btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  width: 32px; height: 32px;
  border-radius: var(--radius-xs);
  color: var(--text-2);
  font-size: 1rem;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: background .15s, color .15s;
  cursor: pointer;
}
.x-btn:hover { background: var(--surface-3); color: var(--text); }

@keyframes pop {
  from { opacity: 0; transform: translateY(16px) scale(.97); }
  to   { opacity: 1; transform: none; }
}

/* ============================================================
   TOAST
   ============================================================ */
#toasts {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: clamp(280px, 90vw, 340px);
  pointer-events: none;
}
.toast {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--brand-2);
  border-radius: 11px;
  padding: 12px 15px;
  box-shadow: var(--shadow);
  font-size: .88rem;
  animation: slideIn .22s ease both;
  pointer-events: all;
  line-height: 1.4;
}
.toast.success { border-left-color: var(--success); }
.toast.error   { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }

@keyframes slideIn {
  from { opacity: 0; transform: translateX(24px); }
  to   { opacity: 1; transform: none; }
}

/* ============================================================
   LOADERS
   ============================================================ */
.spinner {
  width: 32px; height: 32px;
  border: 2.5px solid var(--border);
  border-top-color: var(--brand-2);
  border-radius: 50%;
  animation: spin .75s linear infinite;
  margin: 32px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

.page-loader {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: grid;
  place-items: center;
  z-index: 300;
  transition: opacity .28s;
}
.page-loader.gone { opacity: 0; pointer-events: none; }

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty {
  text-align: center;
  padding: clamp(36px, 6vw, 56px) 20px;
  color: var(--text-3);
}
.empty .ico {
  width: 52px; height: 52px;
  margin: 0 auto 14px;
  opacity: .35;
  display: flex;
  align-items: center;
  justify-content: center;
}
.empty .ico svg { width: 100%; height: 100%; }
.empty p { font-size: .9rem; max-width: 260px; margin: 0 auto; line-height: 1.5; }

/* ============================================================
   AUTH PAGES
   ============================================================ */
.auth-wrap {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: clamp(16px, 4vw, 28px);
}
.auth-card { width: 100%; max-width: 420px; }
.auth-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
}
.auth-logo img {
  filter: brightness(0) invert(1);
  height: 68px;
  width: auto;
}
.auth-logo .name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
}
.auth-logo .name b { color: var(--brand-soft); }

.auth-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 18px;
  background: var(--bg);
  padding: 5px;
  border-radius: 12px;
  border: 1px solid var(--border-soft);
}
.auth-tabs button {
  flex: 1;
  padding: 10px;
  border: none;
  background: transparent;
  color: var(--text-2);
  border-radius: 8px;
  font-weight: 600;
  font-size: .88rem;
  transition: background .15s, color .15s;
  cursor: pointer;
}
.auth-tabs button.active {
  background: var(--surface-2);
  color: #fff;
  box-shadow: var(--shadow-soft);
}

/* ============================================================
   AGENDA
   ============================================================ */
.cal-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.seg {
  display: flex;
  background: var(--bg);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
}
.seg button {
  padding: 7px 13px;
  border: none;
  background: transparent;
  color: var(--text-2);
  border-radius: 8px;
  font-weight: 600;
  font-size: .82rem;
  cursor: pointer;
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.seg button.active {
  background: var(--brand-2);
  color: #fff;
  box-shadow: 0 2px 8px -3px rgba(46,111,224,.6);
}

/* Month grid */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.cal-dow {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-3);
  text-align: center;
  padding: 6px 0;
  font-weight: 700;
}
.cal-cell {
  min-height: 90px;
  background: var(--bg-2);
  border: 1px solid var(--border-soft);
  border-radius: 11px;
  padding: 7px;
  font-size: .76rem;
  transition: border-color .15s;
  overflow: hidden;
}
.cal-cell:hover { border-color: var(--border); }
.cal-cell.dim { opacity: .35; }
.cal-cell .d { font-weight: 700; color: var(--text-2); margin-bottom: 5px; font-size: .78rem; }
.cal-cell .ev {
  background: rgba(46,111,224,.16);
  color: #9dbcff;
  border-radius: 5px;
  padding: 2px 5px;
  margin-bottom: 3px;
  font-size: .7rem;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background .12s;
}
.cal-cell .ev:hover { background: rgba(46,111,224,.28); }

/* Appointment list items */
.appt-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 15px;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  margin-bottom: 8px;
  background: var(--bg-2);
  transition: border-color .15s, background .15s;
  min-width: 0;
}
.appt-item:hover { border-color: var(--border); background: var(--surface); }
.appt-item .time {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .95rem;
  min-width: 48px;
  flex-shrink: 0;
}

/* ============================================================
   PRONTUÁRIO — TIMELINE
   ============================================================ */
.timeline { position: relative; padding-left: 24px; }
.timeline::before {
  content: "";
  position: absolute;
  left: 6px; top: 6px; bottom: 6px;
  width: 1.5px;
  background: var(--border);
}
.tl-item { position: relative; margin-bottom: 18px; }
.tl-item::before {
  content: "";
  position: absolute;
  left: -24px; top: 5px;
  width: 13px; height: 13px;
  border-radius: 50%;
  background: var(--brand-2);
  box-shadow: 0 0 0 3px var(--bg);
}

/* ============================================================
   DIVIDERS & SECTION TITLES
   ============================================================ */
.divider {
  height: 1px;
  background: var(--border-soft);
  margin: 16px 0;
}
.section-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: .74rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-3);
  margin-bottom: 12px;
  font-weight: 700;
}
.section-title svg { width: 15px; height: 15px; flex-shrink: 0; }

/* ============================================================
   LIST CARDS
   ============================================================ */
.list-card {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 14px 15px;
  border: 1px solid var(--border-soft);
  border-radius: 13px;
  background: var(--bg-2);
  transition: border-color .15s, background .15s, transform .15s;
  min-width: 0;
  cursor: pointer;
}
.list-card:hover {
  border-color: var(--border);
  background: var(--surface);
  transform: translateY(-1px);
}
.list-card .ava {
  width: 42px; height: 42px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--brand-2), var(--brand));
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: .85rem;
  color: #fff;
  flex-shrink: 0;
  letter-spacing: -.01em;
}

/* ============================================================
   SERVIÇOS — checkboxes estilizados
   ============================================================ */
.service-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}
.service-card { position: relative; cursor: pointer; }
.service-card input[type="checkbox"] {
  position: absolute;
  opacity: 0; width: 0; height: 0;
}
.service-card-inner {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: var(--bg-2);
  transition: border-color .15s, background .15s, box-shadow .15s;
  cursor: pointer;
}
.service-card:hover .service-card-inner { border-color: var(--border); background: var(--surface); }
.service-card input:checked + .service-card-inner {
  border-color: var(--brand-2);
  background: rgba(46,111,224,.09);
  box-shadow: 0 0 0 2px rgba(46,111,224,.2);
}
.service-card-inner .svc-check {
  width: 20px; height: 20px;
  border-radius: 6px;
  border: 2px solid var(--border);
  background: transparent;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: background .15s, border-color .15s;
}
.service-card input:checked + .service-card-inner .svc-check {
  background: var(--brand-2);
  border-color: var(--brand-2);
}
.service-card input:checked + .service-card-inner .svc-check::after {
  content: '';
  width: 10px; height: 6px;
  border: 2px solid #fff;
  border-top: none;
  border-right: none;
  transform: rotate(-45deg) translate(1px, -1px);
  display: block;
}
.service-card-inner .svc-info { min-width: 0; }
.service-card-inner .svc-name {
  font-weight: 600;
  font-size: .88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.service-card-inner .svc-price {
  font-size: .76rem;
  color: var(--text-3);
  margin-top: 2px;
}

/* ============================================================
   UPLOAD ZONE
   ============================================================ */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: 13px;
  padding: 26px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color .18s, background .18s;
  background: var(--bg);
  position: relative;
}
.upload-zone:hover,
.upload-zone.drag-over {
  border-color: var(--brand-2);
  background: rgba(46,111,224,.05);
}
.upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%; height: 100%;
}
.upload-zone .upload-icon {
  width: 40px; height: 40px;
  margin: 0 auto 10px;
  color: var(--text-3);
  opacity: .7;
  display: flex;
  align-items: center;
  justify-content: center;
}
.upload-zone .upload-icon svg { width: 100%; height: 100%; }
.upload-zone .upload-label {
  font-weight: 600;
  color: var(--text-2);
  font-size: .88rem;
}
.upload-zone .upload-hint {
  font-size: .76rem;
  color: var(--text-3);
  margin-top: 4px;
}
.upload-zone.has-file {
  border-color: var(--success);
  background: var(--success-bg);
}
.upload-zone.has-file .upload-icon { color: var(--success); opacity: 1; }
.upload-file-name {
  font-size: .82rem;
  color: var(--success);
  margin-top: 6px;
  font-weight: 600;
}

/* ============================================================
   PAYMENT INFO
   ============================================================ */
.payment-info-card {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: linear-gradient(155deg, var(--surface-2), var(--bg-2));
  padding: 18px;
  margin-bottom: 16px;
}
.payment-info-card .pix-key {
  font-family: var(--font-display);
  font-size: .95rem;
  font-weight: 700;
  padding: 10px 13px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 9px;
  margin-top: 6px;
  word-break: break-all;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.payment-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: linear-gradient(135deg, var(--brand-2), var(--brand));
  color: #fff;
  border-radius: 10px;
  font-weight: 600;
  font-size: .88rem;
  text-decoration: none;
  transition: opacity .15s, transform .12s;
  margin-top: 10px;
}
.payment-link-btn:hover { opacity: .9; transform: translateY(-1px); }

/* ============================================================
   NOTIFICAÇÃO IN-APP
   ============================================================ */
.notif-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--danger);
  border: 2px solid var(--bg-2);
  position: absolute;
  top: -1px; right: -1px;
}
.notif-btn {
  position: relative;
  background: var(--surface-2);
  border: 1px solid var(--border);
  width: 38px; height: 38px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background .15s;
  flex-shrink: 0;
}
.notif-btn:hover { background: var(--surface-3); }

/* ============================================================
   PWA INSTALL BANNER
   ============================================================ */
.pwa-banner {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(135deg, var(--brand-2) 0%, var(--brand) 100%);
  color: #fff;
  padding: 13px clamp(14px, 4vw, 20px);
  display: flex;
  align-items: center;
  gap: 13px;
  z-index: 500;
  box-shadow: 0 -8px 32px -6px rgba(0,0,0,.5);
  transform: translateY(100%);
  transition: transform .32s cubic-bezier(.4,0,.2,1);
}
.pwa-banner.show { transform: translateY(0); }
.pwa-banner .pwa-icon {
  width: 36px; height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  opacity: .9;
}
.pwa-banner .pwa-icon svg { width: 26px; height: 26px; }
.pwa-banner .pwa-text { flex: 1; min-width: 0; }
.pwa-banner .pwa-title { font-weight: 700; font-size: .92rem; }
.pwa-banner .pwa-sub  { font-size: .76rem; opacity: .82; margin-top: 2px; }
.pwa-banner .pwa-install {
  background: rgba(255,255,255,.95);
  color: var(--brand);
  border: none;
  padding: 8px 15px;
  border-radius: 8px;
  font-weight: 700;
  font-size: .83rem;
  cursor: pointer;
  flex-shrink: 0;
  white-space: nowrap;
  transition: background .15s;
}
.pwa-banner .pwa-install:hover { background: #fff; }
.pwa-banner .pwa-close {
  background: transparent;
  border: none;
  color: rgba(255,255,255,.65);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px;
  flex-shrink: 0;
  line-height: 1;
  display: grid;
  place-items: center;
  width: 28px; height: 28px;
  border-radius: 6px;
  transition: background .15s;
}
.pwa-banner .pwa-close:hover { background: rgba(255,255,255,.15); }

/* ============================================================
   AGENDAMENTO PÚBLICO — steps, datas, confirmação
   ============================================================ */
.pub-steps {
  display: flex;
  gap: 0;
  margin-bottom: 22px;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid var(--border-soft);
}
.pub-step {
  flex: 1;
  padding: 11px 6px;
  text-align: center;
  background: var(--bg-2);
  font-size: .75rem;
  font-weight: 600;
  color: var(--text-3);
  border-right: 1px solid var(--border-soft);
  transition: background .2s, color .2s;
  line-height: 1.3;
}
.pub-step:last-child { border-right: none; }
.pub-step.active { background: rgba(46,111,224,.13); color: var(--brand-soft); }
.pub-step.done   { background: var(--success-bg); color: var(--success); }
.pub-step .step-num {
  display: flex;
  justify-content: center;
  margin-bottom: 3px;
}
.pub-step .step-num svg { width: 15px; height: 15px; }

/* Date / time buttons */
.date-btn, .time-btn {
  padding: 9px 13px;
  border: 1.5px solid var(--border);
  border-radius: 9px;
  background: var(--bg-2);
  color: var(--text);
  font-weight: 600;
  font-size: .83rem;
  cursor: pointer;
  transition: border-color .13s, background .13s, box-shadow .13s, color .13s;
  white-space: nowrap;
  font-family: var(--font-body);
}
.date-btn:hover:not(:disabled),
.time-btn:hover:not(:disabled) {
  border-color: var(--brand-soft);
  background: rgba(46,111,224,.08);
  color: #fff;
}
.date-btn.selected, .time-btn.selected {
  background: var(--brand-2);
  border-color: var(--brand-2);
  color: #fff;
  box-shadow: 0 4px 14px -4px rgba(46,111,224,.65);
}
.date-btn:disabled, .time-btn:disabled { opacity: .3; cursor: not-allowed; }
.time-btn.taken { text-decoration: line-through; opacity: .28; cursor: not-allowed; }

/* Confirm screen */
.confirm-screen {
  text-align: center;
  padding: clamp(26px, 5vw, 42px) 20px;
}
.confirm-screen .confirm-icon {
  width: 76px; height: 76px;
  border-radius: 50%;
  background: var(--success-bg);
  display: grid;
  place-items: center;
  margin: 0 auto 18px;
  border: 2px solid rgba(46,204,143,.3);
}
.confirm-screen .confirm-icon svg { width: 36px; height: 36px; }
.confirm-screen h2 { font-size: clamp(1.3rem, 4vw, 1.65rem); margin-bottom: 10px; }
.confirm-detail {
  background: var(--bg-2);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 14px 18px;
  text-align: left;
  margin: 14px 0;
}
.confirm-detail .cd-row {
  display: flex;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-soft);
  font-size: .88rem;
  flex-wrap: wrap;
}
.confirm-detail .cd-row:last-child { border-bottom: none; }
.confirm-detail .cd-label {
  color: var(--text-3);
  min-width: 88px;
  font-size: .8rem;
  font-weight: 500;
}
.confirm-detail .cd-value { font-weight: 600; }

/* Pix preview */
.pix-preview {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-top: 8px;
}
.pix-preview .pix-icon {
  width: 34px; height: 34px;
  border-radius: 8px;
  background: linear-gradient(135deg, #00b4d8, #0077b6);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.pix-preview .pix-icon svg { width: 16px; height: 16px; }

/* Pub photo */
.pub-photo {
  width: 88px; height: 88px;
  border-radius: 20px;
  object-fit: cover;
  border: 2px solid var(--surface);
  box-shadow: 0 6px 20px -8px rgba(0,0,0,.5), 0 0 0 1px var(--border);
  flex-shrink: 0;
}
.pub-photo-fallback {
  width: 88px; height: 88px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  font-size: 1.8rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--brand-2), var(--brand));
  box-shadow: 0 6px 20px -8px rgba(0,0,0,.5);
  flex-shrink: 0;
}

/* Pub header logo */
.pub-head img { filter: brightness(0) invert(1); height: 30px; }

/* ============================================================
   SIDEBAR NOTIF BADGE
   ============================================================ */
.nav a .badge-count {
  margin-left: auto;
  min-width: 20px;
  height: 18px;
  border-radius: 9px;
  background: var(--danger);
  color: #fff;
  font-size: .66rem;
  font-weight: 700;
  display: grid;
  place-items: center;
  padding: 0 5px;
}

/* ============================================================
   CALENDÁRIO PÚBLICO (PICKER)
   ============================================================ */
.cal-picker {
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  padding: 16px;
  background: var(--bg-2);
  max-width: 360px;
}
.cal-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.cal-picker-head strong {
  font-family: var(--font-display);
  font-size: 1rem;
  text-transform: capitalize;
}
.cal-nav-btn {
  width: 32px; height: 32px;
  border-radius: 9px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  display: grid; place-items: center;
  transition: border-color .13s, background .13s;
}
.cal-nav-btn:hover:not(:disabled) {
  border-color: var(--brand-soft);
  background: rgba(46,111,224,.08);
}
.cal-nav-btn:disabled { opacity: .28; cursor: not-allowed; }

.cal-grid-pick {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}
.cal-dow-mini {
  text-align: center;
  font-size: .68rem;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 4px 0 5px;
}
.cal-day {
  aspect-ratio: 1;
  border: none;
  background: transparent;
  border-radius: 9px;
  color: var(--text);
  font-weight: 600;
  font-size: .86rem;
  cursor: pointer;
  transition: background .1s, color .1s;
  display: grid;
  place-items: center;
  position: relative;
  font-family: var(--font-body);
}
.cal-day.empty    { visibility: hidden; }
.cal-day.disabled { color: var(--text-3); opacity: .25; cursor: not-allowed; }
.cal-day.available:hover { background: rgba(46,111,224,.12); color: var(--brand-soft); }
.cal-day.available::after {
  content: '';
  position: absolute;
  bottom: 4px; left: 50%;
  transform: translateX(-50%);
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--brand-soft);
}
.cal-day.today { box-shadow: inset 0 0 0 1.5px rgba(46,111,224,.4); }
.cal-day.selected {
  background: var(--brand-2);
  color: #fff;
  box-shadow: 0 3px 12px -4px rgba(46,111,224,.7);
}
.cal-day.selected::after { background: #fff; }

/* ============================================================
   CONFIGURAÇÕES — serviços
   ============================================================ */
.svc-config-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.svc-config-row input { flex: 1; min-width: 120px; }
.svc-config-row .svc-price-input { max-width: 110px; flex: 0 0 110px; }
.svc-remove-btn {
  width: 36px; height: 36px;
  flex-shrink: 0;
  border: 1.5px solid var(--border);
  background: var(--surface);
  border-radius: 9px;
  color: var(--danger);
  cursor: pointer;
  display: grid; place-items: center;
  transition: background .13s, border-color .13s;
}
.svc-remove-btn:hover {
  background: rgba(240,85,107,.1);
  border-color: var(--danger);
}

/* ============================================================
   MISC
   ============================================================ */
.pill-link {
  font-size: .8rem;
  color: var(--brand-soft);
  word-break: break-all;
}
.pill-link:hover { text-decoration: underline; }

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

/* ============================================================
   FOCUS (ACESSIBILIDADE)
   ============================================================ */
*:focus-visible {
  outline: 2px solid var(--brand-2);
  outline-offset: 2px;
  border-radius: 5px;
}

/* ============================================================
   RESPONSIVIDADE MOBILE
   ============================================================ */
@media (max-width: 600px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .stat .val { font-size: 1.4rem; }
  .stat { padding: 16px; }

  .modal-bg { padding: 10px; }
  .modal-body { max-height: 75vh; }
  .modal-foot { flex-wrap: wrap; }

  .appt-item { flex-wrap: wrap; gap: 8px; }
  .appt-item .time { min-width: 0; }

  .cal-grid { gap: 3px; }
  .cal-cell { min-height: 62px; padding: 5px; }
  .cal-cell .d { font-size: .72rem; }
  .cal-dow  { font-size: .62rem; }

  .service-grid { grid-template-columns: 1fr; }

  .content { padding: 13px; }
  .topbar  { padding: 0 12px; gap: 10px; }
  .topbar h1 { font-size: .95rem; }

  .table-wrap { border-radius: 10px; }

  .pwa-banner .pwa-sub { display: none; }

  .confirm-screen { padding: 22px 14px; }
  .btn-block-mobile { width: 100%; }

  .modal-foot .btn { flex: 1; min-width: 0; }
}

@media (max-width: 400px) {
  .stats { grid-template-columns: 1fr; }
  .badge { font-size: .68rem; padding: 2px 7px; }
}
/* ============================================================
   OVERRIDES V4 — Refinamento geral, responsividade, calendário
   ============================================================ */

/* ---- Botão sair compacto ---- */
.logout-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: background .15s, color .15s, border-color .15s;
}
.logout-btn svg { width: 15px; height: 15px; }
.logout-btn:hover {
  background: rgba(240,85,107,.1);
  border-color: rgba(240,85,107,.4);
  color: var(--danger);
}

/* ---- Side-foot layout corrigido ---- */
.side-foot {
  padding: 12px 14px;
  border-top: 1px solid var(--border-soft);
  flex-shrink: 0;
}
.side-foot .row {
  align-items: center;
  gap: 9px;
  flex-wrap: nowrap;
}
.side-foot .row > div {
  flex: 1;
  min-width: 0;
}

/* ---- Calendário picker — responsivo e contido ---- */
.cal-picker {
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  padding: 14px;
  background: var(--surface);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.cal-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  gap: 8px;
}
.cal-picker-head strong {
  font-family: var(--font-display);
  font-size: .95rem;
  text-transform: capitalize;
  text-align: center;
  flex: 1;
}

.cal-grid-pick {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  width: 100%;
}

.cal-dow-mini {
  text-align: center;
  font-size: .65rem;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .03em;
  padding: 3px 0 6px;
  line-height: 1;
}

.cal-day {
  aspect-ratio: 1;
  border: none;
  background: transparent;
  border-radius: 8px;
  color: var(--text);
  font-weight: 600;
  font-size: .85rem;
  cursor: pointer;
  transition: background .1s, color .1s;
  display: grid;
  place-items: center;
  position: relative;
  font-family: var(--font-body);
  width: 100%;
  min-width: 0;
  padding: 0;
  line-height: 1;
}

.cal-day.empty    { visibility: hidden; pointer-events: none; }
.cal-day.disabled { color: var(--text-3); opacity: .22; cursor: not-allowed; }
.cal-day.available:hover:not(:disabled) {
  background: rgba(46,111,224,.14);
  color: var(--brand-soft);
}
.cal-day.available::after {
  content: '';
  position: absolute;
  bottom: 3px; left: 50%;
  transform: translateX(-50%);
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--brand-soft);
}
.cal-day.today {
  box-shadow: inset 0 0 0 1.5px rgba(46,111,224,.45);
}
.cal-day.selected {
  background: var(--brand-2);
  color: #fff;
  box-shadow: 0 2px 10px -3px rgba(46,111,224,.7);
}
.cal-day.selected::after { background: rgba(255,255,255,.6); }

/* Wrap do calendário ocupa toda largura disponível */
#calWrap {
  width: 100%;
}

/* ---- Horários — grid fluído ---- */
#timeRow {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}
.time-btn {
  padding: 9px 14px;
  border: 1.5px solid var(--border);
  border-radius: 9px;
  background: var(--bg-2);
  color: var(--text);
  font-weight: 600;
  font-size: .84rem;
  cursor: pointer;
  transition: border-color .13s, background .13s, box-shadow .13s, color .13s;
  white-space: nowrap;
  font-family: var(--font-body);
  min-width: 68px;
  text-align: center;
}

/* ---- Page head — sem overflow ---- */
.page-head {
  margin-bottom: 20px;
  overflow: hidden;
}
.page-head h2 {
  font-size: clamp(1.2rem, 2.8vw, 1.55rem);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---- Topbar ---- */
.topbar h1 {
  font-size: clamp(.95rem, 2vw, 1.1rem);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* ---- Content area — padding uniforme ---- */
.content {
  padding: clamp(14px, 2.5vw, 24px);
  max-width: 100%;
  overflow-x: hidden;
}

/* ---- Card padding consistente ---- */
.card-pad {
  padding: clamp(14px, 2.5vw, 22px);
}

/* ---- Stat cards — alinhamento preciso ---- */
.stats {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
}
.stat {
  padding: 18px;
}

/* ---- Appt items — não quebram layout ---- */
.appt-item {
  overflow: hidden;
}
.appt-item .grow {
  overflow: hidden;
}
.appt-item .grow > div:first-child {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---- Modal — melhora para mobile ---- */
.modal-bg {
  padding: clamp(10px, 3vw, 24px);
  align-items: flex-start;
}
.modal {
  width: 100%;
  max-width: 540px;
  margin: auto;
}
.modal-body {
  padding: 18px 20px;
  max-height: 72vh;
}

/* ---- Botões na área de ação — não estourar ---- */
.row.wrap .btn {
  flex-shrink: 0;
}

/* ---- Section title ---- */
.section-title {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-3);
  margin-bottom: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ---- Badge — uniform ---- */
.badge {
  line-height: 1.2;
}

/* ---- Notif panel — responsivo ---- */
#notifPanel {
  max-width: min(320px, calc(100vw - 32px)) !important;
  right: 12px !important;
}

/* ---- Tabela — melhorias ---- */
table.tbl th,
table.tbl td {
  padding: 11px 14px;
}

/* ---- Grid 2 — corrige em mobile ---- */
@media (max-width: 640px) {
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .cal-picker { padding: 10px; }
  .cal-day { font-size: .78rem; border-radius: 7px; }
  .cal-dow-mini { font-size: .58rem; }
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { padding: 14px; }
  .stat .val { font-size: 1.35rem; }
  .modal-body { max-height: 78vh; }
  .modal-foot { flex-direction: row; flex-wrap: wrap; }
  .modal-foot .btn { flex: 1 1 auto; min-width: 0; }
  .content { padding: 12px; }
  .topbar { padding: 0 12px; gap: 8px; }
  .side-foot { padding: 10px 12px; }
  #notifPanel { right: 8px !important; top: 68px !important; }
}

@media (max-width: 400px) {
  .stats { grid-template-columns: 1fr; }
  .cal-day { font-size: .72rem; }
  .badge { font-size: .67rem; padding: 2px 7px; }
  .time-btn { min-width: 60px; font-size: .78rem; padding: 8px 10px; }
}

/* ---- Pwa banner — sem emoji ---- */
.pwa-banner .pwa-close {
  display: grid;
  place-items: center;
  line-height: 1;
}

/* ---- Empty state — alinhado ---- */
.empty .ico svg {
  width: 40px;
  height: 40px;
  stroke-width: 1.5;
}

/* ---- Input group row — agendamento link ---- */
.input-action-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  width: 100%;
}
.input-action-row .input {
  flex: 1;
  min-width: 160px;
}

/* ---- Pub wrap — contido ---- */
.pub-wrap {
  box-sizing: border-box;
  overflow-x: hidden;
}

/* ---- Confirm detail rows ---- */
.confirm-detail .cd-row {
  flex-wrap: wrap;
  align-items: flex-start;
}
.confirm-detail .cd-label {
  flex-shrink: 0;
}

/* ---- Prevent horizontal scroll globally ---- */
html, body {
  overflow-x: hidden;
  max-width: 100%;
}
