/* Colorista Pro — estilos */
:root {
  --bg: #f6f2f0;
  --surface: #ffffff;
  --surface-2: #f3ece9;
  --border: #e6dcd8;
  --text: #241a20;
  --muted: #7a6b72;
  --primary: #6e2754;
  --primary-hover: #5b1f45;
  --primary-50: #f5e8f0;
  --on-primary: #ffffff;
  --accent: #b9663a;
  --accent-50: #fbefe6;
  --good: #1d7f55;
  --good-50: #e3f4ec;
  --warn: #a8691a;
  --warn-50: #fcf1de;
  --bad: #b8342a;
  --bad-50: #fbe9e7;
  --wa: #1f9d55;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(36, 26, 32, .05), 0 6px 20px rgba(36, 26, 32, .05);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --nav-h: 64px;
  color-scheme: light;
}
:root[data-theme="dark"] {
    --bg: #141013;
    --surface: #1d171b;
    --surface-2: #261f24;
    --border: #352b32;
    --text: #f2ebee;
    --muted: #a8979f;
    --primary: #d887b7;
    --primary-hover: #e6a2ca;
    --primary-50: #3a2232;
    --on-primary: #1d0f18;
    --accent: #e39a6d;
    --accent-50: #3a2619;
    --good: #5cc795;
    --good-50: #173327;
    --warn: #e5ad5b;
    --warn-50: #3a2b15;
    --bad: #f07b70;
    --bad-50: #3d1b18;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    --bg: #141013;
    --surface: #1d171b;
    --surface-2: #261f24;
    --border: #352b32;
    --text: #f2ebee;
    --muted: #a8979f;
    --primary: #d887b7;
    --primary-hover: #e6a2ca;
    --primary-50: #3a2232;
    --on-primary: #1d0f18;
    --accent: #e39a6d;
    --accent-50: #3a2619;
    --good: #5cc795;
    --good-50: #173327;
    --warn: #e5ad5b;
    --warn-50: #3a2b15;
    --bad: #f07b70;
    --bad-50: #3d1b18;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}

* { 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); -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
h3 { font-size: 16px; margin-bottom: 12px; }
p { margin: 0 0 8px; }
img { max-width: 100%; display: block; }
small { font-size: 12.5px; }
[hidden] { display: none !important; }
.icon { flex-shrink: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mt { margin-top: 16px; }
.mb { margin-bottom: 16px; }
.grow { flex: 1; min-width: 0; }
.link { font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; margin: 0 0 2px; }

/* ---------- App shell ---------- */
.app { min-height: 100vh; }
.sidebar { display: none; }
.main { min-width: 0; padding-bottom: calc(var(--nav-h) + 24px + env(safe-area-inset-bottom)); }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; padding: 10px 16px; padding-top: calc(10px + env(safe-area-inset-top)); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); min-height: 56px; }
.topbar h1 { font-size: 18px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { display: flex; gap: 8px; }
.content { padding: 16px; max-width: 1180px; margin: 0 auto; }

.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 17px; color: var(--text); font-weight: 500; }
.brand:hover { text-decoration: none; }
.brand b { color: var(--primary); }
.brand-mark { width: 32px; height: 32px; border-radius: 9px; display: block; object-fit: cover; flex-shrink: 0; box-shadow: 0 4px 12px rgba(110, 39, 84, .3); }
.brand-mobile .brand-mark { width: 30px; height: 30px; }

