:root {
  color-scheme: light;
  --canvas: #F1F4F3;
  --surface: #FFFFFF;
  --surface-raised: #FFFFFF;
  --field-bg: #FFFFFF;
  --text: #26343D;
  --text-muted: #53636B;
  --text-faint: #5C6C73;
  --border: #D4DDDA;
  --control-border: #82928C;
  --nav-bg: #34414B;
  --nav-text: #F5F7F6;
  --primary-bg: #245B49;
  --primary-text: #FFFFFF;
  --focus: #89614E;
  --success: #176A48;
  --warning: #875500;
  --danger: #AC263B;
  --info: #2457A6;
  --positive: #176A48;
  --selected: #E7EFEB;
  --shadow: 0 4px 18px rgba(32, 43, 51, .05);
  --heading-family: "Manrope", "Segoe UI", system-ui, sans-serif;
  --brand-copper: #CBA58F;
  --brand-emerald: #245B49;
  --brand-slate: #34414B;
  --sans: "Public Sans", "Segoe UI", system-ui, sans-serif;
  --radius-control: 8px;
  --radius-card: 14px;
  --radius-dialog: 18px;
}

html[data-area="admin"], html[data-area="admin"][data-theme="admin"], html[data-theme="classic"] {
  color-scheme: light;
}

html[data-area="cliente"][data-theme="premium"] {
  color-scheme: dark;
  --canvas: #202B33;
  --surface: #2F3C45;
  --surface-raised: #35444D;
  --field-bg: #29363E;
  --text: #F5F7F6;
  --text-muted: #C2CEC9;
  --text-faint: #C2CEC9;
  --border: #60716D;
  --control-border: #859A91;
  --nav-bg: #34414B;
  --nav-text: #F5F7F6;
  --primary-bg: #CBA58F;
  --primary-text: #202B33;
  --focus: #E2C6B5;
  --success: #98CFB1;
  --warning: #D9BB8F;
  --danger: #FFACBA;
  --info: #A3B7C5;
  --positive: #98CFB1;
  --selected: #3C504A;
  --shadow: 0 8px 22px rgba(0, 0, 0, .18);
}
html[data-area="cliente"][data-theme="premium"] body {
  background-image:
    radial-gradient(ellipse at 78% 2%, rgba(203, 165, 143, .06), transparent 36%),
    radial-gradient(ellipse at 2% 24%, rgba(36, 91, 73, .10), transparent 34%);
  background-attachment: fixed;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }
