/* Eu Marco — estilos base */
:root {
  --brand: #2563eb;
  --brand-600: color-mix(in srgb, var(--brand) 88%, #000);
  --brand-50: color-mix(in srgb, var(--brand) 8%, #fff);
  --brand-100: color-mix(in srgb, var(--brand) 16%, #fff);
  --bg: #f6f7fb;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 4px 16px rgba(15, 23, 42, .06);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.5; color: var(--text); background: var(--bg); }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.25rem; } h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
small, .muted { color: var(--muted); }
.hidden { display: none !important; }
img { max-width: 100%; }

/* ---------- Botões ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .6rem 1rem; border-radius: 10px; border: 1px solid transparent;
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none !important; transition: background .15s, border-color .15s, opacity .15s; white-space: nowrap; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-600); }
.btn-light { background: #fff; border-color: var(--border); color: var(--text); }
.btn-light:hover { background: #f8fafc; }
.btn-danger { background: #fff; border-color: #fecaca; color: var(--danger); }
.btn-danger:hover { background: #fef2f2; }
.btn-success { background: var(--success); color: #fff; }
.btn-wa { background: #25d366; color: #fff; }
.btn-sm { padding: .35rem .7rem; font-size: .85rem; border-radius: 8px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.link-btn { background: none; border: 0; color: var(--brand); font: inherit; cursor: pointer; padding: 0; }
.link-btn.danger { color: var(--danger); }

/* ---------- Formulários ---------- */
.form-group { margin-bottom: 1rem; }
label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .3rem; }
.req::after { content: " *"; color: var(--danger); }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number], input[type=date], input[type=time], input[type=search], select, textarea {
  width: 100%; padding: .6rem .75rem; border: 1px solid var(--border); border-radius: 10px; font: inherit; color: var(--text); background: #fff; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-100); }
textarea { min-height: 90px; resize: vertical; }
input[type=color] { width: 56px; height: 40px; border: 1px solid var(--border); border-radius: 10px; padding: 3px; background: #fff; }
.check { display: flex; align-items: flex-start; gap: .55rem; font-weight: 500; cursor: pointer; }
.check input { margin-top: .25rem; width: 18px; height: 18px; accent-color: var(--brand); flex-shrink: 0; }
.hint { font-size: .82rem; color: var(--muted); margin-top: .25rem; }
.error-text { font-size: .82rem; color: var(--danger); margin-top: .25rem; }
.has-error input, .has-error select, .has-error textarea { border-color: var(--danger); }
.input-prefix { display: flex; align-items: stretch; }
.input-prefix span { display: flex; align-items: center; padding: 0 .7rem; background: #f1f5f9; border: 1px solid var(--border); border-right: 0; border-radius: 10px 0 0 10px; color: var(--muted); font-size: .9rem; white-space: nowrap; }
.input-prefix input { border-radius: 0 10px 10px 0; }
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 720px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* ---------- Cards / tabelas ---------- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem; margin-bottom: 1.25rem; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .7rem .6rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
tr:last-child td { border-bottom: 0; }
.row-link { cursor: pointer; }
.row-link:hover td { background: #f8fafc; }

.badge { display: inline-block; padding: .15rem .55rem; border-radius: 999px; font-size: .75rem; font-weight: 600; background: #f1f5f9; color: #334155; white-space: nowrap; }
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-confirmed { background: #dbeafe; color: #1e40af; }
.badge-completed { background: #dcfce7; color: #166534; }
.badge-cancelled { background: #fee2e2; color: #991b1b; }
.badge-no_show { background: #f3e8ff; color: #6b21a8; }
.badge-off { background: #f1f5f9; color: #94a3b8; }

.alert { padding: .8rem 1rem; border-radius: 10px; margin-bottom: 1rem; border: 1px solid; font-weight: 500; }
.alert-success { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.alert-error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.alert-warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.alert-info { background: var(--brand-50); border-color: var(--brand-100); color: var(--text); }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.stat { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.1rem; box-shadow: var(--shadow); }
.stat b { display: block; font-size: 1.6rem; letter-spacing: -.02em; }
.stat span { color: var(--muted); font-size: .85rem; }
@media (max-width: 900px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.empty { text-align: center; color: var(--muted); padding: 2rem 1rem; }
.flex { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; } .mt-1 { margin-top: 1rem; }
.inline { display: inline; }

/* ---------- Painel ---------- */
.panel { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar { background: #0f172a; color: #cbd5e1; padding: 1.25rem .9rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; }
.sidebar .logo { color: #fff; font-weight: 800; font-size: 1.2rem; padding: 0 .6rem 1.2rem; display: block; letter-spacing: -.02em; }
.sidebar .logo span { color: #60a5fa; }
.sidebar nav a { display: flex; align-items: center; gap: .6rem; color: #cbd5e1; padding: .55rem .7rem; border-radius: 8px; font-weight: 500; margin-bottom: 2px; }
.sidebar nav a:hover { background: rgba(255, 255, 255, .06); text-decoration: none; color: #fff; }
.sidebar nav a.active { background: rgba(96, 165, 250, .16); color: #fff; }
.sidebar nav a svg { width: 18px; height: 18px; flex-shrink: 0; opacity: .85; }
.sidebar .biz { margin-top: auto; padding: .8rem .7rem 0; border-top: 1px solid rgba(255, 255, 255, .08); font-size: .85rem; }
.sidebar .biz b { color: #fff; display: block; }
.sidebar .biz .link-btn { color: #94a3b8; font-size: .85rem; margin-top: .4rem; }
.main { padding: 1.75rem 2rem 3rem; min-width: 0; max-width: 1200px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.page-head h1 { margin: 0; }
.share-box { display: flex; gap: .5rem; align-items: center; background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: .35rem .35rem .35rem .8rem; }
.share-box code { font-size: .88rem; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar { display: none; }
@media (max-width: 900px) {
  .panel { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 50; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: none; }
  .topbar { display: flex; align-items: center; justify-content: space-between; padding: .8rem 1rem; background: #0f172a; color: #fff; position: sticky; top: 0; z-index: 40; }
  .topbar b { font-weight: 800; }
  .topbar button { background: none; border: 0; color: #fff; font-size: 1.5rem; cursor: pointer; }
  .main { padding: 1.25rem 1rem 3rem; }
}

.appt-list { display: flex; flex-direction: column; gap: .5rem; }
.appt { display: grid; grid-template-columns: 70px 1fr auto; gap: .9rem; align-items: center; padding: .75rem .9rem; border: 1px solid var(--border); border-left: 4px solid var(--brand); border-radius: 10px; background: #fff; color: var(--text); }
.appt:hover { text-decoration: none; background: #f8fafc; }
.appt .time { font-weight: 700; font-size: 1.05rem; }
.appt .time small { display: block; font-weight: 500; font-size: .78rem; }
.appt .who b { display: block; }
.appt .who span { color: var(--muted); font-size: .88rem; }
.appt.st-pending { border-left-color: var(--warning); }
.appt.st-cancelled { border-left-color: #cbd5e1; opacity: .65; }
.appt.st-completed { border-left-color: var(--success); }
.appt.st-no_show { border-left-color: #a855f7; }
@media (max-width: 560px) { .appt { grid-template-columns: 58px 1fr; } .appt .badge { grid-column: 2; justify-self: start; } }
.day-title { font-weight: 700; margin: 1.25rem 0 .5rem; }

.dl { display: grid; grid-template-columns: 180px 1fr; gap: .5rem 1rem; margin: 0; }
.dl dt { color: var(--muted); font-weight: 500; }
.dl dd { margin: 0; font-weight: 500; word-break: break-word; }
@media (max-width: 560px) { .dl { grid-template-columns: 1fr; } .dl dd { margin-bottom: .5rem; } }

.hours-day { display: grid; grid-template-columns: 150px 1fr; gap: 1rem; padding: .9rem 0; border-bottom: 1px solid var(--border); align-items: start; }
.hours-day:last-of-type { border-bottom: 0; }
.interval { display: flex; gap: .5rem; align-items: center; margin-bottom: .5rem; }
.interval input { max-width: 130px; }
@media (max-width: 560px) { .hours-day { grid-template-columns: 1fr; gap: .5rem; } }

.setup-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; }
.setup-step { border: 1px dashed var(--border); border-radius: 10px; padding: .8rem 1rem; color: var(--text); }
.setup-step.done { border-style: solid; background: #f0fdf4; border-color: #bbf7d0; }
.setup-step b { display: block; }
@media (max-width: 720px) { .setup-steps { grid-template-columns: 1fr; } }

.integration { display: flex; gap: 1rem; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.integration .who { display: flex; gap: .9rem; align-items: center; }
.integration .icon { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; background: #f1f5f9; font-weight: 800; font-size: 1.1rem; }

/* ---------- Site / auth ---------- */
.site-header { display: flex; align-items: center; justify-content: space-between; max-width: 1100px; margin: 0 auto; padding: 1.1rem 1.25rem; }
.site-header .logo { font-weight: 800; font-size: 1.3rem; color: var(--text); letter-spacing: -.02em; }
.site-header .logo span { color: var(--brand); }
.hero { max-width: 1100px; margin: 0 auto; padding: 3rem 1.25rem 2rem; display: grid; grid-template-columns: 1.1fr 1fr; gap: 3rem; align-items: center; }
.hero h1 { font-size: clamp(2rem, 4.5vw, 3rem); letter-spacing: -.03em; }
.hero p.lead { font-size: 1.15rem; color: var(--muted); }
.hero-card { background: #fff; border-radius: 18px; box-shadow: 0 20px 50px rgba(15, 23, 42, .12); padding: 1.25rem; border: 1px solid var(--border); }
.features { max-width: 1100px; margin: 0 auto; padding: 1rem 1.25rem 4rem; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.feature { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 1.2rem; }
.feature h3 { margin-bottom: .3rem; }
.feature p { color: var(--muted); margin: 0; font-size: .93rem; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin: 1rem 0 1.5rem; }
.chip { padding: .3rem .7rem; border-radius: 999px; background: #fff; border: 1px solid var(--border); font-size: .85rem; color: var(--text); }
.chip:hover { border-color: var(--brand); text-decoration: none; }
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; padding-top: 1.5rem; } .features { grid-template-columns: 1fr; } }
.auth-box { max-width: 460px; margin: 2rem auto 4rem; padding: 0 1rem; }
.auth-box .card { padding: 1.75rem; }
.site-footer { text-align: center; color: var(--muted); font-size: .85rem; padding: 2rem 1rem; }

/* ---------- Página pública de agendamento ---------- */
.bk { max-width: 760px; margin: 0 auto; padding: 1.5rem 1rem 4rem; }
.bk-header { display: flex; gap: 1rem; align-items: center; margin-bottom: 1.25rem; }
.bk-logo { width: 64px; height: 64px; border-radius: 16px; object-fit: cover; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 1.6rem; flex-shrink: 0; }
.bk-header h1 { margin: 0 0 .15rem; font-size: 1.4rem; }
.bk-header .meta { color: var(--muted); font-size: .9rem; display: flex; flex-wrap: wrap; gap: .25rem .9rem; }
.bk-desc { color: var(--muted); margin-bottom: 1rem; white-space: pre-line; }
.steps { display: flex; gap: .4rem; margin-bottom: 1rem; }
.steps span { flex: 1; height: 5px; border-radius: 5px; background: var(--border); transition: background .2s; }
.steps span.on { background: var(--brand); }
.step-title { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .9rem; }
.step-title h2 { margin: 0; font-size: 1.15rem; }

.svc { display: flex; gap: .9rem; align-items: center; border: 1.5px solid var(--border); border-radius: 12px; padding: .9rem 1rem; margin-bottom: .6rem; cursor: pointer; background: #fff; transition: border-color .15s, background .15s; font-weight: 400; }
.svc:hover { border-color: var(--brand-100); }
.svc input { width: 20px; height: 20px; accent-color: var(--brand); flex-shrink: 0; margin: 0; }
.svc .info { flex: 1; min-width: 0; }
.svc .info b { display: block; }
.svc .info small { display: block; }
.svc .price { font-weight: 700; white-space: nowrap; text-align: right; }
.svc .price small { display: block; font-weight: 500; color: var(--muted); }
.svc.selected { border-color: var(--brand); background: var(--brand-50); }

.summary-bar { position: sticky; bottom: 0; background: #fff; border-top: 1px solid var(--border); padding: .8rem 1rem; margin: 1rem -1.25rem -1.25rem; border-radius: 0 0 var(--radius) var(--radius); display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.summary-bar .tot b { font-size: 1.05rem; }

.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .6rem; }
.cal-head b { text-transform: capitalize; font-size: 1.05rem; }
.cal-nav { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border); background: #fff; cursor: pointer; font-size: 1.1rem; }
.cal-nav:disabled { opacity: .35; cursor: default; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.cal .dow { font-size: .75rem; color: var(--muted); font-weight: 600; padding: .3rem 0; }
.cal button { aspect-ratio: 1; border: 0; border-radius: 10px; background: transparent; font: inherit; font-weight: 600; color: #cbd5e1; cursor: default; max-height: 56px; }
.cal button.avail { color: var(--text); background: var(--brand-50); cursor: pointer; }
.cal button.avail:hover { background: var(--brand-100); }
.cal button.sel { background: var(--brand) !important; color: #fff !important; }
.cal button.today { box-shadow: inset 0 0 0 1.5px var(--border); }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: .5rem; margin-top: 1rem; }
.slots button { padding: .6rem 0; border: 1.5px solid var(--border); border-radius: 10px; background: #fff; font: inherit; font-weight: 600; cursor: pointer; }
.slots button:hover { border-color: var(--brand); }
.slots button.sel { background: var(--brand); border-color: var(--brand); color: #fff; }
.loading { color: var(--muted); padding: 1rem 0; text-align: center; }
.recap { background: var(--brand-50); border-radius: 12px; padding: .9rem 1rem; margin-bottom: 1rem; font-size: .95rem; }
.recap b { display: block; }
.success-icon { width: 64px; height: 64px; border-radius: 50%; background: #dcfce7; color: var(--success); display: grid; place-items: center; font-size: 2rem; margin: 0 auto 1rem; }
.hp { position: absolute; left: -9999px; }
.powered { text-align: center; font-size: .8rem; color: var(--muted); margin-top: 2rem; }
.powered a { color: var(--muted); font-weight: 600; }
