:root {
  --bg: #F4F5F8; --surface: #FFFFFF; --ink: #14161C; --ink-2: #2A2F3A; --muted: #5A6070;
  --line: #E3E6EC; --line-2: #EEF0F4; --input: #CBD0DA; --navy: #10162B; --navy-2: #1F2847; --navy-3: #2A3457;
  --accent: #2443D6; --accent-soft: #E6EBFF; --ok: #0A6B49; --ok-soft: #E3F4EC; --warn: #8A5A00; --warn-soft: #FFF4D6;
  --bad: #A3321A; --bad-soft: #FDE7E2; --gray-soft: #F1F3F7;
  --display: 'Bricolage Grotesque', system-ui, sans-serif; --body: 'DM Sans', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 15px; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--display); margin: 0; }
h1 { font-size: 30px; } h2 { font-size: 20px; }
code { font-size: 12px; background: var(--gray-soft); padding: 3px 8px; border-radius: 6px; color: #4A5060; }

.shell { min-height: 100vh; display: flex; flex-wrap: wrap; }
.rail { flex: 0 0 64px; background: var(--navy); padding: 16px 0; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.rail-logo { width: 40px; height: 40px; border-radius: 12px; background: #fff; color: var(--navy); display: flex; align-items: center; justify-content: center; font-family: var(--display); font-weight: 700; margin-bottom: 12px; }
.rail a { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; text-decoration: none; font-weight: 700; }
.rail-app { background: var(--navy-3); color: #9DB0FF; }
.rail-app.soon { color: #FFB27A; opacity: .75; }
.rail-app.is-active { background: var(--accent); color: #fff; outline: 2px solid #fff; outline-offset: 2px; }
.rail-gear { margin-top: auto; color: #C9CFE0; }
.rail-gear.is-active { background: #fff; color: var(--navy); }

.submenu { flex: 1 1 220px; max-width: 100%; background: var(--surface); border-right: 1px solid var(--line); padding: 22px 14px; display: flex; flex-direction: column; gap: 4px; }
.submenu-title { font-family: var(--display); font-size: 20px; font-weight: 700; padding: 0 12px 18px; }
.submenu a { display: flex; align-items: center; justify-content: space-between; min-height: 42px; padding: 0 12px; border-radius: 10px; color: var(--ink-2); text-decoration: none; }
.submenu a:hover { background: var(--gray-soft); }
.submenu a.is-active { background: var(--navy); color: #fff; font-weight: 600; }
.submenu a.disabled { color: #8C94AB; cursor: default; }
.pill-beta { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }

.main { flex: 999 1 560px; min-width: 0; padding: 32px 36px; display: flex; flex-direction: column; gap: 20px; outline: none; }
.crumb { font-size: 14px; color: var(--muted); }
.lead { margin: 8px 0 0; color: var(--muted); max-width: 660px; line-height: 1.5; }
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; }
.row { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.grow-1 { flex: 1 1 320px; min-width: 0; } .grow-2 { flex: 1.4 1 420px; min-width: 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 22px; }
.card > h2 { margin-bottom: 12px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.grid { display: grid; gap: 14px; }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g6 { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 1100px) { .g6 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .g4, .g3, .g6 { grid-template-columns: 1fr 1fr; } .main { padding: 24px 16px; } }

.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.kpi .lbl { font-size: 13px; color: var(--muted); }
.kpi .val { font-family: var(--display); font-size: 30px; font-weight: 700; margin-top: 4px; }
.stage { display: flex; flex-direction: column; gap: 6px; padding: 14px; border-radius: 12px; background: #F7F8FA; text-decoration: none; color: var(--ink); border-top: 4px solid #B8BECB; }
.stage .lbl { font-size: 13px; color: #4A5060; } .stage .val { font-family: var(--display); font-size: 24px; font-weight: 700; }
.alert-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 0 12px; border-radius: 10px; background: #F7F8FA; color: var(--ink); text-decoration: none; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 10px; }
.kv { display: flex; justify-content: space-between; font-size: 14px; border-bottom: 1px solid var(--line-2); padding-bottom: 10px; }
.kv:last-child { border-bottom: 0; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--input); background: #fff; font-weight: 600; cursor: pointer; text-decoration: none; color: var(--ink); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.dark { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn[disabled] { opacity: .6; cursor: wait; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { min-height: 38px; padding: 0 14px; border-radius: 999px; font-size: 13px; font-weight: 600; cursor: pointer; border: 1px solid var(--input); background: #fff; }
.chip.is-on { background: var(--navy); border-color: var(--navy); color: #fff; }
a.chip { display: inline-flex; align-items: center; text-decoration: none; color: var(--ink); }
a.chip.is-on { color: #fff; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > span, .field > label { font-weight: 600; font-size: 14px; }
.input, select.input, textarea.input { min-height: 44px; padding: 0 12px; border: 1px solid var(--input); border-radius: 10px; background: #fff; width: 100%; }
textarea.input { padding: 10px 12px; min-height: 80px; resize: vertical; }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; min-height: 36px; }
.hint { font-size: 13px; color: var(--muted); line-height: 1.5; }

.switch { width: 46px; height: 26px; border-radius: 999px; border: 0; padding: 3px; background: #B8BECB; display: flex; justify-content: flex-start; cursor: pointer; flex: none; }
.switch::after { content: ""; width: 20px; height: 20px; border-radius: 50%; background: #fff; }
.switch[aria-checked="true"] { background: var(--accent); justify-content: flex-end; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; color: var(--muted); font-weight: 500; padding: 12px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 13px 8px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.badge { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--gray-soft); color: #4A5060; white-space: nowrap; display: inline-block; }
.b-pending_payment { background: var(--gray-soft); color: #4A5060; }
.b-paid { background: var(--gray-soft); color: #4A5060; }
.b-in_transit, .b-out_for_delivery { background: var(--accent-soft); color: var(--accent); }
.b-delivered, .b-ok { background: var(--ok-soft); color: var(--ok); }
.b-cancelled, .b-late, .b-failed { background: var(--bad-soft); color: var(--bad); }
.b-warn, .b-pending { background: var(--warn-soft); color: var(--warn); }

.progress { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.progress li { display: flex; flex-direction: column; gap: 8px; font-size: 13px; color: var(--muted); }
.progress li::before { content: ""; height: 8px; border-radius: 999px; background: var(--line); }
.progress li.done { color: var(--ink); } .progress li.done::before { background: var(--accent); }
.progress li.now { color: var(--ink); font-weight: 700; } .progress li.now::before { background: #C98A00; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: 14px; }
.timeline .rail-l { display: flex; flex-direction: column; align-items: center; }
.timeline .tdot { width: 12px; height: 12px; border-radius: 50%; margin-top: 4px; background: var(--accent); }
.timeline .tline { flex: 1; width: 2px; min-height: 16px; background: var(--line); }
.timeline li:last-child .tline { background: transparent; }
.timeline .tbody { padding-bottom: 14px; flex: 1; min-width: 0; }
.timeline .thead { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-weight: 600; }
.src-custom .tdot { background: #7A3FD1; } .src-nuvemshop .tdot { background: var(--ok); } .src-system .tdot { background: #C98A00; }

.banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; background: var(--navy); color: #fff; border-radius: 14px; padding: 16px 20px; }
.banner a { color: #fff; font-weight: 600; }
.code-box { display: flex; gap: 8px; }
.code-box code { flex: 1; min-width: 0; display: flex; align-items: center; padding: 0 14px; min-height: 48px; border-radius: 10px; background: var(--navy-2); font-size: 14px; color: #fff; overflow-x: auto; white-space: nowrap; }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.swatch { width: 44px; height: 44px; border-radius: 12px; border: 3px solid #fff; cursor: pointer; box-shadow: 0 0 0 1px var(--line); }
.swatch[aria-pressed="true"] { border-color: var(--ink); }
.seg { display: flex; gap: 8px; flex-wrap: wrap; }
.seg button { min-height: 40px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--input); background: #fff; font-weight: 600; cursor: pointer; }
.seg button[aria-pressed="true"] { border: 2px solid var(--accent); background: var(--accent-soft); }

.preview-bg { background: #ECEDEF; border-radius: 16px; padding: 28px; }
.preview-card { background: #fff; border-radius: 14px; padding: 28px; display: flex; flex-direction: column; gap: 12px; max-width: 420px; margin: 0 auto; }
.preview-card .pv-title { font-family: var(--display); font-size: 24px; font-weight: 700; }
.pv-in { min-height: 46px; border: 1px solid #D5D9E0; border-radius: 8px; display: flex; align-items: center; padding: 0 12px; font-size: 14px; color: #6A7080; }
.pv-or { display: flex; align-items: center; gap: 10px; font-size: 12px; font-weight: 700; color: var(--muted); }
.pv-or::before, .pv-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.pv-btn { min-height: 48px; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; letter-spacing: .04em; }

.int-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px; display: flex; flex-direction: column; gap: 8px; }
.int-card .meta { font-size: 12px; color: var(--muted); font-weight: 600; letter-spacing: .04em; }
.empty { padding: 32px; text-align: center; color: var(--muted); }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 12px; font-size: 14px; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(16px); opacity: 0; pointer-events: none; background: var(--navy); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 600; transition: transform .2s, opacity .2s; z-index: 10; max-width: 90vw; }
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast.err { background: var(--bad); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.acct { margin-top: auto; padding: 14px 12px 4px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.acct-name { font-weight: 700; font-size: 14px; }
.acct-dom { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-links { display: flex; gap: 6px; margin-top: 8px; }
.submenu .acct-links a { min-height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; font-weight: 600; justify-content: center; flex: 1; }

[hidden] { display: none !important; }
.submenu .acct-links a { white-space: nowrap; }

/* Campo de senha com "olhinho" */
.pw-wrap { position: relative; display: block; width: 100%; }
.pw-wrap > input { width: 100%; padding-right: 48px !important; }
.pw-eye { position: absolute; top: 50%; right: 4px; transform: translateY(-50%); width: 40px; height: 40px; border: 0; border-radius: 8px; background: transparent; color: #5A6070; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.pw-eye:hover { background: #F1F3F7; color: #14161C; }
.pw-eye:focus-visible { outline: 2px solid #2443D6; outline-offset: 1px; }
