/* =====================================================================
   AgendaPro — design system
   ===================================================================== */
:root {
  --primary: #6c5ce7; --secondary: #2d3436; --button: #6c5ce7; --menu: #111827; --accent: #fd79a8;
  --bg: #f4f6fb; --surface: #ffffff; --surface-2: #f8f9fc; --text: #0f172a; --text-2: #334155; --muted: #64748b;
  --border: #e6e8f0; --border-strong: #d5d9e4;
  --ok: #10b981; --warn: #f59e0b; --danger: #ef4444; --info: #3b82f6;
  --r-sm: 10px; --r: 14px; --r-lg: 20px; --r-xl: 28px;
  --sh-1: 0 1px 2px rgba(15,23,42,.04), 0 1px 3px rgba(15,23,42,.06);
  --sh-2: 0 4px 6px -2px rgba(15,23,42,.05), 0 12px 24px -6px rgba(15,23,42,.08);
  --sh-3: 0 24px 48px -12px rgba(15,23,42,.18);
  --ring: 0 0 0 4px color-mix(in srgb, var(--primary) 18%, transparent);
  --primary-soft: color-mix(in srgb, var(--primary) 10%, #fff);
  --primary-strong: color-mix(in srgb, var(--primary) 82%, #000);
  --ease: cubic-bezier(.2,.8,.2,1);
  font-size: 15px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.5; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  font-feature-settings: "cv02","cv03","cv04","cv11";
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-strong); }
img { max-width: 100%; display: block; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .6em; letter-spacing: -.02em; color: var(--text); }
h1 { font-size: 1.6rem; font-weight: 750; } h2 { font-size: 1.15rem; font-weight: 700; } h3 { font-size: 1rem; font-weight: 650; }
small, .muted { color: var(--muted); }
hr { border: 0; border-top: 1px solid var(--border); margin: 1.4rem 0; }
code { background: var(--surface-2); border: 1px solid var(--border); padding: 1px 6px; border-radius: 6px; font-size: .85em; word-break: break-all; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.icon { width: 18px; height: 18px; flex-shrink: 0; display: inline-block; vertical-align: -3px; }
.icon.lg { width: 22px; height: 22px; }
::selection { background: color-mix(in srgb, var(--primary) 25%, transparent); }

/* ---------------------------------------------------------------- shell */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  background: radial-gradient(120% 60% at 0% 0%, color-mix(in srgb, var(--primary) 22%, var(--menu)) 0%, var(--menu) 55%);
  color: #cbd5e1; width: 264px; flex-shrink: 0; position: fixed; inset: 0 auto 0 0; z-index: 40;
  transform: translateX(-102%); transition: transform .28s var(--ease); display: flex; flex-direction: column; overflow-y: auto;
  border-right: 1px solid rgba(255,255,255,.04);
}
.sidebar.open { transform: none; box-shadow: var(--sh-3); }
.sidebar .brand { display: flex; align-items: center; gap: 12px; padding: 22px 20px 18px; color: #fff; font-weight: 700; letter-spacing: -.01em; }
.sidebar .brand img, .sidebar .brand .avatar { width: 40px; height: 40px; border-radius: 12px; object-fit: cover; background: rgba(255,255,255,.1); box-shadow: 0 0 0 1px rgba(255,255,255,.12); }
.sidebar .brand .sub { display: block; font-size: .72rem; font-weight: 500; color: #94a3b8; letter-spacing: .02em; }
.sidebar .nav-label { font-size: .68rem; text-transform: uppercase; letter-spacing: .12em; color: #64748b; padding: 14px 22px 6px; font-weight: 600; }
.sidebar nav { padding: 0 12px; }
.sidebar nav a { display: flex; align-items: center; gap: 12px; padding: 9px 12px; margin: 2px 0; color: #cbd5e1; font-size: .92rem; border-radius: 10px; font-weight: 500; transition: background .15s, color .15s; }
.sidebar nav a .icon { opacity: .75; }
.sidebar nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar nav a.active { background: linear-gradient(135deg, var(--primary), var(--primary-strong)); color: #fff; box-shadow: 0 8px 20px -8px color-mix(in srgb, var(--primary) 70%, transparent); }
.sidebar nav a.active .icon { opacity: 1; }
.sidebar .foot { margin-top: auto; padding: 16px; }
.sidebar .user-card { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 14px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.06); }
.sidebar .user-card .avatar { width: 36px; height: 36px; font-size: .8rem; background: color-mix(in srgb, var(--primary) 35%, #1e293b); color: #fff; }
.sidebar .user-card .who { flex: 1; min-width: 0; line-height: 1.25; }
.sidebar .user-card .who b { display: block; color: #fff; font-size: .86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar .user-card .who small { color: #94a3b8; font-size: .74rem; }
.sidebar .icon-btn { background: none; border: 0; color: #94a3b8; cursor: pointer; padding: 6px; border-radius: 8px; display: inline-flex; }
.sidebar .icon-btn:hover { background: rgba(255,255,255,.08); color: #fff; }
.main { flex: 1; min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  display: flex; align-items: center; gap: 12px; padding: 12px 20px; min-height: 64px;
}
.topbar .title { font-weight: 700; font-size: 1.12rem; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.02em; }
.menu-btn { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text); box-shadow: var(--sh-1); }
.content { padding: 20px 16px 40px; max-width: 1320px; margin: 0 auto; }
.backdrop { position: fixed; inset: 0; background: rgba(15,23,42,.45); backdrop-filter: blur(2px); z-index: 35; opacity: 0; pointer-events: none; transition: opacity .25s; }
.backdrop.show { opacity: 1; pointer-events: auto; }
@media (min-width: 1000px) {
  .sidebar { transform: none; position: sticky; top: 0; height: 100vh; }
  .menu-btn { display: none; }
  .content { padding: 28px 32px 48px; }
  .topbar { padding: 14px 32px; }
}

/* ---------------------------------------------------------------- componentes */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--sh-1); padding: 20px; margin-bottom: 18px; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.card.flat { box-shadow: none; }
.grid { display: grid; gap: 16px; }
.grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid.cols-2 { grid-template-columns: repeat(2, 1fr); } .grid.cols-3, .grid.cols-4 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1080px) { .grid.cols-3 { grid-template-columns: repeat(3, 1fr); } .grid.cols-4 { grid-template-columns: repeat(4, 1fr); } }
.stat { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 18px 20px; box-shadow: var(--sh-1); overflow: hidden; }
.stat::after { content: ""; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--primary) 14%, transparent), transparent 70%); }
.stat .label { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.stat .value { font-size: 1.75rem; font-weight: 750; margin-top: 6px; font-variant-numeric: tabular-nums; letter-spacing: -.03em; }
.stat small { font-size: .8rem; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.spacer { flex: 1; }
.stack > * + * { margin-top: 10px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--button) 92%, #fff), var(--button));
  color: #fff; border: 1px solid color-mix(in srgb, var(--button) 80%, #000); border-radius: 12px; padding: 10px 18px;
  font: inherit; font-weight: 600; font-size: .94rem; cursor: pointer; text-decoration: none; min-height: 44px; white-space: nowrap;
  box-shadow: 0 1px 0 rgba(255,255,255,.25) inset, 0 6px 16px -6px color-mix(in srgb, var(--button) 65%, transparent);
  transition: transform .15s var(--ease), box-shadow .15s, filter .15s;
}
.btn:hover { color: #fff; filter: brightness(1.05); transform: translateY(-1px); box-shadow: 0 1px 0 rgba(255,255,255,.25) inset, 0 10px 22px -8px color-mix(in srgb, var(--button) 70%, transparent); }
.btn:active { transform: translateY(0); }
.btn.secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); box-shadow: var(--sh-1); }
.btn.secondary:hover { color: var(--text); background: var(--surface-2); }
.btn.ghost { background: transparent; color: var(--text-2); border-color: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.danger { background: linear-gradient(180deg, #f87171, var(--danger)); border-color: #dc2626; box-shadow: 0 6px 16px -6px rgba(239,68,68,.6); }
.btn.ok { background: linear-gradient(180deg, #34d399, var(--ok)); border-color: #059669; box-shadow: 0 6px 16px -6px rgba(16,185,129,.6); }
.btn.small { padding: 6px 12px; min-height: 34px; font-size: .84rem; border-radius: 10px; }
.btn.lg { min-height: 54px; font-size: 1.02rem; border-radius: 16px; padding: 12px 22px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; filter: grayscale(.2); }
.link-btn { background: none; border: 0; color: var(--primary); cursor: pointer; font: inherit; padding: 0; font-weight: 600; }

label { display: block; font-weight: 600; font-size: .85rem; margin-bottom: 6px; color: var(--text-2); }
.field { margin-bottom: 14px; }
.field .hint { font-weight: 400; color: var(--muted); font-size: .8rem; margin-top: 5px; }
input:not([type]), input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number], input[type=date], input[type=time], input[type=datetime-local], input[type=url], input[type=search], input[type=month], select, textarea {
  width: 100%; padding: 10px 14px; border: 1px solid var(--border-strong); border-radius: 12px; font: inherit; font-size: .95rem;
  background: var(--surface); color: var(--text); min-height: 44px; transition: border-color .15s, box-shadow .15s; appearance: none; -webkit-appearance: none;
}
select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2364748b' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 38px; }
input::placeholder, textarea::placeholder { color: #94a3b8; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
input[type=color] { width: 52px; height: 44px; border: 1px solid var(--border-strong); border-radius: 12px; padding: 3px; background: var(--surface); cursor: pointer; }
input[type=file] { font: inherit; font-size: .88rem; color: var(--muted); }
input[type=file]::file-selector-button { font: inherit; font-weight: 600; border: 1px solid var(--border-strong); background: var(--surface); padding: 8px 14px; border-radius: 10px; margin-right: 10px; cursor: pointer; }
textarea { min-height: 90px; resize: vertical; }
.check { display: flex; gap: 10px; align-items: center; font-weight: 500; color: var(--text-2); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--primary); }
.checks { display: flex; flex-wrap: wrap; gap: 10px 18px; }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--r); }
table.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .9rem; }
.table th, .table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th { color: var(--muted); font-weight: 600; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; background: var(--surface-2); position: sticky; top: 0; }
.table th:first-child { border-top-left-radius: 12px; } .table th:last-child { border-top-right-radius: 12px; }
.table tr:last-child td { border-bottom: 0; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table tbody tr, .table tr { transition: background .12s; }
.table tr:hover td { background: color-mix(in srgb, var(--primary) 3%, #fff); }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: .74rem; font-weight: 600; background: #eef1f6; color: #475569; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .75; }
.badge.ok, .badge.confirmado, .badge.concluido, .badge.active, .badge.received, .badge.confirmed, .badge.enviado { background: #e7f8f1; color: #047857; }
.badge.warn, .badge.aguardando_pagamento, .badge.pending, .badge.pendente, .badge.maintenance, .badge.trial { background: #fef6e4; color: #b45309; }
.badge.danger, .badge.cancelado, .badge.blocked, .badge.failed, .badge.falhou, .badge.overdue, .badge.nao_compareceu { background: #fdecec; color: #b91c1c; }
.badge.info, .badge.em_atendimento, .badge.refunded, .badge.refund_pending { background: #e8f0fe; color: #1d4ed8; }
.badge.inactive, .badge.canceled { background: #f1f5f9; color: #64748b; }

.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: 14px; margin-bottom: 16px; border: 1px solid; font-size: .92rem; }
.alert.success { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.alert.error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.alert.warn { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.alert.info { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }

.avatar { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; background: linear-gradient(135deg, #e2e8f0, #cbd5e1); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; color: #475569; flex-shrink: 0; font-size: .85rem; }
.avatar.lg { width: 76px; height: 76px; font-size: 1.4rem; }
.thumb { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; background: #eef1f6; }
.tabs { display: flex; gap: 4px; padding: 4px; margin-bottom: 18px; overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; width: fit-content; max-width: 100%; box-shadow: var(--sh-1); }
.tabs a { padding: 8px 14px; color: var(--muted); border-radius: 10px; white-space: nowrap; font-weight: 600; font-size: .88rem; transition: background .15s, color .15s; }
.tabs a.active { background: var(--primary); color: #fff; box-shadow: 0 6px 14px -6px color-mix(in srgb, var(--primary) 70%, transparent); }
.tabs a:hover:not(.active) { background: var(--surface-2); color: var(--text); }
.empty { text-align: center; color: var(--muted); padding: 36px 12px; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 8px 14px; font-size: .92rem; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; }
.pill-list { display: flex; flex-wrap: wrap; gap: 6px; }
.danger-zone { border-color: #fecaca; background: linear-gradient(180deg, #fff, #fff7f7); }
details > summary { list-style: none; } details > summary::-webkit-details-marker { display: none; }
details > summary::after { content: "›"; float: right; transition: transform .2s; color: var(--muted); font-size: 1.2rem; line-height: 1; }
details[open] > summary::after { transform: rotate(90deg); }

/* ---------------------------------------------------------------- agenda (painel) */
.cal-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.cal-toolbar .period { font-weight: 750; font-size: 1.1rem; min-width: 180px; letter-spacing: -.02em; }
.seg { display: inline-flex; padding: 4px; gap: 2px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: var(--sh-1); }
.seg a, .seg button { padding: 7px 13px; border: 0; background: none; font: inherit; color: var(--text-2); cursor: pointer; font-size: .86rem; font-weight: 600; border-radius: 9px; }
.seg a.active, .seg button.active { background: var(--primary); color: #fff; }
.seg a:hover:not(.active) { background: var(--surface-2); }
.day-grid { position: relative; display: grid; grid-template-columns: 60px 1fr; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--sh-1); }
.day-grid .hours { border-right: 1px solid var(--border); background: var(--surface-2); }
.day-grid .hour { height: 60px; font-size: .72rem; color: var(--muted); padding: 4px 8px; border-bottom: 1px dashed var(--border); font-variant-numeric: tabular-nums; }
.day-cols { display: grid; position: relative; }
.day-col { position: relative; border-right: 1px solid var(--border); min-width: 150px; }
.day-col .col-head { position: sticky; top: 0; height: 40px; background: var(--surface-2); border-bottom: 1px solid var(--border); font-size: .82rem; font-weight: 700; padding: 11px 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; z-index: 2; color: var(--text); }
.day-grid .hours > div:first-child { height: 40px !important; }
.day-col .slot-line { height: 60px; border-bottom: 1px dashed var(--border); transition: background .12s; }
.day-col .slot-line:hover { background: var(--primary-soft); }
.ev { position: absolute; left: 4px; right: 4px; border-radius: 10px; padding: 5px 8px; font-size: .76rem; color: #fff; overflow: hidden; cursor: pointer; line-height: 1.3; box-shadow: 0 4px 10px -4px rgba(15,23,42,.35); border: 1px solid rgba(255,255,255,.18); }
.ev:hover { color: #fff; filter: brightness(1.08); z-index: 3; }
.ev.aguardando_pagamento { background-image: repeating-linear-gradient(135deg, rgba(255,255,255,.2) 0 6px, transparent 6px 12px); }
.ev.cancelado { opacity: .45; text-decoration: line-through; }
.ev.block { background: repeating-linear-gradient(135deg, #cbd5e1 0 8px, #e2e8f0 8px 16px) !important; color: #334155; cursor: default; box-shadow: none; }
.month-grid { display: grid; grid-template-columns: repeat(7, 1fr); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); box-shadow: var(--sh-1); }
.month-grid .mh { background: var(--surface-2); font-size: .72rem; font-weight: 700; padding: 10px 6px; text-align: center; color: var(--muted); border-bottom: 1px solid var(--border); text-transform: uppercase; letter-spacing: .08em; }
.month-grid .md { min-height: 96px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 6px; font-size: .74rem; }
.month-grid .md.out { background: var(--surface-2); color: #cbd5e1; }
.month-grid .md.today .n { background: var(--primary); color: #fff; }
.month-grid .md .n { display: inline-flex; width: 26px; height: 26px; align-items: center; justify-content: center; border-radius: 50%; font-weight: 700; color: var(--text-2); }
.month-grid .md a.mini { display: block; color: #fff; border-radius: 6px; padding: 2px 6px; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .8rem; color: var(--muted); margin-top: 10px; }
.slot-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(82px, 1fr)); gap: 8px; }
.slot-picker button { padding: 11px 4px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface); font: inherit; font-weight: 650; cursor: pointer; font-variant-numeric: tabular-nums; transition: all .15s var(--ease); color: var(--text); }
.slot-picker button:hover { border-color: var(--primary); color: var(--primary); }
.slot-picker button.sel { background: var(--primary); color: #fff; border-color: var(--primary); box-shadow: 0 8px 18px -8px color-mix(in srgb, var(--primary) 80%, transparent); transform: translateY(-1px); }

/* ---------------------------------------------------------------- login / auth */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; background:
  radial-gradient(60% 50% at 10% 0%, color-mix(in srgb, var(--primary) 22%, transparent), transparent 70%),
  radial-gradient(50% 50% at 100% 100%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 70%), var(--bg); }
.auth-card { width: 100%; max-width: 420px; padding: 32px 28px !important; border-radius: var(--r-xl) !important; box-shadow: var(--sh-3) !important; border: 1px solid rgba(255,255,255,.6) !important; }
.auth-card .logo { display: flex; justify-content: center; margin-bottom: 16px; }
.auth-card .logo img, .auth-card .logo .avatar { width: 68px; height: 68px; border-radius: 20px; object-fit: cover; box-shadow: var(--sh-2); }
.auth-card h1 { text-align: center; font-size: 1.45rem; }

/* ---------------------------------------------------------------- página pública */
.pub-body { background: var(--bg); min-height: 100vh; }
.pub-hero {
  position: relative; overflow: hidden; color: #fff; padding: 28px 18px 88px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-strong) 100%);
}
.pub-hero::before, .pub-hero::after { content: ""; position: absolute; border-radius: 50%; filter: blur(40px); opacity: .55; pointer-events: none; }
.pub-hero::before { width: 320px; height: 320px; right: -80px; top: -120px; background: var(--accent); }
.pub-hero::after { width: 260px; height: 260px; left: -90px; bottom: -140px; background: color-mix(in srgb, var(--primary) 40%, #fff); }
.pub-hero .inner { position: relative; z-index: 1; max-width: 720px; margin: 0 auto; display: flex; gap: 16px; align-items: center; }
.pub-hero .logo { width: 68px; height: 68px; border-radius: 20px; object-fit: cover; background: rgba(255,255,255,.18); box-shadow: 0 10px 30px -10px rgba(0,0,0,.4), 0 0 0 3px rgba(255,255,255,.25); flex-shrink: 0; display: grid; place-items: center; font-weight: 800; font-size: 1.4rem; }
.pub-hero h1 { margin: 0; font-size: 1.45rem; color: #fff; font-weight: 800; letter-spacing: -.03em; }
.pub-hero .sub { opacity: .9; font-size: .88rem; margin-top: 4px; display: flex; gap: 10px; flex-wrap: wrap; }
.pub-hero .sub span { display: inline-flex; align-items: center; gap: 5px; }
.hero-actions { position: absolute; z-index: 2; top: 14px; right: 14px; display: flex; gap: 8px; }
.chip-btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 99px; background: rgba(255,255,255,.18); color: #fff; font-size: .8rem; font-weight: 600; border: 1px solid rgba(255,255,255,.28); backdrop-filter: blur(8px); cursor: pointer; font-family: inherit; }
.chip-btn:hover { background: rgba(255,255,255,.28); color: #fff; }
.pub-main { position: relative; z-index: 2; max-width: 720px; margin: -64px auto 24px; padding: 0 14px; }
.pub-card { background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--sh-3); border: 1px solid var(--border); padding: 20px 18px 24px; }
@media (min-width: 640px) { .pub-card { padding: 28px; } }

.stepper { display: flex; gap: 6px; margin-bottom: 22px; }
.stepper .st { flex: 1; min-width: 0; }
.stepper .bar { height: 5px; border-radius: 99px; background: #e8ebf2; overflow: hidden; position: relative; }
.stepper .bar::after { content: ""; position: absolute; inset: 0; width: 0; background: linear-gradient(90deg, var(--primary), var(--accent)); border-radius: 99px; transition: width .45s var(--ease); }
.stepper .st.done .bar::after, .stepper .st.cur .bar::after { width: 100%; }
.stepper .lbl { font-size: .72rem; font-weight: 600; color: #94a3b8; margin-top: 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stepper .st.cur .lbl { color: var(--text); }
.stepper .st.done .lbl { color: var(--primary); }

.step-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.step-head h2 { margin: 0; font-size: 1.25rem; flex: 1; }
.back-btn { width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); display: inline-grid; place-items: center; cursor: pointer; color: var(--text); flex-shrink: 0; }
.back-btn:hover { background: var(--surface-2); }
.fade-in { animation: fadeUp .35s var(--ease); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.cat-title { font-size: .75rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-weight: 700; margin: 18px 2px 10px; }
.svc-grid, .svc-list { display: flex; flex-direction: column; gap: 10px; }
.svc {
  position: relative; display: flex; gap: 14px; align-items: center; text-align: left; width: 100%; padding: 12px 12px 12px 12px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px; font: inherit; color: inherit; outline: none;
  transition: transform .18s var(--ease), box-shadow .18s, border-color .18s;
}
.svc:hover { transform: translateY(-1px); box-shadow: var(--sh-2); border-color: color-mix(in srgb, var(--primary) 35%, var(--border)); }
.svc:focus-visible { border-color: var(--primary); box-shadow: var(--ring); }
.svc img, .svc .ph { width: 72px; height: 72px; border-radius: 14px; object-fit: cover; flex-shrink: 0; background: var(--primary-soft); display: grid; place-items: center; color: var(--primary); }
.svc .info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.svc .top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.svc .name { font-weight: 700; font-size: .98rem; letter-spacing: -.01em; line-height: 1.3; }
.svc .price { font-weight: 800; font-size: .98rem; white-space: nowrap; letter-spacing: -.02em; }
.svc .desc { color: var(--muted); font-size: .83rem; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.svc .meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 4px; }
.svc .go { color: #cbd5e1; flex-shrink: 0; display: grid; place-items: center; transition: transform .18s, color .18s; }
.svc:hover .go { color: var(--primary); transform: translateX(2px); }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: .74rem; font-weight: 600; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); padding: 2px 8px; border-radius: 99px; }
.tag.brand { background: var(--primary-soft); color: var(--primary-strong); border-color: transparent; }
@media (max-width: 480px) { .svc { gap: 12px; padding: 10px; } .svc img, .svc .ph { width: 60px; height: 60px; border-radius: 12px; } .svc .go { display: none; } }

.pros { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 10px; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.pros::-webkit-scrollbar, .dates::-webkit-scrollbar { display: none; }
.pro { flex: 0 0 auto; width: 88px; scroll-snap-align: start; background: none; border: 0; cursor: pointer; font: inherit; color: inherit; text-align: center; padding: 0; }
.pro .ph, .pro img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; margin: 0 auto 6px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); font-weight: 800; font-size: 1.1rem; box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px transparent; transition: box-shadow .2s; }
.pro .nm { font-size: .78rem; font-weight: 600; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--text-2); }
.pro.sel .ph, .pro.sel img { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--primary); }
.pro.sel .nm { color: var(--primary); }

.dates { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 12px; scroll-snap-type: x proximity; scrollbar-width: none; }
.date { flex: 0 0 auto; width: 62px; padding: 10px 0 9px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface); font: inherit; cursor: pointer; text-align: center; scroll-snap-align: start; transition: all .15s var(--ease); color: var(--text); }
.date .wd { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.date .dn { font-size: 1.25rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.2; }
.date .mo { font-size: .66rem; color: var(--muted); font-weight: 600; }
.date:hover:not(:disabled) { border-color: var(--primary); }
.date.sel { background: linear-gradient(160deg, var(--primary), var(--primary-strong)); border-color: transparent; color: #fff; box-shadow: 0 10px 22px -10px color-mix(in srgb, var(--primary) 85%, transparent); }
.date.sel .wd, .date.sel .mo { color: rgba(255,255,255,.85); }
.date:disabled { opacity: .38; cursor: default; background: var(--surface-2); }
.pick-first { display: flex; align-items: center; gap: 12px; padding: 16px; border: 1px dashed var(--border-strong); border-radius: 14px; color: var(--muted); font-size: .9rem; background: var(--surface-2); }
.pick-first svg { flex-shrink: 0; color: var(--primary); }
.period-title { display: flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin: 16px 0 8px; }
.section-label { font-size: .8rem; font-weight: 700; color: var(--text-2); margin: 4px 0 10px; display: flex; align-items: center; justify-content: space-between; }

.summary-box { background: linear-gradient(180deg, var(--surface-2), var(--surface)); border: 1px solid var(--border); border-radius: 18px; padding: 14px 16px; font-size: .92rem; }
.summary-box .line { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; }
.summary-box .line span:first-child { color: var(--muted); }
.summary-box .line.total { font-weight: 750; border-top: 1px dashed var(--border-strong); margin-top: 6px; padding-top: 10px; }
.summary-box .line.total span:first-child { color: var(--text); }
.sum-top { display: flex; gap: 12px; align-items: center; padding-bottom: 10px; margin-bottom: 6px; border-bottom: 1px solid var(--border); }
.sum-top img, .sum-top .ph { width: 48px; height: 48px; border-radius: 12px; object-fit: cover; background: var(--primary-soft); flex-shrink: 0; }
.sum-top b { display: block; }
.paymethods { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.paymethod { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--border-strong); border-radius: 14px; cursor: pointer; background: var(--surface); font-weight: 600; transition: all .15s; }
.paymethod input { display: none; }
.paymethod:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); box-shadow: var(--ring); }
.paymethod small { display: block; font-weight: 500; font-size: .74rem; }

.sticky-cta { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--border); transform: translateY(110%); transition: transform .3s var(--ease); }
.sticky-cta:not(.show) { visibility: hidden; transition: transform .3s var(--ease), visibility 0s .3s; }
.sticky-cta.show { transform: none; }
.sticky-cta .inner { max-width: 692px; margin: 0 auto; display: flex; gap: 12px; align-items: center; }
.sticky-cta .txt { flex: 1; min-width: 0; font-size: .84rem; line-height: 1.3; }
.sticky-cta .txt b { display: block; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.pay-card { text-align: center; }
.pay-amount { font-size: 2rem; font-weight: 800; letter-spacing: -.04em; margin: 2px 0 4px; }
.qr-wrap { display: inline-block; padding: 14px; border-radius: 22px; background: #fff; border: 1px solid var(--border); box-shadow: var(--sh-2); margin: 10px 0 14px; }
.qr-wrap img { width: 220px; height: 220px; image-rendering: pixelated; }
.pix-code { font-family: ui-monospace, monospace; font-size: .74rem; word-break: break-all; background: var(--surface-2); border: 1px dashed var(--border-strong); padding: 10px 12px; border-radius: 12px; text-align: left; max-height: 84px; overflow: auto; color: var(--text-2); }
.timer { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; font-weight: 600; color: var(--muted); background: var(--surface-2); padding: 5px 12px; border-radius: 99px; font-variant-numeric: tabular-nums; }
.waiting { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 16px; color: var(--muted); font-size: .88rem; }
.pulse-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 0 0 rgba(245,158,11,.6); animation: pulse 1.6s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 12px rgba(245,158,11,0); } 100% { box-shadow: 0 0 0 0 rgba(245,158,11,0); } }
.success-mark { width: 84px; height: 84px; border-radius: 50%; margin: 6px auto 14px; display: grid; place-items: center; background: linear-gradient(160deg, #34d399, #059669); color: #fff; box-shadow: 0 16px 36px -12px rgba(16,185,129,.7); animation: pop .5s var(--ease); }
.success-mark svg { width: 42px; height: 42px; stroke-dasharray: 30; stroke-dashoffset: 30; animation: draw .5s .25s forwards var(--ease); }
@keyframes pop { from { transform: scale(.5); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
.saved-hint { display: flex; align-items: center; gap: 10px; background: var(--primary-soft); border-radius: 14px; padding: 10px 12px; font-size: .85rem; margin-bottom: 14px; color: var(--primary-strong); }
.spinner { width: 20px; height: 20px; border: 2.5px solid color-mix(in srgb, var(--primary) 20%, transparent); border-top-color: var(--primary); border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, #eef1f6 25%, #f6f8fb 37%, #eef1f6 63%); background-size: 400% 100%; animation: sk 1.3s ease infinite; border-radius: 14px; }
@keyframes sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.footer-note { text-align: center; color: var(--muted); font-size: .8rem; margin: 22px 0; display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.footer-note a { color: var(--muted); display: inline-flex; gap: 5px; align-items: center; }

/* ---------------------------------------------------------------- instalar app (bottom sheet) */
.install-sheet { position: fixed; inset: 0; z-index: 120; display: none; }
.install-sheet.show { display: block; }
.install-sheet .shade { position: absolute; inset: 0; background: rgba(15,23,42,.45); backdrop-filter: blur(3px); animation: fadeIn .25s; }
.install-sheet .panel { position: absolute; left: 0; right: 0; bottom: 0; max-width: 520px; margin: 0 auto; background: var(--surface); border-radius: 28px 28px 0 0; padding: 12px 22px calc(22px + env(safe-area-inset-bottom)); box-shadow: 0 -20px 50px -10px rgba(15,23,42,.35); animation: sheetUp .38s var(--ease); }
@media (min-width: 640px) { .install-sheet .panel { bottom: 24px; border-radius: 28px; } }
.install-sheet .grab { width: 42px; height: 5px; border-radius: 99px; background: #e2e8f0; margin: 0 auto 16px; }
.install-sheet .app { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.install-sheet .app img { width: 64px; height: 64px; border-radius: 16px; box-shadow: var(--sh-2); }
.install-sheet .app b { display: block; font-size: 1.08rem; letter-spacing: -.02em; }
.install-sheet .app small { font-size: .82rem; }
.install-sheet ul { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 10px; }
.install-sheet li { display: flex; gap: 10px; align-items: center; font-size: .9rem; color: var(--text-2); }
.install-sheet li .ic { width: 32px; height: 32px; border-radius: 10px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; flex-shrink: 0; }
.install-sheet .ios-steps { background: var(--surface-2); border: 1px solid var(--border); border-radius: 16px; padding: 12px 14px; margin-bottom: 16px; display: grid; gap: 10px; font-size: .9rem; }
.install-sheet .ios-steps div { display: flex; gap: 10px; align-items: center; }
.install-sheet .ios-steps p { margin: 0; line-height: 1.9; }
.install-sheet .ios-steps .kbd svg { width: 14px; height: 14px; vertical-align: -2px; }
.install-sheet .ios-steps .n { width: 24px; height: 24px; border-radius: 50%; background: var(--primary); color: #fff; font-size: .75rem; font-weight: 700; display: grid; place-items: center; flex-shrink: 0; }
.install-sheet .ios-steps .kbd { display: inline-flex; align-items: center; gap: 4px; background: #fff; border: 1px solid var(--border-strong); border-radius: 8px; padding: 2px 8px; font-weight: 600; font-size: .82rem; }
.ios-arrow { position: fixed; bottom: 8px; left: 50%; transform: translateX(-50%); z-index: 121; color: #fff; display: none; animation: bob 1.2s infinite; filter: drop-shadow(0 4px 10px rgba(0,0,0,.4)); }
@keyframes bob { 50% { transform: translate(-50%, 8px); } }
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: none; } }
@keyframes fadeIn { from { opacity: 0; } }
.install-fab { position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 60; display: none; align-items: center; gap: 8px; padding: 10px 16px 10px 10px; border-radius: 99px; border: 0; cursor: pointer; font: inherit; font-weight: 700; font-size: .88rem; color: #fff; background: linear-gradient(135deg, var(--menu), color-mix(in srgb, var(--menu) 70%, var(--primary))); box-shadow: var(--sh-3); animation: sheetUp .4s var(--ease); }
.install-fab img { width: 30px; height: 30px; border-radius: 9px; }
.install-fab.show { display: inline-flex; }
body.has-cta .install-fab { bottom: calc(96px + env(safe-area-inset-bottom)); }

/* ---------------------------------------------------------------- modal */
.modal-bg { position: fixed; inset: 0; background: rgba(15,23,42,.5); backdrop-filter: blur(3px); z-index: 130; display: grid; place-items: center; padding: 16px; animation: fadeIn .2s; }
.modal { background: var(--surface); border-radius: 22px; max-width: 440px; width: 100%; padding: 24px; box-shadow: var(--sh-3); animation: pop .25s var(--ease); }
.modal .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

/* complementos do fluxo público */
.sum-top small { display: block; font-size: .8rem; }
details.acc { border: 1px solid var(--border); border-radius: 16px; padding: 12px 14px; background: var(--surface); }
details.acc > summary { cursor: pointer; font-weight: 700; list-style: none; display: flex; align-items: center; gap: 8px; }
details.acc > summary::-webkit-details-marker { display: none; }
details.acc > summary::after { content: "+"; margin-left: auto; font-weight: 500; font-size: 1.2rem; color: var(--muted); }
details.acc[open] > summary::after { content: "–"; }
details.acc.slim { border-style: dashed; padding: 10px 14px; }
details.acc.slim > summary { font-weight: 600; font-size: .88rem; color: var(--text-2); }
.pub-hero .sub .chip-btn { text-decoration: none; }
@media (max-width: 560px) {
  .pub-hero { padding: 22px 16px 80px; }
  .hero-actions { display: none; }
  .pub-hero .inner { align-items: flex-start; gap: 14px; }
  .pub-hero .logo { width: 56px; height: 56px; border-radius: 16px; font-size: 1.15rem; }
  .pub-hero h1 { font-size: 1.22rem; line-height: 1.2; }
  .pub-hero .sub { font-size: .8rem; gap: 6px; }
  .pub-hero .sub .chip-btn { padding: 5px 10px; font-size: .74rem; }
  .pub-hero .sub .chip-btn svg { width: 14px; height: 14px; }
  .sticky-cta .btn { padding-left: 22px; padding-right: 22px; }
}
@media (max-width: 719px) { .desk-only { display: none !important; } }
@media (min-width: 720px) { .sticky-cta { display: none; } body.has-cta .install-fab { bottom: calc(16px + env(safe-area-inset-bottom)); } }


/* ---------------------------------------------------------------- horários (configuração) */
.sched-nav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; position: sticky; top: 72px; z-index: 5; }
.sched-nav a { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 99px; background: var(--surface); border: 1px solid var(--border); color: var(--text-2); font-size: .84rem; font-weight: 600; box-shadow: var(--sh-1); }
.sched-nav a:hover { color: var(--primary); border-color: color-mix(in srgb, var(--primary) 40%, var(--border)); }
.sched-nav .icon { width: 15px; height: 15px; }
[id="semana"], [id="regras"], [id="excecoes"], [id="previa"] { scroll-margin-top: 130px; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.card-head h3 { margin: 0 0 4px; font-size: 1.05rem; }
.card-head p { margin: 0; font-size: .86rem; max-width: 720px; }
.form-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.icon-btn { background: none; border: 0; color: var(--muted); cursor: pointer; width: 34px; height: 34px; border-radius: 10px; display: inline-grid; place-items: center; font-size: 1.2rem; line-height: 1; flex-shrink: 0; }
.icon-btn:hover { background: #fdecec; color: var(--danger); }

.week { display: flex; flex-direction: column; gap: 8px; }
.week-tools { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.wrow { display: grid; grid-template-columns: 190px 1fr; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); transition: background .15s, opacity .15s; }
.wrow.off { background: var(--surface-2); }
.wrow.off .shifts { opacity: .35; pointer-events: none; filter: grayscale(1); }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; margin: 0; font-weight: 500; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 40px; height: 24px; border-radius: 99px; background: #cbd5e1; position: relative; flex-shrink: 0; transition: background .2s; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s var(--ease); }
.switch input:checked + .track { background: var(--primary); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { box-shadow: var(--ring); }
.switch .wname { display: flex; flex-direction: column; line-height: 1.2; }
.switch .wname b { font-size: .92rem; color: var(--text); }
.switch .wname small { font-size: .74rem; }
.switch.inline { padding: 6px 0; }

.shifts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.shift { display: inline-flex; align-items: center; gap: 6px; padding: 4px 4px 4px 6px; border: 1px solid var(--border-strong); border-radius: 12px; background: var(--surface); }
.shift input[type=time] { width: 124px; min-height: 36px; padding: 6px 8px; border: 0; background: var(--surface-2); border-radius: 8px; font-variant-numeric: tabular-nums; }
.shift input[type=time]:focus { box-shadow: var(--ring); }
.shift .dash { color: var(--muted); font-size: .8rem; }
.shift-x { border: 0; background: none; color: var(--muted); width: 28px; height: 28px; border-radius: 8px; cursor: pointer; font-size: 1.1rem; line-height: 1; }
.shift-x:hover { background: #fdecec; color: var(--danger); }
.shift-add { display: inline-flex; align-items: center; gap: 4px; border: 1px dashed var(--border-strong); background: none; color: var(--primary); font: inherit; font-weight: 600; font-size: .84rem; padding: 8px 12px; border-radius: 12px; cursor: pointer; }
.shift-add:hover { background: var(--primary-soft); border-color: var(--primary); }
.shift-add .icon { width: 15px; height: 15px; }
.inline-shifts { margin-bottom: 4px; }

.choice-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; }
.choice-card { margin: 0; cursor: pointer; }
.choice-card input { position: absolute; opacity: 0; }
.choice-card .cc-body { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border: 1px solid var(--border-strong); border-radius: 14px; background: var(--surface); transition: all .15s; height: 100%; }
.choice-card .cc-body b { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: .95rem; }
.choice-card .cc-body small { font-weight: 400; font-size: .82rem; }
.choice-card input:checked + .cc-body { border-color: var(--primary); background: var(--primary-soft); box-shadow: var(--ring); }
.choice-card input:checked + .cc-body b { color: var(--primary-strong); }
.choice-card input:focus-visible + .cc-body { box-shadow: var(--ring); }

.seg-choice { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; }
.seg-choice label { margin: 0; cursor: pointer; }
.seg-choice input { position: absolute; opacity: 0; }
.seg-choice span { display: flex; flex-direction: column; padding: 9px 12px; border: 1px solid var(--border-strong); border-radius: 12px; font-weight: 600; font-size: .88rem; color: var(--text); background: var(--surface); transition: all .15s; height: 100%; }
.seg-choice span small { font-weight: 400; font-size: .76rem; color: var(--muted); }
.seg-choice input:checked + span { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-strong); }
.seg-choice input:focus-visible + span { box-shadow: var(--ring); }

.input-suffix { display: flex; align-items: center; border: 1px solid var(--border-strong); border-radius: 12px; background: var(--surface); overflow: hidden; }
.input-suffix:focus-within { border-color: var(--primary); box-shadow: var(--ring); }
.input-suffix input { border: 0 !important; box-shadow: none !important; flex: 1; min-width: 0; }
.input-suffix span { padding: 0 12px; color: var(--muted); font-size: .84rem; white-space: nowrap; }

.fixed { display: flex; flex-direction: column; gap: 8px; }
.fixed-gen { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: .86rem; color: var(--text-2); padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; }
.fixed-gen select { width: auto; min-height: 34px; padding: 4px 32px 4px 10px; font-size: .86rem; }
.frow { display: grid; grid-template-columns: 48px 1fr; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px dashed var(--border); }
.frow:last-child { border-bottom: 0; }
.fname { font-size: .84rem; color: var(--text-2); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 2px; padding: 4px 4px 4px 10px; border-radius: 99px; background: var(--primary-soft); color: var(--primary-strong); font-weight: 650; font-size: .84rem; font-variant-numeric: tabular-nums; }
.chip button { border: 0; background: none; color: inherit; opacity: .6; cursor: pointer; width: 22px; height: 22px; border-radius: 50%; font-size: .95rem; line-height: 1; }
.chip button:hover { opacity: 1; background: rgba(0,0,0,.06); }
.chip-add { display: inline-flex; gap: 4px; align-items: center; }
.chip-add input { width: 124px; min-height: 32px; padding: 4px 8px; font-size: .85rem; }
.chip-add .btn { min-height: 32px; width: 32px; padding: 0; }

.exc-form { background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: 14px; }
.exc-list { display: flex; flex-direction: column; gap: 8px; }
.exc-item { display: grid; grid-template-columns: 58px 1fr auto 34px; gap: 12px; align-items: center; padding: 8px 10px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.exc-date { text-align: center; background: var(--primary-soft); color: var(--primary-strong); border-radius: 12px; padding: 5px 0; line-height: 1.1; }
.exc-date b { display: block; font-size: 1.2rem; }
.exc-date small { font-size: .66rem; color: inherit; }
.exc-info { min-width: 0; }
.exc-info b { display: block; font-size: .92rem; }
.exc-info small { display: inline-flex; align-items: center; gap: 4px; font-size: .78rem; }
.exc-info .icon { width: 13px; height: 13px; }
.exc-when .badge { white-space: normal; }
.pv-out { margin-top: 4px; min-height: 40px; }
.pv-out .slot-picker button { cursor: default; }

.wk-summary { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.wk { display: flex; flex-direction: column; font-size: .8rem; padding: 8px 10px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); font-variant-numeric: tabular-nums; }
.wk b { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.wk.off { opacity: .55; }

@media (max-width: 640px) {
  .sched-nav { top: 60px; overflow-x: auto; flex-wrap: nowrap; margin: 0 -12px 14px; padding: 0 12px 4px; scrollbar-width: none; }
  .sched-nav a { white-space: nowrap; }
  .wrow { grid-template-columns: 1fr; gap: 8px; padding: 10px; }
  .wrow.off .shifts { display: none; }
  .shift { padding: 3px 3px 3px 4px; }
  .shift input[type=time] { min-height: 34px; }
  .shift { flex: 1 1 100%; justify-content: space-between; }
  .shift input[type=time] { flex: 1; width: auto; }
  .shift-add { flex: 1 1 100%; justify-content: center; }
  .frow { grid-template-columns: 1fr; gap: 6px; }
  .exc-item { grid-template-columns: 52px 1fr 34px; }
  .exc-when { grid-column: 2 / 3; }
  .form-foot .btn { width: 100%; }
  .week-tools .btn { flex: 1 1 100%; }
}




/* ---------------------------------------------------------------- agenda (painel) — v2 */
.ag-top { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.ag-title { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.ag-arrows { display: flex; align-items: center; gap: 6px; }
.ag-title h2 { margin: 0; font-size: 1.3rem; letter-spacing: -.02em; }
.ag-sum { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.ag-sum span { font-size: .78rem; color: var(--text-2); background: var(--surface); border: 1px solid var(--border); padding: 2px 9px; border-radius: 99px; }
.ag-sum span.warn { background: #fef6e4; border-color: #fde68a; color: #92400e; }
.ag-sum span.ok { background: #e7f8f1; border-color: #a7f3d0; color: #047857; }
.ag-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.ag-views { margin: 0; }
.ag-filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ag-filters select { min-width: 200px; width: auto; }
.ag-filters input[type=date] { width: auto; }
.ag-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .76rem; color: var(--muted); margin-bottom: 10px; }
.ag-legend span { display: inline-flex; align-items: center; gap: 6px; }
.ag-legend i { width: 14px; height: 14px; border-radius: 4px; display: inline-block; border: 1px solid var(--border-strong); }
.lg-free { background: var(--surface); }
.lg-closed { background: repeating-linear-gradient(135deg, #eef1f6 0 4px, #f8f9fc 4px 8px); }
.lg-block { background: repeating-linear-gradient(135deg, #cbd5e1 0 4px, #e2e8f0 4px 8px); }
.lg-wait { background: #fef3c7; border-color: #f59e0b !important; }

.ag-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--sh-1); }
.ag-grid { display: grid; grid-template-columns: 56px repeat(var(--cols), minmax(0, 1fr)); }
.ag-head { position: sticky; top: 0; z-index: 6; display: flex; align-items: center; gap: 8px; padding: 10px; background: var(--surface-2); border-bottom: 1px solid var(--border); border-left: 1px solid var(--border); min-width: 0; color: var(--text); }
.ag-head .avatar { width: 32px; height: 32px; font-size: .74rem; }
.ag-head span { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.ag-head b { font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-head small { font-size: .72rem; color: var(--muted); }
.ag-corner { border-left: 0; position: sticky; left: 0; z-index: 7; }
.ag-dayhead { justify-content: center; text-decoration: none; }
.ag-dayhead span { align-items: center; }
.ag-dayhead small { text-transform: uppercase; letter-spacing: .06em; font-weight: 700; font-size: .66rem; }
.ag-dayhead b { font-size: 1.2rem; }
.ag-dayhead em { font-style: normal; font-size: .68rem; font-weight: 700; background: var(--primary-soft); color: var(--primary-strong); border-radius: 99px; padding: 1px 7px; }
.ag-dayhead.today b { background: var(--primary); color: #fff; border-radius: 50%; width: 30px; height: 30px; display: grid; place-items: center; }
.ag-dayhead:hover { background: var(--primary-soft); }
.ag-hours { position: sticky; left: 0; z-index: 5; background: var(--surface-2); border-right: 1px solid var(--border); }
.ag-hour { position: absolute; left: 0; right: 0; transform: translateY(-50%); text-align: right; padding-right: 8px; font-size: .7rem; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.ag-hour:first-child { transform: none; padding-top: 3px; }
.ag-col { border-left: 1px solid var(--border); min-width: 0; }
.ag-body { position: relative; }
.ag-slot { position: absolute; left: 0; right: 0; border: 0; border-top: 1px dashed #eef0f5; background: transparent; cursor: pointer; padding: 0; font: inherit; display: flex; align-items: flex-start; justify-content: flex-start; }
.ag-slot.hr { border-top: 1px solid var(--border); }
.ag-slot span { opacity: 0; font-size: .7rem; font-weight: 700; color: var(--primary-strong); padding: 3px 6px; transition: opacity .1s; display: inline-flex; gap: 4px; }
.ag-slot span::before { content: "+"; }
.ag-slot:hover, .ag-slot:focus-visible, .ag-slot.picked { background: var(--primary-soft); outline: none; }
.ag-slot:hover span, .ag-slot:focus-visible span, .ag-slot.picked span { opacity: 1; }
.ag-slot.picked { box-shadow: inset 0 0 0 2px var(--primary); z-index: 1; }
.ag-slot.past { cursor: default; background: rgba(248,249,252,.55); }
.ag-slot.past:hover { background: rgba(248,249,252,.55); }
.ag-slot.past span { display: none; }
.ag-closed { position: absolute; left: 0; right: 0; background: repeating-linear-gradient(135deg, rgba(226,232,240,.55) 0 6px, rgba(248,249,252,.55) 6px 12px); pointer-events: none; z-index: 1; }
.ag-block { position: absolute; left: 4px; right: 4px; z-index: 2; border-radius: 10px; background: repeating-linear-gradient(135deg, #cbd5e1 0 8px, #e2e8f0 8px 16px); color: #334155; font-size: .74rem; font-weight: 600; padding: 4px 6px 4px 8px; display: flex; justify-content: space-between; align-items: flex-start; gap: 4px; overflow: hidden; }
.ag-block span { display: inline-flex; gap: 4px; align-items: center; min-width: 0; }
.ag-block .icon { width: 13px; height: 13px; flex-shrink: 0; }
.ag-block form { margin: 0; }
.ag-block button { border: 0; background: rgba(255,255,255,.7); color: #334155; width: 22px; height: 22px; border-radius: 6px; cursor: pointer; font-size: 1rem; line-height: 1; }
.ag-block button:hover { background: #fff; color: var(--danger); }
.ag-ev { position: absolute; left: 4px; right: 4px; z-index: 3; background: color-mix(in srgb, var(--c) 12%, #fff); border: 1px solid color-mix(in srgb, var(--c) 30%, #fff); border-left: 4px solid var(--c); border-radius: 10px; padding: 4px 8px; color: var(--text); overflow: hidden; display: flex; flex-direction: column; gap: 1px; line-height: 1.25; box-shadow: 0 2px 6px -3px rgba(15,23,42,.25); text-decoration: none; transition: box-shadow .15s, transform .15s; }
.ag-ev:hover { color: var(--text); box-shadow: 0 8px 18px -8px rgba(15,23,42,.35); transform: translateY(-1px); z-index: 4; }
.ag-ev .t { font-size: .7rem; font-weight: 700; color: color-mix(in srgb, var(--c) 75%, #000); display: flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
.ag-ev .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); margin-left: auto; flex-shrink: 0; }
.ag-ev b { font-size: .82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-ev small { font-size: .72rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-ev em { font-style: normal; font-size: .64rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #92400e; }
.ag-ev.tiny { flex-direction: row; align-items: center; gap: 6px; padding-top: 2px; padding-bottom: 2px; }
.ag-ev.tiny small, .ag-ev.tiny em, .ag-ev.tiny .te { display: none; }
.ag-ev .t { white-space: nowrap; gap: 0; }
.ag-ev .t .dot { margin-left: auto; }
.ag-ev.tiny .dot { margin-left: 0; order: -1; }
.ag-ev.st-aguardando_pagamento { background: repeating-linear-gradient(135deg, #fffbeb 0 8px, #fef3c7 8px 16px); border-color: #fcd34d; }
.ag-ev.st-aguardando_pagamento .dot { background: var(--warn); }
.ag-ev.st-concluido { opacity: .75; }
.ag-ev.st-concluido .dot { background: #94a3b8; }
.ag-ev.st-em_atendimento .dot { background: var(--info); }
.ag-ev.st-nao_compareceu { opacity: .6; }
.ag-ev.st-nao_compareceu .dot { background: var(--danger); }
.ag-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--danger); z-index: 5; pointer-events: none; }
.ag-now i { position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--danger); }

.ag-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); box-shadow: var(--sh-1); }
.ag-month .mh { background: var(--surface-2); font-size: .7rem; font-weight: 700; padding: 10px 6px; text-align: center; color: var(--muted); border-bottom: 1px solid var(--border); text-transform: uppercase; letter-spacing: .08em; }
.ag-month .md { min-height: 96px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 8px; display: flex; flex-direction: column; gap: 4px; color: var(--text); text-decoration: none; transition: background .12s; }
.ag-month .md:hover { background: var(--primary-soft); }
.ag-month .md.out { background: var(--surface-2); color: #cbd5e1; }
.ag-month .md .n { font-weight: 700; font-size: .9rem; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; }
.ag-month .md.today .n { background: var(--primary); color: #fff; }
.ag-month .cnt { font-size: .74rem; font-weight: 700; color: var(--primary-strong); }
.ag-month .dots { display: flex; gap: 3px; flex-wrap: wrap; }
.ag-month .dots i { width: 7px; height: 7px; border-radius: 50%; }
.ag-month .first { font-size: .72rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.slot-pop { position: fixed; inset: 0; z-index: 110; }
.slot-pop .sp-shade { position: absolute; inset: 0; background: rgba(15,23,42,.18); }
.sp-panel { position: absolute; width: 320px; background: var(--surface); border-radius: 18px; box-shadow: var(--sh-3); border: 1px solid var(--border); padding: 14px; animation: pop .18s var(--ease); }
.sp-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 12px; }
.sp-head b { display: block; font-size: 1rem; }
.sp-head small { color: var(--muted); font-size: .8rem; }
.sp-or { display: flex; align-items: center; gap: 8px; margin: 12px 0 10px; color: var(--muted); font-size: .76rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.sp-or::before, .sp-or::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
.sp-pro { margin-bottom: 8px; }
.sp-durs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.sp-durs label { margin: 0; cursor: pointer; }
.sp-durs input { position: absolute; opacity: 0; }
.sp-durs span { display: inline-block; padding: 6px 10px; border: 1px solid var(--border-strong); border-radius: 99px; font-size: .8rem; font-weight: 600; color: var(--text-2); }
.sp-durs input:checked + span { background: #334155; border-color: #334155; color: #fff; }
.sp-durs input:focus-visible + span { box-shadow: var(--ring); }
@media (max-width: 640px) {
  .ag-top { align-items: stretch; }
  .ag-top > .btn { width: 100%; }
  .ag-title { width: 100%; justify-content: space-between; }
  .ag-title h2 { font-size: 1.08rem; }
  .ag-bar { flex-direction: column; align-items: stretch; }
  .ag-views { width: 100%; display: grid; grid-template-columns: repeat(4, 1fr); }
  .ag-views a { text-align: center; }
  .ag-filters select, .ag-filters input[type=date] { flex: 1 1 140px; min-width: 0; }
  .ag-legend { font-size: .7rem; gap: 8px 12px; }
  .ag-grid { grid-template-columns: 44px repeat(var(--cols), minmax(0, 1fr)); }
  .ag-hour { font-size: .64rem; padding-right: 4px; }
  .ag-month .md { min-height: 64px; padding: 4px; }
  .ag-month .md .n { width: 24px; height: 24px; font-size: .8rem; }
  .ag-month .cnt { font-size: .66rem; }
  .sp-panel { left: 0 !important; right: 0; bottom: 0; top: auto !important; width: auto; border-radius: 22px 22px 0 0; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); animation: sheetUp .28s var(--ease); }
}

/* ---------------------------------------------------------------- grade visual da semana */
.wg-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.wg-nav { display: flex; align-items: center; gap: 8px; }
.wg-range { display: flex; flex-direction: column; align-items: center; min-width: 150px; line-height: 1.2; }
.wg-range b { font-size: 1rem; letter-spacing: -.01em; }
.wg-range small { font-size: .74rem; color: var(--muted); }
.wg-prof select { min-width: 220px; }
.wg-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .78rem; color: var(--muted); margin-bottom: 10px; }
.wg-legend span { display: inline-flex; align-items: center; gap: 6px; }
.wg-legend .lg { width: 14px; height: 14px; border-radius: 4px; display: inline-block; border: 1px solid var(--border-strong); }
.lg.on { background: var(--primary-soft); border-color: var(--primary) !important; }
.lg.off { background: var(--surface-2); background-image: linear-gradient(135deg, transparent 45%, #cbd5e1 45%, #cbd5e1 55%, transparent 55%); }
.lg.extra { background: #e0f2fe; border-color: #0284c7 !important; }
.lg.booked { background: #ffe4e6; border-color: #e11d48 !important; }
.wg { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.wg-day { border: 1px solid var(--border); border-radius: 14px; background: var(--surface); display: flex; flex-direction: column; min-width: 0; }
.wg-day.today { border-color: var(--primary); box-shadow: var(--ring); }
.wg-day.past { background: var(--surface-2); opacity: .7; }
.wg-head { display: flex; align-items: baseline; gap: 6px; padding: 9px 10px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.wg-head b { font-size: .9rem; }
.wg-head span { font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.wg-head em { font-style: normal; font-size: .64rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--primary); }
.wg-all { margin-left: auto; border: 0; background: none; color: var(--primary); font: inherit; font-size: .72rem; font-weight: 600; cursor: pointer; padding: 2px 4px; border-radius: 6px; }
.wg-all:hover { background: var(--primary-soft); }
.wg-slots { display: flex; flex-direction: column; gap: 3px; padding: 6px; flex: 1; }
.wg-empty { font-size: .8rem; color: var(--muted); text-align: center; padding: 10px 0; }
.gs { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 0; padding: 3px 6px; min-height: 28px; border-radius: 8px; border: 1px solid var(--border-strong); font-size: .84rem; font-weight: 650; font-variant-numeric: tabular-nums; color: var(--text); background: var(--surface); cursor: pointer; user-select: none; position: relative; transition: all .12s; }
label.gs input[type=checkbox] { width: 14px; height: 14px; margin: 0; accent-color: var(--primary); cursor: pointer; flex-shrink: 0; }
label.gs:has(input:checked) { background: var(--primary-soft); border-color: color-mix(in srgb, var(--primary) 55%, var(--border)); color: var(--primary-strong); }
label.gs:not(:has(input:checked)) { background: var(--surface-2); color: #94a3b8; }
label.gs:not(:has(input:checked)) span { text-decoration: line-through; }
label.gs:hover { border-color: var(--primary); }
.gs.extra { background: #e0f2fe; border-color: #7dd3fc; color: #0369a1; cursor: default; }
.gs.extra button { border: 0; background: none; color: inherit; cursor: pointer; font-size: 1rem; line-height: 1; padding: 0 2px; border-radius: 6px; opacity: .7; }
.gs.extra button:hover { opacity: 1; background: rgba(2,132,199,.12); }
.gs.booked { background: #ffe4e6; border-color: #fda4af; color: #9f1239; cursor: default; }
.gs.past { background: none; border-style: dashed; color: #cbd5e1; cursor: default; }
.gs.off.inh { background: var(--surface-2); color: #94a3b8; text-decoration: line-through; cursor: help; }
.gs.inh { cursor: help; opacity: .8; }
.gs.flash { animation: gsflash .9s var(--ease); }
@keyframes gsflash { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--primary) 60%, transparent); } 100% { box-shadow: 0 0 0 8px transparent; } }
.wg-add { padding: 0 8px 8px; }
.wg-plus { width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 4px; border: 1px dashed var(--border-strong); background: none; color: var(--primary); font: inherit; font-size: .8rem; font-weight: 650; padding: 6px; border-radius: 9px; cursor: pointer; }
.wg-plus:hover { background: var(--primary-soft); border-color: var(--primary); }
.wg-plus .icon { width: 14px; height: 14px; }
.wg-new { display: flex; gap: 4px; }
.wg-new input { min-height: 34px; padding: 4px 6px; font-size: .84rem; min-width: 0; flex: 1; }
.wg-new .btn { min-height: 34px; width: 34px; padding: 0; flex-shrink: 0; }
.wg-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); font-size: .86rem; }
[data-wgrid].dirty .wg-foot { position: sticky; bottom: 0; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px); padding: 12px; margin: 14px -12px -12px; border-radius: 0 0 16px 16px; z-index: 5; }
.step-inline { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; padding: 10px 12px; background: var(--primary-soft); border-radius: 12px; }
.step-inline label { margin: 0; font-weight: 650; color: var(--text); }
.step-inline select { width: auto; min-height: 38px; background-color: var(--surface); }
details.more-opts > summary { list-style: none; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
details.more-opts > summary > span { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1.02rem; }
details.more-opts > summary small { font-size: .82rem; }
details.more-opts > summary::after { content: none; }
details.more-opts > summary > span::after { content: "+"; margin-left: auto; font-size: 1.3rem; font-weight: 400; color: var(--muted); }
details.more-opts[open] > summary > span::after { content: "–"; }
.sub-card { border-top: 1px solid var(--border); margin-top: 18px; padding-top: 18px; }
.sub-card h4 { margin: 0 0 10px; font-size: .98rem; }
@media (min-width: 1000px) and (max-width: 1280px) { .wg { gap: 6px; } .gs { font-size: .8rem; padding: 5px 4px; gap: 4px; } }
@media (max-width: 999px) { .wg { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); } }
@media (max-width: 640px) {
  .wg { grid-template-columns: 1fr; }
  .wg.tabbed .wg-day:not(.act) { display: none; }
  .wg-tabs { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 10px; }
  .wg-tabs button { border: 1px solid var(--border); background: var(--surface); border-radius: 12px; padding: 6px 0; font: inherit; display: flex; flex-direction: column; align-items: center; line-height: 1.15; cursor: pointer; color: var(--text); }
  .wg-tabs button b { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
  .wg-tabs button span { font-size: 1.05rem; font-weight: 800; }
  .wg-tabs button small { font-size: .62rem; color: var(--muted); }
  .wg-tabs button.act { background: var(--primary); border-color: var(--primary); color: #fff; }
  .wg-tabs button.act b, .wg-tabs button.act small { color: rgba(255,255,255,.85); }
  .wg-tabs button.past { opacity: .45; }
  .wg-slots { flex-direction: row; flex-wrap: wrap; }
  .gs { flex: 0 0 calc(25% - 3px); padding: 7px 4px; min-height: 38px; }
  .wg-add { padding-top: 0; }
  .wg-toolbar { flex-direction: column; align-items: stretch; }
  .wg-nav { justify-content: space-between; }
  .wg-prof select { width: 100%; }
  .wg-foot .btn { width: 100%; }
  [data-wgrid].dirty .wg-foot { margin: 14px -14px -16px; }
}


/* ---------------------------------------------------------------- fundo da página pública (aparência) */
.bg-pick { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.bg-thumb { width: 220px; aspect-ratio: 16 / 10; border-radius: 14px; border: 1px solid var(--border); background: var(--surface-2) center / cover no-repeat; display: grid; place-items: center; font-size: .82rem; flex-shrink: 0; }
input[type=range] { width: 100%; accent-color: var(--primary); }
@media (max-width: 640px) { .bg-thumb { width: 100%; } }

/* ---------------------------------------------------------------- seleção de cliente */
.client-pick { margin-bottom: 6px; }
.cp-input { display: flex; align-items: center; gap: 10px; border: 1px solid var(--border-strong); border-radius: 14px; padding: 0 12px; background: var(--surface); }
.cp-input:focus-within { border-color: var(--primary); box-shadow: var(--ring); }
.cp-input .icon { color: var(--muted); }
.cp-input input { border: 0 !important; box-shadow: none !important; padding-left: 0; min-height: 48px; font-size: 1rem; }
.cp-results { margin-top: 6px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); box-shadow: var(--sh-2); overflow: hidden; }
.cp-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0; border-bottom: 1px solid var(--border); background: none; font: inherit; text-align: left; color: var(--text); cursor: pointer; }
.cp-row:last-child { border-bottom: 0; }
button.cp-row:hover, button.cp-row:focus-visible { background: var(--primary-soft); outline: none; }
.cp-row .avatar { width: 34px; height: 34px; font-size: .8rem; }
.cp-row b { display: block; font-size: .92rem; }
.cp-row small { color: var(--muted); font-size: .8rem; }
.cp-row.empty-row { cursor: default; color: var(--muted); font-size: .88rem; display: block; }
.btn.cp-newbtn { margin-top: 8px; color: var(--primary); border: 1px dashed color-mix(in srgb, var(--primary) 50%, var(--border)); background: var(--surface); }
.btn.cp-newbtn:hover { background: var(--primary-soft); color: var(--primary-strong); }
.cp-selected { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid color-mix(in srgb, var(--primary) 45%, var(--border)); background: var(--primary-soft); border-radius: 14px; }
.cp-selected .avatar { background: var(--primary); color: #fff; }
.cp-who { flex: 1; min-width: 0; line-height: 1.25; }
.cp-who b { display: block; }
.cp-new { border: 1px dashed var(--border-strong); border-radius: 14px; padding: 12px 14px 2px; background: var(--surface-2); }

/* ---------------------------------------------------------------- link de agendamento (dashboard) */
.share-link { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; background: linear-gradient(135deg, var(--primary-soft), var(--surface)); border-color: color-mix(in srgb, var(--primary) 30%, var(--border)); }
.sl-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--primary); color: #fff; display: grid; place-items: center; flex-shrink: 0; }
.sl-body { flex: 1; min-width: 200px; }
.sl-body b { display: block; font-size: .95rem; }
.sl-url { font-family: ui-monospace, monospace; font-size: .86rem; color: var(--primary-strong); word-break: break-all; margin-top: 2px; }
.sl-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.grid > .share-link { margin-bottom: 0; }
.mini-link { display: flex; align-items: center; gap: 2px; margin-top: 4px; font-size: .78rem; min-width: 0; }
.mini-link a { font-family: ui-monospace, monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.ml-tag { font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; background: var(--primary-soft); color: var(--primary-strong); border-radius: 6px; padding: 1px 5px; margin-right: 4px; flex-shrink: 0; }
.ml-tag.adm { background: #eef1f6; color: var(--text-2); }
.mini-link .icon-btn { width: 26px; height: 26px; font-size: .8rem; }
.mini-link .icon-btn:hover { background: var(--primary-soft); color: var(--primary); }
.mini-link .icon-btn .icon { width: 14px; height: 14px; }
@media (max-width: 640px) { .sl-actions { width: 100%; } .sl-actions .btn { flex: 1; } }

/* ---------------------------------------------------------------- paginação */
[hidden] { display: none !important; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.pager-info { font-size: .82rem; color: var(--muted); font-variant-numeric: tabular-nums; }
div.pager-info { margin-top: 10px; text-align: right; }
.pager-btns { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.pg { min-width: 36px; height: 36px; padding: 0 10px; display: inline-grid; place-items: center; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font: inherit; font-size: .88rem; font-weight: 600; cursor: pointer; text-decoration: none; font-variant-numeric: tabular-nums; transition: all .15s; }
a.pg:hover, button.pg:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.pg.nav { font-size: 1.1rem; line-height: 1; }
.pg.cur { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 6px 14px -6px color-mix(in srgb, var(--primary) 70%, transparent); cursor: default; }
.pg.off { opacity: .35; cursor: default; }
.pg.gap { border-color: transparent; background: none; cursor: default; min-width: 20px; padding: 0; }
@media (max-width: 640px) {
  .pager { justify-content: center; }
  .pager-info { width: 100%; text-align: center; }
  .pg { min-width: 38px; height: 38px; }
  .pager-btns > .pg.nav:first-child, .pager-btns > .pg.nav:last-child { display: none; }
}

/* =====================================================================
   RESPONSIVO — smartphone (≤640) · tablet (641–1023) · notebook (≥1024)
   ===================================================================== */
svg { max-width: 100%; }
svg.icon { max-width: none; }
.grid > *, .row > *, .main, .card { min-width: 0; }
.table-wrap { max-width: 100%; }
.day-grid { overflow: clip; }
.day-grid .hours { position: sticky; left: 0; z-index: 4; }
.topbar .btn.small .icon { width: 16px; height: 16px; }

/* notebook: menu um pouco mais estreito em telas de 1024–1280 */
@media (min-width: 1000px) and (max-width: 1280px) {
  .sidebar { width: 232px; }
  .sidebar nav a { padding: 8px 10px; font-size: .88rem; }
  .content { padding: 24px 24px 40px; }
}

/* tablet */
@media (min-width: 641px) and (max-width: 999px) {
  .content { padding: 22px 22px 40px; }
  .topbar { padding: 12px 22px; }
  .grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
  .grid.cols-3 { grid-template-columns: repeat(2, 1fr); }
  .stat .value { font-size: 1.5rem; }
}

/* smartphone */
@media (max-width: 640px) {
  :root { font-size: 14px; }
  h1 { font-size: 1.35rem; } h2 { font-size: 1.08rem; }
  .content { padding: 14px 12px 32px; }
  .topbar { padding: 8px 12px; min-height: 56px; gap: 10px; }
  .topbar .title { font-size: 1rem; }
  .menu-btn { width: 38px; height: 38px; border-radius: 11px; }
  .topbar .btn.small span { display: none; }
  .topbar .btn.small { width: 38px; height: 38px; min-height: 38px; padding: 0; border-radius: 11px; }
  .card { padding: 16px 14px; border-radius: 16px; margin-bottom: 14px; }
  .grid { gap: 12px; }
  /* indicadores 2 por linha, compactos */
  .grid.cols-3 { grid-template-columns: 1fr; }
  .grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
  .grid.cols-4:has(> .stat), .grid.cols-3:has(> .stat) { grid-template-columns: repeat(2, 1fr); }
  .grid.cols-4 > .stat, .grid.cols-3 > .stat { padding: 12px 14px; border-radius: 16px; }
  .stat .label { font-size: .66rem; letter-spacing: .06em; }
  .stat .value { font-size: 1.22rem; margin-top: 2px; }
  .stat small { font-size: .72rem; }
  .stat::after { width: 70px; height: 70px; right: -24px; top: -24px; }
  .btn { padding: 9px 14px; font-size: .9rem; min-height: 42px; }
  .btn.small { min-height: 34px; padding: 6px 11px; }
  .row > .btn, .row > form > .btn { flex: 0 1 auto; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dt { font-size: .78rem; margin-top: 8px; }
  .tabs { width: 100%; }
  .cal-toolbar { gap: 8px; }
  .cal-toolbar .period { min-width: 0; font-size: 1rem; flex: 1 1 100%; order: -1; }
  .cal-toolbar input[type=date], .cal-toolbar select { width: auto; flex: 1 1 140px; }
  .seg a, .seg button { padding: 6px 10px; font-size: .82rem; }
  .day-grid { grid-template-columns: 48px 1fr; }
  .day-grid .hour { font-size: .66rem; padding: 4px 5px; }
  .day-col { min-width: 132px; }
  .ev { font-size: .7rem; padding: 4px 6px; }
  .month-grid .md { min-height: 58px; padding: 3px; font-size: .64rem; }
  .month-grid .md .n { width: 22px; height: 22px; font-size: .72rem; }
  .month-grid .md a.mini { padding: 1px 4px; font-size: .62rem; }
  .month-grid .mh { font-size: .6rem; padding: 8px 2px; letter-spacing: .02em; }
  .avatar.lg { width: 60px; height: 60px; }
  .alert { font-size: .86rem; padding: 10px 12px; }
  .auth-card { padding: 26px 18px !important; }

  /* tabelas viram cartões no celular (rótulos vêm do cabeçalho via JS) */
  .table-wrap:has(> table.table:not(.no-stack)) { overflow: visible; border-radius: 0; }
  table.table:not(.no-stack), table.table:not(.no-stack) tbody, table.table:not(.no-stack) tr, table.table:not(.no-stack) td { display: block; width: 100%; }
  table.table:not(.no-stack) thead { display: none; }
  table.table:not(.no-stack) tr { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; margin-bottom: 10px; background: var(--surface); box-shadow: var(--sh-1); }
  table.table:not(.no-stack) tr[hidden] { display: none !important; }
  table.table:not(.no-stack) tr:hover td { background: none; }
  table.table:not(.no-stack) td { border: 0; padding: 0; text-align: left; min-width: 0; overflow-wrap: anywhere; font-size: .9rem; line-height: 1.35; width: auto; }
  table.table:not(.no-stack) td::before { content: attr(data-label); display: block; color: var(--muted); font-size: .64rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 2px; }
  table.table:not(.no-stack) td[data-label=""]::before, table.table:not(.no-stack) td:not([data-label])::before { display: none; }
  table.table:not(.no-stack) td:first-child { grid-column: 1 / -1; font-weight: 700; font-size: .95rem; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
  table.table:not(.no-stack) td:first-child::before, table.table:not(.no-stack) td.title-sm::before { display: none; }
  table.table:not(.no-stack) td.title-sm { grid-column: 1 / -1; font-weight: 700; font-size: .95rem; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
  .hide-sm { display: none !important; }
  table.table:not(.no-stack) td[data-label=""]:not(:first-child) { grid-column: 1 / -1; display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 6px; padding-top: 4px; }
  table.table:not(.no-stack) td[data-label=""] .btn { margin: 0; }
  table.table:not(.no-stack) td.num { text-align: left; white-space: normal; }
  table.table:not(.no-stack) td > .row { justify-content: flex-start; }
  table.table:not(.no-stack) tr td[colspan] { grid-column: 1 / -1; text-align: center; }
  table.table:not(.no-stack) tr td[colspan]::before { display: none; }
}

/* crédito do desenvolvedor (rodapé) */
.pub-body { display: flex; flex-direction: column; }
.pub-page { flex: 1 0 auto; }
.pub-body:has(.auth-wrap) { position: relative; }
.pub-page > .auth-wrap { padding-bottom: 64px; }
.pub-body:has(.auth-wrap) > .credit { position: absolute; left: 0; right: 0; bottom: 0; }
.pub-body:has(.auth-wrap.dark) > .credit, .pub-body:has(.auth-wrap.dark) > .credit a { color: rgba(255,255,255,.75); }
.credit { text-align: center; font-size: .78rem; color: var(--muted); padding: 16px 12px calc(16px + env(safe-area-inset-bottom)); }
.credit a { color: var(--text-2); font-weight: 650; display: inline-flex; align-items: center; gap: 4px; }
.credit a:hover { color: var(--primary); }
.credit .icon { width: 14px; height: 14px; }
.main > .credit { border-top: 1px solid var(--border); margin: 0 16px; }
body.has-cta .credit { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
@media (min-width: 720px) { body.has-cta .credit { padding-bottom: 16px; } }
button:focus:not(:focus-visible) { outline: none; }

/* legado: barra de instalação antiga (mantida oculta) */
.install-bar { display: none !important; }

@media print { .sidebar, .topbar, .no-print, .install-fab { display: none !important; } .content { padding: 0; } body { background: #fff; } .card { box-shadow: none; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Master: alterar senha de usuário */
.pw-reset { margin-top: 14px; padding: 14px; border: 1px dashed var(--border, #dfe3ee); border-radius: 12px; background: var(--surface-2, #f8f9fc); }
.pw-reset h4 { margin: 0 0 4px; font-size: .95rem; }
.pw-reset p.muted { margin: 0 0 10px; font-size: .82rem; }
.pw-reset-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: end; }
.pw-reset-row label:first-child { grid-column: 1 / -1; }
.pw-reset-row label { display: flex; flex-direction: column; gap: 4px; font-size: .8rem; font-weight: 600; min-width: 0; }
.pw-reset-row select, .pw-reset-row input { width: 100%; min-width: 0; }
@media (max-width: 560px) { .pw-reset-row { grid-template-columns: 1fr; } }