.bottomnav { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; background: var(--surface); border-top: 1px solid var(--border); }
.bottomnav a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--muted); font-weight: 600; padding: 6px 0; }
.bottomnav a:hover { text-decoration: none; }
.bottomnav a.active { color: var(--primary); }
.bottomnav .fab { width: 54px; height: 54px; margin: -22px auto 0; border-radius: 18px; justify-content: center; color: #fff; background: linear-gradient(135deg, #8a3168 0%, #c46b3d 100%); box-shadow: 0 8px 20px rgba(110, 39, 84, .35); }

@media (min-width: 960px) {
  .app { display: grid; grid-template-columns: 252px 1fr; }
  .sidebar { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 0; height: 100vh; padding: 20px 14px; background: var(--surface); border-right: 1px solid var(--border); }
  .sidebar .brand { padding: 4px 8px 8px; }
  .side-nav { display: flex; flex-direction: column; gap: 2px; }
  .side-nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-sm); color: var(--muted); font-weight: 600; font-size: 14.5px; }
  .side-nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
  .side-nav a.active { background: var(--primary-50); color: var(--primary); }
  .side-foot { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px 8px 0; border-top: 1px solid var(--border); }
  .side-user { flex: 1; min-width: 0; display: flex; flex-direction: column; }
  .side-user strong, .side-user small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .side-user small { color: var(--muted); }
  .bottomnav, .brand-mobile { display: none; }
  .main { padding-bottom: 40px; }
  .topbar { padding: 14px 28px; }
  .topbar h1 { font-size: 20px; }
  .content { padding: 24px 28px; }
}

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 16px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, transform .05s; }
.btn:hover { text-decoration: none; background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: wait; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--primary); }
.btn-ghost:hover { background: var(--primary-50); }
.btn-wa { background: var(--wa); border-color: var(--wa); color: #fff; }
.btn-wa:hover { background: #198347; }
.btn-danger-ghost { background: transparent; border-color: transparent; color: var(--bad); }
.btn-danger-ghost:hover { background: var(--bad-50); }
.btn-sm { min-height: 34px; padding: 6px 12px; font-size: 13px; }
.btn-lg { min-height: 48px; padding: 12px 20px; font-size: 15px; }
.btn-block { width: 100%; }
.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; border: 0; background: transparent; color: var(--muted); cursor: pointer; flex-shrink: 0; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.sidebar-cta { min-height: 44px; }
@media (max-width: 420px) { .hide-xs { display: none; } }

/* ---------- Forms ---------- */
.stack { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 13px; font-weight: 600; color: var(--muted); }
.field > span em { font-weight: 400; font-style: normal; }
.input { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: inherit; font-size: 16px; transition: border-color .15s, box-shadow .15s; }
textarea.input { resize: vertical; min-height: 64px; }
select.input { appearance: none; -webkit-appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237a6b72' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-50); }
.input-lg { font-size: 20px; font-weight: 700; }
.has-error .input { border-color: var(--bad); }
.error { color: var(--bad); font-weight: 600; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--primary); flex-shrink: 0; }
.form-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 640px) {
  .form-grid { grid-template-columns: 1fr 1fr; }
  .form-grid.one { grid-template-columns: 1fr; }
  .span-2 { grid-column: span 2; }
}
.form-page { display: flex; flex-direction: column; gap: 16px; max-width: 760px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.sticky-actions { position: sticky; bottom: calc(var(--nav-h) + 12px + env(safe-area-inset-bottom)); padding: 12px 0; }
@media (min-width: 960px) { .sticky-actions { bottom: 0; } }
.danger-zone { margin-top: 28px; padding-top: 16px; border-top: 1px dashed var(--border); max-width: 760px; }
.searchbar { position: relative; margin-bottom: 14px; }
.searchbar .icon { position: absolute; left: 14px; top: 13px; color: var(--muted); }
.searchbar .input { padding-left: 42px; }

/* ---------- Cards & lists ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); margin-bottom: 16px; min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.card-head h3 { margin: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 0 16px; }
@media (min-width: 900px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-2.wide-left { grid-template-columns: 1.5fr 1fr; }
}
.list-card { padding: 4px 0; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; color: var(--text); border-bottom: 1px solid var(--border); }
.list-card .list-row:last-child, .list .list-row:last-child { border-bottom: 0; }
.list .list-row { padding: 10px 0; }
a.list-row:hover, .list-row a:hover { text-decoration: none; background: var(--surface-2); }
.list .list-row:hover { background: transparent; }
.list-row .grow { display: flex; flex-direction: column; color: var(--text); }
.list-row .grow small { color: var(--muted); }
.list-row .right { display: flex; flex-direction: column; align-items: flex-end; text-align: right; white-space: nowrap; }
.list-sub { padding: 14px 16px 4px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.row-icon { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary); flex-shrink: 0; }
.row-icon.warn { background: var(--warn-50); color: var(--warn); }
.row-icon.cat-oxidante { background: var(--surface-2); color: var(--muted); }
.row-icon.cat-descolorante { background: var(--accent-50); color: var(--accent); }
.row-icon.cat-tratamento { background: var(--good-50); color: var(--good); }
.section-title { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 22px 4px 10px; }
.avatar { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; font-weight: 700; font-size: 14px; color: var(--primary); background: var(--primary-50); }
.avatar.sm { width: 36px; height: 36px; font-size: 13px; }
.avatar.lg { width: 64px; height: 64px; font-size: 22px; color: #fff; background: linear-gradient(135deg, #8a3168, #c46b3d); }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--surface-2); color: var(--muted); }
.badge-ok { background: var(--good-50); color: var(--good); }
.badge-warn { background: var(--warn-50); color: var(--warn); }
.badge-bad { background: var(--bad-50); color: var(--bad); }
.chip { display: inline-block; padding: 1px 8px; border-radius: 6px; background: var(--primary-50); color: var(--primary); font-size: 12px; font-weight: 700; }
.chips-scroll { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 14px; scrollbar-width: none; }
.chips-scroll::-webkit-scrollbar { display: none; }
.chip-link { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.chip-link:hover { text-decoration: none; color: var(--text); }
.chip-link.active { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.pager { display: flex; justify-content: center; align-items: center; gap: 12px; margin: 16px 0; }

/* ---------- Flash / notes / banners ---------- */
.flash { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm); margin-bottom: 14px; font-size: 14px; font-weight: 500; }
.flash-success { background: var(--good-50); color: var(--good); }
.flash-error { background: var(--bad-50); color: var(--bad); }
.flash-info { background: var(--primary-50); color: var(--primary); }
.banner { display: flex; align-items: center; gap: 10px; padding: 10px 16px; font-size: 14px; flex-wrap: wrap; }
.banner span { flex: 1; min-width: 180px; }
.banner a { font-weight: 700; }
.banner-info { background: var(--primary-50); color: var(--primary); }
.banner-warn { background: var(--warn-50); color: var(--warn); }
.banner-warn a { color: var(--warn); }
.note { padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-2); margin: 12px 0 0; }
.note b { display: flex; align-items: center; gap: 6px; font-size: 13.5px; }
.note p { margin: 4px 0 0; font-size: 14px; }
.note-warn { background: var(--warn-50); color: var(--warn); }
.note-warn p { color: var(--text); }
.empty { text-align: center; padding: 48px 16px; }
.empty h2 { font-size: 18px; margin: 12px 0 6px; }
.empty .btn { margin-top: 12px; }
.empty-icon { width: 64px; height: 64px; margin: 0 auto; border-radius: 20px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary); }
.small-empty { padding: 24px 16px; background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius); }

