/* Dashboard shell (/conta): fixed sidebar on desktop, drawer on small screens. */
[hidden] { display: none !important; }
body.app { --sidebar: 240px; }

.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 20; width: var(--sidebar);
  display: flex; flex-direction: column; padding: 24px 16px;
  background: var(--bg); border-right: 1px solid var(--line);
}
.sidebar .brand { margin: 2px 10px 28px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 10px;
  color: var(--muted); text-decoration: none; font-weight: 400; font-size: 14px;
}
.nav a:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }
.nav a[aria-current="page"] { color: var(--text); background: #1a1a1a; }
.nav svg, .icon-button svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sidebar-foot { margin-top: auto; padding: 16px 10px 0; border-top: 1px solid var(--line); }
.sidebar-foot .who { margin: 0; font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.sidebar-foot button { margin-top: 12px; padding: 8px; font-size: 14px; }

.shell { margin-left: var(--sidebar); min-height: 100vh; }
.topbar {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 12px;
  padding: 18px 32px; background: rgba(10, 10, 10, 0.85); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px);
}
.topbar h1 { margin: 0; font-size: 22px; }
.icon-button { display: none; width: 40px; height: 40px; margin: 0; padding: 0; place-items: center; background: transparent; color: var(--text); border: 1px solid var(--line); border-radius: 12px; box-shadow: none; }
main.content { max-width: none; margin: 0; padding: 28px 32px 48px; }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.kpi { position: relative; overflow: hidden; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; }
.kpi span { display: block; color: var(--muted); font: 500 11px var(--mono); text-transform: uppercase; letter-spacing: 0.08em; }
.kpi strong { display: block; margin-top: 8px; font: 400 24px var(--display); letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.card-head a { font-size: 14px; }

.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.actions button, button.inline { width: auto; margin-top: 0; padding: 10px 18px; }
button.inline { margin-top: 16px; }

.scrim { position: fixed; inset: 0; z-index: 15; background: rgb(0 0 0 / 0.6); backdrop-filter: blur(2px); }

.banner {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; padding: 16px 18px;
  border-radius: 14px; border: 1px solid rgba(255, 255, 255, 0.14); background: #161616;
}
.banner p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
/* What blocks the assistant (2FA off): white, with a pulsing button. */
.banner.alert { background: #ffffff; border-color: #ffffff; color: var(--brand-ink); }
.banner.alert p { color: #3d3d3d; }
.banner.alert p a { color: var(--brand-ink); font-weight: 600; }
.banner.alert .button-link { background: var(--brand-ink); color: #ffffff; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgb(10 10 10 / 0.5); } 50% { transform: scale(1.06); box-shadow: 0 0 0 10px rgb(10 10 10 / 0); } }
@media (prefers-reduced-motion: reduce) { .banner.alert .button-link { animation: none; } }
.button-link {
  display: inline-block; flex: none; padding: 10px 18px; border-radius: 999px; border: 1px solid transparent;
  background: var(--gradient) border-box; color: var(--brand-ink); font-weight: 500; font-size: 14px; text-decoration: none; cursor: pointer;
}
.button-link.secondary { background: #1f1f1f; color: var(--text); border-color: var(--line); }
.button-link.busy { opacity: 0.6; pointer-events: none; }
.link-button { width: auto; margin: 0; padding: 0; background: none; color: var(--brand); font-weight: 600; font-size: 14px; box-shadow: none; }
.link-button:hover:not(:disabled) { transform: none; background: none; color: var(--muted); }
ul.kyc-list { list-style: none; margin: 12px 0 0; padding: 0; }
ul.kyc-list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 14px 0; border-top: 1px solid var(--line); }
ul.kyc-list li > div:first-child { flex: 1 1 260px; }
.kyc-action { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.kyc-action .hint { margin: 0; }
ul.kyc-list strong { margin-right: 8px; }
ul.kyc-list .hint { margin: 4px 0 0; }
.refund { margin: 12px 0 16px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--field); }
.refund h3 { margin: 0; font-size: 16px; }
button.table-action { width: auto; margin: 0 6px 4px 0; padding: 6px 10px; font-size: 13px; white-space: nowrap; }
.rule-list { list-style: none; margin: 12px 0 0; padding: 0; }
.rule-list li { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px 16px; padding: 14px 0; border-top: 1px solid var(--line); }
.rule-list li > div { flex: 1 1 280px; }
.rule-list strong { margin-right: 8px; }
.rule-list .hint { margin: 4px 0 0; }
fieldset.checks { margin: 14px 0 0; padding: 0; border: 0; }
fieldset.checks legend { font-size: 14px; font-weight: 600; margin-bottom: 6px; }
fieldset.checks label { display: flex; align-items: center; gap: 8px; margin: 6px 0; font-weight: 400; }
fieldset.checks input { width: auto; }
.choice, .segmented { margin: 14px 0 0; padding: 0; border: 0; min-width: 0; }
.choice legend, .segmented legend { font-size: 14px; font-weight: 600; margin-bottom: 6px; padding: 0; }
.choice-list { display: grid; gap: 8px; }
.choice-card { display: flex; align-items: center; gap: 12px; margin: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--field); font-weight: 400; cursor: pointer; }
.choice-card input { width: 18px; height: 18px; flex: none; accent-color: var(--brand); }
.choice-card span { display: flex; flex-direction: column; min-width: 0; }
.choice-card strong { overflow-wrap: anywhere; }
.choice-card small { color: var(--muted); font-size: 13px; }
.choice-card:has(input:checked) { border-color: #5c5c5c; background: #181818; }
.segmented { display: flex; flex-wrap: wrap; gap: 8px; }
.segmented legend { width: 100%; }
.segmented label { position: relative; margin: 0; font-weight: 600; font-size: 14px; }
.segmented input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.segmented span { display: block; min-height: 40px; padding: 9px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--field); color: var(--muted); cursor: pointer; }
.segmented label:has(input:checked) span { border-color: #fff; color: #0a0a0a; background: #fff; }
.segmented label:has(input:focus-visible) span, .choice-card:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 2px; }
textarea { width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--field); color: var(--text); font: inherit; resize: vertical; }
.deposit-body { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-top: 8px; }
.deposit-info { flex: 1 1 260px; min-width: 0; }
.deposit-label { display: block; color: var(--muted); font-size: 13px; }
.pix-key { display: block; margin-top: 4px; font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.deposit-qr { width: 160px; height: 160px; margin: 0; }
.bill-info { margin-top: 16px; }
.balance-sm { margin: 8px 0 0; font-size: 18px; font-weight: 500; font-variant-numeric: tabular-nums; }
label.inline-check { display: flex; align-items: center; gap: 8px; font-weight: 400; }
label.inline-check input { width: auto; }
.sandbox-note { margin-top: 16px; padding: 12px 14px; border: 1px dashed var(--line); border-radius: 10px; }
.sandbox-note .hint { margin: 0; }
.sandbox-note button { margin-top: 10px; }

@media (max-width: 960px) { .kpis { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 860px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.2s ease; box-shadow: none; }
  .sidebar.open { transform: none; box-shadow: 0 0 40px rgb(0 0 0 / 0.3); }
  .shell { margin-left: 0; }
  .icon-button { display: grid; }
  .topbar { padding: 12px 16px; }
  main.content { padding: 20px 16px 40px; }
}
table.history .status { white-space: nowrap; }
@media (max-width: 520px) {
  table.history .date { display: none; }
  .banner { flex-direction: column; align-items: flex-start; }
  .kpi { padding: 14px; }
  .card { padding: 18px; }
  .kpi strong { font-size: 18px; }
}
@media (max-width: 330px) { .kpis { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .sidebar { transition: none; } }

/* Connect an assistant: one-time link, per-assistant steps. */
.copy-row { display: flex; gap: 8px; align-items: center; }
.copy-row input { flex: 1; min-width: 0; font-family: var(--mono); font-size: 13px; }
.copy-row button { margin: 0; }
.steps details { border-bottom: 1px solid var(--line); padding: 10px 0; }
#connect-rotate { margin-top: 8px; }
#connect-rotate summary { cursor: pointer; color: var(--muted); }
.steps summary { cursor: pointer; font-weight: 600; }
.steps ol { margin: 10px 0 6px; padding-left: 20px; line-height: 1.6; }
.steps pre { overflow-x: auto; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--field); font-family: var(--mono); font-size: 12px; white-space: pre-wrap; word-break: break-all; }
table.fees td:last-child { color: var(--muted); }

/* Credentials: one site per row, inline reveal (account password + 2FA). */
.cred-list li > div:first-child { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.cred-actions { display: flex; gap: 16px; align-items: center; }

/* Accounts without a password (WhatsApp login): confirmations ask only for the 2FA code. */
body.no-password label[for$="-password"], body.no-password label[for$="-password"] + .password-wrap { display: none; }

/* Plano: usage meter and the plan cards. */
.meter { height: 4px; border-radius: 4px; background: #262626; overflow: hidden; margin: 10px 0 4px; }
.meter i { display: block; height: 100%; background: #fff; }
.plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.plans .card { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.plans .card.current { border-color: rgba(255, 255, 255, 0.35); }
.plans .price { margin: 4px 0 0; font: 400 26px var(--display); color: var(--text); }
.plans .ops { margin: 0 0 8px; color: var(--muted); font-size: 14px; }
.plans .card button { margin-top: auto; }
.checks-list { margin: 8px 0 12px; padding-left: 18px; color: var(--muted); line-height: 1.8; }
@media (max-width: 860px) { .plans { grid-template-columns: minmax(0, 1fr); } }