html { scroll-behavior: smooth; }
body {
  min-width: 320px;
  overflow-x: hidden;
  color: var(--text);
  background: var(--canvas);
  font: 15px/1.5 var(--sans);
  transition: background-color 80ms ease, color 80ms ease;
}
button, input, select, textarea { color: inherit; font: inherit; }
button { cursor: pointer; }
a { color: var(--primary-bg); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.bar :focus-visible, .sheet.dark :focus-visible, .block.lead :focus-visible { outline-color: #E2C6B5; }
::selection { color: var(--primary-text); background: var(--primary-bg); }
[hidden] { display: none !important; }
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.num, .money, .numeric { font-variant-numeric: tabular-nums lining-nums; }
.num { white-space: nowrap; overflow-wrap: normal; }

/* Shared shell and navigation */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.bar {
  z-index: 20;
  display: flex;
  min-width: 0;
  flex-direction: column;
  color: var(--nav-text);
  background: var(--nav-bg);
}
.client-bar { position: sticky; top: 0; height: 100vh; padding: 20px 12px 16px; }
.bar-head { display: flex; min-width: 0; align-items: center; gap: 12px; }
.client-bar .bar-head { min-height: 44px; padding: 0 12px; margin-bottom: 20px; }
.brand { font-family: var(--heading-family); text-transform: uppercase; display: inline-flex; min-width: 0; align-items: center; gap: 10px; color: inherit; font-size: 16px; font-weight: 700; letter-spacing: -.02em; text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand > span:last-child { overflow-wrap: anywhere; }
.brand-mark { display: block; width: 44px; height: 44px; flex: none; overflow: hidden; border-radius: 8px; background: var(--brand-slate); }
.brand-mark img { display: block; width: 100%; height: 100%; object-fit: contain; }
.client-bar .brand { font-size: 14px; letter-spacing: .025em; }
.client-bar .bar-head { padding: 0 4px; }

.nav { display: flex; min-height: 0; flex-direction: column; gap: 4px; overflow: auto; padding-right: 2px; }
.nav-group { position: relative; min-width: 0; }
.nav-link, .nav-toggle {
  display: flex;
  width: 100%; min-height: 44px;
  align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 12px;
  border: 0; border-radius: var(--radius-control);
  color: rgba(245, 247, 246, .84);
  background: transparent;
  font-size: 14px; font-weight: 550; line-height: 1.35;
  text-align: left; text-decoration: none;
  transition: color 140ms ease, background-color 140ms ease;
}
.nav-link:hover, .nav-toggle:hover { color: #FFFFFF; background: rgba(255, 255, 255, .07); text-decoration: none; }
.nav-link.is-disabled { cursor: not-allowed; opacity: .66; }
.nav-link.is-disabled:hover { color: inherit; background: transparent; text-decoration: none; }
.nav-link.is-on, .nav-toggle.is-on { color: #FFFFFF; background: rgba(255, 255, 255, .12); box-shadow: inset 3px 0 0 var(--brand-copper); }
.nav-toggle > span { min-width: 0; }
.nav-toggle > i {
  width: 8px; height: 8px; flex: none;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  opacity: .8; transform: rotate(45deg) translateY(-2px); transition: transform 140ms ease;
}
.nav-group.is-open > .nav-toggle > i { transform: rotate(225deg) translate(-1px, -1px); }
.nav-submenu { display: none; margin: 2px 0 6px 14px; padding: 2px 0 2px 10px; border-left: 1px solid rgba(245, 247, 246, .2); }
.nav-submenu.open:not([hidden]) { display: flex; flex-direction: column; gap: 2px; }
.nav-submenu .nav-link { min-height: 44px; padding: 7px 10px; color: rgba(245, 247, 246, .76); font-size: 13px; }
.nav-submenu .nav-link.is-on { color: #FFFFFF; background: rgba(255, 255, 255, .12); box-shadow: inset 2px 0 0 var(--brand-copper); }
.side-foot { display: flex; flex-direction: column; gap: 12px; margin-top: auto; padding-top: 16px; border-top: 1px solid rgba(245, 247, 246, .15); }
.side-foot > .account { order: 1; }
.side-foot > .nav-link { order: 0; }
.account { display: flex; min-width: 0; align-items: center; gap: 10px; padding: 4px 8px; color: var(--nav-text); }
.account > div { min-width: 0; overflow-wrap: anywhere; font-size: 13px; font-weight: 600; }
.account small { display: block; color: rgba(245, 247, 246, .68); font-size: 12px; font-weight: 400; }
.avatar { display: grid; width: 36px; height: 36px; flex: none; place-items: center; border-radius: 50%; color: #FFFFFF; background: #245B49; font-size: 14px; font-weight: 700; }
.stage { min-width: 0; }
.main { width: min(100%, 1304px); min-width: 0; margin: 0 auto; padding: 28px 32px 48px; outline: none; }
.top { display: flex; min-height: 56px; align-items: center; justify-content: space-between; gap: 16px; margin: 0 0 24px; }
.top-title { display: flex; min-width: 0; align-items: center; gap: 14px; }
.top-title > div { min-width: 0; }
.eyebrow { margin: 0 0 3px; color: var(--text-muted); font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-family: var(--heading-family); margin: 0; color: var(--text); font-size: clamp(26px, 2.4vw, 32px); font-weight: 650; letter-spacing: -.035em; line-height: 1.15; overflow-wrap: anywhere; }
.is-dashboard h1 { font-family: var(--heading-family); font-size: clamp(30px, 2.7vw, 36px); font-weight: 600; letter-spacing: -.025em; }
h2 { margin: 0 0 12px; font-size: 18px; font-weight: 650; letter-spacing: -.015em; line-height: 1.3; }
h3 { margin: 0 0 8px; font-size: 15px; font-weight: 650; }
p { margin-bottom: 12px; }
.top-meta { display: flex; align-items: center; gap: 18px; }
.when { margin: 0; color: var(--text-muted); font-size: 13px; white-space: nowrap; }
.admin-account { color: var(--text); }
.admin-account small { color: var(--text-muted); }
.admin-account .avatar { background: var(--primary-bg); color: var(--primary-text); }
.signout-link { display: inline-flex; min-width: 44px; min-height: 44px; align-items: center; justify-content: center; padding: 8px; color: var(--text-muted); }
.admin-bar .admin-account, .admin-bar .signout-link { color: var(--nav-text); }
.admin-bar .admin-account small { color: rgba(245, 247, 246, .76); }
.drawer-backdrop { display: none; }
.drawer-close { display: none; }
.burger { display: none; min-height: 44px; padding: 0 12px; border: 1px solid var(--border); border-radius: var(--radius-control); color: var(--text); background: var(--surface); font-weight: 600; }
.page-body { min-width: 0; }

/* Client dashboard and reusable content surfaces */
.blocks { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.block {
  --summary-accent: var(--primary-bg);
  display: flex; min-width: 0; min-height: 136px; flex-direction: column;
  padding: 18px 20px 16px;
  border: 1px solid var(--border); border-top: 2px solid var(--summary-accent); border-radius: var(--radius-card);
  color: var(--text); background: var(--surface); box-shadow: var(--shadow);
}
.block:nth-child(2) { --summary-accent: #A3B7C5; }
.block:nth-child(3) { --summary-accent: var(--brand-copper); }
.block:nth-child(4) { --summary-accent: #CBA58F; }
.block:nth-child(5) { --summary-accent: #A1B9AE; }
.block.lead { grid-column: 1 / -1; min-height: 148px; align-items: start; justify-content: center; padding: 22px 24px; border-top-width: 3px; }
.block .label { margin: 0 0 8px; color: var(--text-muted); font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.block.lead .label { color: var(--text-muted); }
.money { margin: 0; color: var(--text); font-size: clamp(26px, 2.3vw, 34px); font-weight: 650; letter-spacing: -.035em; line-height: 1.15; overflow-wrap: anywhere; }
.block.lead .money { font-size: clamp(34px, 3vw, 42px); }
.foot { margin-top: auto; padding-top: 12px; color: var(--text-muted); font-size: 13px; overflow-wrap: anywhere; }
.block.lead .foot { padding-top: 8px; }
.block.lead .actions { position: absolute; right: 24px; top: 50%; margin: 0; transform: translateY(-50%); }
.block.lead .actions svg { width: 56px; height: 56px; display: block; flex: none; }
.block.lead { position: relative; padding-right: 168px; }
html[data-area="cliente"][data-theme="classic"] .block.lead,
html[data-area="admin"] .block.lead { color: #FFFFFF; background: var(--nav-bg); border-color: var(--nav-bg); }
html[data-area="cliente"][data-theme="classic"] .block.lead .label,
html[data-area="admin"] .block.lead .label,
html[data-area="cliente"][data-theme="classic"] .block.lead .money,
html[data-area="admin"] .block.lead .money { color: #FFFFFF; }
html[data-area="cliente"][data-theme="classic"] .block.lead .foot,
html[data-area="admin"] .block.lead .foot { color: rgba(255, 255, 255, .76); }
html[data-area="cliente"][data-theme="premium"] .block { background: var(--surface); }
html[data-area="cliente"][data-theme="premium"] .block.lead { border-color: #98CFB1; }
.block.wide { grid-column: auto; }
.card, .sheet, .plan {
  min-width: 0;
  border: 1px solid var(--border); border-radius: var(--radius-card);
  color: var(--text); background: var(--surface); box-shadow: var(--shadow);
}
.card { padding: 20px 20px 16px; margin-top: 16px; }
.card.flat { box-shadow: none; }
.card h2 { margin-bottom: 12px; }
.sheet { padding: 20px; }
.sheet.dark { color: #FFFFFF; background: var(--nav-bg); border-color: var(--nav-bg); }
.sheet.dark h2, .sheet.dark .fine, .sheet.dark dt { color: rgba(255, 255, 255, .76); }
.sheet.dark dd, .sheet.dark .money { color: #FFFFFF; }
.sheet.dark .btn-line { color: #FFFFFF; background: transparent; border-color: rgba(255, 255, 255, .35); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.grid-2 > * { min-width: 0; }
.plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.plan { display: flex; flex-direction: column; gap: 8px; padding: 20px; }
.plan h2 { overflow-wrap: anywhere; }
.plan .money { margin: 4px 0 8px; }
.plan .btn { align-self: flex-start; margin-top: auto; }
.plan ul { margin: 0 0 12px; padding-left: 20px; color: var(--text-muted); }
.plan li + li { margin-top: 4px; }
.desk { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 320px); gap: 16px; align-items: start; }
.ref { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.ref > div { min-width: 0; }
.ref code { display: block; margin-top: 4px; color: var(--text); font: 13px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; overflow-wrap: anywhere; }
.ledger .table-scroll { margin-top: 2px; }
.fine, .field-help { color: var(--text-muted); font-size: 13px; }
.fine { margin: 8px 0 0; }
.hint { margin: 12px 0; color: var(--text-muted); font-size: 13px; }
.pos { color: var(--positive); font-weight: 650; }
.empty-state { color: var(--text-muted); }
.empty-state h2 { color: var(--text); }

/* Tables keep native relationships and scroll inside their own region */
.table-scroll { max-width: 100%; overflow: auto; border-radius: 8px; scrollbar-color: var(--border) transparent; }
.table-scroll-hint { display: none; margin: 6px 4px 0; color: var(--text-muted); font-size: 12px; text-align: right; }
table { width: 100%; border-collapse: collapse; color: var(--text); font-size: 14px; }
th { padding: 12px 10px; color: var(--text-faint); background: color-mix(in srgb, var(--canvas) 70%, var(--surface)); font-size: 11px; font-weight: 650; letter-spacing: .055em; text-align: left; text-transform: uppercase; white-space: nowrap; }
td { min-height: 48px; padding: 13px 10px; border-top: 1px solid var(--border); vertical-align: middle; }
th.numeric, td.numeric { text-align: right; white-space: nowrap; }
tbody tr.click:hover td { background: color-mix(in srgb, var(--selected) 72%, var(--surface)); }
tbody tr.click { cursor: pointer; }
tr.is-on td { background: var(--selected); }
tr.is-on td:first-child { box-shadow: inset 3px 0 0 var(--primary-bg); }
.table-empty { padding: 22px 12px; color: var(--text-muted); text-align: center; white-space: normal; }
.table-select { display: inline-flex; min-height: 44px; align-items: center; padding: 0; border: 0; border-radius: 0; color: var(--primary-bg); background: transparent; font: inherit; font-weight: 650; text-align: left; text-decoration: underline; text-underline-offset: 3px; }
.table-select:hover { text-decoration-thickness: 2px; }

/* Controls, forms and explicit status labels */
.btn, .btn-line, .quiet, .row-actions > button, .row-actions > a, button.btn-line {
  display: inline-flex; min-height: 44px; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 16px; border: 1px solid transparent; border-radius: var(--radius-control);
  font-weight: 650; line-height: 1.25; text-align: center; text-decoration: none;
  transition: color 140ms ease, background-color 140ms ease, border-color 140ms ease;
}
.btn { color: var(--primary-text); background: var(--primary-bg); }
.btn:hover { filter: brightness(.95); text-decoration: none; }
.btn:disabled, .btn-line:disabled, button:disabled { cursor: not-allowed; opacity: .56; }
.btn-line { color: var(--text); border-color: var(--control-border); background: var(--surface); }
.btn-line:hover { border-color: var(--primary-bg); background: var(--selected); text-decoration: none; }
.btn.danger, .btn-line.danger { color: #FFFFFF; background: var(--danger); }
.btn-line.danger { color: var(--danger); border-color: currentColor; background: transparent; }
.quiet { min-height: 44px; padding: 8px 0; color: var(--primary-bg); border: 0; background: transparent; }
.actions, .row-actions { display: flex; min-width: 0; align-items: center; gap: 8px; flex-wrap: wrap; }
.actions { margin-top: 14px; }
.row-actions { justify-content: flex-start; }
.field { display: flex; min-width: 0; flex-direction: column; gap: 6px; margin-bottom: 14px; color: var(--text); font-size: 13px; font-weight: 600; }
.field-label { display: block; }
.field input, .field select, .field textarea, input, select, textarea {
  max-width: 100%; border: 1px solid var(--control-border); border-radius: var(--radius-control);
  color: var(--text); background: var(--field-bg);
}
.field input, .field select, .field textarea { width: 100%; min-height: 44px; padding: 10px 12px; font-weight: 450; }
textarea { min-height: 112px; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--text-faint); opacity: 1; }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--danger); }
.field-help { display: block; font-weight: 400; }
.grid-2 .field { margin-bottom: 0; }
.dot { display: inline-flex; min-height: 24px; align-items: center; gap: 7px; color: var(--text-muted); font-size: 13px; font-weight: 600; white-space: nowrap; }
.dot i { width: 8px; height: 8px; flex: none; border-radius: 50%; background: currentColor; }
.dot.ok { color: var(--success); }
.dot.wait { color: var(--warning); }
.dot.bad { color: var(--danger); }
.dot.quiet { color: var(--text-muted); }
.tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.tab { display: flex; min-height: 96px; flex-direction: column; justify-content: space-between; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius-card); color: var(--text); background: var(--surface); text-align: left; }
.tab b { margin-bottom: 6px; font-size: 30px; font-weight: 650; letter-spacing: -.035em; line-height: 1.05; }
.tab span { color: var(--text-muted); font-size: 13px; font-weight: 550; }
.tab.is-on { color: #FFFFFF; border-color: var(--nav-bg); background: var(--nav-bg); }
.tab.is-on span { color: rgba(255, 255, 255, .78); }
dl { margin: 12px 0 0; }
dl div { display: flex; min-width: 0; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); font-size: 14px; }
dt { color: var(--text-muted); }
dd { min-width: 0; margin: 0; color: var(--text); font-weight: 650; text-align: right; overflow-wrap: anywhere; }

/* Appearance selector previews and saved/draft states */
.page-stack { display: grid; gap: 16px; }
.appearance-panel { margin-top: 0; }
.section-heading { margin-bottom: 16px; }
.section-heading p { margin: 0; color: var(--text-muted); }
.theme-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; padding: 0; margin: 0; border: 0; }
.theme-choice { position: relative; display: grid; min-width: 0; grid-template-columns: 24px minmax(0, 1fr); gap: 12px; padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); cursor: pointer; }
.theme-choice:has(input:checked), .theme-choice.is-selected { border-color: var(--primary-bg); box-shadow: inset 0 0 0 1px var(--primary-bg); }
.theme-choice > input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--primary-bg); }
.theme-choice-content { display: grid; min-width: 0; gap: 10px; }
.theme-choice-copy { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.theme-choice-copy > span:first-child { min-width: 0; }
.theme-choice-copy strong { display: block; color: var(--text); font-size: 15px; }
.theme-choice-copy small { display: block; color: var(--text-muted); font-size: 13px; }
.applied-badge { flex: none; padding: 4px 8px; border-radius: 999px; color: var(--success); background: color-mix(in srgb, var(--success) 12%, var(--surface)); font-size: 11px; font-weight: 700; }
.theme-preview { display: grid; min-height: 102px; grid-template-columns: 48px minmax(0, 1fr); overflow: hidden; border: 1px solid var(--border); border-radius: 8px; }
.theme-preview-side { padding: 8px 5px; color: #F5F7F6; background: #34414B; }
.theme-preview-side span { display: block; width: 80%; height: 5px; margin: 6px auto; border-radius: 4px; background: rgba(255, 255, 255, .52); }
.theme-preview-main { display: flex; flex-direction: column; gap: 8px; padding: 10px; background: #F1F4F3; }
.theme-preview-title { width: 46%; height: 8px; border-radius: 4px; background: #53636B; }
.theme-preview-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.theme-preview-cards i { display: block; height: 26px; border: 1px solid #D4DDDA; border-top: 2px solid #245B49; border-radius: 5px; background: #FFFFFF; }
.theme-preview[data-preview="premium"] .theme-preview-side { background: #34414B; }
.theme-preview[data-preview="premium"] .theme-preview-main { background: #202B33; }
.theme-preview[data-preview="premium"] .theme-preview-title { background: #C2CEC9; }
.theme-preview[data-preview="premium"] .theme-preview-cards i { border-color: #60716D; border-top-color: #98CFB1; background: #2F3C45; }
.theme-preview[data-preview="premium"] .theme-preview-cards i:nth-child(2) { border-top-color: var(--brand-copper); }
.appearance-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 16px; margin-top: 16px; border-top: 1px solid var(--border); }
.appearance-note { max-width: 68ch; margin: 0; color: var(--text-muted); font-size: 13px; }
.appearance-status { min-height: 1.5em; margin: 0; color: var(--info); font-size: 13px; }

/* Public access pages */
.auth { display: grid; min-height: 100vh; place-items: center; padding: 32px 24px; background: var(--canvas); }
.auth-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); width: min(900px, 100%); overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-dialog); background: var(--surface); }
.auth-brand { display: flex; align-items: center; justify-content: center; padding: 24px; border-bottom: 3px solid var(--brand-copper); background: #36424D; }
.auth-brand img { display: block; width: 100%; max-width: 368px; height: auto; }
.auth-layout .auth-card { width: 100%; align-self: center; padding: 40px; border: 0; border-radius: 0; box-shadow: none; }
@media (max-width: 639px) {
  .auth { padding: 16px; }
  .auth-layout { grid-template-columns: minmax(0, 1fr); max-width: 440px; }
  .auth-brand { padding: 0; }
  .auth-brand img { width: 192px; }
  .auth-layout .auth-card { padding: 24px; }
}
.auth-card { width: min(440px, 100%); padding: 32px; border: 1px solid var(--border); border-radius: var(--radius-dialog); color: var(--text); background: var(--surface); box-shadow: var(--shadow); }
.auth-card h1 { margin-bottom: 8px; }
.auth-card > .label { margin-bottom: 8px; color: var(--primary-bg); font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.auth-card .hint { color: var(--text-muted); }
.auth-card .btn { width: 100%; margin-top: 6px; }
.auth-card a { display: inline-block; min-height: 36px; padding-top: 6px; }

/* Feedback */
.toast {
  position: fixed; z-index: 100; right: 24px; bottom: 24px; max-width: min(420px, calc(100vw - 32px));
  padding: 12px 16px; border: 1px solid rgba(255, 255, 255, .12); border-radius: var(--radius-control);
  color: #FFFFFF; background: #34414B; box-shadow: 0 10px 32px rgba(32, 43, 51, .22); font-size: 14px;
}
.toast[hidden] { display: none; }

@supports (backdrop-filter: blur(1px)) {
  html[data-area="cliente"][data-theme="premium"] .client-bar { background: var(--nav-bg); }
}
@media (prefers-reduced-transparency: reduce) {
  html[data-area="cliente"][data-theme="premium"] .client-bar,
  html[data-area="cliente"][data-theme="premium"] .block { background: #2F3C45; backdrop-filter: none; -webkit-backdrop-filter: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media (max-width: 1199px) {
  .shell { display: block; }
  .bar {
    position: fixed; inset: 0 auto 0 0; width: min(320px, calc(100vw - 32px)); height: 100dvh;
    padding: 20px 16px 16px; overflow: auto; transform: translateX(-105%); transition: transform 160ms ease;
  }
  .bar.open { transform: translateX(0); }
  .bar-head { min-height: 44px; margin-bottom: 16px; }
  .client-bar .bar-head { padding: 0; }
  .drawer-close { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; padding: 8px 10px; border: 1px solid rgba(245, 247, 246, .28); border-radius: 8px; margin-left: auto; color: var(--nav-text); background: transparent; }
  .drawer-backdrop:not([hidden]) { position: fixed; z-index: 19; inset: 0; display: block; border: 0; background: rgba(32, 43, 51, .52); }
  .drawer-open { overflow: hidden; }
  .burger { display: inline-flex; align-items: center; }
  .main { padding: 24px; }
  .top-meta .admin-account { display: none; }
  .admin-bar { flex-direction: column; }
  .admin-bar .bar-head { flex-wrap: wrap; }
  .admin-bar .admin-label { display: none; }
  .admin-bar .nav { align-items: stretch; flex-direction: column; gap: 4px; overflow: visible; }
  .admin-bar .nav-group { width: 100%; }
  .admin-bar .nav-submenu { position: static; padding: 2px 0 2px 10px; margin-left: 14px; border-left: 1px solid rgba(245, 247, 246, .2); box-shadow: none; }
  .plans { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .blocks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .block.lead { grid-column: 1 / -1; }
}

@media (min-width: 1200px) {
  .admin-shell { display: block; }
  .admin-bar { position: sticky; top: 0; height: auto; padding: 12px max(24px, calc((100vw - 1376px) / 2)); }
  .admin-bar .bar-head { min-height: 46px; gap: 16px; }
  .admin-bar .brand { color: #FFFFFF; }
  .admin-label { padding-left: 16px; border-left: 1px solid rgba(245, 247, 246, .28); color: rgba(245, 247, 246, .72); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
  .admin-account { margin-left: auto; }
  .admin-bar .nav { min-height: 48px; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px; overflow: visible; padding: 8px 0 0; }
  .admin-bar .nav-group { flex: 0 0 auto; }
  .admin-bar .nav-link, .admin-bar .nav-toggle { width: auto; min-height: 44px; padding: 8px 10px; white-space: nowrap; }
  .admin-bar .nav-submenu .nav-link { min-height: 44px; }
  .admin-bar .nav-submenu {
    position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; min-width: 228px; max-width: min(320px, 90vw);
    padding: 8px; margin: 0; border: 1px solid rgba(245, 247, 246, .18); border-radius: 10px;
    background: #35444D; box-shadow: 0 12px 32px rgba(32, 43, 51, .24);
  }
  .admin-bar .nav-submenu.open:not([hidden]) { display: flex; }
  .admin-bar .nav-submenu .nav-link { width: 100%; white-space: normal; }
  .admin-shell .main { padding-top: 24px; }
}

@media (max-width: 767px) {
  .table-scroll.can-scroll + .table-scroll-hint { display: block; }
  .main { padding: 20px 16px 36px; }
  .top { align-items: flex-start; flex-direction: column; gap: 12px; margin-bottom: 20px; }
  .top-title { align-items: flex-start; }
  .eyebrow { margin-top: 2px; }
  .when { white-space: normal; }
  .top-meta { width: 100%; padding-left: 58px; }
  .blocks, .plans, .grid-2, .desk, .tabs { grid-template-columns: minmax(0, 1fr); }
  .block.wide { grid-column: auto; }
  .block.lead { min-height: 172px; padding: 20px 20px 56px; }
  .block.lead .actions { top: auto; right: 20px; bottom: 16px; left: auto; transform: none; }
  .block.lead .actions .btn { width: 100%; }
  .block.lead .foot { max-width: calc(100% - 68px); }
  .card, .sheet, .plan { padding: 16px; }
  .card { margin-top: 12px; }
  .theme-choices { grid-template-columns: minmax(0, 1fr); }
  .appearance-footer { align-items: stretch; flex-direction: column; }
  .appearance-footer .btn { width: 100%; }
  .ref { align-items: flex-start; flex-direction: column; }
  .ref .btn-line { width: 100%; }
  .actions > .btn, .actions > .btn-line { flex: 1 1 auto; }
  .tabs { gap: 8px; }
  .tab { min-height: 76px; }
  .auth { align-items: start; padding: 20px 16px; }
  .auth-card { padding: 24px 20px; }
  .toast { right: 16px; bottom: 16px; left: 16px; max-width: none; text-align: center; }
}

@media (max-width: 479px) {
  body { font-size: 15px; }
  .main { padding: 16px 16px 32px; }
  h1 { font-size: 26px; }
  .is-dashboard h1 { font-size: 30px; }
  .top-title { gap: 10px; }
  .top-meta { padding-left: 54px; }
  .burger { min-height: 44px; padding: 0 10px; }
  .block { min-height: 120px; padding: 16px; }
  .block.lead { padding: 18px 16px 56px; }
  .block.lead .actions { right: 16px; left: auto; }
  .money { font-size: 28px; }
  .grid-2 .field { min-width: 0; }
  .table-scroll { margin-right: -4px; }
  th, td { padding-right: 8px; padding-left: 8px; }
  .row-actions { gap: 6px; }
  .row-actions > button, .row-actions > a { flex: 1 1 100%; }
  .appearance-panel { padding: 16px; }
  .theme-choice { grid-template-columns: 24px minmax(0, 1fr); gap: 8px; padding: 10px; }
  .theme-preview { min-height: 88px; grid-template-columns: 40px minmax(0, 1fr); }
}

@media print {
  :root, html[data-area="cliente"][data-theme="premium"] { color-scheme: light; --canvas: #FFFFFF; --surface: #FFFFFF; --text: #111111; --text-muted: #333333; --border: #CCCCCC; }
  body { color: #111111; background: #FFFFFF; }
  .bar, .top-meta, .burger, .drawer-backdrop, .toast, .actions, .row-actions, form button { display: none !important; }
  .shell { display: block; }
  .main { width: 100%; padding: 0; }
  .card, .sheet, .plan, .block { break-inside: avoid; color: #111111; background: #FFFFFF !important; box-shadow: none; }
  a { color: #111111; text-decoration: none; }
}