/* ---------- Dashboard ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-title { font-size: 22px; }
.month-nav { display: inline-flex; align-items: center; gap: 2px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 2px; font-weight: 600; font-size: 14px; }
.month-nav span { padding: 0 6px; min-width: 132px; text-align: center; }
.month-nav .icon-btn { width: 34px; height: 34px; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
@media (min-width: 900px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; box-shadow: var(--shadow); min-width: 0; }
.stat-label { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.stat-value { font-size: 22px; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-accent { background: linear-gradient(135deg, #6e2754 0%, #a0482f 100%); border-color: transparent; color: #fff; }
.stat-accent .stat-label, .stat-accent small { color: rgba(255, 255, 255, .8); }
.pct { font-weight: 700; font-size: 12.5px; }
.pct-good { color: var(--good); }
.pct-warn { color: var(--warn); }
.pct-bad { color: var(--bad); }
.pct-muted { color: var(--muted); }
.bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.bar-top { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
.bar-top span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-top b { white-space: nowrap; }
.bar { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin: 5px 0 2px; }
.bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #8a3168, #c46b3d); }
.onboarding { background: linear-gradient(135deg, var(--primary-50), var(--accent-50)); border-color: transparent; }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.steps li { display: flex; align-items: center; gap: 12px; background: var(--surface); border-radius: var(--radius-sm); padding: 12px; }
.steps li div { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.steps li small { color: var(--muted); }
.step-dot { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--border); color: transparent; flex-shrink: 0; }
.steps li.done .step-dot { background: var(--good); border-color: var(--good); color: #fff; }
.steps li.done strong { text-decoration: line-through; color: var(--muted); }
.steps li.done .btn { display: none; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; margin: 0 -4px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 6px 4px; border-bottom: 1px solid var(--border); }
.table td { padding: 9px 4px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; white-space: nowrap; }
.table.compact td { padding: 7px 4px; }
.dev-row td { color: var(--muted); }
.table td b { white-space: nowrap; }

/* ---------- Client ---------- */
.client-hero, .appt-hero { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.client-hero h2, .appt-hero h2 { font-size: 22px; }
.appt-hero h2 a { color: var(--text); }
.appt-hero > div:first-child { flex: 1; min-width: 200px; }
.meta { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--muted); font-size: 13.5px; margin-top: 4px; }
.meta span { display: inline-flex; align-items: center; gap: 5px; }
.client-hero > .grow { flex: 1 1 220px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; }
.hero-actions .btn { flex: 1 1 auto; }
@media (min-width: 1240px) { .hero-actions { width: auto; } .hero-actions .btn { flex: 0 0 auto; } }
.mini-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 16px; }
@media (min-width: 640px) { .mini-stats { grid-template-columns: repeat(4, 1fr); } }
.mini-stats div { background: var(--surface); padding: 12px 14px; display: flex; flex-direction: column; }
.mini-stats span { font-size: 12px; color: var(--muted); font-weight: 600; }
.mini-stats b { font-size: 16px; }
.tech-grid { display: grid; gap: 12px; margin-top: 12px; }
@media (min-width: 760px) { .tech-grid { grid-template-columns: repeat(3, 1fr); } }
.tech-grid b { font-size: 13px; color: var(--muted); }
.tech-grid p { margin: 2px 0 0; font-size: 14px; }
.tech-sheet .note-warn { margin-top: 0; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 18px; position: relative; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 8px; bottom: 8px; width: 2px; background: var(--border); }
.tl-item { position: relative; }
.tl-dot { position: absolute; left: -18px; top: 22px; width: 12px; height: 12px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 4px var(--bg); }
.tl-card { padding: 14px 16px; }
.tl-head { display: flex; justify-content: space-between; gap: 12px; color: var(--text); margin-bottom: 8px; }
.tl-head:hover { text-decoration: none; }
.tl-head > div:first-child { display: flex; flex-direction: column; }
.tl-head .right { display: flex; flex-direction: column; align-items: flex-end; white-space: nowrap; }
.formula-line { font-size: 14px; padding: 6px 0; border-top: 1px dashed var(--border); }
.tl-actions { display: flex; gap: 4px; margin: 8px -8px -6px; flex-wrap: wrap; }
.thumbs { display: flex; gap: 8px; overflow-x: auto; margin-top: 10px; padding-bottom: 2px; }
.thumb { position: relative; flex: 0 0 auto; width: 84px; height: 84px; border-radius: 10px; overflow: hidden; background: var(--surface-2); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb span { position: absolute; left: 4px; bottom: 4px; font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 6px; background: rgba(0, 0, 0, .55); color: #fff; }

/* ---------- Appointment form & formula editor ---------- */
.appt-layout { display: grid; grid-template-columns: 1fr; gap: 0 16px; align-items: start; }
@media (min-width: 1040px) {
  .appt-layout { grid-template-columns: minmax(0, 1fr) 340px; }
  .appt-side { position: sticky; top: 80px; }
}
.bowl { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; margin-bottom: 12px; background: var(--surface-2); }
.bowl-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.bowl-num { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--primary); color: var(--on-primary); font-weight: 700; font-size: 13px; flex-shrink: 0; }
.bowl-head .input { font-weight: 700; background: var(--surface); }
.item-row { display: grid; grid-template-columns: 1fr 1.5fr 38px; grid-template-areas: "prod prod del" "shade amt amt" "cost cost cost"; gap: 8px; padding: 10px; border-radius: var(--radius-sm); background: var(--surface); margin-bottom: 8px; align-items: center; }
.item-row .f-prod { grid-area: prod; }
.item-row .f-shade { grid-area: shade; }
.item-row .f-amt { grid-area: amt; }
.item-row .item-cost { grid-area: cost; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 0 4px; }
.item-row .item-cost b { font-size: 15px; order: 2; white-space: nowrap; }
.item-row .item-cost small { font-size: 12px; color: var(--muted); order: 1; }
.item-row .del { grid-area: del; }
@media (min-width: 720px) {
  .item-row { grid-template-columns: minmax(0, 2fr) 84px 156px minmax(130px, 1fr) 38px; grid-template-areas: "prod shade amt cost del"; }
  .item-row .item-cost { flex-direction: column; align-items: flex-end; gap: 2px; text-align: right; padding: 0; }
  .item-row .item-cost b, .item-row .item-cost small { order: 0; }
}
.qty-wrap { display: flex; min-width: 0; }
.qty-wrap .input:first-child { flex: 1; min-width: 0; font-weight: 700; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.qty-wrap .unit-sel { width: 68px; flex-shrink: 0; margin-left: -1px; border-top-left-radius: 0; border-bottom-left-radius: 0; padding: 10px 26px 10px 12px; background-position: right 9px center; font-weight: 600; }
.hint-muted { color: var(--muted); font-style: italic; }
.hint-warn { color: var(--warn); font-weight: 700; }
.amount-wrap { position: relative; }
.amount-wrap .input { padding-right: 34px; font-weight: 700; }
.amount-wrap .unit { position: absolute; right: 12px; top: 12px; color: var(--muted); font-size: 14px; pointer-events: none; }
.shade-input { font-weight: 700; text-align: center; }
.dev-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.dev-grid .field > span { font-size: 12px; }
.dev-grid .input { background: var(--surface); }
.dev-grid .f-dev { grid-column: span 2; order: -1; }
@media (min-width: 720px) { .dev-grid { grid-template-columns: 1fr 1.6fr 0.8fr 0.8fr; } .dev-grid .f-dev { grid-column: auto; order: 0; } }
.bowl-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); font-size: 14px; }
.bowl-foot strong { font-size: 15px; }
.unpriced-hint { color: var(--warn); font-weight: 600; font-size: 12px; }
.summary { margin: 16px 0; display: flex; flex-direction: column; }
.summary div { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.summary dt { color: var(--muted); }
.summary dd { margin: 0; font-weight: 600; text-align: right; }
.summary .total { font-size: 16px; }
.summary .total dt { color: var(--text); font-weight: 700; }
.summary .pos { color: var(--good); }
.summary .neg { color: var(--bad); }
.suggest { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--accent-50); margin-bottom: 14px; }
.suggest > div { display: flex; flex-direction: column; }
.suggest strong { font-size: 20px; color: var(--accent); }
.summary-card h3 { margin-bottom: 14px; }

