/* Design system do hub Remo (painel /app e portal de lojas /r). Sem dependências. */
:root {
  --ink: #121111;
  --muted: #5f7683;
  --line: #dfe6e6;
  --line-strong: #c9d4d6;
  --paper: #ffffff;
  --bg: #f4f7f7;
  --remo: #234f60;
  --remo-hover: #173942;
  --remo-soft: #dce6e8;
  --remo-text: #ffffff;
  --ok: #1e6b4f;
  --ok-soft: #ddefe7;
  --warn: #8a5a00;
  --warn-soft: #fbefd5;
  --danger: #8a2e2e;
  --danger-soft: #f7e3e3;
  --side: #10171b;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(18, 17, 17, 0.04), 0 10px 28px -14px rgba(18, 17, 17, 0.16);
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --serif: "Fraunces", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { margin: 0; font-weight: 500; }
p { margin: 0; }
a { color: var(--remo); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--remo); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ------------------------------------------------------------------ shell */
.shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 22px 14px 16px;
  color: #dbe6e9; background: radial-gradient(120% 60% at 30% -10%, rgba(35, 79, 96, 0.55), rgba(16, 23, 27, 0) 60%), var(--side);
}
.brandmark { font: 600 18px var(--serif); color: #fff; padding: 2px 10px 18px; letter-spacing: 0.2px; }
.brandmark span { color: #7fb3c4; }
.tenant { margin: 0 6px 16px; padding: 10px 12px; border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 10px; background: rgba(255, 255, 255, 0.04); }
.tenant small { display: block; color: #8ea6ae; font-size: 11px; text-transform: uppercase; letter-spacing: 0.6px; }
.tenant strong { display: block; color: #fff; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 9px; color: #b9cad0; text-decoration: none; font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.nav a svg { width: 18px; height: 18px; flex: none; opacity: 0.85; }
.nav a:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.nav a[aria-current="page"] { background: rgba(127, 179, 196, 0.16); color: #fff; }
.nav .badge { margin-left: auto; background: #7fb3c4; color: #10171b; font-size: 11px; font-weight: 600; border-radius: 999px; padding: 1px 7px; }
.side-foot { padding: 10px 6px 0; border-top: 1px solid rgba(255, 255, 255, 0.08); display: flex; flex-direction: column; gap: 4px; }
.side-foot button, .side-foot a { all: unset; cursor: pointer; padding: 8px 12px; border-radius: 8px; color: #9db2b9; font-size: 13px; }
.side-foot button:hover, .side-foot a:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.main { padding: 30px 38px 70px; max-width: 1180px; width: 100%; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h1 { font: 500 28px/1.2 var(--serif); }
.page-head p { color: var(--muted); margin-top: 6px; max-width: 62ch; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; height: auto; padding: 12px; flex-direction: row; align-items: center; gap: 8px; flex-wrap: wrap; }
  .brandmark { padding: 0 8px; }
  .tenant, .side-foot span { display: none; }
  .nav { flex-direction: row; overflow-x: auto; flex: 1 1 100%; order: 3; padding-bottom: 4px; }
  .nav a { white-space: nowrap; }
  .side-foot { border: 0; padding: 0; margin-left: auto; flex-direction: row; }
  .main { padding: 20px 16px 60px; }
}

/* ------------------------------------------------------------ primitives */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.card + .card { margin-top: 18px; }
.card h2 { font: 500 17px var(--serif); margin-bottom: 4px; }
.card .sub { color: var(--muted); font-size: 13px; margin-bottom: 16px; max-width: 70ch; }
.grid { display: grid; gap: 16px; }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 1000px) { .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .grid.cols-4, .grid.cols-3, .grid.cols-2 { grid-template-columns: 1fr; } }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; border-radius: 9px; border: 1px solid var(--line-strong);
  background: var(--paper); color: var(--ink); font-weight: 500; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: border-color 0.15s, background 0.15s, transform 0.15s, box-shadow 0.15s;
}
.btn:hover { border-color: var(--remo); transform: translateY(-1px); }
.btn:active { transform: none; }
.btn.primary { background: var(--remo); border-color: var(--remo); color: var(--remo-text); }
.btn.primary:hover { background: var(--remo-hover); box-shadow: 0 8px 18px -8px rgba(35, 79, 96, 0.6); }
.btn.danger { color: var(--danger); border-color: #e2bcbc; }
.btn.danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn.sm { padding: 5px 11px; font-size: 13px; border-radius: 8px; }
.btn.link { border: 0; background: none; padding: 4px 6px; color: var(--remo); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn svg { width: 16px; height: 16px; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 5px; font-weight: 500; }
.field input, .field select, .field textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: 9px; background: #fbfcfc; transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--remo); box-shadow: 0 0 0 3px rgba(35, 79, 96, 0.15); background: #fff; }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 620px) { .row { grid-template-columns: 1fr; } }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 500; background: var(--remo-soft); color: var(--remo); white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.danger { background: var(--danger-soft); color: var(--danger); }
.pill.neutral { background: #eef1f2; color: var(--muted); }
.pill.live::before { animation: pulse 1.6s ease-out infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 currentColor; } 100% { box-shadow: 0 0 0 7px transparent; } }

.banner { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-radius: 10px; margin-bottom: 18px; border: 1px solid; font-size: 13.5px; }
.banner.warn { background: var(--warn-soft); border-color: #ecd49b; color: #5c3d00; }
.banner.danger { background: var(--danger-soft); border-color: #e2bcbc; color: var(--danger); }
.banner.info { background: var(--remo-soft); border-color: #b7cbd0; color: var(--remo-hover); }
.banner svg { width: 18px; height: 18px; flex: none; margin-top: 2px; }

/* KPIs */
.kpi { padding: 18px 20px; }
.kpi small { color: var(--muted); font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; }
.kpi strong { display: block; font: 500 34px/1.15 var(--serif); margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi span { color: var(--muted); font-size: 12.5px; }

.chart { display: flex; align-items: flex-end; gap: 4px; height: 120px; margin-top: 8px; }
.chart .bar { flex: 1; background: var(--remo-soft); border-radius: 4px 4px 0 0; min-height: 3px; position: relative; transition: background 0.15s; }
.chart .bar:hover { background: var(--remo); }
.chart .bar[data-count="0"] { background: #edf1f2; }
.chart-axis { display: flex; justify-content: space-between; color: var(--muted); font-size: 11.5px; margin-top: 6px; }

.progress { height: 6px; background: #e9eef0; border-radius: 999px; overflow: hidden; margin: 10px 0 16px; }
.progress > i { display: block; height: 100%; background: var(--remo); border-radius: 999px; transition: width 0.4s ease; }
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.steps li { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px dashed var(--line); }
.steps li:last-child { border: 0; }
.steps .dot { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line-strong); display: grid; place-items: center; flex: none; color: #fff; }
.steps li.done .dot { background: var(--ok); border-color: var(--ok); }
.steps li.done .t { color: var(--muted); text-decoration: line-through; }
.steps .dot svg { width: 12px; height: 12px; }
.steps .t { flex: 1; }
.steps .t small { display: block; color: var(--muted); }

/* tabelas */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); font-weight: 600; padding: 11px 16px; border-bottom: 1px solid var(--line); background: #fafcfc; white-space: nowrap; }
td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr.click { cursor: pointer; transition: background 0.12s; }
tbody tr.click:hover, tbody tr.click:focus-visible { background: #f5f9f9; }
td .sub { color: var(--muted); font-size: 12.5px; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.toolbar .grow { flex: 1 1 240px; }
.toolbar input, .toolbar select { padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: 9px; background: #fff; width: 100%; }
.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; color: var(--muted); font-size: 13px; }
.empty { text-align: center; padding: 46px 20px; color: var(--muted); }
.empty h3 { font: 500 18px var(--serif); color: var(--ink); margin-bottom: 6px; }
.skeleton { background: linear-gradient(90deg, #eef2f3 25%, #f7f9f9 37%, #eef2f3 63%); background-size: 400% 100%; animation: shimmer 1.3s ease infinite; border-radius: 8px; height: 16px; }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* cartões de plataforma */
.platform { display: flex; flex-direction: column; gap: 10px; text-align: left; cursor: pointer; padding: 18px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s; }
.platform:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--remo); }
.platform .top { display: flex; align-items: center; gap: 12px; }
.platform .logo { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; font: 600 15px var(--serif); color: #fff; background: var(--remo); flex: none; }
.platform strong { font-weight: 600; display: block; }
.platform p { color: var(--muted); font-size: 12.5px; }

/* bloco de código */
.code { position: relative; background: #0f1a1f; color: #d7e6ea; border-radius: 10px; padding: 46px 16px 14px; font: 12.5px/1.6 var(--mono); overflow-x: auto; white-space: pre; }
.code .copy { position: absolute; top: 8px; right: 8px; }
.copyline { display: flex; align-items: center; gap: 8px; background: #f1f5f6; border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; }
.copyline code { flex: 1; font: 12.5px var(--mono); overflow-x: auto; white-space: nowrap; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.tabs button { background: none; border: 0; padding: 8px 14px; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; font-weight: 500; }
.tabs button[aria-selected="true"] { color: var(--remo); border-bottom-color: var(--remo); }

/* gaveta e modal */
.overlay { position: fixed; inset: 0; background: rgba(10, 18, 22, 0.5); backdrop-filter: blur(2px); z-index: 50; animation: fade 0.18s ease; }
@keyframes fade { from { opacity: 0; } }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); background: var(--paper); z-index: 51; box-shadow: -20px 0 60px -20px rgba(0, 0, 0, 0.4); display: flex; flex-direction: column; animation: slide 0.22s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
.drawer-head { padding: 20px 24px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.drawer-head h2 { font: 500 20px var(--serif); }
.drawer-body { padding: 22px 24px; overflow-y: auto; flex: 1; }
.modal { position: fixed; z-index: 52; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 24px); overflow-y: auto; background: var(--paper); border-radius: 14px; padding: 24px; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.5); animation: pop 0.2s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes pop { from { opacity: 0; transform: translate(-50%, -46%); } }
.modal h2 { font: 500 20px var(--serif); margin-bottom: 4px; }
.modal .sub { color: var(--muted); margin-bottom: 18px; }
.modal .foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
.dl { display: grid; grid-template-columns: 140px 1fr; gap: 8px 14px; margin: 0; }
.dl dt { color: var(--muted); font-size: 12.5px; }
.dl dd { margin: 0; overflow-wrap: anywhere; }

.timeline { list-style: none; margin: 0; padding: 0 0 0 4px; }
.timeline li { position: relative; padding: 0 0 16px 22px; }
.timeline li::before { content: ""; position: absolute; left: 0; top: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--remo); }
.timeline li::after { content: ""; position: absolute; left: 4px; top: 16px; bottom: -2px; width: 1px; background: var(--line-strong); }
.timeline li:last-child::after { display: none; }
.timeline small { color: var(--muted); display: block; }

/* toasts */
.toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 80; }
.toast { background: #10171b; color: #fff; padding: 11px 16px; border-radius: 10px; box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.5); animation: pop-t 0.2s ease; max-width: 360px; }
.toast.error { background: var(--danger); }
.toast.ok { background: var(--ok); }
@keyframes pop-t { from { opacity: 0; transform: translateY(8px); } }

/* login */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.login-art { background: radial-gradient(90% 70% at 30% 20%, rgba(35, 79, 96, 0.7), rgba(16, 23, 27, 0) 65%), var(--side); color: #dbe6e9; padding: 60px; display: flex; flex-direction: column; justify-content: space-between; }
.login-art h2 { font: 500 34px/1.2 var(--serif); color: #fff; max-width: 15ch; }
.login-art p { color: #9db2b9; max-width: 42ch; margin-top: 16px; }
.login-art ul { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 12px; color: #c4d4d9; }
.login-art li::before { content: "✓"; color: #7fb3c4; margin-right: 10px; }
.login-form { display: grid; place-items: center; padding: 30px; }
.login-form form { width: min(380px, 100%); }
.login-form h1 { font: 500 28px var(--serif); margin-bottom: 6px; }
@media (max-width: 860px) { .login-wrap { grid-template-columns: 1fr; } .login-art { display: none; } }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; } }
