/* NISSBOOK — sistema de design compartilhado */
:root {
  --brand: #f0b429;
  --brand-on: #241c00;
  --brand-ink: var(--brand-ink-l, #7a5800);
  --brand-soft: color-mix(in srgb, var(--brand) 11%, var(--card));
  --brand-line: color-mix(in srgb, var(--brand) 30%, var(--card));
  --ink: #24211e;
  --muted: #77716a;
  --bg: #f6f5f2;
  --card: #ffffff;
  --line: #e6e2dc;
  --ok: #1f9d6b;
  --warn: #d98a00;
  --danger: #d6455d;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(40, 35, 30, .05), 0 8px 30px rgba(40, 35, 30, .07);
  --surface-2: #f9f8f5; --hover: rgba(0, 0, 0, .05); --on-ink: #ffffff; --star-off: #e5dfd0;
  --ok-bg: #e3f6ee; --ok-fg: #12724d; --warn-bg: #fff3da; --warn-fg: #9a6200; --danger-bg: #fde6ea; --danger-fg: #a82a41; --gray-bg: #f1ecf2; --gray-fg: #6d5f74;
  --notice-bg: #fff3da; --notice-fg: #7a4d00; --notice-danger-fg: #8e2236; --overlay: rgba(43, 31, 46, .45); --edge: rgba(255, 255, 255, .8);
  color-scheme: light;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --brand-ink: var(--brand-ink-d, #f3c85a);
  --ink: #f1ede6; --muted: #a39c91; --bg: #141210; --card: #1e1b17; --line: #38342d;
  --ok: #3dc28d; --warn: #f0a526; --danger: #ef6a80;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 30px rgba(0, 0, 0, .35);
  --surface-2: #26221d; --hover: rgba(255, 255, 255, .07); --on-ink: #14120f; --star-off: #4a443a;
  --ok-bg: #123a2c; --ok-fg: #7fe0b8; --warn-bg: #3d2d0c; --warn-fg: #f5c667; --danger-bg: #44181f; --danger-fg: #f59aa9; --gray-bg: #2e2833; --gray-fg: #c4b6cc;
  --notice-bg: #3d2d0c; --notice-fg: #f5d28a; --notice-danger-fg: #f7a8b5; --overlay: rgba(0, 0, 0, .65); --edge: rgba(255, 255, 255, .12);
  color-scheme: dark;
} }
:root[data-theme="dark"] {
  --brand-ink: var(--brand-ink-d, #f3c85a);
  --ink: #f1ede6; --muted: #a39c91; --bg: #141210; --card: #1e1b17; --line: #38342d;
  --ok: #3dc28d; --warn: #f0a526; --danger: #ef6a80;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 30px rgba(0, 0, 0, .35);
  --surface-2: #26221d; --hover: rgba(255, 255, 255, .07); --on-ink: #14120f; --star-off: #4a443a;
  --ok-bg: #123a2c; --ok-fg: #7fe0b8; --warn-bg: #3d2d0c; --warn-fg: #f5c667; --danger-bg: #44181f; --danger-fg: #f59aa9; --gray-bg: #2e2833; --gray-fg: #c4b6cc;
  --notice-bg: #3d2d0c; --notice-fg: #f5d28a; --notice-danger-fg: #f7a8b5; --overlay: rgba(0, 0, 0, .65); --edge: rgba(255, 255, 255, .12);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); line-height: 1.5; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.02em; }
p { margin: 0 0 1em; }
a { color: var(--brand-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { max-width: 100%; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.center { text-align: center; }
.row { display: flex; gap: 12px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.spread { justify-content: space-between; }
.grow { flex: 1; }
.gap-s { gap: 8px; }
.mt { margin-top: 16px; } .mt-s { margin-top: 8px; } .mb { margin-bottom: 16px; }

/* logo */
.logo { font-weight: 800; font-size: 1.3rem; letter-spacing: .14em; color: var(--ink); display: inline-flex; align-items: center; gap: 8px; }
.logo:hover { text-decoration: none; }
.logo .dot { width: 26px; height: 26px; border-radius: 9px; background: linear-gradient(135deg, #f9d56e, #f0b429 60%, #d99a0b); display: inline-grid; place-items: center; color: #241c00; font-size: 15px; box-shadow: 0 4px 12px rgba(240, 180, 41, .4); }

/* botões */
.btn { appearance: none; border: 0; cursor: pointer; font: inherit; font-weight: 650; padding: 11px 20px; border-radius: 999px; background: var(--brand); color: var(--brand-on); transition: transform .08s, box-shadow .15s, background .15s; display: inline-flex; align-items: center; gap: 8px; justify-content: center; text-decoration: none; white-space: nowrap; }
.btn:hover { text-decoration: none; box-shadow: 0 6px 18px color-mix(in srgb, var(--brand) 38%, transparent); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .55; cursor: not-allowed; box-shadow: none; }
.btn.ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.btn.ghost:hover { border-color: var(--brand-line); background: var(--brand-soft); box-shadow: none; }
.btn.soft { background: var(--brand-soft); color: var(--brand-ink); }
.btn.danger { background: var(--danger); }
.btn.ok { background: var(--ok); }
.btn.sm { padding: 6px 13px; font-size: .86rem; }
.btn.lg { padding: 15px 28px; font-size: 1.05rem; }
.btn.block { width: 100%; }

/* formulários */
label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: 6px; }
input, select, textarea { font: inherit; width: 100%; padding: 11px 14px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--card); color: var(--ink); transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 16%, transparent); }
input[type=checkbox] { width: auto; accent-color: var(--brand); }
input[type=color] { padding: 3px; height: 44px; }
.field { margin-bottom: 14px; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.hint { font-size: .8rem; color: var(--muted); margin-top: 5px; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 600; cursor: pointer; }
.check input { width: 18px; height: 18px; }

/* cartões */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.card.flat { box-shadow: none; }
.card h3 { font-size: 1.05rem; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.stat .v { font-size: 1.9rem; font-weight: 800; letter-spacing: -.03em; }
.stat .l { color: var(--muted); font-size: .85rem; font-weight: 600; }

/* tabela */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: var(--surface-2); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }

/* badges */
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .76rem; font-weight: 700; background: var(--brand-soft); color: var(--brand-ink); white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok-fg); }
.badge.warn { background: var(--warn-bg); color: var(--warn-fg); }
.badge.danger { background: var(--danger-bg); color: var(--danger-fg); }
.badge.gray { background: var(--gray-bg); color: var(--gray-fg); }

/* modal + toast */
.modal-bg { position: fixed; inset: 0; background: var(--overlay); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 16px; z-index: 50; overflow-y: auto; }
.modal { background: var(--card); border-radius: 20px; width: 100%; max-width: 520px; padding: 26px; box-shadow: 0 30px 80px rgba(0, 0, 0, .25); margin: auto; }
.modal h3 { font-size: 1.25rem; margin-bottom: 18px; }
.modal .actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 100; width: min(92vw, 420px); }
.toast { background: var(--ink); color: var(--on-ink); padding: 12px 18px; border-radius: 14px; box-shadow: var(--shadow); font-weight: 600; animation: pop .2s ease; }
.toast.err { background: var(--danger); }
.toast.ok { background: var(--ok); }
@keyframes pop { from { opacity: 0; transform: translateY(8px); } }

.empty { text-align: center; padding: 38px 16px; color: var(--muted); }
.empty .big { font-size: 2.2rem; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--card); font-weight: 650; cursor: pointer; font: inherit; font-weight: 650; color: var(--ink); }
.chip:hover { border-color: var(--brand-line); background: var(--brand-soft); }
.chip.on { background: var(--brand); border-color: var(--brand); color: var(--brand-on); }

/* layout de painel (admin e salão) */
.shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.side { background: var(--card); border-right: 1px solid var(--line); padding: 22px 16px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px; }
.side .logo { padding: 0 10px 18px; }
.side a.nav { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 12px; color: var(--ink); font-weight: 600; text-decoration: none; }
.side a.nav:hover { background: var(--brand-soft); }
.side a.nav.on { background: var(--brand); color: var(--brand-on); }
.side .bottom { margin-top: auto; padding: 10px; }
.main { min-width: 0; padding: 30px clamp(16px, 4vw, 44px) 80px; max-width: 1180px; width: 100%; }
.main h1 { font-size: 1.7rem; margin-bottom: 4px; }
.topbar { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; flex-wrap: wrap; margin-bottom: 24px; }
.notice { padding: 14px 18px; border-radius: 14px; background: var(--notice-bg); color: var(--notice-fg); font-weight: 600; margin-bottom: 18px; }
.notice.danger { background: var(--danger-bg); color: var(--notice-danger-fg); }
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 12px; gap: 6px; border-right: 0; border-bottom: 1px solid var(--line); }
  .side .logo { padding: 0 8px 0 4px; width: 100%; }
  .side a.nav { padding: 8px 12px; font-size: .88rem; flex: 1 1 auto; justify-content: center; white-space: nowrap; }
  .side .bottom { margin: 0; padding: 0; width: 100%; }
  .grid2 { grid-template-columns: 1fr; }
}
.logo .mark { width: 30px; height: 30px; border-radius: 9px; flex: none; box-shadow: 0 4px 12px rgba(240, 180, 41, .35); }

/* telefone com código do país e escolha de profissionais */
.phone-in { display: flex; gap: 8px; } .phone-in select { width: auto; max-width: 46%; flex: none; } .phone-in input { min-width: 0; flex: 1; }
.checks { display: flex; flex-wrap: wrap; gap: 8px; } .checks label { margin: 0; border: 1.5px solid var(--line); background: var(--card, #fff); border-radius: 999px; padding: 7px 14px; font-weight: 650; display: inline-flex; gap: 8px; align-items: center; cursor: pointer; }
.checks label:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); } .checks input { width: auto; }

.cal{background:var(--card,#fff);border:1px solid var(--line,#eee);border-radius:14px;padding:10px;margin-bottom:14px}
.cal-h,.cal-g{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:4px}
.cal-h div{text-align:center;font-size:11px;color:var(--muted,#888);text-transform:capitalize;padding:4px 0;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.mc{position:relative;aspect-ratio:1/0.85;min-height:44px;border:1px solid transparent;border-radius:10px;background:transparent;cursor:pointer;font:inherit;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;color:inherit}
.mc.off{cursor:default}
.mc:not(.off):hover{background:var(--hover)}
.mc.today{border-color:currentColor}
.mc.sel{background:#f5c518;color:#111;font-weight:700}
.mc .cnt{font-size:11px;background:#111;color:#fff;border-radius:99px;min-width:18px;padding:0 5px;line-height:18px}
.mc.sel .cnt{background:#111}
@media (max-width: 560px) { .grid2 { grid-template-columns: minmax(0, 1fr); } }

/* ---- vários idiomas: textos longos (alemão, finlandês...) e escrita da direita para a esquerda não quebram o layout ---- */
body { overflow-wrap: break-word; }
h1, h2, h3, h4, p, li, label, dt, dd, td, th, small, summary, .muted, .hint, .notice, .chip, .btn, .badge, .nav, .cat-t, .stat, .daytitle { overflow-wrap: anywhere; hyphens: auto; }
h1, h2, h3 { text-wrap: balance; }
p, li { text-wrap: pretty; }
.btn, .chip { white-space: normal; text-align: center; max-width: 100%; line-height: 1.25; }
.badge { white-space: normal; text-align: center; line-height: 1.25; border-radius: 14px; max-width: 100%; }
.row > *, .grid2 > *, .grid3 > *, .field, .card { min-width: 0; }
input, select, textarea { max-width: 100%; min-width: 0; }
img, svg, video { max-width: 100%; }
html[dir="rtl"] .tl-wrap, html[dir="rtl"] .cal-grid, html[dir="rtl"] [data-ltr] { direction: ltr; }
html[dir="rtl"] input[type="tel"], html[dir="rtl"] input[type="email"], html[dir="rtl"] input[type="url"], html[dir="rtl"] input[type="time"], html[dir="rtl"] input[type="date"] { direction: ltr; text-align: end; }
@media (max-width: 700px) { table:not(.table-wrap table) { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; } }

/* ícones de linha do menu */
.side a.nav .ico { width: 22px; height: 22px; flex: none; }
.side a.nav { gap: 12px; }
@media (max-width: 860px) { .side a.nav .ico { width: 18px; height: 18px; } .side a.nav { gap: 8px; } }
.stars { display: inline-flex; gap: 2px; vertical-align: middle; }
.stars svg { width: 16px; height: 16px; fill: var(--star-off); stroke: none; } .stars svg.on { fill: #f0b429; }
.starpick { display: inline-flex; gap: 6px; direction: ltr; }
.starpick button { border: 0; background: transparent; padding: 2px; cursor: pointer; line-height: 0; border-radius: 8px; }
.starpick button svg { width: 34px; height: 34px; fill: var(--star-off); stroke: none; transition: transform .1s; } .starpick button.on svg { fill: #f0b429; } .starpick button:hover svg { transform: scale(1.12); }
.revrow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 14px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.revrow:first-child { border-top: 0; }
.ratebig { font-size: 2.4rem; font-weight: 800; line-height: 1; }

/* ---- celebração: check animado, confete e tela de espera ---- */
.doing { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 24px; text-align: center; background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(10px); animation: dfade .2s ease; }
.doing b { display: block; font-size: 1.25rem; margin-top: 18px; }
.doing .spin { width: 68px; height: 68px; border-radius: 50%; border: 5px solid var(--line); border-top-color: var(--brand); animation: drot .8s linear infinite; margin: 0 auto; }
@keyframes drot { to { transform: rotate(360deg); } } @keyframes dfade { from { opacity: 0; } }
.checkbig { width: 96px; height: 96px; margin: 0 auto; display: block; overflow: visible; }
.checkbig .bg { fill: var(--ok-bg); transform-origin: center; animation: cpop .5s cubic-bezier(.2, 1.4, .4, 1) both; }
.checkbig .ring { fill: none; stroke: var(--ok); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 289; stroke-dashoffset: 289; animation: cdraw .6s .1s ease-out forwards; }
.checkbig .tick { fill: none; stroke: var(--ok); stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 50; stroke-dashoffset: 50; animation: cdraw .4s .55s ease-out forwards; }
@keyframes cdraw { to { stroke-dashoffset: 0; } } @keyframes cpop { from { transform: scale(.4); opacity: 0; } }
.rise > * { opacity: 0; animation: rise .6s ease forwards; }
.rise > *:nth-child(1) { animation-delay: .15s; } .rise > *:nth-child(2) { animation-delay: .3s; } .rise > *:nth-child(3) { animation-delay: .45s; } .rise > *:nth-child(4) { animation-delay: .6s; } .rise > *:nth-child(5) { animation-delay: .75s; } .rise > *:nth-child(6) { animation-delay: .9s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 150; }
.confetti i { position: absolute; top: -12px; width: 9px; height: 14px; border-radius: 2px; opacity: 0; animation: cfall var(--d, 2.4s) var(--dl, 0s) cubic-bezier(.3, .6, .5, 1) forwards; }
@keyframes cfall { 0% { opacity: 1; transform: translate3d(0, 0, 0) rotate(0); } 100% { opacity: 0; transform: translate3d(var(--x, 0), 105vh, 0) rotate(var(--r, 540deg)); } }
.thanks { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px; background: var(--ok-bg); color: var(--ok-fg); font-weight: 700; font-size: .9rem; margin-top: 4px; }
@media (prefers-reduced-motion: reduce) { .confetti { display: none; } .checkbig .ring, .checkbig .tick { animation: none; stroke-dashoffset: 0; } .rise > * { animation: none; opacity: 1; } .doing .spin { animation-duration: 2s; } }