/* ---------- Appointment view ---------- */
.bowl-view { margin-bottom: 14px; }
.bowl-view-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 10px; background: var(--surface-2); border-radius: var(--radius-sm); }
.bowl-view-head span { display: inline-flex; align-items: center; gap: 4px; }
.photo-cols { display: grid; gap: 12px; margin-bottom: 16px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
@media (min-width: 760px) { .photo-cols { gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); } }
.photo-cols h4 { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.photo { position: relative; margin: 0; aspect-ratio: 3 / 4; border-radius: 12px; overflow: hidden; background: var(--surface-2); }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo-del { position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; border-radius: 50%; border: 0; display: grid; place-items: center; background: rgba(0, 0, 0, .55); color: #fff; cursor: pointer; }
.upload { display: flex; flex-direction: column; gap: 12px; border-top: 1px solid var(--border); padding-top: 16px; }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 12px; padding: 3px; gap: 2px; align-self: flex-start; }
.seg.wide { display: flex; align-self: stretch; }
.seg.wide label { flex: 1; }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; padding: 7px 14px; border-radius: 10px; font-size: 13.5px; font-weight: 600; color: var(--muted); text-align: center; }
.seg input:checked + span { background: var(--surface); color: var(--primary); box-shadow: var(--shadow); }
.seg input:focus-visible + span { outline: 2px solid var(--primary); }
.dropzone { position: relative; display: flex; align-items: center; gap: 14px; padding: 18px; border: 2px dashed var(--border); border-radius: var(--radius); color: var(--primary); cursor: pointer; }
.dropzone:hover { border-color: var(--primary); background: var(--primary-50); }
.dropzone span { display: flex; flex-direction: column; color: var(--text); }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; }

/* ---------- Products ---------- */
.product-row { flex-wrap: wrap; position: relative; }
.product-row > a.grow { color: var(--text); }
.product-row > a.grow:hover { text-decoration: none; }
.stock-col { min-width: 72px; }
@media (max-width: 600px) { .hide-sm { display: none; } .stock-col { min-width: 0; } }
.stock-in { position: static; }
.stock-in summary { list-style: none; }
.stock-in summary::-webkit-details-marker { display: none; }
.stock-in[open] summary { background: var(--primary-50); color: var(--primary); }
.stock-form { display: flex; align-items: flex-end; gap: 8px; width: 100%; padding: 10px 0 2px; }
.stock-in[open] { flex-basis: 100%; display: flex; flex-direction: column; align-items: flex-end; }
.stock-in[open] summary { position: absolute; right: 16px; top: 12px; }
.stock-form .field { flex: 1; }
.price-row { flex-wrap: wrap; }
.price-row .grow { flex-basis: 100%; }
.mini-field { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 120px; }
.mini-field span { font-size: 12px; color: var(--muted); font-weight: 600; }
@media (min-width: 720px) { .price-row .grow { flex-basis: auto; } .mini-field { flex: 0 0 150px; } }

/* ---------- Calculator ---------- */
.tone-row { display: grid; grid-template-columns: 1fr 1fr 38px; grid-template-areas: "prod prod del" "shade parts parts"; gap: 8px; padding: 10px; background: var(--surface-2); border-radius: var(--radius-sm); margin-bottom: 8px; }
.tone-row .f-prod { grid-area: prod; }
.tone-row .f-shade { grid-area: shade; }
.tone-row .f-parts { grid-area: parts; }
.tone-row .del { grid-area: del; }
@media (min-width: 720px) { .tone-row { grid-template-columns: minmax(0, 2fr) 100px 120px 38px; grid-template-areas: "prod shade parts del"; } }
.calc-result .res-row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.calc-result .res-row b { font-size: 18px; white-space: nowrap; }
.calc-result .res-row.dev b { color: var(--muted); }
.calc-result .res-total { display: flex; justify-content: space-between; padding: 12px 0 0; font-weight: 700; }

/* ---------- Settings / admin ---------- */
.plan-card.inactive { border-color: var(--warn); }
.plan-card h3 { display: flex; align-items: center; gap: 8px; margin: 0; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 14px 0; }
.plan-opt { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; display: flex; flex-direction: column; gap: 2px; }
.plan-opt.current { border-color: var(--primary); background: var(--primary-50); }
.plan-opt .price { font-size: 20px; font-weight: 700; }
.plan-opt .price small { font-size: 13px; color: var(--muted); font-weight: 500; }
.admin-org summary { display: flex; align-items: center; gap: 12px; cursor: pointer; list-style: none; flex-wrap: wrap; }
.admin-org summary::-webkit-details-marker { display: none; }
.admin-org summary .grow { display: flex; flex-direction: column; min-width: 220px; }

