:root {
  --ink: #dbe7f7; --muted: #8da1bc; --bg: #07111f; --panel: #0d1b2e;
  --panel-2: #11243b; --line: rgba(163,190,224,.14); --blue: #5da9ff;
  --green: #39d39b; --yellow: #ffc766; --red: #ff7180; --purple: #b68cff;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: radial-gradient(circle at top right, #102a49 0, var(--bg) 38rem); color: var(--ink); min-height: 100vh; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.app-shell { min-height: 100vh; display: flex; }
.sidebar { width: 252px; background: rgba(6,16,30,.82); border-right: 1px solid var(--line); padding: 28px 18px 18px; display: flex; flex-direction: column; gap: 25px; }
.brand { font-weight: 800; font-size: 21px; letter-spacing: -.04em; display: flex; align-items: center; gap: 9px; }
.brand-mark { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; color: #06121f; background: linear-gradient(135deg,#63c8ff,#7c8aff); }
.brand-accent { color: var(--blue); }
.workspace-label, .eyebrow { color: #6e86a5; font-size: 10px; letter-spacing: .15em; font-weight: 800; }
.nav-list { display: grid; gap: 7px; }
.nav-item { color: var(--muted); border: 0; background: transparent; text-align: left; border-radius: 11px; padding: 12px 13px; display: flex; align-items: center; gap: 11px; font-weight: 650; transition: .2s; }
.nav-item:hover, .nav-item.active { background: rgba(93,169,255,.14); color: #fff; }
.nav-item .nav-icon { width: 20px; text-align: center; }
.sidebar-foot { margin-top: auto; color: var(--muted); font-size: 12px; display: flex; align-items: center; gap: 8px; padding: 10px 4px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(57,211,155,.12); }
.tiny-pill { margin-left: auto; color: #7aa8d4; border: 1px solid rgba(122,168,212,.25); padding: 2px 5px; border-radius: 4px; font-size: 9px; }
.main-content { min-width: 0; flex: 1; padding: 27px clamp(18px,4vw,52px) 52px; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 25px; }
.topbar h1 { margin: 5px 0 0; font-size: clamp(24px,3vw,34px); letter-spacing: -.055em; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.avatar { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(135deg,#384fbb,#51b4d9); font-size: 12px; font-weight: 800; }
.ghost-btn, .primary-btn, .danger-btn, .icon-btn { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; color: var(--ink); background: rgba(255,255,255,.04); }
.ghost-btn:hover { background: rgba(255,255,255,.09); }
.primary-btn { background: linear-gradient(135deg,#3289f6,#6c74ff); border-color: transparent; color: white; font-weight: 750; }
.primary-btn.small, .ghost-btn.small, .danger-btn.small { padding: 7px 10px; font-size: 12px; }
.danger-btn { color: #ffd6d9; border-color: rgba(255,113,128,.3); background: rgba(255,113,128,.09); }
.content-grid { display: grid; gap: 22px; }
.stats-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 13px; }
.stat-card, .panel { background: linear-gradient(145deg, rgba(18,37,61,.93), rgba(10,25,42,.96)); border: 1px solid var(--line); border-radius: 17px; box-shadow: 0 15px 45px rgba(0,0,0,.12); }
.stat-card { padding: 17px; min-height: 112px; }
.stat-top { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; }
.stat-value { font-size: 27px; font-weight: 800; margin: 14px 0 3px; letter-spacing: -.05em; }
.stat-meta { font-size: 11px; color: var(--muted); }
.stat-icon { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 9px; background: rgba(93,169,255,.12); color: var(--blue); }
.panel { overflow: hidden; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 19px 20px; border-bottom: 1px solid var(--line); }
.panel-title { margin: 0; font-size: 15px; letter-spacing: -.01em; }
.panel-subtitle { color: var(--muted); font-size: 12px; margin: 4px 0 0; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 740px; }
th { text-align: left; color: #7089a8; font-size: 10px; text-transform: uppercase; letter-spacing: .11em; padding: 13px 20px; font-weight: 800; }
td { padding: 15px 20px; border-top: 1px solid var(--line); color: #d7e4f3; font-size: 13px; }
tr.clickable { cursor: pointer; } tr.clickable:hover td { background: rgba(93,169,255,.055); }
.company-cell { display: flex; align-items: center; gap: 11px; min-width: 180px; }
.company-logo { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: #213758; color: #a8ccff; font-weight: 800; font-size: 11px; }
.company-name { font-weight: 750; } .company-meta { color: var(--muted); font-size: 11px; margin-top: 3px; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 999px; font-size: 10px; font-weight: 800; letter-spacing: .02em; }
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge.green { color: var(--green); background: rgba(57,211,155,.1); } .badge.yellow { color: var(--yellow); background: rgba(255,199,102,.1); }
.badge.red { color: var(--red); background: rgba(255,113,128,.1); } .badge.blue { color: var(--blue); background: rgba(93,169,255,.1); } .badge.gray { color: #9fb0c5; background: rgba(159,176,197,.1); }
.filter-row { display:flex; flex-wrap: wrap; gap: 7px; padding: 0 20px 16px; }
.filter-btn { background: transparent; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; font-size: 11px; padding: 7px 11px; } .filter-btn.active { color: white; background: rgba(93,169,255,.14); border-color: rgba(93,169,255,.4); }
.detail-grid { display: grid; grid-template-columns: 1.4fr .9fr; gap: 16px; }
.hero-card { padding: 23px; display:flex; justify-content:space-between; align-items:flex-start; gap: 18px; }
.hero-card h2 { margin: 5px 0 5px; letter-spacing: -.04em; } .hero-card p { color: var(--muted); font-size: 13px; margin: 0; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.metric-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 11px; }
.metric-card { padding: 16px; background: rgba(255,255,255,.025); border: 1px solid var(--line); border-radius: 13px; } .metric-card strong { display:block; font-size: 22px; margin-top: 8px; } .metric-card span { color: var(--muted); font-size: 11px; }
.status-line { display:flex; justify-content: space-between; align-items:center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 13px; } .status-line:last-child { border-bottom: 0; } .status-line span { color: var(--muted); }
.qr-card { padding: 20px; text-align: center; } .qr-image { width: 220px; height: 220px; padding: 12px; border-radius: 16px; background: white; margin: 12px auto; object-fit: contain; } .qr-placeholder { padding: 50px 15px; border: 1px dashed rgba(93,169,255,.35); border-radius: 13px; color: var(--muted); font-size: 12px; }
.banner { padding: 12px 16px; border: 1px solid rgba(255,199,102,.32); color: #ffe3aa; background: rgba(255,199,102,.09); border-radius: 12px; margin-bottom: 18px; font-size: 13px; }
.banner.red { color: #ffd4d8; border-color: rgba(255,113,128,.35); background: rgba(255,113,128,.08); } .banner.blue { color: #cde5ff; border-color: rgba(93,169,255,.35); background: rgba(93,169,255,.08); }
.toast { position: fixed; z-index: 10; right: 25px; bottom: 25px; padding: 13px 16px; border: 1px solid rgba(57,211,155,.35); background: #102b37; color: #d8fff1; border-radius: 10px; box-shadow: 0 10px 30px #0005; font-size: 13px; }
.hidden { display: none !important; } .mobile-only { display:none; }
.modal-backdrop { position: fixed; inset: 0; z-index: 20; display:grid; place-items:center; padding: 18px; background: rgba(2,8,17,.75); backdrop-filter: blur(8px); } .modal { width: min(620px,100%); max-height: 90vh; overflow: auto; background: #0f2137; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 30px 100px #0008; } .modal-head { display:flex; justify-content:space-between; align-items:center; padding: 18px 21px; border-bottom: 1px solid var(--line); } .modal-head h3 { margin:0; } .modal-body { padding: 21px; } .modal-foot { display:flex; justify-content:flex-end; gap:9px; padding: 0 21px 20px; }
.form-grid { display:grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; } .field { display:grid; gap:6px; } .field.full { grid-column: 1/-1; } label { color: #a9bbcf; font-size: 11px; font-weight: 700; } input, select, textarea { width:100%; border:1px solid var(--line); border-radius:9px; color:var(--ink); background: #0a192c; padding: 10px 11px; outline: none; } textarea { min-height: 78px; resize: vertical; } input:focus, select:focus, textarea:focus { border-color: rgba(93,169,255,.7); } .check-row { display:flex; flex-wrap:wrap; gap: 10px 16px; } .check-row label { display:flex; align-items:center; gap:6px; font-weight:600; } .check-row input { width:auto; }
.empty { padding: 35px 20px; text-align:center; color:var(--muted); }
@media (max-width: 980px) { .sidebar { width: 220px; } .stats-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } .detail-grid { grid-template-columns: 1fr; } }
@media (max-width: 680px) { .sidebar { position: fixed; inset: 0 auto 0 0; z-index: 15; transform: translateX(-105%); transition: .22s; width: 245px; } .sidebar.open { transform: none; } .mobile-only { display: inline-flex; } .main-content { padding: 18px 14px 35px; } .topbar { align-items:flex-start; } .topbar-actions .ghost-btn { display:none; } .stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; } .stat-card { min-height: 98px; padding: 13px; } .stat-value { font-size: 22px; } .hero-card { flex-direction:column; } .hero-actions { justify-content:flex-start; } .metric-grid { grid-template-columns: 1fr 1fr; } .form-grid { grid-template-columns: 1fr; } .field.full { grid-column: auto; } }

/* TOM ASSIST AI: tokens compartilhados e duas experiências visuais sobre a mesma aplicação. */
:root {
  --brand-midnight: #080c24; --brand-violet: #6d4aff; --brand-gold: #ffca58;
  --brand-cyan: #48d9ff; --brand-blue: #3878ff; --brand-green: #28c989;
  --brand-danger: #e84e6b; --radius: 18px; --shadow: 0 18px 55px rgba(15,24,70,.13);
}
html { scroll-behavior: smooth; }
body { overflow-x: hidden; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--brand-cyan); outline-offset: 3px; }
.skip-link { position: fixed; left: 12px; top: -100px; z-index: 100; padding: 10px 14px; border-radius: 8px; background: white; color: #14224a; }
.skip-link:focus { top: 12px; }
.brand { color: inherit; text-decoration: none; align-items: center; }
.brand-copy { display: grid; line-height: 1.05; }
.brand-copy strong { letter-spacing: -.04em; }
.brand-copy small { margin-top: 3px; color: var(--muted); font-size: 10px; letter-spacing: .16em; text-transform: uppercase; }
.brand-slogan { margin: -17px 0 0 40px; color: var(--muted); font-size: 9px; line-height: 1.4; }
.brand-mark img { width: 100%; height: 100%; object-fit: contain; }
.page-subtitle { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.panel-body { padding: 20px; }
.panel-body > p { color: var(--muted); line-height: 1.6; }
.button-row, .form-actions, .page-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.form-actions { grid-column: 1 / -1; justify-content: flex-end; margin-top: 10px; }
.page-actions { justify-content: space-between; }
.primary-btn.big, .ghost-btn.big { padding: 13px 19px; font-size: 14px; }
.primary-btn:disabled, .ghost-btn:disabled { cursor: not-allowed; opacity: .45; }
.field-help, .block-muted, .version-row small, .phone-head small { display: block; color: var(--muted); font-size: 11px; line-height: 1.4; }
.field.full { grid-column: 1 / -1; }
.choice-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.choice-card { position: relative; display: flex; gap: 12px; align-items: flex-start; min-height: 82px; padding: 15px; border: 1px solid var(--line); border-radius: 14px; cursor: pointer; transition: .2s ease; }
.choice-card:hover { transform: translateY(-1px); border-color: rgba(72,217,255,.45); }
.choice-card input { position: absolute; opacity: 0; width: 1px; }
.choice-card:has(input:checked) { border-color: var(--brand-violet); box-shadow: inset 0 0 0 1px var(--brand-violet); }
.choice-card:has(input:checked) .choice-symbol { color: white; background: var(--brand-violet); }
.choice-card.disabled { cursor: not-allowed; opacity: .48; }
.choice-symbol { flex: 0 0 auto; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: rgba(109,74,255,.1); color: var(--brand-violet); }
.choice-card strong, .choice-card small { display: block; }
.choice-card small { margin-top: 5px; color: var(--muted); font-weight: 500; line-height: 1.35; }
.toggle-line { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 12px; }
.toggle-line input { width: 19px; height: 19px; accent-color: var(--brand-violet); }
.toggle-line.full { grid-column: 1 / -1; }
.read-only-note { margin-bottom:16px; padding:11px 13px; border:1px solid #cdd8f5; border-radius:11px; color:#425488; background:#f1f5ff; font-size:12px; }
.read-only-note.compact { margin:0; padding:8px 11px; }
.filter-form { padding: 16px 20px; display: grid; grid-template-columns: 1.2fr 1fr .8fr .8fr auto; gap: 9px; align-items: end; }
.client-list { display: grid; }
.client-row { width: 100%; display: grid; grid-template-columns: auto minmax(160px,1fr) auto auto auto; gap: 15px; align-items: center; padding: 14px 20px; border: 0; border-top: 1px solid var(--line); color: inherit; background: transparent; text-align: left; }
.client-row:hover { background: rgba(93,169,255,.06); }
.client-row-main { display: grid; gap: 4px; }
.client-row-main small { color: var(--muted); }
.row-arrow { color: var(--muted); }
.detail-hero, .magic-intro, .portal-welcome { position: relative; overflow: hidden; display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 25px; border: 1px solid var(--line); border-radius: 20px; }
.detail-hero h2, .magic-intro h2, .portal-welcome h2 { margin: 7px 0; font-size: clamp(22px,3vw,34px); letter-spacing: -.045em; }
.detail-hero p, .magic-intro p, .portal-welcome p { margin: 0; color: var(--muted); }
.magic-intro { min-height: 150px; background: radial-gradient(circle at 15% 20%,rgba(72,217,255,.12),transparent 32%), linear-gradient(125deg,rgba(109,74,255,.18),rgba(9,16,43,.74)); }
.magic-orbit { position: absolute; right: 19%; top: -40px; color: var(--brand-gold); font-size: 120px; opacity: .11; filter: blur(.2px); animation: float 7s ease-in-out infinite; }
.settings-grid, .portal-cards { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 13px; }
.split-grid, .help-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 15px; }
.badge.success, .badge.ATIVO { color: var(--brand-green); background: rgba(40,201,137,.11); }
.badge.warning { color: #bd7900; background: rgba(255,202,88,.17); }
.badge.danger { color: var(--brand-danger); background: rgba(232,78,107,.11); }
.badge.info { color: var(--brand-blue); background: rgba(56,120,255,.11); }
.badge.neutral { color: var(--muted); background: rgba(127,139,168,.11); }
.tone-green .stat-icon { color: var(--brand-green); background: rgba(40,201,137,.12); }
.tone-gold .stat-icon { color: var(--brand-gold); background: rgba(255,202,88,.13); }
.tone-red .stat-icon { color: var(--brand-danger); background: rgba(232,78,107,.12); }
.audit-detail { max-width: 430px; overflow-wrap: anywhere; font-family: ui-monospace,monospace; font-size: 11px; }
.auth-layout { min-height: 68vh; display: grid; place-items: center; position: relative; }
.auth-card { width: min(440px,100%); padding: 30px; }
.auth-card > h2 { margin-top: 0; font-size: 25px; }
.auth-card > p { color: var(--muted); }
.auth-card form { display: grid; gap: 14px; }
.auth-magic { position: absolute; font-size: 340px; color: var(--brand-violet); opacity: .06; animation: float 8s ease-in-out infinite; pointer-events: none; }
.modal-lead, .safe-note { color: var(--muted); line-height: 1.55; }
.modal-head h2 { margin: 0; font-size: 19px; }
.version-list { display: grid; gap: 9px; }
.version-row { display: flex; align-items: center; gap: 12px; padding: 13px; border: 1px solid var(--line); border-radius: 12px; }
.version-row > div { flex: 1; }
.version-number { display: grid; place-items: center; min-width: 42px; height: 42px; border-radius: 12px; font-weight: 850; background: rgba(109,74,255,.13); color: var(--brand-violet); }

/* Portal do cliente: claro, didático e amigável. */
body.theme-client { --ink:#17213f; --muted:#697493; --bg:#f5f8ff; --panel:#fff; --panel-2:#f8faff; --line:rgba(59,72,126,.13); background: radial-gradient(circle at 82% -10%,#eadfff 0,transparent 29rem), radial-gradient(circle at 30% 0,#dff5ff 0,transparent 23rem),#f6f8ff; color:var(--ink); }
.theme-client .sidebar { background: rgba(255,255,255,.88); border-right-color: var(--line); box-shadow: 14px 0 45px rgba(41,51,100,.06); backdrop-filter: blur(18px); }
.theme-client .brand-mark { color: white; background: linear-gradient(135deg,var(--brand-violet),#945cff 55%,#ff75bc); box-shadow: 0 8px 22px rgba(109,74,255,.28); }
.theme-client .nav-item { color: #697493; }
.theme-client .nav-item:hover, .theme-client .nav-item.active { color:#4935a9; background:linear-gradient(90deg,#f0ebff,#ecf6ff); }
.theme-client .nav-item.active { box-shadow: inset 3px 0 var(--brand-violet); }
.theme-client .sidebar-foot { color:#697493; }
.theme-client .tiny-pill { color:#6146cf; border-color:#d8cffb; background:#f2efff; }
.theme-client .main-content { max-width: 1500px; }
.theme-client .avatar { color:white; background:linear-gradient(135deg,#7452f6,#ff7db7); box-shadow:0 8px 20px rgba(109,74,255,.2); }
.theme-client .ghost-btn, .theme-client .icon-btn { color:#283354; background:white; border-color:#dfe4f4; }
.theme-client .ghost-btn:hover { background:#f3f5ff; }
.theme-client .primary-btn { background:linear-gradient(135deg,#6d4aff,#3a83ff); box-shadow:0 8px 20px rgba(83,79,234,.2); }
.theme-client .stat-card, .theme-client .panel { color:var(--ink); background:rgba(255,255,255,.92); border-color:var(--line); box-shadow:var(--shadow); }
.theme-client .stat-card { min-height: 135px; }
.theme-client .stat-value { color:#273154; }
.theme-client .panel-head { border-color:var(--line); }
.theme-client td { color:#273154; border-color:var(--line); }
.theme-client th { color:#7983a1; }
.theme-client input, .theme-client select, .theme-client textarea { color:#1c2748; background:#fbfcff; border-color:#dce2f2; }
.theme-client input:focus, .theme-client select:focus, .theme-client textarea:focus { border-color:#7d63ee; box-shadow:0 0 0 3px rgba(109,74,255,.1); }
.theme-client label { color:#4e5978; }
.theme-client .modal { color:var(--ink); background:white; }
.theme-client .modal-backdrop { background:rgba(26,29,61,.44); }
.theme-client .toast { color:#15523d; background:#ebfff6; border-color:#a7efd1; }
.theme-client .toast.error { color:#82273a; background:#fff0f3; border-color:#f4b6c2; }
.portal-welcome { min-height: 170px; border:0; color:white; background:linear-gradient(120deg,#6550db,#438af6 62%,#46cdda); box-shadow:0 20px 60px rgba(68,84,198,.22); }
.portal-welcome::after { content:'✦'; position:absolute; right:22%; top:-60px; font-size:180px; color:white; opacity:.1; transform:rotate(20deg); }
.portal-welcome p, .portal-welcome .eyebrow { color:rgba(255,255,255,.82); }
.portal-welcome .primary-btn { position:relative; z-index:1; color:#4c3caa; background:white; box-shadow:0 10px 30px rgba(22,36,107,.16); }
.portal-cards { grid-template-columns:repeat(4,minmax(0,1fr)); }
.next-step { display:flex; gap:14px; align-items:center; margin-bottom:18px; }
.step-bubble { flex:0 0 auto; display:grid; place-items:center; width:48px; height:48px; border-radius:16px; color:white; background:linear-gradient(135deg,#774ff5,#478aff); font-size:20px; font-weight:900; }
.next-step p { color:var(--muted); margin:5px 0 0; }
.simple-status { display:flex; align-items:center; gap:18px; padding:25px; border-radius:20px; border:1px solid; }
.simple-status.ok { color:#175c43; border-color:#afe8d2; background:linear-gradient(120deg,#ecfff7,#f8fffc); }
.simple-status.attention { color:#825714; border-color:#f4d692; background:linear-gradient(120deg,#fff9e9,#fffdf8); }
.simple-status-icon { display:grid; place-items:center; width:52px; height:52px; border-radius:17px; color:white; background:currentColor; font-size:0; }
.simple-status-icon::after { content:'✓'; font-size:25px; color:white; }
.simple-status.attention .simple-status-icon::after { content:'!'; }
.simple-status h2 { margin:0 0 5px; font-size:21px; }
.simple-status p { margin:0; opacity:.8; }
.theme-client .qr-placeholder { border-color:#d2d8eb; background:#fafbff; }

/* Assistente guiado e conteúdo operacional. */
.wizard-head { display:flex; justify-content:space-between; align-items:flex-start; gap:20px; }
.wizard-head h2 { margin:7px 0; font-size:clamp(24px,4vw,38px); letter-spacing:-.045em; }
.wizard-head p { margin:0; color:var(--muted); }
.progress-track { height:10px; overflow:hidden; border-radius:999px; background:#e5e8f4; }
.progress-track span { display:block; height:100%; border-radius:inherit; background:linear-gradient(90deg,#704df4,#3e97ff,#48d6c4); transition:width .35s ease; }
.wizard-layout { display:grid; grid-template-columns:250px minmax(0,1fr); gap:18px; align-items:start; }
.wizard-steps { list-style:none; margin:0; padding:13px; border:1px solid var(--line); border-radius:18px; background:rgba(255,255,255,.8); box-shadow:var(--shadow); }
.wizard-steps button { width:100%; display:flex; align-items:center; gap:10px; border:0; padding:10px; color:var(--muted); background:transparent; text-align:left; font-size:12px; border-radius:11px; }
.wizard-steps li.active button { color:#5138bd; background:#f0ecff; font-weight:800; }
.wizard-steps li.done button { color:#23865f; }
.wizard-steps button span { display:grid; place-items:center; flex:0 0 auto; width:25px; height:25px; border-radius:8px; background:#edf0f8; font-size:11px; font-weight:900; }
.wizard-steps li.active span { color:white; background:var(--brand-violet); }
.wizard-steps li.done span { color:white; background:var(--brand-green); }
.wizard-card { min-width:0; padding:clamp(20px,4vw,36px); border:1px solid var(--line); border-radius:20px; background:rgba(255,255,255,.94); box-shadow:var(--shadow); }
.friendly-form > h3, .review-card > h3 { margin:0 0 7px; font-size:23px; letter-spacing:-.025em; }
.friendly-form > p, .review-card > p { margin:0 0 23px; color:var(--muted); line-height:1.55; }
.friendly-form .form-grid { gap:16px; }
.wizard-actions { display:grid; grid-template-columns:1fr auto 1fr; align-items:center; gap:12px; margin-top:26px; padding-top:20px; border-top:1px solid var(--line); }
.wizard-actions > :last-child { justify-self:end; }
.save-state { color:var(--muted); font-size:11px; }
.big-choice-row { display:grid; grid-template-columns:1fr 1fr; gap:13px; }
.big-choice { display:grid; justify-items:start; gap:6px; padding:22px; border:1px solid #dce2f3; border-radius:17px; color:#273154; background:#fbfcff; text-align:left; }
.big-choice:hover { transform:translateY(-2px); border-color:#927cf2; box-shadow:0 12px 30px rgba(74,62,151,.1); }
.big-choice > span { display:grid; place-items:center; width:43px; height:43px; border-radius:13px; color:white; background:linear-gradient(135deg,#7753ef,#498cf4); font-size:23px; }
.big-choice small { color:var(--muted); }
.mini-summary { display:flex; align-items:baseline; gap:8px; margin-top:17px; padding:16px; border-radius:14px; color:#5641b1; background:#f1edff; }
.mini-summary strong { font-size:24px; }
.review-card { text-align:center; }
.review-icon { display:grid; place-items:center; width:72px; height:72px; margin:0 auto 18px; border-radius:23px; color:#ffb93b; background:linear-gradient(145deg,#fff7d8,#f2e9ff); font-size:35px; animation:float 4s ease-in-out infinite; }
.review-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:10px; margin:25px 0; }
.review-grid div { padding:15px 8px; border-radius:13px; background:#f7f8fd; }
.review-grid strong, .review-grid span { display:block; }
.review-grid strong { color:#4f3db0; font-size:19px; }
.review-grid span { margin-top:4px; color:var(--muted); font-size:10px; }
.button-row.center { justify-content:center; }
.publish-review { text-align:center; }
.publish-review ul { display:inline-block; margin:10px auto 18px; text-align:left; color:#4f3db0; }
.publish-review p { color:var(--muted); line-height:1.55; }
.empty-state { display:grid; justify-items:center; padding:35px; color:var(--muted); }
.empty-state > span { font-size:38px; color:#7657ea; }
.empty-state h3 { margin:12px 0 3px; color:var(--ink); }
.upload-zone { position:relative; display:grid; justify-items:center; padding:35px 20px; border:2px dashed #cfd7ec; border-radius:17px; text-align:center; background:#fafbff; }
.upload-zone > span { font-size:35px; color:#6d4aff; }
.upload-zone h3 { margin:10px 0 4px; }
.upload-zone p { margin:0 0 15px; color:var(--muted); }
.upload-zone input { max-width:330px; background:white; }
.mapping-grid { display:grid; grid-template-columns:1fr 1fr; gap:8px 13px; max-height:360px; overflow:auto; padding:4px; }
.mapping-row { display:grid; grid-template-columns:1fr 1.2fr; align-items:center; gap:8px; font-size:12px; }
.data-preview { margin:18px 0; }
.data-preview summary { cursor:pointer; color:#5a43c4; font-weight:800; }
.import-errors { padding:14px; border:1px solid #f2b7c4; border-radius:13px; color:#8d3045; background:#fff3f5; }
.import-errors p { margin:7px 0 0; font-size:12px; }
.simulator-shell { width:min(720px,100%); margin:auto; overflow:hidden; border:1px solid #d9dfed; border-radius:24px; background:#efeae2; box-shadow:0 25px 75px rgba(28,38,82,.16); }
.phone-head { display:flex; align-items:center; gap:11px; padding:14px 17px; color:white; background:linear-gradient(100deg,#6246ce,#397be6); }
.phone-head > div { flex:1; }
.phone-head small { color:rgba(255,255,255,.72); }
.bot-avatar { display:grid; place-items:center; width:39px; height:39px; border-radius:50%; background:white; color:#664bda; }
.draft-pill { padding:5px 8px; border-radius:999px; background:rgba(255,255,255,.17); font-size:9px; font-weight:900; letter-spacing:.1em; }
.chat-messages { height:420px; overflow-y:auto; display:flex; flex-direction:column; gap:8px; padding:22px; background:radial-gradient(circle at 20% 0,rgba(255,255,255,.48),transparent 24rem),#efeae2; }
.bubble { max-width:min(78%,520px); padding:10px 13px; border-radius:12px; color:#20283b; background:white; box-shadow:0 2px 3px rgba(28,41,69,.09); line-height:1.45; white-space:pre-wrap; }
.bubble.in { align-self:flex-start; border-top-left-radius:3px; }
.bubble.out { align-self:flex-end; border-top-right-radius:3px; background:#d9fdd3; }
.chat-input { display:flex; gap:8px; padding:11px; background:#f5f6f7; }
.chat-input input { flex:1; background:white; }
.suggestion-row { display:flex; justify-content:center; align-items:center; gap:7px; flex-wrap:wrap; margin-top:14px; color:var(--muted); font-size:11px; }
.chip { border:1px solid #dce1ef; border-radius:999px; padding:7px 10px; color:#4e45a0; background:white; }
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }

/* Tutorial guiado. */
.tour-shade { position:fixed; inset:0; z-index:40; background:rgba(25,28,63,.62); backdrop-filter:blur(2px); }
.tour-target { position:relative; z-index:42 !important; border-radius:13px; box-shadow:0 0 0 5px white,0 0 0 9px #ffcf5a,0 20px 65px rgba(0,0,0,.35) !important; }
.tour-card { position:fixed; z-index:43; left:50%; bottom:28px; transform:translateX(-50%); width:min(500px,calc(100% - 28px)); padding:23px; border-radius:20px; color:#222d4e; background:white; box-shadow:0 24px 90px rgba(10,14,50,.35); }
.tour-count { color:#7253e8; font-size:10px; font-weight:900; letter-spacing:.13em; }
.tour-card h2 { margin:8px 0 5px; font-size:22px; }
.tour-card p { margin:0; color:#697493; }
.tour-actions { display:flex; justify-content:flex-end; gap:8px; margin-top:19px; }

@keyframes float { 0%,100% { transform:translateY(0) rotate(0); } 50% { transform:translateY(-10px) rotate(3deg); } }
@media (prefers-reduced-motion:reduce) { *,*::before,*::after { scroll-behavior:auto !important; animation-duration:.01ms !important; transition-duration:.01ms !important; } }
@media (max-width:1100px) { .portal-cards { grid-template-columns:repeat(2,minmax(0,1fr)); } .settings-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } .filter-form { grid-template-columns:repeat(2,minmax(0,1fr)); } .filter-form button { align-self:end; } }
@media (max-width:850px) { .wizard-layout { grid-template-columns:1fr; } .wizard-steps { display:flex; overflow:auto; padding:8px; } .wizard-steps li { flex:0 0 auto; } .wizard-steps button { width:auto; } .wizard-steps button { font-size:0; } .wizard-steps button span { font-size:11px; } .review-grid { grid-template-columns:repeat(2,1fr); } .split-grid,.help-grid { grid-template-columns:1fr; } .client-row { grid-template-columns:auto minmax(130px,1fr) auto; } .client-row .badge:nth-of-type(2),.client-row .row-arrow { display:none; } }
@media (max-width:680px) { .brand-slogan { display:none; } .theme-client .sidebar { box-shadow:20px 0 60px rgba(28,35,78,.18); } .topbar-actions { gap:5px; } .topbar-actions .avatar { width:34px; height:34px; } .heading-group h1 { font-size:23px; } .page-subtitle { max-width:250px; } .portal-cards,.settings-grid { grid-template-columns:1fr 1fr; } .portal-welcome,.detail-hero,.magic-intro,.wizard-head { align-items:flex-start; flex-direction:column; } .portal-welcome::after { right:-30px; } .wizard-card { padding:19px 15px; } .choice-grid,.big-choice-row,.mapping-grid { grid-template-columns:1fr; } .wizard-actions { grid-template-columns:1fr 1fr; } .wizard-actions .save-state { grid-column:1 / -1; grid-row:1; text-align:center; } .wizard-actions > :last-child { justify-self:stretch; } .wizard-actions button { width:100%; } .filter-form { grid-template-columns:1fr; } .form-actions { justify-content:stretch; } .form-actions button { flex:1; } .modal { border-radius:16px; } .modal-body { padding:17px 14px; } .chat-messages { height:55vh; min-height:330px; } .chat-input .primary-btn { padding-inline:10px; } .review-grid { grid-template-columns:1fr 1fr; } }
@media (max-width:410px) { .portal-cards,.stats-grid,.settings-grid { grid-template-columns:1fr; } .review-grid { grid-template-columns:1fr; } .client-row { padding:12px; gap:9px; } }

/* Homologação: hierarquia legível e controles confortáveis nos dois painéis.
   Este bloco evolui os componentes existentes, sem alterar navegação ou dados. */
:root {
  --ink: #edf0ff;
  --muted: #acb9d3;
  --bg: #0b1026;
  --panel: #141d38;
  --panel-2: #1b2744;
  --line: rgba(185,198,237,.2);
  --focus: #8ee9ff;
  --shadow: 0 14px 40px rgba(28,38,90,.08);
  font-size: 16px;
}
body { font-size: 1rem; line-height: 1.5; }
body.theme-admin {
  background:
    radial-gradient(ellipse at 90% 0,rgba(112,72,233,.22),transparent 40rem),
    radial-gradient(ellipse at 40% 40%,rgba(27,131,177,.09),transparent 45rem),
    var(--brand-midnight);
}
body.theme-client {
  --ink: #202b49;
  --muted: #59647e;
  --line: #dbe2f1;
  --focus: #6142d0;
  background:
    radial-gradient(ellipse at 85% 0,#eee3ff,transparent 35rem),
    radial-gradient(ellipse at 22% 10%,#e2f7ff,transparent 34rem),#f5f7fe;
}
button, input, select, textarea { font-size: 1rem; line-height: 1.5; }
button { touch-action: manipulation; }
button:focus-visible, a:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
input:not([type=checkbox]):not([type=radio]), select, textarea {
  min-height: 48px;
  padding: 11px 13px;
  border-radius: 12px;
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
textarea { min-height: 106px; }
input[type=checkbox], input[type=radio] { accent-color: var(--brand-violet); }
input[disabled], select[disabled], textarea[disabled] { cursor: not-allowed; opacity: .75; }
small, label, .workspace-label, .eyebrow, .brand-copy small, .brand-slogan,
.page-subtitle, .panel-subtitle, .stat-top, .stat-meta, .company-meta,
.sidebar-foot, .tiny-pill, .badge, .field-help, .block-muted, .version-row small,
.phone-head small, .choice-card small, .read-only-note, .metric-card span,
.audit-detail, .save-state, .review-grid span, .mapping-row,
.import-errors p, .suggestion-row, .tour-count, .draft-pill, .company-logo {
  font-size: .875rem;
  line-height: 1.5;
}
label { color: #c2cbe0; }
.workspace-label, .eyebrow { color: var(--muted); letter-spacing: .08em; }
.theme-client label, .theme-client th { color: #505c76; }
.theme-client .nav-item, .theme-client .sidebar-foot { color: #59647e; }
.topbar h1, .heading-group h1 { font-size: clamp(1.5rem,2.25vw,2rem); letter-spacing: -.035em; line-height: 1.25; }
.detail-hero h2, .magic-intro h2, .portal-welcome h2, .wizard-head h2 {
  font-size: clamp(1.375rem,2vw,1.875rem);
  line-height: 1.3;
  letter-spacing: -.025em;
}
.panel-title, .modal-head h2, .simple-status h2 { font-size: 1.125rem; line-height: 1.4; }
.friendly-form > h3, .review-card > h3, .auth-card > h2, .tour-card h2 { font-size: 1.375rem; line-height: 1.35; }
.hero-card p, .status-line, .qr-placeholder, .banner, .toast, td { font-size: 1rem; }
.brand { gap: 12px; }
.brand-mark { width: 40px; height: 40px; flex: 0 0 auto; border-radius: 13px; }
.brand-copy { line-height: 1.2; }
.brand-copy strong { font-size: 1.375rem; }
.brand-copy small { letter-spacing: .1em; }
.brand-wordmark { display: inline-grid; justify-items: start; gap: 1px; line-height: 1; }
.brand-wordmark-main { font-size: 1.75rem; font-weight: 900; letter-spacing: -.06em; }
.brand-wordmark-detail { font-size: .69rem; font-weight: 750; letter-spacing: .23em; line-height: 1.4; }
.brand-copy .brand-wordmark + small { margin-top: 7px; letter-spacing: .06em; }
.brand-wordmark.large .brand-wordmark-main { font-size: clamp(2.2rem,5vw,3rem); }
.brand-wordmark.large .brand-wordmark-detail { font-size: .875rem; }
.brand-slogan { margin: -10px 0 0; max-width: 23ch; }
.sidebar {
  flex: 0 0 272px;
  width: 272px;
  padding: 28px 18px 20px;
  gap: 22px;
}
.theme-admin .sidebar {
  background: linear-gradient(165deg,rgba(26,29,59,.95),rgba(10,17,38,.97));
  box-shadow: 12px 0 40px rgba(0,0,0,.16);
}
.nav-item { min-height: 48px; padding: 12px 13px; font-size: 1rem; }
.nav-item .nav-icon { width: 24px; flex: 0 0 24px; font-size: 1.125rem; }
.sidebar-foot { flex-wrap: wrap; gap: 9px; }
.tiny-pill { padding: 3px 7px; }
.main-content { padding: 30px clamp(20px,3.3vw,48px) 56px; }
.topbar { margin-bottom: 28px; }
.heading-group { min-width: 0; }
.topbar-actions { flex: 0 0 auto; }
.page-subtitle { max-width: 65ch; }
.primary-btn, .ghost-btn, .danger-btn, .icon-btn, .filter-btn, .chip {
  min-height: 44px;
  border-radius: 12px;
  padding: 10px 16px;
  font-size: 1rem;
  font-weight: 650;
  transition: background .16s ease, border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.primary-btn, .primary-btn.big, .ghost-btn.big { min-height: 48px; padding: 12px 20px; font-size: 1rem; }
.primary-btn.small, .ghost-btn.small, .danger-btn.small { min-height: 44px; padding: 9px 13px; font-size: .875rem; }
.icon-btn { min-width: 44px; padding: 9px 12px; }
.primary-btn:hover:not(:disabled) { box-shadow: 0 7px 23px rgba(102,83,230,.28); transform: translateY(-1px); }
.primary-btn:active:not(:disabled), .ghost-btn:active:not(:disabled) { transform: translateY(0); }
.primary-btn:disabled, .ghost-btn:disabled, .danger-btn:disabled,
.icon-btn:disabled, .chip:disabled, button[aria-busy=true] { cursor: not-allowed; opacity: .68; transform: none; }
button[aria-busy=true]::before {
  content: '';
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: tom-loading-spin .7s linear infinite;
}
@keyframes tom-loading-spin { to { transform: rotate(360deg); } }
.sidebar-backdrop { display: none; border: 0; padding: 0; }
.theme-admin .primary-btn { background: linear-gradient(120deg,#7152e9,#356cd9); }
.theme-admin .badge.success, .theme-admin .badge.ATIVO { color: #69e6b4; }
.theme-admin .badge.warning { color: #ffcf72; }
.theme-admin .badge.danger { color: #ff97ab; }
.theme-admin .badge.info { color: #97c5ff; }
.theme-client .primary-btn { background: linear-gradient(110deg,#6942d9,#2c63ce); }
.theme-client .danger-btn { color: #a22d47; border-color: #e5a7b5; background: #fff1f4; }
.theme-client .badge.success, .theme-client .badge.ATIVO, .theme-client .badge.green { color: #116647; background: #e4f7ee; }
.theme-client .badge.warning, .theme-client .badge.yellow { color: #795100; background: #fff1ce; }
.theme-client .badge.danger, .theme-client .badge.red { color: #a12f47; background: #ffedf1; }
.theme-client .badge.info, .theme-client .badge.blue { color: #235bb5; background: #edf3ff; }
.theme-client .badge.neutral, .theme-client .badge.gray { color: #526079; background: #edf0f7; }
.theme-client .banner { color: #755014; background: #fff6dd; border-color: #e9c781; }
.theme-client .banner.red { color: #94324a; background: #fff0f3; border-color: #eab2bf; }
.theme-client .banner.blue { color: #27549b; background: #eef5ff; border-color: #b8d1f2; }
.badge { padding: 6px 10px; white-space: normal; letter-spacing: 0; }
.badge::before { flex: 0 0 6px; width: 6px; height: 6px; }
.content-grid, .settings-grid, .portal-cards, .stats-grid, .split-grid, .help-grid { gap: 20px; }
.stat-card { min-height: 152px; padding: 22px; }
.stat-top { gap: 10px; align-items: center; }
.stat-icon { flex: 0 0 38px; width: 38px; height: 38px; border-radius: 12px; font-size: 1.125rem; }
.stat-value { margin: 16px 0 5px; font-size: 1.875rem; line-height: 1.2; letter-spacing: -.025em; overflow-wrap: anywhere; }
.panel, .stat-card, .wizard-card { border-radius: 20px; }
.theme-admin .stat-card, .theme-admin .panel {
  background: linear-gradient(145deg,rgba(29,36,68,.96),rgba(17,26,49,.98));
  box-shadow: inset 0 1px rgba(216,219,255,.05),0 15px 42px rgba(0,0,0,.15);
}
.panel-head, .panel-body { padding: 24px; }
.panel-head { flex-wrap: wrap; }
.panel-head > div { min-width: 0; }
.status-line { padding: 14px 0; flex-wrap: wrap; }
.status-line > strong { overflow-wrap: anywhere; }
.client-row { gap: 18px; padding: 18px 24px; }
.client-row-main { min-width: 0; }
.client-row-main small { overflow-wrap: anywhere; }
.company-logo { width: 44px; height: 44px; flex: 0 0 44px; border-radius: 14px; }
th { font-size: .875rem; line-height: 1.5; letter-spacing: .04em; color: var(--muted); }
th, td { padding: 16px 20px; }
.table-wrap { overscroll-behavior-x: contain; }
.filter-form { padding: 20px 24px; gap: 14px; }
.audit-detail { max-width: 430px; }
.detail-hero, .magic-intro, .portal-welcome { padding: 30px; gap: 24px; }
.magic-intro { min-height: 190px; border-color: rgba(178,157,255,.3); isolation: isolate; }
.magic-intro > div, .magic-intro > button { position: relative; z-index: 1; }
.magic-intro::before, .magic-intro::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}
.magic-intro::before {
  background:
    radial-gradient(circle at 64% 22%,rgba(255,220,154,.7) 0 1px,transparent 2px),
    radial-gradient(circle at 81% 70%,rgba(111,227,255,.85) 0 1px,transparent 2px),
    radial-gradient(circle at 91% 20%,rgba(207,181,255,.8) 0 2px,transparent 3px),
    radial-gradient(circle at 55% 85%,rgba(140,191,255,.8) 0 1px,transparent 2px),
    radial-gradient(ellipse at 88% 5%,rgba(135,72,255,.22),transparent 60%);
  animation: starlight 7s ease-in-out infinite alternate;
}
.magic-intro::after { inset: auto -70px -190px auto; width: 430px; height: 430px; border-radius: 50%; border: 1px solid rgba(168,126,255,.2); box-shadow: 0 0 0 35px rgba(130,107,255,.035),0 0 0 70px rgba(130,107,255,.025); transform: rotate(-25deg) scaleY(.6); }
.magic-orbit { right: 17%; opacity: .2; font-size: 140px; pointer-events: none; }
.portal-welcome { min-height: 195px; background: linear-gradient(115deg,#6140c7 0%,#3d60cb 57%,#24768f 100%); }
.portal-welcome > div, .portal-welcome > button { position: relative; z-index: 1; }
.portal-welcome p, .portal-welcome .eyebrow { color: #fff; }
.portal-welcome::after { right: 10%; opacity: .16; pointer-events: none; }
.portal-welcome::before { content: ''; position: absolute; width: 220px; height: 220px; right: -45px; bottom: -160px; border: 28px solid rgba(223,215,255,.18); border-radius: 40%; transform: rotate(-28deg); pointer-events: none; }
.theme-client .portal-welcome .primary-btn { color: #5135a6; background: #fff; }
.simple-status { padding: 26px; }
.simple-status-icon { flex: 0 0 52px; background: #22845f; }
.simple-status.attention .simple-status-icon { background: #9e6b1e; }
.simple-status p { opacity: 1; }
.wizard-layout { grid-template-columns: 230px minmax(0,1fr); gap: 22px; }
.wizard-steps { padding: 12px; }
.wizard-steps button { min-height: 48px; padding: 11px; font-size: .875rem; }
.wizard-steps button span { width: 30px; height: 30px; font-size: .875rem; }
.wizard-steps li.done button { color: #176647; }
.wizard-card { padding: clamp(22px,3vw,32px); }
.friendly-form .form-grid, .form-grid { gap: 20px; }
.field { min-width: 0; gap: 8px; }
.field label { line-height: 1.5; }
.field-help { font-weight: 400; }
.wizard-actions { grid-template-columns: auto minmax(100px,1fr) auto; gap: 15px; margin-top: 30px; padding-top: 24px; }
.save-state { text-align: center; }
.save-state[data-state=success] { color: #176647; }
.save-state[data-state=error] { color: #a22d47; }
.choice-grid { gap: 16px; }
.choice-card { min-height: 102px; padding: 20px; border-radius: 16px; }
.choice-card strong { font-size: 1rem; line-height: 1.4; }
.choice-card.disabled { opacity: 1; color: var(--muted); border-style: dashed; background: rgba(111,121,151,.04); }
.choice-card:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 3px; }
.choice-card input:focus-visible { outline: 0; }
.choice-symbol, .choice-icon { flex: 0 0 40px; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; color: #6844c2; background: #f0eaff; font-size: 1.125rem; }
.automation-choice { min-height: 172px; align-items: flex-start; }
.automation-choice > span:last-child { min-width: 0; }
.choice-example { display: block; margin-top: 10px; color: var(--muted); font-size: .875rem; font-weight: 400; line-height: 1.5; }
.toggle-line { min-height: 56px; padding: 14px 16px; font-size: 1rem; }
.toggle-line input, .check-row input { min-height: 0; width: 20px; height: 20px; flex: 0 0 20px; }
.big-choice { min-height: 145px; padding: 24px; }
.big-choice small { font-size: .875rem; }
.review-grid { gap: 14px; }
.review-grid div { padding: 20px 12px; }
.review-grid strong { font-size: 1.125rem; overflow-wrap: anywhere; }
.review-grid span { margin-top: 7px; }
.publish-review ul { color: var(--ink); max-width: 100%; line-height: 1.8; }
.publish-review li { overflow-wrap: anywhere; }
.service-row { display: grid; grid-template-columns: minmax(0,1fr) minmax(130px,.45fr) auto; align-items: end; gap: 14px; padding: 20px; margin: 16px 0; border: 1px solid var(--line); border-radius: 16px; background: var(--panel-2); }
.service-row > .field:has(textarea), .service-row > .field:nth-child(3), .service-row .service-description { grid-column: 1 / -1; grid-row: 2; }
.service-row > button { grid-column: 3; grid-row: 1; }
.status-row { display: flex; align-items: end; gap: 12px; padding: 14px; margin: 12px 0; border: 1px solid var(--line); border-radius: 14px; background: var(--panel-2); }
.status-row > .field, .status-row > input { flex: 1; min-width: 0; }
.status-row > button, .service-row > button { flex-shrink: 0; }
.paid-resource { position: relative; display: grid; gap: 14px; padding: 24px; margin: 16px 0; border: 1px solid #d8cef2; border-radius: 18px; background: linear-gradient(135deg,#f7f2ff,#f0f6ff); color: #3c365b; }
.paid-resource h3, .paid-resource h4, .paid-resource p { margin: 0; }
.paid-resource p { color: #615b79; }
.paid-resource > button, .paid-resource > .button-row { justify-self: start; }
.theme-admin .paid-resource { color: #ece6ff; border-color: #514674; background: linear-gradient(135deg,#26213e,#1c2b45); }
.theme-admin .paid-resource p { color: #c0b7d9; }
.ai-options { display: grid; gap: 22px; }
.ai-options fieldset { min-width: 0; margin: 0; padding: 20px; border: 1px solid var(--line); border-radius: 16px; }
.ai-options legend { padding: 0 8px; font-size: 1rem; font-weight: 700; }
.ai-options .choice-grid { margin-top: 8px; }
.ai-options label:has(input[type=radio]) { display: flex; align-items: center; gap: 10px; min-height: 48px; cursor: pointer; }
.ai-options input[type=radio] { min-height: 0; width: 20px; height: 20px; flex: 0 0 20px; }
.upload-zone { padding: 36px 24px; gap: 6px; border-color: #b1a0e4; background: linear-gradient(135deg,#fbf8ff,#f1f7ff); }
.upload-zone input[type=file] { max-width: 100%; border: 0; background: transparent; padding: 0; min-height: 48px; }
input[type=file]::file-selector-button { min-height: 48px; margin: 0 14px 8px 0; padding: 12px 20px; border: 0; border-radius: 12px; color: white; background: #6540cd; font: inherit; font-weight: 700; cursor: pointer; }
.import-summary { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; margin: 20px 0; }
.import-summary > div, .import-summary > article { min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: 15px; background: var(--panel-2); }
.import-summary strong { display: block; font-size: 1.5rem; line-height: 1.3; color: #5940ae; }
.import-summary span, .import-summary small { display: block; margin-top: 5px; font-size: .875rem; color: var(--muted); }
.mapping-grid { gap: 16px; padding: 6px; max-height: 430px; }
.mapping-row { gap: 12px; }
.data-preview summary { min-height: 44px; padding: 10px 0; }
.import-errors { padding: 18px; }
.simulator-shell { border-radius: 24px; width: min(780px,100%); }
.phone-head { padding: 18px 20px; background: linear-gradient(100deg,#6240bb,#3464bb); }
.phone-head small { color: #f1eefa; }
.bot-avatar { flex: 0 0 44px; width: 44px; height: 44px; }
.draft-pill { letter-spacing: .04em; padding: 6px 10px; }
.chat-messages { height: clamp(330px,47vh,520px); gap: 13px; padding: 24px; background: radial-gradient(circle at 10% 0,rgba(244,238,255,.8),transparent 28rem),#f0eee9; }
.bubble { padding: 13px 16px; max-width: min(85%,560px); line-height: 1.6; overflow-wrap: anywhere; }
.bubble.in { border: 1px solid #e3dfed; }
.bubble.out { background: #dff5e2; }
.chat-input { align-items: end; padding: 14px; gap: 10px; }
.chat-input input { min-width: 0; }
.suggestion-row { gap: 10px; margin-top: 20px; }
.chip { color: #54429b; border-color: #cfc8e5; border-radius: 999px; font-size: .875rem; }
.chip:hover { background: #f2edff; border-color: #997ede; }
.version-row { padding: 18px; flex-wrap: wrap; }
.version-row > div { min-width: 150px; }
.version-number { min-width: 48px; height: 48px; }
.toast { z-index: 50; max-width: min(560px,calc(100vw - 32px)); padding: 17px 20px; }
.modal { width: min(740px,100%); max-height: calc(100dvh - 40px); }
.modal-head, .modal-body { padding: 24px; }
.modal-head { gap: 16px; }
.modal-foot { padding: 0 24px 24px; flex-wrap: wrap; }
.modal-head .icon-btn { flex: 0 0 44px; }
.tour-count { letter-spacing: .08em; }
.tour-card { padding: 26px; max-height: calc(100dvh - 32px); overflow-y: auto; }
.tour-card p { color: #59647e; }
@keyframes starlight { from { opacity: .55; } to { opacity: 1; } }
@media (max-width:1200px) {
  .sidebar { flex-basis: 240px; width: 240px; padding-inline: 16px; }
  .main-content { padding-inline: 24px; }
  .stats-grid, .portal-cards, .settings-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .wizard-layout { grid-template-columns: 1fr; }
  .wizard-steps { display: flex; overflow-x: auto; gap: 7px; padding: 12px; }
  .wizard-steps li { flex: 0 0 auto; }
  .wizard-steps button { width: auto; font-size: .875rem; white-space: nowrap; }
  .wizard-steps button span { font-size: .875rem; }
  .choice-grid { grid-template-columns: 1fr; }
}
@media (max-width:960px) {
  .main-content { padding-inline: 20px; }
  .topbar { align-items: flex-start; flex-wrap: wrap; }
  .topbar-actions { margin-left: auto; }
  .detail-hero, .magic-intro, .portal-welcome { align-items: flex-start; flex-direction: column; padding: 25px; }
  .split-grid, .help-grid { grid-template-columns: 1fr; }
  .client-row { grid-template-columns: auto minmax(0,1fr) auto; padding: 18px; }
  .client-row .badge:nth-of-type(2), .client-row .row-arrow { display: none; }
  .mapping-grid { grid-template-columns: 1fr; }
  .big-choice-row { grid-template-columns: 1fr; }
  .service-row { grid-template-columns: minmax(0,1fr) auto; }
  .service-row > .field { grid-column: 1 / -1; grid-row: auto; }
  .service-row > button { justify-self: end; grid-column: 2; grid-row: auto; }
}
@media (max-width:680px) {
  .sidebar { visibility: hidden; width: min(300px,calc(100vw - 55px)); height: 100dvh; overflow-y: auto; transition: transform .2s ease,visibility .2s; }
  .sidebar.open { visibility: visible; }
  .sidebar-backdrop { position: fixed; inset: 0; z-index: 14; display: block; visibility: hidden; opacity: 0; background: rgba(8,12,28,.34); backdrop-filter: blur(2px); transition: opacity .2s ease,visibility .2s; }
  .sidebar-backdrop.open { visibility: visible; opacity: 1; }
  .brand-slogan { display: block; }
  .main-content { padding: 20px 16px 40px; }
  .topbar { gap: 12px; margin-bottom: 24px; }
  .heading-group { flex: 1; }
  .topbar-actions { margin-left: 0; }
  .topbar-actions .ghost-btn { display: inline-flex; }
  .topbar-actions #refresh-btn { display: none; }
  .topbar-actions .avatar { display: none; }
  .page-subtitle { max-width: none; }
  .topbar h1 { font-size: 1.5rem; }
  .content-grid { gap: 20px; }
  .stats-grid, .portal-cards, .settings-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
  .stat-card, .theme-client .stat-card { min-height: 148px; padding: 18px; }
  .stat-value { font-size: 1.625rem; }
  .stat-top { align-items: flex-start; flex-wrap: wrap; }
  .panel-head, .panel-body { padding: 20px; }
  .panel-head > .button-row, .panel-head > button { width: 100%; }
  .panel-head .button-row button { flex: 1; }
  .detail-hero, .magic-intro, .portal-welcome { padding: 24px; }
  .portal-welcome .primary-btn { width: 100%; }
  .simple-status { padding: 22px; gap: 14px; align-items: flex-start; }
  .simple-status-icon { flex-basis: 44px; width: 44px; height: 44px; }
  .wizard-card { padding: 23px 18px; }
  .wizard-steps { max-width: 100%; }
  .wizard-steps button { font-size: .875rem; }
  .wizard-actions { grid-template-columns: 1fr 1fr; }
  .wizard-actions .save-state { grid-column: 1 / -1; grid-row: 1; }
  .wizard-actions > :last-child { justify-self: stretch; }
  .choice-card { padding: 18px; }
  .automation-choice { min-height: 150px; }
  .service-row { padding: 16px; }
  .status-row { flex-wrap: wrap; }
  .status-row > .field { flex-basis: calc(100% - 60px); }
  .status-row > button { margin-left: auto; }
  .paid-resource { padding: 22px; }
  .import-summary { grid-template-columns: 1fr; gap: 10px; }
  .import-summary > div, .import-summary > article { padding: 15px 18px; }
  .mapping-row { grid-template-columns: 1fr; gap: 7px; }
  .upload-zone { padding: 28px 18px; }
  .phone-head { flex-wrap: wrap; padding: 16px; }
  .draft-pill { margin-left: 54px; }
  .chat-messages { height: 52vh; min-height: 300px; padding: 16px; }
  .chat-input { flex-wrap: wrap; padding: 12px; }
  .chat-input input { flex-basis: 65%; }
  .chat-input .primary-btn { flex-grow: 1; }
  .bubble { max-width: 92%; }
  .modal-backdrop { padding: 12px; }
  .modal { border-radius: 18px; max-height: calc(100dvh - 24px); }
  .modal-head, .modal-body { padding: 20px; }
  .modal-foot { padding: 0 20px 20px; }
  .modal-foot button { flex: 1; }
  .tour-card { bottom: 16px; padding: 22px; }
  .tour-actions { flex-wrap: wrap; }
  .toast { right: 16px; bottom: 16px; }
  .client-row { gap: 12px; }
}
@media (max-width:440px) {
  .stats-grid, .portal-cards, .settings-grid, .review-grid { grid-template-columns: 1fr; }
  .stat-card, .theme-client .stat-card { min-height: 130px; }
  .stat-top { flex-wrap: nowrap; }
  .client-row { grid-template-columns: auto minmax(0,1fr); }
  .client-row > .badge { grid-column: 2; justify-self: start; }
  .simple-status { flex-direction: column; }
  .wizard-actions { gap: 10px; }
  .wizard-actions button { padding-inline: 10px; }
  .button-row > button { flex: 1 1 auto; }
  .phone-head .draft-pill { margin-left: 0; }
}
@media (prefers-reduced-motion:reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media (forced-colors:active) {
  .choice-card:has(input:checked), .wizard-steps li.active button, .nav-item.active { outline: 2px solid Highlight; }
  .primary-btn, .ghost-btn, .danger-btn, .badge, .choice-card, .panel, .stat-card { border-color: CanvasText; }
}
[hidden] { display: none !important; }
.stat-value.long-value { font-size: 20px; line-height: 1.4; overflow-wrap: normal; }
.handoff-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 330px), 1fr)); gap: 16px; padding: 20px; }
.handoff-card { min-width: 0; border: 1px solid var(--border); border-radius: 16px; padding: 20px; }
.handoff-card-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; align-items: flex-start; }
.handoff-card h3 { margin: 0; overflow-wrap: anywhere; }
.handoff-card p { overflow-wrap: anywhere; }
.handoff-summary { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; line-height: 1.6; padding: 16px; border: 1px solid var(--border); border-radius: 12px; max-height: 360px; overflow: auto; }
.handoff-attendant { min-width: 0; border: 1px solid var(--border); border-radius: 12px; padding: 16px; margin-bottom: 18px; }
.handoff-attendant legend { padding-inline: 6px; }
.handoff-timeout { margin-top: 20px; }
