/* CRM Rayane Financiamentos — Ideia Hub */
:root {
  --brand: #43398a;
  --brand-600: #372e75;
  --brand-700: #2a2359;
  --brand-50: #efedf8;
  --brand-100: #dfdbf2;
  --green: #7fb62f;
  --green-600: #6a9a24;
  --green-50: #f1f8e6;
  --lime: #a6e86d;
  --ink: #14161a;
  --text: #1f2430;
  --muted: #667085;
  --soft: #98a2b3;
  --line: #e6e8ee;
  --line-2: #eff1f5;
  --bg: #f5f6f8;
  --card: #ffffff;
  --danger: #dc2626;
  --danger-50: #fef2f2;
  --warn: #b45309;
  --warn-50: #fdf6e7;
  --ok: #15803d;
  --ok-50: #ecfdf3;
  --info: #0369a1;
  --info-50: #eff8ff;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-lg: 0 12px 32px -8px rgba(16, 24, 40, .18), 0 4px 8px -4px rgba(16, 24, 40, .08);
  --sidebar: 248px;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--text);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); min-height: 100%; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; color: var(--ink); letter-spacing: -.01em; }
h1 { font-size: 24px; font-weight: 700; }
h2 { font-size: 18px; font-weight: 650; }
h3 { font-size: 15px; font-weight: 650; }
.muted { color: var(--muted); }
.soft { color: var(--soft); }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; }
.bold { font-weight: 600; }
.nowrap { white-space: nowrap; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
.hidden { display: none !important; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.row.top { align-items: flex-start; }
.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 12px; }
.stack-sm > * + * { margin-top: 6px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
svg.i.sm { width: 15px; height: 15px; }
svg.i.lg { width: 22px; height: 22px; }

/* ---------- Botões ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 15px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--ink); font-weight: 550; white-space: nowrap; transition: background .15s, border-color .15s, box-shadow .15s, transform .05s; }
.btn:hover { background: #f8f9fb; border-color: #d5d9e2; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 1px 2px rgba(67, 57, 138, .3); }
.btn.primary:hover { background: var(--brand-600); }
.btn.dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.dark:hover { background: #2a2d33; }
.btn.green { background: var(--green); border-color: var(--green); color: #fff; }
.btn.green:hover { background: var(--green-600); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: var(--danger-50); border-color: #fecaca; }
.btn.danger.solid { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: rgba(16, 24, 40, .05); }
.btn.sm { height: 31px; padding: 0 11px; font-size: 13px; border-radius: 8px; gap: 6px; }
.btn.xs { height: 26px; padding: 0 8px; font-size: 12px; border-radius: 7px; gap: 5px; }
.btn.icon { width: 38px; padding: 0; }
.btn.sm.icon { width: 31px; }
.btn.wa { background: #25d366; border-color: #25d366; color: #fff; }
.btn.wa:hover { background: #1fb457; }

/* ---------- Formulários ---------- */
label.f { display: block; }
label.f > span, .f-label { display: block; font-size: 12.5px; font-weight: 550; color: #344054; margin-bottom: 6px; }
.input, select.input, textarea.input { width: 100%; height: 40px; padding: 0 12px; border: 1px solid #d5d9e2; border-radius: 10px; background: #fff; outline: none; transition: border-color .15s, box-shadow .15s; }
textarea.input { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; line-height: 1.45; }
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(67, 57, 138, .14); }
.input.sm { height: 33px; font-size: 13px; padding: 0 10px; border-radius: 8px; }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23667085' stroke-width='2'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 32px; }
.input.invalid { border-color: var(--danger); }
.field-err { color: var(--danger); font-size: 12px; margin-top: 4px; }
.hint { color: var(--muted); font-size: 12px; margin-top: 4px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.check input { width: 16px; height: 16px; accent-color: var(--brand); }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track { width: 38px; height: 22px; border-radius: 99px; background: #d0d5dd; position: relative; transition: background .15s; flex: none; }
.switch .track::after { content: ''; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s; }
.switch input:checked + .track { background: var(--green); }
.switch input:checked + .track::after { transform: translateX(16px); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; border-radius: 99px; border: 1px solid var(--line); background: #fff; font-size: 12.5px; font-weight: 550; color: #475467; cursor: pointer; user-select: none; }
.chip:hover { border-color: #cfd4dd; }
.chip.on { background: var(--brand-50); border-color: #c9c3ea; color: var(--brand); }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; }
.seg { display: inline-flex; background: #eef0f4; border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; height: 30px; padding: 0 12px; border-radius: 8px; font-weight: 550; color: #475467; font-size: 13px; }
.seg button.on { background: #fff; color: var(--ink); box-shadow: var(--shadow); }

/* ---------- Cartões e badges ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line-2); }
.card-b { padding: 18px 20px; }
.card-b.tight { padding: 8px 12px; }
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 99px; font-size: 11.5px; font-weight: 600; background: #f2f4f7; color: #475467; white-space: nowrap; }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.ok { background: var(--ok-50); color: var(--ok); }
.badge.warn { background: var(--warn-50); color: var(--warn); }
.badge.danger { background: var(--danger-50); color: var(--danger); }
.badge.info { background: var(--info-50); color: var(--info); }
.badge.brand { background: var(--brand-50); color: var(--brand); }
.badge.green { background: var(--green-50); color: var(--green-600); }
.stage-pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.avatar { width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center; color: #fff; font-size: 11.5px; font-weight: 700; flex: none; letter-spacing: .02em; }
.avatar.sm { width: 22px; height: 22px; font-size: 9.5px; }
.avatar.lg { width: 40px; height: 40px; font-size: 14px; }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; font-size: 13px; line-height: 1.45; }
.alert.warn { background: var(--warn-50); color: #8a4b0a; }
.alert.danger { background: var(--danger-50); color: #991b1b; border: 1px solid #fecaca; }
.alert.info { background: #f2f4f7; color: #344054; }
.alert.ok { background: var(--ok-50); color: #14532d; }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty svg.i { width: 34px; height: 34px; color: var(--soft); margin-bottom: 8px; }

/* ---------- Layout ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar); background: linear-gradient(180deg, #2b2360 0%, #211a4b 100%); color: #d9d6ee; display: flex; flex-direction: column; z-index: 30; }
.sidebar .logo { padding: 22px 22px 18px; }
.sidebar .logo img { width: 168px; display: block; }
.sidebar .logo .tag { margin-top: 8px; font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--lime); font-weight: 700; }
.nav { padding: 6px 12px; flex: 1; overflow-y: auto; }
.nav .sec { font-size: 10.5px; text-transform: uppercase; letter-spacing: .12em; color: #8c86b8; padding: 16px 10px 6px; font-weight: 700; }
.nav a { display: flex; align-items: center; gap: 11px; height: 40px; padding: 0 12px; border-radius: 10px; color: #d9d6ee; font-weight: 550; margin-bottom: 2px; position: relative; }
.nav a:hover { background: rgba(255,255,255,.06); text-decoration: none; color: #fff; }
.nav a.on { background: rgba(166, 232, 109, .14); color: #fff; }
.nav a.on::before { content: ''; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--lime); }
.nav a.on svg.i { color: var(--lime); }
.nav .count { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.sidebar .me { margin: 10px 12px; padding: 12px; border-radius: 12px; background: rgba(255,255,255,.06); display: flex; align-items: center; gap: 10px; }
.sidebar .me .name { color: #fff; font-weight: 600; font-size: 13px; }
.sidebar .me .role { font-size: 11.5px; color: #a8a3cf; }
.sidebar .me .btn { color: #cfcbe8; }
.sidebar .me .btn:hover { background: rgba(255,255,255,.1); color: #fff; }
.sidebar .by { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 0 16px; font-size: 10.5px; color: #8c86b8; }
.sidebar .by img { height: 15px; opacity: .85; }
.main { margin-left: var(--sidebar); flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; height: 64px; background: rgba(245, 246, 248, .86); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 14px; padding: 0 28px; }
.topbar .search { position: relative; width: 340px; max-width: 40vw; }
.topbar .search svg { position: absolute; left: 11px; top: 11px; color: var(--soft); }
.topbar .search input { padding-left: 36px; background: #fff; }
.topbar .menu-btn { display: none; }
.content { padding: 26px 28px 60px; max-width: 1480px; width: 100%; }
.page-h { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-h p { margin: 4px 0 0; color: var(--muted); }

/* ---------- Notificações ---------- */
.bell { position: relative; }
.bell .dotc { position: absolute; top: 4px; right: 4px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 99px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--bg); }
.dropdown { position: absolute; right: 0; top: calc(100% + 8px); width: 380px; max-height: 70vh; overflow: auto; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); z-index: 50; }
.notif { display: flex; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line-2); cursor: pointer; }
.notif:hover { background: #fafbfc; }
.notif.unread { background: #faf9ff; }
.notif .ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--brand-50); color: var(--brand); }

/* ---------- Tabelas ---------- */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: separate; border-spacing: 0; }
table.t th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 650; padding: 11px 14px; border-bottom: 1px solid var(--line); background: #fafbfc; white-space: nowrap; position: sticky; top: 0; }
table.t td { padding: 12px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.t tbody tr { transition: background .1s; }
table.t tbody tr.click { cursor: pointer; }
table.t tbody tr:hover { background: #fafaff; }
table.t tbody tr.sel { background: #f5f3ff; }
table.t td.num, table.t th.num { text-align: right; }
table.t tr:last-child td { border-bottom: 0; }
.pager { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-top: 1px solid var(--line); }

/* ---------- KPIs e gráficos ---------- */
.kpi { padding: 18px 20px; }
.kpi .lbl { color: var(--muted); font-size: 12.5px; font-weight: 550; display: flex; align-items: center; gap: 8px; }
.kpi .val { font-size: 28px; font-weight: 700; color: var(--ink); margin-top: 8px; letter-spacing: -.02em; }
.kpi .sub { font-size: 12px; color: var(--muted); margin-top: 4px; }
.kpi .ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; }
.bars { display: flex; align-items: flex-end; gap: 4px; height: 150px; padding-top: 10px; }
.bars .b { flex: 1; background: var(--brand-100); border-radius: 5px 5px 2px 2px; position: relative; min-height: 2px; transition: background .15s; }
.bars .b:hover { background: var(--brand); }
.bars .b:hover::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; font-size: 11px; padding: 4px 7px; border-radius: 6px; white-space: nowrap; z-index: 2; }
.hbar { display: grid; grid-template-columns: minmax(110px, 1.1fr) 2fr auto; align-items: center; gap: 12px; padding: 7px 0; font-size: 13px; }
.hbar .track { height: 9px; background: #f0f1f5; border-radius: 99px; overflow: hidden; }
.hbar .fill { height: 100%; border-radius: 99px; background: var(--brand); }
.funnel-row { display: grid; grid-template-columns: 170px 1fr 56px; gap: 12px; align-items: center; padding: 6px 0; }
.funnel-row .track { height: 26px; background: #f5f6f9; border-radius: 8px; overflow: hidden; }
.funnel-row .fill { height: 100%; border-radius: 8px; display: flex; align-items: center; padding-left: 10px; color: #fff; font-size: 11.5px; font-weight: 700; min-width: 4px; }

/* ---------- Filtros ---------- */
.filters { padding: 14px 16px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; border-bottom: 1px solid var(--line-2); }
.filters .input { width: auto; }
.adv { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; padding: 16px; background: #fbfbfd; border-bottom: 1px solid var(--line-2); }
.bulkbar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: var(--brand-50); border-bottom: 1px solid #d9d4f2; color: var(--brand); font-weight: 600; }

/* ---------- Kanban ---------- */
.kanban { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 14px; align-items: flex-start; min-height: calc(100vh - 210px); }
.kcol { width: 292px; flex: none; background: #eceef3; border-radius: 14px; display: flex; flex-direction: column; max-height: calc(100vh - 200px); }
.kcol .kh { padding: 12px 14px 10px; }
.kcol .kh .t { display: flex; align-items: center; gap: 8px; font-weight: 650; color: var(--ink); font-size: 13.5px; }
.kcol .kh .t .n { margin-left: auto; background: #fff; border-radius: 99px; padding: 1px 8px; font-size: 12px; color: var(--muted); }
.kcol .kh .bar { height: 3px; border-radius: 3px; margin-top: 10px; }
.kcol .kb { padding: 4px 10px 12px; overflow-y: auto; flex: 1; min-height: 80px; }
.kcol.drop .kb { background: rgba(67, 57, 138, .07); border-radius: 0 0 14px 14px; outline: 2px dashed #b9b2e3; outline-offset: -6px; }
.kcard { background: #fff; border-radius: 11px; padding: 11px 12px; margin-bottom: 8px; box-shadow: 0 1px 2px rgba(16,24,40,.06); border: 1px solid #e7e9ef; cursor: grab; transition: box-shadow .15s, transform .15s; }
.kcard:hover { box-shadow: var(--shadow-lg); border-color: #d8dbe4; }
.kcard.dragging { opacity: .45; }
.kcard .nm { font-weight: 600; color: var(--ink); font-size: 13.5px; }
.kcard .meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 7px; }
.kcard .ft { display: flex; align-items: center; justify-content: space-between; margin-top: 9px; padding-top: 8px; border-top: 1px dashed #eceef2; }

/* ---------- Ficha do lead ---------- */
.lead-head { padding: 20px 22px; }
.lead-head .nm { font-size: 22px; font-weight: 700; color: var(--ink); letter-spacing: -.02em; }
.stepper { display: flex; gap: 4px; padding: 0 22px 20px; flex-wrap: wrap; }
.stepper button { flex: 1; min-width: 92px; border: 0; height: 34px; background: #eff1f5; color: #667085; font-size: 12px; font-weight: 650; position: relative; clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%, 10px 50%); padding: 0 14px; }
.stepper button:first-child { clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%); border-radius: 8px 0 0 8px; }
.stepper button:last-child { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 10px 50%); border-radius: 0 8px 8px 0; }
.stepper button.done { background: #e3def7; color: var(--brand); }
.stepper button.cur { background: var(--brand); color: #fff; }
.stepper button:hover:not(.cur) { background: #d7d1f1; color: var(--brand); }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); padding: 0 16px; overflow-x: auto; }
.tabs button { border: 0; background: none; height: 46px; padding: 0 14px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.tabs button.on { color: var(--brand); border-bottom-color: var(--brand); }
.tabs button .n { background: #f2f4f7; border-radius: 99px; padding: 0 7px; font-size: 11.5px; color: #475467; }
.lead-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.kv { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 14px; font-size: 13px; }
.kv dt { color: var(--muted); white-space: nowrap; }
.kv dd { margin: 0; text-align: right; font-weight: 600; color: var(--ink); }
.fgroup { margin-bottom: 22px; }
.fgroup h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--brand); margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.fgroup h4::after { content: ''; flex: 1; height: 1px; background: var(--line-2); }
.fgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 14px; }
.fgrid .span2 { grid-column: span 2; }
.fgrid .span3 { grid-column: 1 / -1; }

/* timeline */
.timeline { position: relative; }
.tl { display: flex; gap: 12px; position: relative; padding-bottom: 18px; }
.tl::before { content: ''; position: absolute; left: 15px; top: 34px; bottom: 0; width: 2px; background: var(--line-2); }
.tl:last-child::before { display: none; }
.tl .ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.tl .bd { flex: 1; min-width: 0; }
.tl .bd .hd { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.tl .bd .tx { margin-top: 5px; white-space: pre-wrap; line-height: 1.5; color: #344054; }
.tl.sys .bd .tx { color: var(--muted); margin-top: 2px; }
.composer { padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: #fcfcfe; }
.typepick { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.typepick button { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--line); background: #fff; font-weight: 600; color: #475467; font-size: 13px; }
.typepick button.on { border-color: var(--brand); background: var(--brand-50); color: var(--brand); }

/* documentos */
.doclist { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.docreq { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: #fff; }
.docreq.ok { border-color: #bbf7d0; background: #f6fef9; }
.dropzone { border: 2px dashed #d0d5dd; border-radius: 14px; padding: 22px; text-align: center; color: var(--muted); transition: all .15s; cursor: pointer; }
.dropzone.over, .dropzone:hover { border-color: var(--brand); background: var(--brand-50); color: var(--brand); }
.file { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--line-2); }
.file:last-child { border-bottom: 0; }
.file .fi { width: 36px; height: 36px; border-radius: 9px; background: #f2f4f7; display: grid; place-items: center; color: #475467; flex: none; }

/* ---------- Modal / toast ---------- */
.overlay { position: fixed; inset: 0; background: rgba(17, 14, 40, .45); backdrop-filter: blur(2px); z-index: 100; display: grid; place-items: center; padding: 20px; animation: fade .15s ease; }
.modal { background: #fff; border-radius: 18px; width: 100%; max-width: 560px; max-height: calc(100vh - 40px); display: flex; flex-direction: column; box-shadow: 0 24px 60px -12px rgba(16, 24, 40, .35); animation: pop .18s ease; }
.modal.lg { max-width: 860px; }
.modal.xl { max-width: 1060px; }
.modal .mh { padding: 18px 22px; border-bottom: 1px solid var(--line-2); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.modal .mb { padding: 20px 22px; overflow-y: auto; }
.modal .mf { padding: 14px 22px; border-top: 1px solid var(--line-2); display: flex; justify-content: flex-end; gap: 10px; background: #fcfcfd; border-radius: 0 0 18px 18px; }
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast { min-width: 280px; max-width: 420px; background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow-lg); display: flex; gap: 10px; align-items: flex-start; animation: pop .2s ease; font-size: 13.5px; }
.toast.ok svg { color: var(--lime); }
.toast.err { background: #7f1d1d; }
.toast a { color: var(--lime); font-weight: 600; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.98); } }
.spinner { width: 22px; height: 22px; border: 3px solid var(--brand-100); border-top-color: var(--brand); border-radius: 50%; animation: spin .7s linear infinite; }
.loading { display: grid; place-items: center; padding: 60px; }
@keyframes spin { to { transform: rotate(360deg); } }
.code { background: #16141f; color: #e7e5f5; border-radius: 12px; padding: 14px 16px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; line-height: 1.55; overflow-x: auto; white-space: pre; }
.copyline { display: flex; gap: 8px; align-items: center; }
.copyline .input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; background: #fafbfc; }
.steps-guide { counter-reset: s; padding: 0; margin: 0; list-style: none; }
.steps-guide li { counter-increment: s; position: relative; padding: 0 0 14px 38px; line-height: 1.5; }
.steps-guide li::before { content: counter(s); position: absolute; left: 0; top: -1px; width: 26px; height: 26px; border-radius: 50%; background: var(--brand-50); color: var(--brand); font-weight: 700; font-size: 12.5px; display: grid; place-items: center; }

/* ---------- Login ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; background: #fff; }
.auth .brandside { background: radial-gradient(1200px 600px at 10% 10%, #8fc63e 0%, #7fb62f 45%, #6c9e25 100%); position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; padding: 48px 56px; color: #20193f; }
.auth .brandside::after { content: ''; position: absolute; right: -180px; bottom: -180px; width: 520px; height: 520px; border-radius: 50%; border: 70px solid rgba(67, 57, 138, .09); }
.auth .brandside::before { content: ''; position: absolute; right: 120px; top: -120px; width: 300px; height: 300px; border-radius: 50%; background: rgba(255,255,255,.08); }
.auth .brandside img.logo { width: 330px; max-width: 80%; position: relative; z-index: 1; }
.auth .brandside h2 { font-size: 34px; line-height: 1.15; color: #20193f; max-width: 460px; letter-spacing: -.03em; position: relative; z-index: 1; }
.auth .brandside p { font-size: 15.5px; color: #2d2560; max-width: 430px; line-height: 1.55; position: relative; z-index: 1; }
.auth .brandside .pts { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 26px; position: relative; z-index: 1; }
.auth .brandside .pts div { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13.5px; color: #2a2359; }
.auth .formside { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 40px; }
.auth .box { width: 100%; max-width: 380px; }
.auth .box h1 { font-size: 28px; letter-spacing: -.03em; }
.auth .box .lead { color: var(--muted); margin: 6px 0 28px; }
.auth .box .input { height: 46px; font-size: 15px; }
.auth .box .btn.primary { height: 46px; width: 100%; font-size: 15px; }
.auth .by { margin-top: 48px; display: flex; align-items: center; gap: 10px; justify-content: center; color: var(--soft); font-size: 12px; }
.auth .by img { height: 22px; }

/* ---------- Responsivo ---------- */
@media (max-width: 1200px) {
  .lead-layout { grid-template-columns: 1fr; }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .adv { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
  .main { margin-left: 0; }
  .topbar { padding: 0 14px; }
  .topbar .menu-btn { display: inline-flex; }
  .topbar .search { width: auto; flex: 1; max-width: none; }
  .content { padding: 18px 14px 60px; }
  .g2, .g3 { grid-template-columns: 1fr; }
  .fgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .auth { grid-template-columns: 1fr; }
  .auth .brandside { padding: 32px; min-height: 240px; }
  .auth .brandside h2, .auth .brandside p, .auth .brandside .pts { display: none; }
  .doclist { grid-template-columns: 1fr; }
  .hide-m { display: none !important; }
}
@media (max-width: 560px) {
  .g4 { grid-template-columns: 1fr 1fr; }
  .fgrid { grid-template-columns: 1fr; }
  .fgrid .span2 { grid-column: auto; }
  .adv { grid-template-columns: 1fr; }
  .dropdown { width: calc(100vw - 28px); right: -60px; }
}