/* ---------- Auth ---------- */
.auth-body { background: var(--surface); }
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr; }
.auth-hero { display: none; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 32px 20px; }
.auth-card { width: 100%; max-width: 420px; }
.auth-brand-mobile { margin-bottom: 28px; }
.auth-title { font-size: 26px; margin-bottom: 6px; }
.auth-card .stack { margin-top: 22px; }
.auth-links { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 22px; font-size: 14px; text-align: center; }
@media (min-width: 960px) {
  .auth { grid-template-columns: 1.05fr 1fr; }
  .auth-brand-mobile { display: none; }
  .auth-hero { display: flex; flex-direction: column; justify-content: space-between; padding: 40px 48px; color: #fff; position: relative; overflow: hidden; background: radial-gradient(120% 90% at 0% 0%, #8a3168 0%, #4a1838 55%, #2a0f20 100%); }
  .brand-light { color: #fff; }
  .brand-light b { color: #f2b48f; }
  .auth-hero-copy h2 { font-size: 34px; line-height: 1.15; letter-spacing: -.02em; max-width: 480px; }
  .auth-hero-copy ul { list-style: none; padding: 0; margin: 24px 0 0; display: flex; flex-direction: column; gap: 10px; font-size: 16px; color: rgba(255, 255, 255, .88); }
  .auth-hero-copy li { display: flex; align-items: center; gap: 10px; }
  .auth-hero-copy li .icon { color: #f2b48f; }
  .swatches { display: flex; gap: 10px; }
  .swatches i { width: 42px; height: 42px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .25); }
  .swatches i:nth-child(1) { background: #2b1b14; }
  .swatches i:nth-child(2) { background: #5a3524; }
  .swatches i:nth-child(3) { background: #8c5a3a; }
  .swatches i:nth-child(4) { background: #b9834f; }
  .swatches i:nth-child(5) { background: #dbb57f; }
  .swatches i:nth-child(6) { background: #efdcb5; }
}
@media (min-width: 960px) { :root[data-theme="dark"] .auth-body { background: var(--bg); } }
@media (min-width: 960px) and (prefers-color-scheme: dark) { :root[data-theme="auto"] .auth-body { background: var(--bg); } }

/* ---------- Tutoriais ---------- */
.help-btn { color: var(--primary); }
.help-btn:hover { background: var(--primary-50); color: var(--primary); }
.tutorial { border: 0; padding: 0; width: min(460px, calc(100vw - 32px)); max-height: calc(100vh - 32px); border-radius: 20px; background: var(--surface); color: var(--text); box-shadow: 0 24px 60px rgba(0, 0, 0, .35); overflow: hidden; }
.tutorial[open] { display: flex; flex-direction: column; animation: tut-in .22s ease-out; }
.tutorial::backdrop { background: rgba(20, 10, 16, .55); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
@keyframes tut-in { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: none; } }
.tut-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 12px 0 20px; }
.tut-head .eyebrow { display: inline-flex; align-items: center; gap: 6px; color: var(--primary); margin: 0; }
.tut-body { padding: 8px 24px 4px; overflow-y: auto; min-height: 230px; }
.tut-step h2 { font-size: 22px; margin: 14px 0 8px; }
.tut-step h3 { font-size: 19px; margin: 6px 0 8px; }
.tut-step p { font-size: 15.5px; line-height: 1.55; }
.tut-hero, .tut-icon { width: 60px; height: 60px; border-radius: 18px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #8a3168, #c46b3d); box-shadow: 0 8px 20px rgba(110, 39, 84, .3); margin-top: 8px; flex-shrink: 0; }
.tut-icon { width: 52px; height: 52px; border-radius: 16px; }
.tut-count { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 14px 0 0; }
.tut-dots { display: flex; justify-content: center; gap: 6px; padding: 8px 0 4px; }
.tut-dots i { width: 7px; height: 7px; border-radius: 99px; background: var(--border); transition: width .2s, background .2s; }
.tut-dots i.on { width: 22px; background: var(--primary); }
.tut-foot { display: flex; justify-content: space-between; gap: 10px; padding: 12px 20px 20px; }
.tut-foot .btn { min-width: 110px; }
@media (max-width: 600px) {
  .tutorial { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 22px 22px 0 0; max-height: 88vh; padding-bottom: env(safe-area-inset-bottom); }
  @keyframes tut-in { from { transform: translateY(100%); } to { transform: none; } }
  .tut-foot .btn { flex: 1; }
}
.help-hero { display: flex; gap: 16px; align-items: flex-start; }
.help-hero .tut-hero { margin-top: 0; }
.help-hero h2 { font-size: 20px; margin-bottom: 6px; }
.flow { list-style: none; padding: 0; margin: 0 0 8px; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.flow li { display: flex; gap: 10px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; }
.flow li > span { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--primary); color: var(--on-primary); font-weight: 700; font-size: 13px; flex-shrink: 0; }
.flow li div { display: flex; flex-direction: column; }
.flow li small { color: var(--muted); }
.help-item { padding: 0; }
.help-item summary { display: flex; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer; list-style: none; }
.help-item summary::-webkit-details-marker { display: none; }
.help-item summary .grow { display: flex; flex-direction: column; }
.help-item[open] summary { border-bottom: 1px solid var(--border); }
.help-item > .btn { margin: 0 16px 16px; }
.help-steps { list-style: none; margin: 0; padding: 12px 16px; display: flex; flex-direction: column; gap: 12px; }
.help-steps li { display: flex; gap: 12px; }
.help-steps p { margin: 2px 0 0; font-size: 14px; color: var(--muted); }
.help-ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary); flex-shrink: 0; }
@media (max-width: 600px) { .help-hero { flex-direction: column; } }

/* ---------- Revenda ---------- */
.stats-3 { grid-template-columns: 1fr; }
@media (min-width: 640px) { .stats-3 { grid-template-columns: repeat(3, 1fr); } }
.sale-line { display: grid; grid-template-columns: 1fr 1fr 38px; grid-template-areas: "prod prod del" "qty price price" "total total total" "hint hint hint"; gap: 8px; padding: 10px; border-radius: var(--radius-sm); background: var(--surface-2); margin-bottom: 8px; align-items: end; }
.sale-line .f-prod { grid-area: prod; background: var(--surface); }
.sale-line .f-qty { grid-area: qty; }
.sale-line .f-price { grid-area: price; }
.sale-line .mini-field .input { background: var(--surface); }
.sale-line .del { grid-area: del; align-self: center; }
.sale-line-total { grid-area: total; display: flex; justify-content: space-between; align-items: baseline; }
.sale-line-total b { font-size: 16px; }
.sale-line-hint { grid-area: hint; color: var(--muted); }
.sale-line-hint:empty { display: none; }
@media (min-width: 720px) {
  .sale-line { grid-template-columns: minmax(0, 2fr) 90px 130px 110px 38px; grid-template-areas: "prod qty price total del" "hint hint hint hint hint"; }
  .sale-line-total { flex-direction: column; align-items: flex-end; }
}
.margin-box { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--accent-50); }
.margin-box b { font-size: 17px; }
.pos { color: var(--good); }
.neg { color: var(--bad); }
.sub-title { font-size: 14px; margin: 8px 0 2px; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.section-head .section-title { margin-right: 0; }
.cost-breakdown .summary { margin-top: 0; }
.row-icon.cat-revenda { background: var(--good-50); color: var(--good); }

/* ---------- Alertas de estoque ---------- */
.flash-warning { background: var(--warn-50); color: var(--warn); border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent); }
.flash-warning span { flex: 1; }
.flash-link { font-weight: 700; color: var(--warn); white-space: nowrap; text-decoration: underline; }
.stock-alert { border: 1px solid color-mix(in srgb, var(--warn) 45%, transparent); background: var(--warn-50); color: var(--warn); border-radius: var(--radius); padding: 12px 16px; }
.stock-alert-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.stock-alert-head b { flex: 1; min-width: 180px; }
.stock-alert-head a { font-weight: 700; color: var(--warn); white-space: nowrap; }
.stock-alert ul { margin: 8px 0 0; padding-left: 26px; color: var(--text); font-size: 14px; }
.stock-alert ul a { color: var(--text); }
.stock-alert li + li { margin-top: 2px; }
.nav-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--warn); color: #fff; font-size: 11.5px; font-weight: 700; display: inline-grid; place-items: center; }
.bottomnav .nav-with-badge { position: relative; }
.bottomnav .nav-badge { position: absolute; top: 2px; left: calc(50% + 6px); margin: 0; min-width: 18px; height: 18px; font-size: 11px; padding: 0 5px; }
.stock-bell { position: relative; color: var(--warn); }
.stock-bell:hover { background: var(--warn-50); color: var(--warn); }
.bell-count { position: absolute; top: 3px; right: 2px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px; background: var(--warn); color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; }
.chip-alert { display: inline-flex; align-items: center; gap: 6px; color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, transparent); }
.chip-alert.active { background: var(--warn); border-color: var(--warn); color: #fff; }

/* ---------- Planos ---------- */
.plans-body { background: var(--bg); }
.plans-top { display: flex; justify-content: center; padding: 20px 16px 4px; }
.plans-page { max-width: 880px; margin: 0 auto; }
.plans-head { text-align: center; margin: 8px 0 22px; }
.plans-head h2 { font-size: 26px; margin: 4px 0 8px; letter-spacing: -.02em; }
.plan-cards { display: grid; grid-template-columns: 1fr; gap: 16px; margin-bottom: 16px; }
@media (min-width: 720px) { .plan-cards { grid-template-columns: 1fr 1fr; } }
.plan-card-opt { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 24px 22px; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.plan-card-opt.featured { border: 2px solid var(--primary); box-shadow: 0 12px 32px rgba(110, 39, 84, .18); }
.plan-card-opt h3 { font-size: 18px; margin: 0 0 6px; }
.plan-ribbon { position: absolute; top: -12px; left: 22px; padding: 4px 12px; border-radius: 99px; font-size: 12px; font-weight: 700; color: #fff; background: linear-gradient(135deg, #8a3168, #c46b3d); }
.plan-price { font-size: 34px; font-weight: 800; letter-spacing: -.03em; }
.plan-price small { font-size: 14px; font-weight: 600; color: var(--muted); margin-left: 6px; letter-spacing: 0; }
.plan-features { list-style: none; padding: 0; margin: 14px 0 20px; display: flex; flex-direction: column; gap: 8px; font-size: 14.5px; flex: 1; }
.plan-features li { display: flex; gap: 8px; align-items: flex-start; }
.plan-features .icon { color: var(--good); margin-top: 2px; }
.plan-how ol { margin: 0 0 14px; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.plan-status { display: flex; gap: 12px; align-items: flex-start; padding: 16px; border-radius: var(--radius); margin-bottom: 18px; }
.plan-status p { margin: 2px 0 0; }
.plan-status.ok { background: var(--good-50); color: var(--good); }
.plan-status.bad { background: var(--bad-50); color: var(--bad); }
.plan-status p { color: var(--text); }
.plans-logout { text-align: center; margin: 8px 0 24px; }
.admin-quick { display: flex; flex-wrap: wrap; gap: 8px; }

/* Linha discreta de avisos na lista de produtos */
.tool-line { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .9rem; }
.link-warn { color: #e0a84a; }

/* Explicação da proporção de oxidante */
.ratio-help { margin: 8px 0 0; font-size: .85rem; color: var(--muted, #a99ca6); line-height: 1.4; }
.ratio-help b { color: var(--text, #f3eef2); font-weight: 600; }

/* Mensagens prontas */
.wa-dialog .tut-head h2 { display: inline-flex; align-items: center; gap: 8px; font-size: 18px; margin: 0; }
.wa-body { padding: 4px 20px 20px; overflow-y: auto; }
.wa-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 12px; }
.wa-chips .chip-link { cursor: pointer; font: inherit; font-size: 13px; }
.wa-text { width: 100%; resize: vertical; font-size: 15px; line-height: 1.45; min-height: 190px; }
.wa-actions { display: flex; gap: 8px; margin-top: 12px; }
.wa-actions .btn-wa { flex: 1; justify-content: center; }

/* Logo maior nas telas de entrar/cadastrar e planos */
.brand-light, .auth-brand-mobile { font-size: 22px; gap: 12px; }
.brand-light .brand-mark, .auth-brand-mobile .brand-mark { width: 48px; height: 48px; border-radius: 13px; }

/* ---------- Colorimetria e paletas ---------- */
.seg-tabs { display: flex; gap: 4px; padding: 4px; margin-bottom: 16px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; }
.seg-tabs a { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 8px; border-radius: 10px; font-size: 13.5px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.seg-tabs a:hover { text-decoration: none; color: var(--text); }
.seg-tabs a.active { background: var(--surface); color: var(--primary); box-shadow: var(--shadow); }
@media (max-width: 380px) { .seg-tabs a { font-size: 12.5px; gap: 4px; } .seg-tabs a .icon { display: none; } }

/* amostra: gradiente com brilho, imitando uma mecha */
.swatch { --sw: #8a7f86; position: relative; display: block; background:
    repeating-linear-gradient(100deg, rgba(255,255,255,.05) 0 2px, transparent 2px 5px),
    linear-gradient(160deg, color-mix(in srgb, var(--sw) 72%, #fff) 0%, var(--sw) 42%, color-mix(in srgb, var(--sw) 72%, #000) 100%); }
.swatch b { position: absolute; left: 10px; bottom: 8px; font-size: 15px; font-weight: 800; letter-spacing: -.01em; }
.ink-light b, .ink-light .pick-check { color: rgba(255,255,255,.95); text-shadow: 0 1px 2px rgba(0,0,0,.35); }
.ink-dark b, .ink-dark .pick-check { color: rgba(30,20,25,.85); }
.swatch-dot { width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }
.swatch-none { display: grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.swatch-xl { width: 100%; aspect-ratio: 4 / 3; border-radius: 16px; box-shadow: 0 10px 30px rgba(0,0,0,.18); }
.swatch-xl b { font-size: 28px; left: 16px; bottom: 12px; }

.search-box { position: relative; display: block; }
.search-box .icon { position: absolute; left: 14px; top: 13px; color: var(--muted); pointer-events: none; }
.search-box .input { padding-left: 42px; }
.color-search { display: grid; gap: 10px; margin-bottom: 12px; }
.color-selects { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (min-width: 760px) { .color-search { grid-template-columns: 2fr 1fr 1fr; } .color-selects { display: contents; } }
.chip-n { display: inline-block; min-width: 18px; margin-left: 4px; padding: 0 5px; border-radius: 999px; font-size: 11px; background: var(--surface-2); color: var(--muted); }
.chip-link.active .chip-n { background: rgba(255,255,255,.22); color: inherit; }
.ref-note { display: flex; gap: 6px; align-items: flex-start; margin-top: 18px; }
.ref-note .icon { margin-top: 2px; }

.shade-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 560px) { .shade-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .shade-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); } }
.shade-grid-sm { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.shade-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; color: var(--text); box-shadow: var(--shadow); transition: transform .15s, border-color .15s; }
.shade-card:hover { text-decoration: none; transform: translateY(-2px); border-color: var(--primary); }
.shade-card .swatch { aspect-ratio: 4 / 3; }
.shade-info { display: flex; flex-direction: column; gap: 1px; padding: 10px 12px 12px; min-width: 0; }
.shade-info strong { font-size: 14px; line-height: 1.3; }
.shade-info small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shade-src { color: var(--primary) !important; opacity: .85; }

/* cartela */
.chart-filter { max-width: 420px; margin-bottom: 16px; }
.chart-family .card-head h3 { display: flex; align-items: center; gap: 8px; }
.fam-dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.fam-neutra { background: linear-gradient(135deg, #b89a7a, #6b4b33); }
.fam-fria { background: linear-gradient(135deg, #cfd3dc, #7d7f99); }
.fam-quente { background: linear-gradient(135deg, #e6b06a, #a84a24); }
.fam-fantasia { background: linear-gradient(135deg, #e8739f, #6a2c91); }
.chart-row + .chart-row { margin-top: 14px; }
.locks { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 8px; scrollbar-width: thin; }
.lock { flex: 0 0 72px; display: flex; flex-direction: column; align-items: center; text-align: center; color: var(--text); }
.lock:hover { text-decoration: none; }
.lock-hair { width: 56px; height: 96px; border-radius: 28px 28px 10px 10px; box-shadow: 0 6px 14px rgba(0,0,0,.18), inset 0 0 0 1px rgba(0,0,0,.08); transition: transform .15s; }
.lock:hover .lock-hair { transform: translateY(-3px) scale(1.03); }
.lock > b { margin-top: 6px; font-size: 13.5px; }
.lock small { font-size: 11px; line-height: 1.25; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* cadastro e detalhe da cor */
.shade-editor { display: grid; gap: 18px; }
@media (min-width: 760px) { .shade-editor { grid-template-columns: 260px 1fr; align-items: start; } .shade-editor > p { grid-column: 1 / -1; } }
.shade-preview { display: grid; gap: 14px; }
.hex-pick { display: flex; gap: 8px; }
.hex-pick input[type="color"] { width: 48px; height: 44px; padding: 2px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; flex-shrink: 0; }
.hex-pick .input { font-family: ui-monospace, Menlo, monospace; text-transform: lowercase; }
.shade-hero { display: grid; gap: 18px; }
@media (min-width: 760px) { .shade-hero { grid-template-columns: 280px 1fr; align-items: start; } }
.shade-hero h2 { font-size: 22px; margin-bottom: 2px; }
.spec { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; margin: 14px 0 0; }
.spec div { min-width: 0; }
.spec dt { font-size: 12px; color: var(--muted); font-weight: 600; }
.spec dd { margin: 0; font-weight: 600; }
.add-to-palette { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.inline-form { display: flex; gap: 8px; flex: 1 1 280px; }
.inline-form .input { flex: 1; min-width: 0; }

/* paletas */
.pal-strip { display: flex; height: 64px; border-radius: 12px; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(0,0,0,.06); }
.pal-strip i { flex: 1; }
.pal-strip .pal-empty { background: repeating-linear-gradient(45deg, var(--surface-2) 0 8px, var(--border) 8px 9px); }
.pal-strip-lg { height: 120px; border-radius: 14px; margin-bottom: 14px; }
.palette-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 560px) { .palette-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .palette-grid { grid-template-columns: repeat(3, 1fr); } }
.palette-card { position: relative; padding: 12px; margin: 0; transition: border-color .15s; }
.palette-card:hover { border-color: var(--primary); }
.palette-link { display: block; color: var(--text); }
.palette-link:hover { text-decoration: none; }
.palette-body { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; padding: 10px 40px 2px 2px; }
.palette-body strong { width: 100%; font-size: 15px; }
.fav-form { position: absolute; right: 8px; bottom: 6px; }
.fav-btn.is-fav, .fav-toggle.is-fav { color: #e0a84a; }
.fav-btn.is-fav svg, .fav-toggle.is-fav svg { fill: currentColor; }
.palette-hero-body { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.palette-hero h2 { font-size: 20px; margin-bottom: 4px; }
.palette-hero .small a { display: inline-flex; align-items: center; gap: 4px; }
.upload-inline { display: grid; gap: 12px; align-items: end; }
@media (min-width: 760px) { .upload-inline { grid-template-columns: 180px 1fr auto; } }
.check-center { align-self: end; padding-bottom: 10px; }
.check-center span { display: inline-flex; align-items: center; gap: 6px; }

/* seletor de cores */
.picker.has-error { border-color: var(--bad); }
.tray { display: flex; flex-wrap: wrap; gap: 6px; min-height: 40px; padding: 8px; border: 1px dashed var(--border); border-radius: var(--radius-sm); background: var(--surface-2); align-items: center; }
.tray-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.tray-chip:hover { border-color: var(--bad); }
.tray-chip span { color: var(--muted); }
.tray-chip .swatch, .ref-chip .swatch { width: 22px; height: 22px; border-radius: 50%; }
.picker-cats { margin: 12px 0 10px; }
.picker-cats .chip-link { cursor: pointer; font: inherit; font-size: 13px; font-weight: 600; }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; max-height: 460px; overflow-y: auto; padding: 2px; }
.pick { display: flex; flex-direction: column; gap: 4px; cursor: pointer; }
.pick input { position: absolute; opacity: 0; pointer-events: none; }
.pick .swatch { aspect-ratio: 1; border-radius: 12px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); transition: box-shadow .12s, transform .12s; }
.pick .swatch b { font-size: 13px; left: 8px; bottom: 6px; }
.pick-check { position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 50%; display: none; place-items: center; background: var(--primary); color: var(--on-primary) !important; text-shadow: none !important; }
.pick input:checked + .swatch { box-shadow: 0 0 0 3px var(--primary); transform: scale(.96); }
.pick input:checked + .swatch .pick-check { display: grid; }
.pick input:focus-visible + .swatch { outline: 2px solid var(--primary); outline-offset: 2px; }
.pick-name { font-size: 12px; font-weight: 600; line-height: 1.25; }
.pick-name small { display: block; font-size: 11px; font-weight: 500; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* perfil da cliente */
.client-colors .card-head h3 { display: flex; align-items: center; gap: 8px; color: var(--primary); }
.client-colors .eyebrow { margin-bottom: 8px; }
.palette-grid-sm { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.palette-mini { display: flex; flex-direction: column; gap: 8px; padding: 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); background: var(--surface-2); }
.palette-mini:hover { text-decoration: none; border-color: var(--primary); }
.palette-mini .pal-strip { height: 40px; border-radius: 8px; }
.palette-mini span { display: flex; flex-direction: column; }
.palette-mini strong { display: flex; align-items: center; gap: 4px; font-size: 14px; }
.palette-mini strong .icon { color: #e0a84a; fill: currentColor; }
.ref-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ref-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border-radius: 999px; border: 1px solid var(--border); color: var(--text); font-size: 13px; font-weight: 600; }
.ref-chip:hover { text-decoration: none; border-color: var(--primary); }
.shade-history { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.shade-history .list-row { padding: 10px 12px; }
.appt-notes { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.appt-notes li { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); font-size: 14px; }
.appt-notes p { margin: 4px 0 0; }
[data-palette-form] .sticky-actions { z-index: 5; background: linear-gradient(to bottom, transparent, var(--bg) 35%); padding-top: 22px; }

/* ---------- Pagamento pendente ---------- */
.pay-fields .seg.wide span { padding: 7px 6px; font-size: 12.5px; }
.pay-fields > .field { margin-top: 8px; }
.pay-box { border-color: color-mix(in srgb, var(--warn) 45%, var(--border)); }
.pay-head { display: flex; gap: 12px; align-items: center; }
.pay-head small { display: block; color: var(--muted); }
.pay-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--warn-50); color: var(--warn); flex-shrink: 0; }
.pay-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-top: 14px; }
.pay-form .field { flex: 1 1 180px; }
.pay-ok { margin: -6px 0 12px; }
.pay-ok .badge { display: inline-flex; align-items: center; gap: 4px; }
.debt-list { margin-top: 12px; border-top: 1px solid var(--border); }
.debt-row { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.debt-row > a { display: flex; flex-direction: column; color: var(--text); min-width: 0; }
.debt-row > a:hover { text-decoration: none; }
.debt-pay { display: flex; gap: 6px; align-items: center; }
.debt-pay .input { width: 96px; min-height: 36px; padding: 6px 8px; font-size: 15px; }
.btn-reset { background: none; border: 0; padding: 0; cursor: pointer; font: inherit; color: var(--primary); font-weight: 600; }
.list-row .right .badge { margin-top: 3px; }

/* ---------- Modo claro / escuro ---------- */
:root[data-theme="dark"] .ico-light, :root[data-theme="light"] .ico-dark, :root[data-theme="auto"] .ico-dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] .ico-dark { display: inline; }
  :root[data-theme="auto"] .ico-light { display: none; }
}
.theme-card { margin-bottom: 16px; }
.theme-card .seg { margin-top: 8px; }
button.list-row { width: 100%; text-align: left; font: inherit; font-weight: 400; color: var(--text); background: none; border: 0; border-bottom: 1px solid var(--border); padding: 12px 16px; cursor: pointer; }
button.list-row .ico-dark, button.list-row .ico-light { display: contents; }
:root[data-theme="dark"] button.list-row .ico-light, :root[data-theme="light"] button.list-row .ico-dark, :root[data-theme="auto"] button.list-row .ico-dark { display: none; }
@media (prefers-color-scheme: dark) { :root[data-theme="auto"] button.list-row .ico-dark { display: contents; } :root[data-theme="auto"] button.list-row .ico-light { display: none; } }
.dash-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.theme-seg { align-self: center; border: 1px solid var(--border); }
.theme-seg span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; }

/* ---------- Fotos no formulário de atendimento ---------- */
.photo-step .card-head h3 { display: inline-flex; align-items: center; gap: 8px; }
.photo-step .seg { margin: 12px 0; }
.photo-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.photo-btn { position: relative; overflow: hidden; min-height: 52px; }
.photo-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }
.photo-preview { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin-top: 12px; }
.photo-preview:empty { display: none; }
.photo-preview figure { position: relative; margin: 0; aspect-ratio: 1; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); }
.photo-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-preview figcaption { position: absolute; left: 4px; bottom: 4px; font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 6px; background: rgba(0, 0, 0, .55); color: #fff; }
.photo-preview .busy { display: grid; place-items: center; height: 100%; font-size: 12px; color: var(--muted); }
.photo-hint { margin: 12px 0 0; }
.sync-hint { display: flex; align-items: flex-start; gap: 6px; margin: 0 0 12px; }
@media (max-width: 959px) { .hide-mobile { display: none !important; } }
@media (max-width: 380px) { .photo-actions { grid-template-columns: 1fr; } }

/* ---------- Ver foto ---------- */
.photo-kind { min-width: 0; }
.photo-kind-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; min-height: 34px; }
.photo-kind-head h4 { margin: 0; }
.photo-empty { margin: 0; padding: 18px 10px; text-align: center; border: 1px dashed var(--border); border-radius: 12px; }
.photo-cols { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
a[data-view] { cursor: zoom-in; }
.photo-viewer { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: rgba(10, 6, 9, .96); color: #fff; }
.photo-viewer::backdrop { background: rgba(0, 0, 0, .8); }
.photo-viewer[open] { display: flex; flex-direction: column; }
.pv-top { display: flex; align-items: center; gap: 8px; padding: calc(10px + env(safe-area-inset-top)) 12px 10px; }
.pv-top .icon-btn { color: #fff; }
.pv-label { flex: 1; font-weight: 700; font-size: 15px; }
.pv-stage { position: relative; flex: 1; min-height: 0; display: grid; place-items: center; padding: 0 12px calc(16px + env(safe-area-inset-bottom)); }
.pv-stage img { max-width: 100%; max-height: calc(100dvh - 90px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); object-fit: contain; border-radius: 10px; touch-action: pan-y pinch-zoom; }
.pv-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; border: 0; display: grid; place-items: center; background: rgba(255, 255, 255, .14); color: #fff; cursor: pointer; }
.pv-prev { left: 12px; } .pv-next { right: 12px; }
.pv-nav[hidden] { display: none; }
.photo-preview-groups { display: grid; gap: 12px; margin-top: 12px; }
.photo-preview-groups:empty { display: none; }
.photo-preview-groups .photo-preview { margin-top: 0; }
.photo-preview a { display: block; width: 100%; height: 100%; }
.theme-btn { color: var(--muted); }
.theme-btn:hover { color: var(--primary); }
.theme-btn svg { width: 18px; height: 18px; }

/* Passo a passo de instalação no celular (Ajuda e tela de entrar) */
.install-guide { display: flex; flex-direction: column; gap: 10px; }
.install-guide .help-ic b { font-size: 14px; }
.install-hint { margin-top: 18px; }
.install-hint > summary { display: flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; list-style: none; color: var(--primary); padding: 10px; border: 1px dashed var(--border); border-radius: 12px; }
.install-hint > summary::-webkit-details-marker { display: none; }
.install-hint[open] > summary { margin-bottom: 10px; }
