/* Tela única da revenda e login: mesma identidade do site odle.odle-x.com.br. */
body.simple-mode {
  --bg: #090c15;
  --surface: #121725;
  --surface-alt: #181e2f;
  --surface-strong: #0c101c;
  --line: #2b3346;
  --text: #eef1f7;
  --muted: #9aa4b8;
  --accent: #e8333a;
  --accent-strong: #c4232a;
  --accent-soft: rgba(232, 51, 58, .14);
  --green: #34d399;
  --green-soft: rgba(52, 211, 153, .13);
  --amber: #fbbf24;
  --amber-soft: rgba(251, 191, 36, .13);
  --red: #ff8a8e;
  --red-soft: rgba(232, 51, 58, .14);
  --shadow: 0 18px 50px rgba(0, 0, 0, .45);
  color-scheme: dark;
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(900px 520px at 85% -10%, rgba(232, 51, 58, .16), transparent 60%),
    radial-gradient(700px 480px at -10% 30%, rgba(120, 60, 200, .10), transparent 60%),
    #090c15;
  background-attachment: fixed;
}

/* ── Login e abertura ── */
body.simple-mode .boot-screen,
body.simple-mode .login-screen { background: transparent; }
body.simple-mode .boot-card,
body.simple-mode .login-brand,
body.simple-mode .login-card {
  background: linear-gradient(180deg, rgba(24, 30, 47, .9), rgba(18, 23, 37, .9));
  border: 1px solid #262d3d;
  box-shadow: none;
  color: var(--text);
}
body.simple-mode .login-brand p,
body.simple-mode .eyebrow,
body.simple-mode .field-help { color: var(--muted); }
body.simple-mode .brand-logo { width: 56px; height: 56px; flex: none; }
body.simple-mode .login-switch { background: #0c101c; border-color: #353e52; }
body.simple-mode .switch-btn { color: var(--muted); background: none; }
body.simple-mode .switch-btn.active { background: var(--accent); color: #fff; box-shadow: none; }
body.simple-mode .field-label { color: var(--text); }
body.simple-mode .field-input,
body.simple-mode .modal-shell .field-input {
  min-height: 50px; font-size: 16px; color: var(--text);
  background: #0c101c; border: 1px solid #353e52;
}
body.simple-mode .field-input::placeholder { color: #6d7689; }
body.simple-mode .field-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
body.simple-mode .primary-btn { background: var(--accent); border-color: var(--accent); color: #fff; }
body.simple-mode .primary-btn:hover { background: var(--accent-strong); }
body.simple-mode .ghost-btn { background: #181e2f; border-color: #353e52; color: var(--text); }
body.simple-mode .login-error { color: #ff8a8e; }

/* ── Janelas do painel (trocar senha, avisos) ── */
body.simple-mode .modal-shell,
body.simple-mode .alert-shell { background: #121725; border: 1px solid #353e52; color: var(--text); }
body.simple-mode .modal-header,
body.simple-mode .alert-header { background: transparent; border-color: #262d3d; color: var(--text); }
body.simple-mode .modal-body,
body.simple-mode .alert-body,
body.simple-mode .alert-actions { background: transparent; color: var(--text); }
body.simple-mode .form-section { background: #181e2f; border-color: #262d3d; }
body.simple-mode .form-section-title,
body.simple-mode .modal-shell .field-label { color: var(--text); }
body.simple-mode .toast { background: #0f1422 !important; color: var(--text); border: 1px solid #353e52; }

/* ── Estrutura ── */
#revenda-app { color: var(--text); }
:where(#revenda-app) :where(h1, h2, p) { margin: 0; }
:where(#revenda-app) :where(button, input) { font: inherit; color: inherit; }
:where(#revenda-app) button { cursor: pointer; }
#revenda-app :focus-visible { outline: 2px solid #ff8a8e; outline-offset: 2px; }
#revenda-app .mono { font-family: ui-monospace, Consolas, "Courier New", monospace; letter-spacing: .3px; }
.rv-top { position: sticky; top: 0; z-index: 20; background: rgba(9, 12, 21, .85); backdrop-filter: blur(12px); border-bottom: 1px solid #262d3d; }
.rv-top-in { display: flex; align-items: center; gap: 14px; height: 68px; max-width: 1240px; margin: 0 auto; padding: 0 20px; }
.rv-logo { display: flex; align-items: center; gap: 10px; margin-right: 8px; font-weight: 800; font-size: 20px; letter-spacing: 1px; }
.rv-logo img { width: 34px; height: 34px; }
.rv-logo small { padding-left: 10px; border-left: 1px solid #353e52; font-size: 13px; font-weight: 600; letter-spacing: 0; color: var(--muted); }
.rv-tabs + .rv-credits { margin-left: 0; }
.rv-credits { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 6px 14px; white-space: nowrap; font-weight: 700; background: #181e2f; border: 1px solid #353e52; border-radius: 999px; }
.rv-credits:hover { border-color: var(--muted); }
.rv-credits b { color: #ff8a8e; font-size: 18px; }
.rv-credits.rv-empty { border-color: var(--accent); }
.rv-account { position: relative; }
.rv-avatar { width: 42px; height: 42px; display: grid; place-items: center; font-weight: 700; font-size: 14px; background: #181e2f; border: 1px solid #353e52; border-radius: 50%; }
.rv-avatar:hover { border-color: var(--muted); }
.rv-menu { position: absolute; top: 52px; right: 0; z-index: 30; width: 260px; padding: 8px; background: #0f1422; border: 1px solid #353e52; border-radius: 14px; box-shadow: 0 16px 40px rgba(0, 0, 0, .5); }
.rv-menu-head { padding: 8px 10px 10px; border-bottom: 1px solid #262d3d; margin-bottom: 6px; overflow-wrap: anywhere; }
.rv-menu-head strong { display: block; }
.rv-menu-head span { font-size: 13px; color: var(--muted); }
.rv-menu-item { display: flex; align-items: center; width: 100%; min-height: 44px; padding: 8px 10px; text-align: left; text-decoration: none; color: var(--text); font-size: 15px; font-weight: 600; background: none; border: 0; border-radius: 10px; }
.rv-menu-item:hover { background: #181e2f; }

.rv-layout { display: grid; grid-template-columns: 420px minmax(0, 1fr); gap: 24px; align-items: start; max-width: 1240px; margin: 0 auto; padding: 24px 20px 48px; }
.rv-tabs { display: flex; gap: 4px; padding: 4px; margin-right: auto; background: #0c101c; border: 1px solid #353e52; border-radius: 12px; }
.rv-tabs button { min-height: 38px; padding: 4px 16px; font-size: 15px; font-weight: 600; color: var(--muted); background: none; border: 0; border-radius: 8px; }
.rv-tabs button:hover { color: var(--text); }
.rv-tabs button.on { color: #fff; background: var(--accent); }
.rv-card-title { font-size: 22px; line-height: 1.25; }
.rv-msg { margin-top: 12px; padding: 12px 14px; font-size: 14px; white-space: pre-line; overflow-wrap: anywhere; background: #0c101c; border: 1px solid #353e52; border-radius: 10px; }
.rv-manage { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; grid-column: 1 / -1; padding-top: 12px; border-top: 1px solid #262d3d; }
.rv-mg-block { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-width: 0; padding: 14px; background: #0e1320; border: 1px solid #262d3d; border-radius: 12px; }
#revenda-app .rv-mg-block h3 { margin: 0; font-size: 15px; }
.rv-mg-mail { font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.rv-mg-mail strong { color: var(--text); font-weight: 600; }
.rv-mg-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.rv-mg-line { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; }
.rv-mg-line .rv-input { flex: 1 1 110px; width: auto; min-width: 0; min-height: 42px; padding: 7px 10px; }
.rv-mg-hint { font-size: 13px; color: var(--muted); }
.rv-manage .rv-mac, .rv-manage .rv-msg { width: 100%; margin-top: 2px; }
.rv-card { position: sticky; top: 92px; padding: 24px; background: linear-gradient(180deg, rgba(24, 30, 47, .95), rgba(18, 23, 37, .95)); border: 1px solid #262d3d; border-radius: 22px; }
.rv-form-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.rv-form-head h1 { font-size: 22px; line-height: 1.25; overflow-wrap: anywhere; }

/* ── Formulário ── */
.rv-field { display: block; margin-top: 16px; }
.rv-field > span { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 6px; font-size: 14px; font-weight: 600; }
.rv-field > span em { font-style: normal; font-weight: 400; color: var(--muted); }
.rv-input { width: 100%; min-height: 50px; padding: 11px 14px; font-size: 16px; background: #0c101c; border: 1px solid #353e52; border-radius: 10px; }
.rv-input::placeholder { color: #6d7689; }
.rv-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.rv-mac { display: flex; align-items: center; gap: 12px; margin-top: 10px; padding: 11px 14px; font-size: 14px; border-radius: 10px; }
.rv-mac svg { width: 22px; height: 22px; flex: none; }
.rv-mac.ok { background: rgba(52, 211, 153, .13); color: #a7f3d0; }
.rv-mac.bad { background: rgba(232, 51, 58, .14); color: #ffc2c4; }
.rv-mac.warn { background: rgba(251, 191, 36, .13); color: #fde68a; }
.rv-mac.wait { background: #181e2f; color: var(--muted); }
.rv-spin { width: 18px; height: 18px; flex: none; border: 2px solid #353e52; border-top-color: var(--accent); border-radius: 50%; animation: rv-spin .8s linear infinite; }
@keyframes rv-spin { to { transform: rotate(360deg); } }
.rv-list-closed { margin-top: 14px; }
.rv-list-box { min-width: 0; margin: 16px 0 0; padding: 0; border: 0; }
.rv-list-box legend { padding: 0; margin-bottom: 8px; font-size: 14px; font-weight: 600; }
.rv-seg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; padding: 4px; background: #0c101c; border: 1px solid #353e52; border-radius: 10px; }
.rv-seg button { min-height: 42px; padding: 6px 8px; font-size: 15px; font-weight: 600; background: none; border: 0; border-radius: 7px; color: var(--muted); }
.rv-seg button:hover { color: var(--text); }
.rv-seg button[aria-checked="true"] { background: var(--accent); color: #fff; }
.rv-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.rv-list-remove { margin-top: 8px; }
.rv-plan { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; padding: 13px 16px; background: var(--accent-soft); border: 1px solid rgba(232, 51, 58, .35); border-radius: 14px; }
.rv-plan strong { display: block; }
.rv-plan span.until { font-size: 14px; color: var(--muted); }
.rv-plan .cost { font-weight: 800; color: #ffc2c4; white-space: nowrap; }
.rv-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 11px 20px; font-size: 16px; font-weight: 700; text-align: center; background: #181e2f; border: 1px solid #353e52; border-radius: 14px; transition: background .15s, border-color .15s; }
.rv-btn:hover { border-color: var(--muted); }
.rv-btn.primary { color: #fff; background: var(--accent); border-color: var(--accent); box-shadow: 0 8px 24px rgba(232, 51, 58, .25); }
.rv-btn.primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.rv-btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.rv-btn.block { display: flex; width: 100%; }
.rv-btn.sm { min-height: 40px; padding: 7px 14px; font-size: 14px; border-radius: 10px; white-space: nowrap; }
.rv-btn.confirm { color: var(--ok, #34d399); background: rgba(52, 211, 153, .13); border-color: #34d399; }
.rv-link { padding: 4px 0; font-size: 15px; font-weight: 600; color: #ff8a8e; text-decoration: none; background: none; border: 0; }
.rv-link:hover { text-decoration: underline; }
.rv-link.quiet { font-weight: 500; color: var(--muted); }
.rv-foot .rv-btn { margin-top: 14px; }
.rv-actions { display: grid; gap: 10px; margin-top: 8px; }
.rv-buy-note { margin-top: 10px; font-size: 14px; text-align: center; color: var(--muted); }

/* ── Lista ── */
.rv-list-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 14px; }
.rv-list-head h2 { margin-right: auto; font-size: 22px; }
.rv-search { flex: 1 1 100%; }
.rv-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.rv-filter { min-height: 40px; padding: 6px 14px; font-size: 14px; font-weight: 600; color: var(--muted); background: transparent; border: 1px solid #353e52; border-radius: 999px; }
.rv-filter:hover { color: var(--text); }
.rv-filter.on { color: var(--text); background: var(--accent-soft); border-color: rgba(232, 51, 58, .55); }
.rv-rows { display: grid; gap: 8px; margin-top: 14px; }
.rv-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 14px; padding: 13px 16px; background: #121725; border: 1px solid #262d3d; border-radius: 14px; }
.rv-row:hover { border-color: #353e52; }
.rv-row.sel { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.rv-row-main { min-width: 0; padding: 0; text-align: left; background: none; border: 0; }
.rv-row-name { display: block; overflow: hidden; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.rv-row-sub { display: block; overflow: hidden; font-size: 14px; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.rv-row-state { text-align: right; }
.rv-row-date { display: block; margin-top: 3px; font-size: 13px; color: var(--muted); }
.rv-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; font-size: 13px; font-weight: 700; white-space: nowrap; border: 1px solid transparent; border-radius: 999px; }
.rv-chip::before { content: ""; width: 7px; height: 7px; background: currentColor; border-radius: 50%; }
.rv-chip.ok { color: #34d399; background: rgba(52, 211, 153, .13); }
.rv-chip.warn { color: #fbbf24; background: rgba(251, 191, 36, .13); }
.rv-chip.bad { color: #ff8a8e; background: rgba(232, 51, 58, .14); }
.rv-chip.none { color: var(--muted); background: #181e2f; border-color: #353e52; }
.rv-note { padding: 28px 16px; text-align: center; color: var(--muted); }

@media (min-width: 961px) {
  /* Com a lista aberta o formulário cresce: rola dentro do cartão, sem mexer na lista de clientes,
     e o plano com o botão principal ficam sempre à vista no pé do cartão. */
  .rv-card { max-height: calc(100vh - 116px); overflow-y: auto; padding-bottom: 12px; scroll-padding-bottom: 190px; }
  .rv-foot { position: sticky; bottom: -12px; z-index: 2; margin: 0 -24px; padding: 2px 24px 14px; background: #141a2a; }
}
@media (max-width: 1180px) {
  .rv-manage { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 960px) {
  .rv-layout { grid-template-columns: minmax(0, 1fr); }
  .rv-card { position: static; }
}
@media (max-width: 640px) {
  .rv-top-in { height: 62px; gap: 10px; padding: 0 16px; }
  .rv-logo small { display: none; }
  .rv-top-in { flex-wrap: wrap; height: auto; padding-top: 10px; padding-bottom: 10px; }
  .rv-tabs { order: 5; flex: 1 1 100%; margin-right: 0; }
  .rv-tabs button { flex: 1; }
  .rv-layout { gap: 18px; padding: 16px 16px 40px; }
  .rv-card { padding: 18px; border-radius: 18px; }
  .rv-row { grid-template-columns: minmax(0, 1fr) auto; padding: 12px 14px; }
  .rv-row-state { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; grid-column: 1; grid-row: 2; text-align: left; }
  .rv-row-date { margin: 0; }
  .rv-row-act { grid-column: 2; grid-row: 1 / span 2; }
}
@media (prefers-reduced-motion: reduce) { #revenda-app * { transition: none !important; animation-duration: 2s !important; } }

/* Confirmação de transação: fica acima das telas e da gaveta do admin. */
.tx-overlay { position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(3, 5, 12, .72); overflow-y: auto; }
.tx-box { width: 100%; max-width: 420px; margin: auto; padding: 22px; color: #eef1f7; font-size: 16px; line-height: 1.45; background: #121725; border: 1px solid #353e52; border-radius: 16px; box-shadow: 0 24px 60px rgba(0, 0, 0, .55); }
.tx-box h2 { margin: 0 0 12px; font-size: 21px; line-height: 1.25; color: #eef1f7; }
.tx-rows { display: grid; gap: 2px; }
.tx-row { display: flex; justify-content: space-between; gap: 16px; padding: 7px 0; border-bottom: 1px solid #262d3d; color: #9aa4b8; }
.tx-row b { font-weight: 600; color: #eef1f7; text-align: right; overflow-wrap: anywhere; }
.tx-row.strong b { font-weight: 800; font-size: 18px; }
.tx-note { margin: 12px 0 0; font-size: 14px; color: #9aa4b8; }
.tx-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 18px; }
.tx-btn { min-height: 48px; padding: 8px 10px; font: inherit; font-size: 15px; font-weight: 700; color: #eef1f7; background: #181e2f; border: 1px solid #353e52; border-radius: 12px; cursor: pointer; }
.tx-btn:hover { border-color: #9aa4b8; }
.tx-btn:disabled { opacity: .45; cursor: not-allowed; }
.tx-word { display: grid; gap: 6px; margin-top: 14px; font-size: 14px; color: #eef1f7; }
.tx-word input { min-height: 48px; padding: 8px 12px; font: inherit; font-size: 16px; color: #eef1f7; background: #0b0f19; border: 1px solid #3a4358; border-radius: 10px; }
.tx-word input:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.tx-btn.primary { color: #fff; background: #e8333a; border-color: #e8333a; }
.tx-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
