/* =============================================================================
   Client Control 7 — design system
   ============================================================================= */
:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --hover: #f1f3f6;
  --border: #e4e7ec;
  --border-strong: #d0d5dd;
  --text: #101828;
  --text-2: #475467;
  --muted: #667085;
  --accent: #4f46e5;
  --accent-2: #4338ca;
  --accent-soft: #eef2ff;
  --accent-text: #3730a3;
  --ok: #079455; --ok-soft: #ecfdf3; --ok-text: #067647;
  --warn: #dc6803; --warn-soft: #fffaeb; --warn-text: #b54708;
  --danger: #d92d20; --danger-soft: #fef3f2; --danger-text: #b42318;
  --info: #1570ef; --info-soft: #eff8ff; --info-text: #175cd3;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 4px 16px rgba(16, 24, 40, .08);
  --shadow-lg: 0 20px 48px rgba(16, 24, 40, .18);
  --radius: 12px;
  --radius-sm: 8px;
  --side-w: 248px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0b0d12;
  --surface: #13161d;
  --surface-2: #171b23;
  --hover: #1c212b;
  --border: #262b36;
  --border-strong: #353b48;
  --text: #f2f4f7;
  --text-2: #c2c8d2;
  --muted: #8b93a3;
  --accent: #6d68f5;
  --accent-2: #8580ff;
  --accent-soft: rgba(109, 104, 245, .14);
  --accent-text: #b4b1ff;
  --ok-soft: rgba(7, 148, 85, .14); --ok-text: #47cd89;
  --warn-soft: rgba(220, 104, 3, .14); --warn-text: #fdb022;
  --danger-soft: rgba(217, 45, 32, .15); --danger-text: #f97066;
  --info-soft: rgba(21, 112, 239, .15); --info-text: #84caff;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow: 0 6px 20px rgba(0, 0, 0, .35);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, .55);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
h2 { font-size: 15px; font-weight: 600; }
h3 { font-size: 13px; font-weight: 600; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
code { font-family: var(--mono); font-size: 12px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ic { flex: none; }
.muted { color: var(--muted); }
.sm { font-size: 12px; }
.center { text-align: center; }
.r { text-align: right; }
.grow { flex: 1; min-width: 0; }
.spacer { flex: 1; }
.pad { padding: 12px 0; }
.pad-x { padding: 0 20px 12px; }
.block { width: 100%; justify-content: center; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row-gap { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row-gap.end { justify-content: flex-end; margin-top: 16px; }
.ok-text { color: var(--ok-text); } .warn-text { color: var(--warn-text); } .danger-text { color: var(--danger-text) !important; }
.clamp { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------------------------------------------------------------- botões */
.btn {
  display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px;
  border-radius: var(--radius-sm); border: 1px solid transparent; background: none; cursor: pointer;
  font-weight: 600; font-size: 14px; white-space: nowrap; transition: background .15s, border-color .15s, box-shadow .15s;
  text-decoration: none !important;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover:not(:disabled) { background: var(--accent-2); }
.btn-secondary { background: var(--surface); border-color: var(--border-strong); color: var(--text); box-shadow: var(--shadow-sm); }
.btn-secondary:hover:not(:disabled) { background: var(--hover); }
.btn-ghost { color: var(--text-2); }
.btn-ghost:hover:not(:disabled) { background: var(--hover); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { height: 32px; padding: 0 10px; font-size: 13px; }
.btn-lg { height: 44px; padding: 0 20px; font-size: 15px; }
.btn.is-busy { position: relative; color: transparent !important; }
.btn.is-busy::after { content: ''; position: absolute; inset: 0; margin: auto; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-color: var(--muted) var(--muted) var(--muted) transparent; animation: spin .7s linear infinite; }
.btn-primary.is-busy::after { border-color: #fff #fff #fff transparent; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: var(--radius-sm); border: 0; background: none; color: var(--text-2); cursor: pointer; flex: none; }
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn.sm { width: 30px; height: 30px; }
.link-btn { border: 0; background: none; color: var(--accent); cursor: pointer; padding: 0; font-weight: 600; font-size: 13px; }
.link-btn:hover { text-decoration: underline; }

/* ---------------------------------------------------------------- pills */
.pill { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-ok { background: var(--ok-soft); color: var(--ok-text); }
.pill-warn { background: var(--warn-soft); color: var(--warn-text); }
.pill-danger { background: var(--danger-soft); color: var(--danger-text); }
.pill-info { background: var(--info-soft); color: var(--info-text); }
.pill-muted { background: var(--hover); color: var(--text-2); }
.sm-pill { height: 18px; font-size: 11px; padding: 0 7px; }
.count { display: inline-flex; min-width: 20px; height: 20px; padding: 0 6px; align-items: center; justify-content: center; border-radius: 999px; background: var(--hover); color: var(--text-2); font-size: 11px; font-weight: 700; }
.badge { display: inline-flex; min-width: 20px; height: 20px; padding: 0 6px; align-items: center; justify-content: center; border-radius: 999px; font-size: 11px; font-weight: 700; }
.badge.warn { background: var(--warn-soft); color: var(--warn-text); }
.badge.ok { background: var(--ok-soft); color: var(--ok-text); }

/* ---------------------------------------------------------------- shell */
.boot { min-height: 100vh; display: grid; place-items: center; }
.shell { display: flex; min-height: 100vh; }
.side {
  width: var(--side-w); flex: none; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  padding: 16px 12px; background: var(--surface); border-right: 1px solid var(--border); gap: 14px; z-index: 50;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px; color: var(--text); text-decoration: none !important; }
.brand > .ic { width: 32px; height: 32px; padding: 7px; border-radius: 9px; background: linear-gradient(135deg, var(--accent), #8b5cf6); color: #fff; }
.brand span { display: flex; flex-direction: column; line-height: 1.15; }
.brand strong { font-size: 15px; }
.brand em { font-style: normal; font-size: 12px; color: var(--muted); }
.new-btn { margin: 0 4px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-link { display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 12px; border-radius: var(--radius-sm); color: var(--text-2); font-weight: 500; text-decoration: none !important; }
.nav-link:hover { background: var(--hover); color: var(--text); }
.nav-link.on { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.nav-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.nav-badge.warn { background: var(--warn-soft); color: var(--warn-text); }
.nav-badge.danger { background: var(--danger-soft); color: var(--danger-text); }
.side-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 6px 0; border-top: 1px solid var(--border); }
.me { display: flex; align-items: center; gap: 10px; min-width: 0; }
.me div { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.me strong { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 10px; padding: 12px 28px; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(8px); }
.menu-btn { display: none; }
.search-trigger {
  flex: 1; max-width: 560px; display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--muted); cursor: pointer; box-shadow: var(--shadow-sm);
}
.search-trigger span { flex: 1; text-align: left; }
.search-trigger:hover { border-color: var(--border-strong); }
kbd { font-family: var(--font); font-size: 11px; font-weight: 600; color: var(--muted); border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px; background: var(--surface-2); }
#view { outline: none; }
.side-scrim { display: none; }

/* ---------------------------------------------------------------- página */
.page { max-width: 1240px; margin: 0 auto; padding: 8px 28px 96px; display: flex; flex-direction: column; gap: 16px; }
.page.narrow { max-width: 880px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 8px; }
.page-head p { margin-top: 4px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 20px; }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head h2 { display: flex; align-items: center; gap: 8px; }
.card.flush .card-head { padding: 16px 20px 0; }
.sub-h { margin: 18px 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.callout { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 10px; background: var(--info-soft); color: var(--text); border: 1px solid transparent; }
.callout > .ic { color: var(--info-text); }
.callout > div { flex: 1; }
.callout-warn { background: var(--warn-soft); } .callout-warn > .ic { color: var(--warn-text); }
.callout-danger { background: var(--danger-soft); } .callout-danger > .ic { color: var(--danger-text); }
.empty { padding: 48px 20px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--text-2); }
.empty.compact { padding: 28px 16px; }
.empty-ic { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: var(--hover); color: var(--muted); }
.empty-ic.ok { background: var(--ok-soft); color: var(--ok-text); }
.skel { display: flex; flex-direction: column; gap: 12px; padding-top: 16px; }
.skel > div { height: 72px; border-radius: var(--radius); background: linear-gradient(90deg, var(--surface) 25%, var(--hover) 50%, var(--surface) 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite; }
.skel > div:first-child { height: 36px; width: 40%; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------------------------------------------------------------- formulários */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 13px; font-weight: 600; color: var(--text-2); }
.field > span b { color: var(--danger); }
.field small { font-size: 12px; color: var(--muted); }
input:not([type=checkbox]):not([type=radio]), select, textarea {
  width: 100%; height: 40px; padding: 0 12px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); transition: border-color .15s, box-shadow .15s;
}
textarea { height: auto; padding: 10px 12px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: 16px; height: 16px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); cursor: pointer; }
.switch { display: flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; }
.switch input { position: absolute; opacity: 0; }
.switch span { width: 40px; height: 22px; border-radius: 999px; background: var(--border-strong); position: relative; transition: background .2s; flex: none; }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: var(--shadow-sm); }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.grid-2, .grid-3, .grid-4 { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.more { margin-top: 16px; border-top: 1px dashed var(--border); padding-top: 12px; }
.more summary { cursor: pointer; font-weight: 600; color: var(--text-2); margin-bottom: 12px; }
.chip-check { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-check label { cursor: pointer; }
.chip-check input { position: absolute; opacity: 0; }
.chip-check span { display: inline-block; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--border-strong); font-size: 13px; color: var(--text-2); }
.chip-check input:checked + span { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }
.chip-check input:focus-visible + span { outline: 2px solid var(--accent); }

/* ---------------------------------------------------------------- toolbar, seg, tabs */
.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.card .toolbar { padding: 14px 16px; border-bottom: 1px solid var(--border); }
.search { flex: 1; min-width: 220px; position: relative; display: flex; align-items: center; }
.search > .ic { position: absolute; left: 12px; color: var(--muted); }
.search input { padding-left: 36px !important; }
.sm-search { max-width: 300px; }
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--hover); border-radius: 10px; flex-wrap: wrap; }
.seg button { border: 0; background: none; height: 32px; padding: 0 12px; border-radius: 8px; color: var(--text-2); font-weight: 600; font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.seg button .count { background: var(--border); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); }
.tab { border: 0; background: none; padding: 10px 14px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; display: inline-flex; gap: 6px; align-items: center; }
.tab.on { color: var(--text); border-bottom-color: var(--accent); }

/* ---------------------------------------------------------------- tabelas e listas */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 10px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tr.clickable { cursor: pointer; }
.table tr.clickable:hover td, .table tr.selected td { background: var(--hover); }
.table th.r, .table td.r { text-align: right; }
.w-check { width: 44px; }
.who { display: flex; align-items: center; gap: 12px; }
.who div { display: flex; flex-direction: column; min-width: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 600; background: var(--hover); color: var(--text-2); }
.chip em { font-style: normal; font-weight: 500; color: var(--muted); font-family: var(--mono); font-size: 11px; }
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
.chip.tone-ok .dot { background: var(--ok); } .chip.tone-warn { background: var(--warn-soft); color: var(--warn-text); } .chip.tone-warn .dot { background: var(--warn); }
.chip.tone-danger { background: var(--danger-soft); color: var(--danger-text); } .chip.tone-danger .dot { background: var(--danger); }
.actions-cell { white-space: nowrap; color: var(--muted); }
.actions-cell .btn { opacity: 0; transition: opacity .15s; }
tr:hover .actions-cell .btn, .actions-cell .btn:focus-visible { opacity: 1; }
.list { display: flex; flex-direction: column; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border: 0; border-bottom: 1px solid var(--border); background: none; text-align: left; cursor: pointer; width: 100%; border-radius: 0; }
.list-row.static { cursor: default; }
.list-row:last-child { border-bottom: 0; }
.list-row:not(.static):hover { background: var(--hover); }
.list-row select { width: auto; max-width: 220px; height: 34px; }
.list-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.card.flush .list-row { padding: 12px 20px; }
.avatar { display: inline-grid; place-items: center; border-radius: 10px; flex: none; font-weight: 700; color: hsl(var(--h) 55% 32%); background: hsl(var(--h) 70% 92%); }
:root[data-theme="dark"] .avatar { color: hsl(var(--h) 80% 80%); background: hsl(var(--h) 40% 22%); }

/* ---------------------------------------------------------------- apps */
.app-logo { width: 40px; height: 40px; flex: none; border-radius: 10px; display: grid; place-items: center; font-weight: 800; font-size: 14px; color: #fff; background: linear-gradient(135deg, #64748b, #334155); letter-spacing: -.02em; }
.app-logo.sm { width: 28px; height: 28px; border-radius: 7px; font-size: 11px; }
.app-ticket { background: linear-gradient(135deg, #22c55e, #059669); }
.app-sishotel { background: linear-gradient(135deg, #3b82f6, #4f46e5); }
.app-sisia { background: linear-gradient(135deg, #a855f7, #db2777); }
.ver { font-family: var(--mono); font-size: 12px; font-weight: 600; padding: 2px 7px; border-radius: 6px; background: var(--hover); }
.ver-ok { background: var(--ok-soft); color: var(--ok-text); }
.ver-old { background: var(--warn-soft); color: var(--warn-text); }
.ver-new { background: var(--accent-soft); color: var(--accent-text); }

/* ---------------------------------------------------------------- KPIs / home */
.kpis { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 12px; }
.kpi { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm); text-align: left; cursor: pointer; }
.kpi span { font-size: 13px; color: var(--muted); font-weight: 500; }
.kpi strong { font-size: 24px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi em { font-style: normal; font-size: 12px; color: var(--muted); }
button.kpi:hover { border-color: var(--border-strong); }
.kpi-hero { background: linear-gradient(135deg, var(--accent), #7c3aed); border: 0; color: #fff; cursor: default; }
.kpi-hero span, .kpi-hero em { color: rgba(255, 255, 255, .8); }
.kpi-danger strong { color: var(--danger-text); }
.quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.quick-card { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 18px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); cursor: pointer; text-align: left; box-shadow: var(--shadow-sm); transition: transform .15s, box-shadow .15s, border-color .15s; }
.quick-card:hover { transform: translateY(-1px); box-shadow: var(--shadow); border-color: var(--border-strong); }
.quick-card .ic { color: var(--accent); margin-bottom: 6px; }
.quick-card strong { font-size: 15px; }
.quick-card span { font-size: 13px; color: var(--muted); }
.quick-card.primary { background: linear-gradient(135deg, var(--accent), #7c3aed); border: 0; color: #fff; }
.quick-card.primary .ic, .quick-card.primary span { color: rgba(255, 255, 255, .85); }
.home-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); gap: 16px; align-items: start; }
.inbox { display: flex; flex-direction: column; gap: 6px; }
.inbox-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; text-align: left; width: 100%; color: var(--muted); }
.inbox-row:hover { background: var(--hover); }
.inbox-ic { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; flex: none; background: var(--hover); color: var(--text-2); }
.inbox-row.tone-danger .inbox-ic { background: var(--danger-soft); color: var(--danger-text); }
.inbox-row.tone-warn .inbox-ic { background: var(--warn-soft); color: var(--warn-text); }
.inbox-row.tone-info .inbox-ic { background: var(--info-soft); color: var(--info-text); }
.inbox-body { flex: 1; display: flex; flex-direction: column; min-width: 0; color: var(--text); }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; padding: 0; overflow: hidden; background: var(--border); }
.stat { background: var(--surface); padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.stat span { font-size: 12px; color: var(--muted); }
.stat strong { font-size: 20px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat.danger strong { color: var(--danger-text); } .stat.warn strong { color: var(--warn-text); }
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.timeline li { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); align-items: start; }
.timeline li:last-child { border-bottom: 0; }
.timeline.compact li { padding: 8px 0; }
.tl-ic { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--hover); color: var(--text-2); }

/* ---------------------------------------------------------------- cliente */
.client-hero { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.client-hero-main { flex: 1; min-width: 240px; display: flex; flex-direction: column; gap: 6px; }
.hero-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.hero-meta .ic { vertical-align: -2px; }
.hero-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.client-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.client-main, .client-side { display: flex; flex-direction: column; gap: 16px; }
.sw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.sw-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 12px; background: var(--surface-2); }
.sw-card header { display: flex; align-items: center; gap: 10px; }
.sw-title { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.sw-title .sm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sw-version { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sw-links { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; }
.sw-links .ic { vertical-align: -2px; }
.sw-card footer { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; border-top: 1px solid var(--border); padding-top: 12px; }
.policy select { height: 32px; font-size: 12px; width: auto; }
.fin-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 8px; }
.fin-summary > div { display: flex; flex-direction: column; padding: 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.fin-summary strong { font-size: 18px; font-variant-numeric: tabular-nums; }
.note-form { display: flex; gap: 8px; margin-bottom: 8px; }
.dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 12px; margin: 0 0 12px; font-size: 13px; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; text-align: right; word-break: break-word; }
.contact { display: flex; flex-direction: column; padding: 8px 0; border-bottom: 1px solid var(--border); }
.contact:last-child { border-bottom: 0; }

/* ---------------------------------------------------------------- assistente */
.wizard { max-width: 860px; }
.wz-head { display: flex; align-items: flex-start; gap: 12px; padding-top: 8px; }
.stepper { list-style: none; display: flex; gap: 8px; margin: 0; padding: 0; counter-reset: s; }
.stepper li { flex: 1; display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px; color: var(--muted); font-weight: 600; font-size: 13px; background: var(--surface); border: 1px solid var(--border); }
.stepper-n { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--hover); font-size: 12px; flex: none; }
.stepper li.current { color: var(--text); border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.stepper li.current .stepper-n { background: var(--accent); color: #fff; }
.stepper li.done { color: var(--text-2); }
.stepper li.done .stepper-n { background: var(--ok-soft); color: var(--ok-text); }
.wz-card { padding: 24px; }
.wz-title { font-size: 18px; margin-bottom: 18px; letter-spacing: -.01em; }
.wz-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; position: sticky; bottom: 0; padding: 14px 0; background: linear-gradient(transparent, var(--bg) 35%); }
.wz-foot-right { display: flex; gap: 8px; }
.app-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-bottom: 18px; }
.app-card { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: var(--radius); border: 1.5px solid var(--border); background: var(--surface); cursor: pointer; text-align: left; transition: border-color .15s, box-shadow .15s; }
.app-card:hover:not(:disabled) { border-color: var(--border-strong); }
.app-card.is-selected { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.app-card:disabled { opacity: .6; cursor: not-allowed; }
.app-card-body { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.check-box { width: 22px; height: 22px; border-radius: 6px; border: 1.5px solid var(--border-strong); display: grid; place-items: center; flex: none; color: #fff; }
.is-selected .check-box { background: var(--accent); border-color: var(--accent); }
.app-config { border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-top: 12px; background: var(--surface-2); }
.app-config header { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.url-preview { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px; font-size: 12px; font-family: var(--mono); color: var(--text-2); }
.url-preview em { font-style: normal; font-family: var(--font); color: var(--muted); margin-right: 6px; }
.seg-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin-bottom: 18px; }
.opt { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 14px 14px 14px 40px; border-radius: var(--radius); border: 1.5px solid var(--border); cursor: pointer; }
.opt input { position: absolute; left: 14px; top: 16px; }
.opt.on { border-color: var(--accent); background: var(--accent-soft); }
.price-table { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 18px; }
.price-row { display: grid; grid-template-columns: 28px 120px 1fr 160px; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.price-row select { height: 36px; }
.money-input { display: flex; align-items: center; gap: 6px; }
.money-input span { color: var(--muted); font-weight: 600; }
.money-input input { text-align: right; height: 36px; }
.price-total { display: flex; justify-content: space-between; align-items: center; padding: 14px; background: var(--surface-2); font-weight: 600; }
.price-total strong { font-size: 20px; font-variant-numeric: tabular-nums; }
.review { display: grid; gap: 12px; margin-bottom: 14px; }
.review section { padding: 14px 16px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); display: flex; flex-direction: column; gap: 4px; }
.review h3 { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 4px; }
.review h3 .link-btn { margin-left: auto; text-transform: none; letter-spacing: 0; }
.run-list { display: flex; flex-direction: column; gap: 4px; padding: 12px; }
.run-item { display: flex; gap: 14px; padding: 12px; border-radius: 10px; }
.run-item.run-running { background: var(--accent-soft); }
.run-ic { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--hover); color: var(--muted); }
.run-ic .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border-strong); }
.run-done .run-ic { background: var(--ok-soft); color: var(--ok-text); }
.run-error .run-ic { background: var(--danger-soft); color: var(--danger-text); }
.run-running .run-ic { background: var(--surface); }
.run-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }

/* ---------------------------------------------------------------- progresso / log */
.bar { height: 6px; border-radius: 999px; background: var(--hover); overflow: hidden; }
.bar.lg { height: 10px; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: inherit; transition: width .5s ease; }
.bar.ok i { background: linear-gradient(90deg, var(--ok), #3ccb7f); }
.progress-block { display: flex; flex-direction: column; gap: 6px; }
.url-list { display: flex; flex-direction: column; gap: 4px; }
.url-row { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.url-row .muted { min-width: 80px; }
.kv { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.log-wrap summary { cursor: pointer; font-size: 12px; font-weight: 600; color: var(--muted); }
.log { font-family: var(--mono); font-size: 12px; line-height: 1.55; max-height: 220px; overflow: auto; padding: 10px 12px; margin-top: 8px; border-radius: 8px; background: #0b0d12; color: #c9d1d9; white-space: pre-wrap; word-break: break-word; }
.log.tall { max-height: 60vh; }
.log .error { color: #ff8a80; } .log .ok { color: #7ee2a8; } .log .step { color: #a5b4fc; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--accent-soft); border-top-color: var(--accent); animation: spin .8s linear infinite; display: inline-block; flex: none; }
.spinner.sm { width: 12px; height: 12px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------- atualizações */
.product-tabs { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.product-tab { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--radius); border: 1.5px solid var(--border); background: var(--surface); cursor: pointer; text-align: left; }
.product-tab > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; }
.product-tab.on { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.release-summary { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.release-summary > div:first-child { display: flex; flex-direction: column; }
.big { font-size: 28px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; font-size: 13px; color: var(--text-2); }
.sm-select { height: 32px !important; font-size: 12px; width: auto !important; }
.action-bar { position: sticky; bottom: 16px; z-index: 30; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 12px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--accent); box-shadow: var(--shadow-lg); }
.action-bar label { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); }
.action-bar select { width: auto; height: 34px; }
.targets { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.target { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 10px; background: var(--surface-2); }
.target-ic { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--hover); flex: none; }
.target.tone-ok .target-ic { background: var(--ok-soft); color: var(--ok-text); }
.target.tone-danger .target-ic { background: var(--danger-soft); color: var(--danger-text); }
.target.tone-info { background: var(--accent-soft); }

/* ---------------------------------------------------------------- financeiro */
.inv-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.lines { border: 1px solid var(--border); border-radius: 10px; }
.lines > div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 12px; border-bottom: 1px solid var(--border); font-size: 13px; }
.lines > div:last-child { border-bottom: 0; }
.charge { display: flex; flex-direction: column; gap: 10px; }
.copy-field { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); min-width: 0; }
.copy-field code, .copy-field a { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); font-size: 12px; }
.cf-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); white-space: nowrap; }
.pix { display: flex; gap: 12px; align-items: center; }
.pix img { width: 120px; height: 120px; border-radius: 8px; background: #fff; padding: 6px; flex: none; }
.pix .copy-field { flex: 1; }
.items-head { display: flex; justify-content: space-between; align-items: center; margin: 16px 0 8px; }
.items { display: flex; flex-direction: column; gap: 8px; }
.item-row { display: grid; grid-template-columns: 1.2fr 1.6fr 70px 120px 32px; gap: 8px; align-items: center; }
.item-row input, .item-row select { height: 36px; }
.items + .price-total { margin: 12px 0 16px; border-radius: 10px; border: 1px solid var(--border); }
.setting { display: flex; align-items: center; gap: 16px; }
.setting-ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); flex: none; }
.setting h2 { margin-bottom: 2px; }
.setting .row-gap { margin-top: 8px; }
.plan-group { padding: 8px 20px; }
.plan-group > strong { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 8px 0 2px; }
.integrations { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; padding: 0 20px; }
.card:not(.flush) .integrations, .card:not(.flush) .pad-x { padding-left: 0; padding-right: 0; }
.integ { display: flex; gap: 10px; align-items: flex-start; }
.dot-lg { width: 10px; height: 10px; border-radius: 50%; background: var(--border-strong); margin-top: 6px; flex: none; }
.dot-lg.on { background: var(--ok); box-shadow: 0 0 0 4px var(--ok-soft); }
.admin-links { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.admin-link { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); color: var(--text); text-decoration: none !important; }
.admin-link span { flex: 1; }
.admin-link:hover { background: var(--hover); }

/* ---------------------------------------------------------------- diálogos */
.dlg-backdrop { position: fixed; inset: 0; z-index: 1000; background: rgba(16, 24, 40, .45); backdrop-filter: blur(2px); display: flex; align-items: center; justify-content: center; padding: 16px; animation: fade .15s ease-out; }
.dlg-backdrop.out { opacity: 0; transition: opacity .15s; }
.dlg { width: 100%; max-height: calc(100vh - 32px); display: flex; flex-direction: column; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-lg); border: 1px solid var(--border); animation: pop .18s ease-out; outline: none; }
.dlg-sm { max-width: 440px; } .dlg-md { max-width: 600px; } .dlg-lg { max-width: 820px; }
.dlg-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px 12px; }
.dlg-head h2 { font-size: 17px; }
.dlg-head p { font-size: 13px; color: var(--muted); margin-top: 2px; }
.dlg-body { padding: 4px 20px 20px; overflow-y: auto; }
.dlg-foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.is-drawer { justify-content: flex-end; padding: 0; }
.is-drawer .dlg { max-width: 520px; height: 100vh; max-height: 100vh; border-radius: 0; animation: slide .2s ease-out; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } }
@keyframes slide { from { transform: translateX(30px); opacity: 0; } }

/* ---------------------------------------------------------------- toasts / dock */
#toasts { position: fixed; top: 16px; right: 16px; z-index: 3000; display: flex; flex-direction: column; gap: 8px; }
.toast { display: flex; align-items: center; gap: 10px; max-width: 420px; padding: 12px 14px; border-radius: 12px; background: var(--text); color: var(--surface); box-shadow: var(--shadow-lg); font-weight: 500; animation: pop .2s ease-out; }
.toast-success .ic { color: #47cd89; } .toast-error .ic { color: #f97066; }
.toast.out { opacity: 0; transform: translateY(-6px); transition: all .25s; }
#taskDock { position: fixed; right: 16px; bottom: 16px; z-index: 900; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.dock-pill { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow); cursor: pointer; font-weight: 600; }
.dock-pill.is-running { border-color: var(--accent); }
.dock-panel { order: -1; width: 360px; max-height: 60vh; overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 8px; }
.dock-head { display: flex; justify-content: space-between; align-items: center; padding: 6px 8px 10px; }
.dock-item { display: flex; gap: 10px; width: 100%; padding: 10px 8px; border: 0; border-radius: 10px; background: none; text-align: left; cursor: pointer; }
.dock-item:hover { background: var(--hover); }
.dock-ic { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--hover); }
.dock-ic.tone-ok { background: var(--ok-soft); color: var(--ok-text); }
.dock-ic.tone-danger { background: var(--danger-soft); color: var(--danger-text); }
.dock-ic.tone-warn { background: var(--warn-soft); color: var(--warn-text); }
.dock-main { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.dock-main .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------------------------------------------------------------- paleta */
.palette-backdrop { position: fixed; inset: 0; z-index: 2000; background: rgba(16, 24, 40, .45); backdrop-filter: blur(2px); display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; }
.palette { width: 100%; max-width: 620px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-lg); overflow: hidden; animation: pop .15s ease-out; }
.palette-in { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--border); color: var(--muted); }
.palette-in input { border: 0 !important; box-shadow: none !important; height: 54px !important; padding: 0 !important; font-size: 16px; background: transparent !important; }
.palette-list { max-height: 50vh; overflow-y: auto; padding: 6px; }
.palette-group { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 10px 10px 4px; }
.palette-item { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px; border: 0; border-radius: 8px; background: none; text-align: left; cursor: pointer; }
.palette-item.on, .palette-item:hover { background: var(--accent-soft); }

/* ---------------------------------------------------------------- login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: radial-gradient(circle at 20% 10%, var(--accent-soft), transparent 50%), var(--bg); }
.login-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow); padding: 32px; display: flex; flex-direction: column; gap: 16px; }
.brand.big strong { font-size: 17px; }
.or { text-align: center; color: var(--muted); font-size: 12px; }

/* ---------------------------------------------------------------- responsivo */
@media (max-width: 1100px) {
  .client-grid, .home-grid { grid-template-columns: 1fr; }
  .quick { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .side { position: fixed; left: 0; top: 0; bottom: 0; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-lg); }
  .nav-open .side { transform: none; }
  .nav-open .side-scrim { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 45; }
  .menu-btn { display: inline-flex; }
  .top { padding: 10px 16px; }
  .page { padding: 4px 16px 96px; }
  .search-trigger kbd { display: none; }
  .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; }
  .stepper li span:last-child { display: none; }
  .stepper li { justify-content: center; }
  .price-row { grid-template-columns: 28px 1fr; }
  .price-row select, .price-row .money-input { grid-column: 1 / -1; }
  .item-row { grid-template-columns: 1fr 1fr; }
  .integrations, .admin-links { grid-template-columns: 1fr; }
  .table th, .table td { padding: 10px 12px; }
  .clients-table th:nth-child(3), .clients-table td:nth-child(3) { display: none; }
}
@media (max-width: 600px) {
  h1 { font-size: 20px; }
  .grid-2, .grid-3, .grid-4, .fin-summary { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .kpis, .quick, .stats { grid-template-columns: 1fr 1fr; }
  .table { display: block; overflow-x: auto; white-space: nowrap; }
  .hero-actions { width: 100%; }
  .hero-actions .btn { flex: 1; justify-content: center; }
  .dock-panel { width: calc(100vw - 32px); }
  .is-drawer .dlg { max-width: 100%; }
  .pix { flex-direction: column; align-items: stretch; }
  .pix img { align-self: center; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Lista de clientes vira cartões no celular */
@media (max-width: 600px) {
  .clients-table { display: block; white-space: normal; overflow: visible; }
  .clients-table thead { display: none; }
  .clients-table tbody { display: flex; flex-direction: column; }
  .clients-table tr { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
  .clients-table td { padding: 0; border: 0; display: block; }
  .clients-table td:first-child { grid-column: 1; }
  .clients-table td:nth-child(2) { grid-column: 1 / -1; }
  .clients-table td:nth-child(3) { display: none; }
  .clients-table td:nth-child(4) { grid-column: 1; }
  .clients-table td:nth-child(5) { grid-column: 2; grid-row: 1; align-self: center; font-weight: 600; }
  .clients-table td.actions-cell { display: none; }
}
