/* ═══════════════════════════════════════════════════════════
   Sovereign Trust — Painel Administrativo
   Tokens do design system (DESIGN.md): Corporate Modernism.
   Profundo navy #0A2540, esmeralda #10B981, âmbar #F59E0B,
   fundo frio #F6F8FA, cartões brancos 12px, Inter, Material Symbols.
   Experiência "fluida": transições suaves, micro-interações,
   hover states, animações de entrada e layout responsivo.
   ═══════════════════════════════════════════════════════════ */

:root {
  --bg: #F6F8FA;
  --card: #FFFFFF;
  --navy: #0A2540;
  --navy-vivid: #1351B4;
  --emerald: #10B981;
  --emerald-hover: #059669;
  --amber: #F59E0B;
  --red: #EF4444;
  --muted: #4A5568;
  --border: #E2E8F0;
  --radius-card: 12px;
  --radius-control: 8px;
  --shadow-card: 0 1px 3px 0 rgba(10, 37, 64, 0.05), 0 1px 2px -1px rgba(10, 37, 64, 0.05);
  --shadow-pop: 0 4px 6px -1px rgba(10, 37, 64, 0.07), 0 2px 4px -2px rgba(10, 37, 64, 0.05);
}

* { box-sizing: border-box; }

html, body { margin: 0; }
html { scroll-behavior: smooth; }

::selection { background: var(--navy); color: #fff; }

* { scrollbar-width: thin; scrollbar-color: #C9D2DD transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #C9D2DD; border-radius: 999px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #A9B6C6; border: 2px solid transparent; background-clip: content-box; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: #191c1e;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible {
  outline: 2px solid var(--navy-vivid);
  outline-offset: 2px;
}

.hidden { display: none !important; }

.material-symbols-outlined {
  font-family: 'Material Symbols Outlined';
  font-weight: normal;
  font-style: normal;
  font-size: 18px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  vertical-align: middle;
}

/* ── TELA DE LOGIN ── */

#login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(1200px 500px at 50% -10%, rgba(19, 81, 180, 0.10), transparent 60%),
    var(--bg);
}

.login-card {
  position: relative;
  width: 100%;
  max-width: 400px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 36px 32px;
  display: grid;
  gap: 18px;
  overflow: hidden;
  animation: card-in 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.login-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--navy), var(--navy-vivid) 55%, var(--emerald));
}

@keyframes card-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

@keyframes card-shake {
  0%, 100% { transform: none; }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}

.login-brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.brand-icon {
  font-size: 34px;
  color: var(--navy);
}
.brand-icon.sm { font-size: 20px; }

.login-brand h1 {
  font-size: 18px;
  font-weight: 700;
  color: var(--navy);
  margin: 0;
}
.login-brand p {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.login-hint { margin: 0; font-size: 12px; color: var(--muted); }
.login-hint code {
  background: #F2F4F6;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 12px;
}

/* ── CAMPOS E BOTÕES ── */

.field { display: grid; gap: 6px; }
.field-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}

.input, .select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: #fff;
  font-family: inherit;
  font-size: 14px;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
.input:hover, .select:hover { border-color: #CBD5E1; }
.input:focus, .select:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(10, 37, 64, 0.10);
  background: #fff;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 20px;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .18s, color .18s, border-color .18s, transform .12s, box-shadow .18s;
}
.btn:active { transform: scale(0.98); }

.btn-primary { background: var(--emerald); color: #fff; box-shadow: 0 1px 2px rgba(16, 185, 129, 0.35); }
.btn-primary:hover { background: var(--emerald-hover); box-shadow: 0 10px 22px -10px rgba(5, 150, 105, 0.65), var(--shadow-pop); transform: translateY(-1px); }

.btn-secondary { background: #fff; color: var(--navy); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--navy); box-shadow: var(--shadow-pop); transform: translateY(-1px); }

.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { background: #F2F4F6; color: var(--navy); }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  transition: border-color .18s, color .18s, background .18s, transform .12s, box-shadow .18s;
}
.icon-btn:hover { border-color: var(--navy); color: var(--navy); box-shadow: var(--shadow-card); }
.icon-btn:active { transform: scale(0.94); }
.icon-btn .material-symbols-outlined { font-size: 16px; }

.form-error {
  margin: 0;
  min-height: 18px;
  font-size: 13px;
  color: var(--red);
}

/* ── TOPBAR ── */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 12px 28px;
  background: linear-gradient(180deg, #0E2C4C, var(--navy));
  color: #fff;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06), 0 10px 30px -18px rgba(10, 37, 64, 0.65);
}

.topbar-brand { display: flex; align-items: center; gap: 10px; }
.topbar-brand .brand-icon { color: var(--emerald); }
.topbar-title { font-size: 15px; font-weight: 700; letter-spacing: 0.01em; }
.topbar-sub {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}

.topbar-nav { display: flex; gap: 6px; margin-left: auto; }

.nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .18s, color .18s, border-color .18s;
}
.nav-tab .material-symbols-outlined { font-size: 16px; }
.nav-tab:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }
.nav-tab.active {
  color: #fff;
  background: rgba(16, 185, 129, 0.18);
  border-color: rgba(16, 185, 129, 0.5);
  box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.12), 0 4px 14px -8px rgba(16, 185, 129, 0.7);
}

.topbar-user { display: flex; align-items: center; gap: 12px; margin-left: 12px; }
.topbar-username {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
}
.topbar-user .icon-btn { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.18); color: #fff; }
.topbar-user .icon-btn:hover { background: rgba(239, 241, 243, 0.16); color: #fff; }

/* ── CONTEÚDO ── */

.content {
  padding: 28px;
  max-width: 1160px;
  margin: 0 auto;
  display: grid;
  gap: 24px;
}

.view-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--navy);
  margin: 0 0 4px;
}

.view { animation: view-in .45s cubic-bezier(0.22, 1, 0.36, 1); }
@keyframes view-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 20px;
  transition: box-shadow .25s ease, border-color .25s ease;
}
.card:hover { box-shadow: 0 12px 30px -22px rgba(10, 37, 64, 0.45); }

.card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  color: var(--navy);
}
.card-head .material-symbols-outlined { color: var(--navy-vivid); font-size: 20px; }
.card-head h3 { margin: 0; font-size: 15px; font-weight: 700; color: var(--navy); }

/* ── CARDS DE ESTATÍSTICA ── */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin: 18px 0;
}

.stat-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 18px;
  overflow: hidden;
  transition: transform .2s cubic-bezier(0.22, 1, 0.36, 1), box-shadow .2s;
  animation: stat-in .5s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes stat-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-pop); }

.stat-card .stat-icon {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  margin-bottom: 12px;
}
.stat-card .stat-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.stat-card .stat-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 2px;
}

.stat-total .stat-icon { background: #D2E4FF; color: #314865; }
.stat-transit .stat-icon { background: #D2E4FF; color: var(--navy-vivid); }
.stat-outfor .stat-icon { background: #FFEBD8; color: #B45309; }
.stat-delivered .stat-icon { background: #D1FAE5; color: #047857; }
.stat-exception .stat-icon { background: #FDE2E2; color: #93000A; }

/* ── LISTA DE EVENTOS RECENTES ── */

.recent-list { list-style: none; margin: 0; padding: 0; }
.recent-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 10px;
  margin: 0 -10px;
  border-bottom: 1px solid var(--border);
  border-radius: 8px;
  transition: background .16s ease;
}
.recent-item:hover { background: #F2F4F6; }
.recent-item:last-child { border-bottom: none; }
.recent-dot {
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 9999px;
  margin-top: 4px;
}
.dot-created { background: #9aa1ab; }
.dot-in_transit { background: var(--navy-vivid); }
.dot-out_for_delivery { background: var(--amber); }
.dot-delivered { background: var(--emerald); }
.dot-exception { background: var(--red); }
.recent-text { flex: 1; min-width: 0; }
.recent-text .recent-status { font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.recent-text .recent-msg { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-meta { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ── BARRA DE FILTROS + TABELA ── */

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0;
}
.filter-bar .select { width: 200px; }
.filter-bar .input { flex: 1; min-width: 220px; }

.table-card { padding: 0; overflow: hidden; }

.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  background: #F2F4F6;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.table tbody tr { transition: background .15s; }
.table tbody tr:hover { background: #F2F4F6; }
.table tbody tr:hover .code-cell { color: var(--navy-vivid); }
.table tbody tr:last-child td { border-bottom: none; }

.code-cell { font-weight: 600; color: var(--navy); font-variant-numeric: tabular-nums; transition: color .15s; }

.empty { padding: 32px; text-align: center; color: var(--muted); }

/* ── STATUS CHIPS ── */

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.chip-created { background: #E6E8EA; color: #43474D; }
.chip-in_transit { background: #D2E4FF; color: #314865; }
.chip-out_for_delivery { background: #FFEBD8; color: #B45309; }
.chip-delivered { background: #D1FAE5; color: #047857; }
.chip-exception { background: #FDE2E2; color: #93000A; }
.status-chip .material-symbols-outlined { font-size: 13px; }

/* ── AÇÕES DA TABELA ── */

.row-actions { display: flex; gap: 6px; }
.row-actions .icon-btn {
  width: 30px; height: 30px;
  background: transparent;
  border-color: var(--border);
}
.row-actions .icon-btn:hover { background: #F2F4F6; }
.row-actions .icon-btn.danger:hover { border-color: var(--red); color: var(--red); }
.row-actions .icon-btn .material-symbols-outlined { font-size: 15px; }
.th-actions { width: 150px; }

/* ── GAVETA (DETALHES) ── */

.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 37, 64, 0.35);
  z-index: 40;
  animation: fade-in .2s;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.drawer {
  position: fixed;
  top: 0; right: 0;
  height: 100vh;
  width: min(440px, 92vw);
  background: var(--card);
  border-left: 1px solid var(--border);
  box-shadow: -8px 0 24px rgba(10, 37, 64, 0.10);
  z-index: 50;
  display: flex;
  flex-direction: column;
  animation: drawer-in .35s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes drawer-in {
  from { transform: translateX(60px); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  background: linear-gradient(180deg, #0E2C4C, var(--navy));
  color: #fff;
  box-shadow: 0 8px 24px -18px rgba(10, 37, 64, 0.9);
}
.drawer-code { margin: 0; font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.drawer-head .status-chip { margin-top: 8px; }
.drawer-head .icon-btn { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.2); color: #fff; }
.drawer-head .icon-btn:hover { background: rgba(255,255,255,.16); color: #fff; }

.drawer-body { padding: 20px; overflow-y: auto; display: grid; gap: 20px; }

.drawer-meta { display: flex; align-items: center; gap: 12px; }
.drawer-meta-value { margin: 2px 0 0; font-size: 14px; font-weight: 600; color: var(--navy); }
.meta-arrow { color: var(--navy-vivid); font-size: 20px; }

.drawer-subtitle {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}

/* ── LINHA DO TEMPO ── */

.timeline { list-style: none; margin: 0; padding: 0 0 0 6px; position: relative; }
.timeline::before {
  content: "";
  position: absolute;
  left: 11px; top: 6px; bottom: 6px;
  width: 2px;
  background: var(--border);
}
.timeline-item {
  position: relative;
  padding: 0 0 18px 32px;
}
.timeline-item::before {
  content: "";
  position: absolute;
  left: 6px; top: 2px;
  width: 12px; height: 12px;
  border-radius: 9999px;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--border);
}
.timeline-item.t-created::before { background: #9aa1ab; }
.timeline-item.t-in_transit::before { background: var(--navy-vivid); }
.timeline-item.t-out_for_delivery::before { background: var(--amber); }
.timeline-item.t-delivered::before { background: var(--emerald); }
.timeline-item.t-exception::before { background: var(--red); }
.timeline-status { font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.timeline-msg { margin: 2px 0; font-size: 13px; color: var(--muted); }
.timeline-when { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

.event-form { display: grid; gap: 12px; }
.event-form .btn { justify-self: start; }

/* ── MODAL ── */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 37, 64, 0.4);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 60;
  animation: fade-in .18s;
}

.modal {
  width: min(440px, 92vw);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-pop);
  padding: 24px;
  animation: modal-in .28s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes modal-in {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to   { opacity: 1; transform: none; }
}
.modal h3 { margin: 0 0 16px; font-size: 17px; font-weight: 700; color: var(--navy); }
.modal form { display: grid; gap: 14px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }

/* ── TOAST ── */

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(10, 37, 64, 0.97);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius-control);
  box-shadow: 0 18px 40px -18px rgba(10, 37, 64, 0.6), 0 2px 8px rgba(10, 37, 64, 0.2);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  font-size: 13px;
  font-weight: 600;
  max-width: min(92vw, 560px);
  animation: toast-in .3s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 16px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}
.toast .material-symbols-outlined { color: var(--emerald); }
.toast.error { background: #93000A; }
.toast.error .material-symbols-outlined { color: #FFDAD6; }

/* ── RESPONSIVO ── */

@media (max-width: 900px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .topbar { flex-wrap: wrap; row-gap: 10px; padding: 12px 16px; }
  .topbar-nav { margin-left: 0; order: 3; width: 100%; }
  .content { padding: 16px; }
  .filter-bar .select { width: 100%; }
  .table { display: block; overflow-x: auto; }
}

@media (max-width: 560px) {
  .stat-grid { grid-template-columns: 1fr; }
  .topbar-sub { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  html { scroll-behavior: auto; }
}

/* Fluid layout, usable touch targets and scrollable dialogs. */
button, input, select { font: inherit; }
.btn, .icon-btn, .nav-tab, .row-actions .icon-btn { min-height: 44px; }
.icon-btn, .row-actions .icon-btn { min-width: 44px; }
.filter-bar .input { min-width: min(220px, 100%); }
.topbar-brand, .topbar-user, .drawer-meta > div { min-width: 0; }
.topbar-user { margin-left: auto; }
.drawer { height: 100dvh; max-width: 100%; }
.drawer-body { min-height: 0; padding-bottom: max(20px, env(safe-area-inset-bottom)); }
.drawer-meta-value, .drawer-code, .timeline-msg { overflow-wrap: anywhere; }
.modal-overlay { padding: 16px; overflow-y: auto; }
.modal { max-height: calc(100dvh - 32px); overflow-y: auto; }
.table-card { overflow-x: auto; }
.table { min-width: 760px; }
.table td.row-actions { display: table-cell; white-space: nowrap; }
.row-actions .icon-btn { display: inline-flex; vertical-align: middle; }
@media (max-width: 560px) {
  input, select { font-size: 16px; }
  .login-card { padding: 28px 20px; }
  .topbar-brand { flex: 1; }
  .topbar-username { max-width: 90px; overflow: hidden; text-overflow: ellipsis; }
  .topbar-nav { display: flex; }
  .nav-tab { flex: 1; justify-content: center; }
  .filter-bar > * { width: 100%; }
  .filter-bar .input { flex-basis: 100%; }
  .drawer { width: 100%; }
  .recent-meta { max-width: 95px; text-align: right; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .stat-card { padding: 16px; }
}

/* Administration workspace */
:root { --bg: #f5f7fa; --navy: #0a2540; --emerald: #087f64; --emerald-hover: #066b54; }
body { font-size: 14px; }
button, a { -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: not-allowed; opacity: .55; }
textarea { width: 100%; resize: vertical; min-height: 112px; border: 1px solid var(--border); border-radius: 8px; padding: 12px; font: inherit; line-height: 1.6; color: var(--navy); background: #fff; }
textarea:focus-visible { outline: 2px solid #1351b4; outline-offset: 2px; }
.login-brand { display: flex; flex-direction: column; align-items: flex-start; gap: 20px; }
.login-logo { width: 180px; height: 72px; object-fit: contain; }
.login-brand h1 { font-size: 22px; }
.sidebar { width: 248px; position: fixed; inset: 0 auto 0 0; z-index: 30; background: #fff; border-right: 1px solid #e4e9ef; display: flex; flex-direction: column; padding: 26px 16px 20px; }
.sidebar-brand { padding: 0 12px; }
.sidebar-brand img { display: block; width: 184px; height: 74px; object-fit: contain; }
.sidebar-caption { font-size: 10px; font-weight: 700; letter-spacing: .12em; color: #8b98a8; padding: 24px 16px 12px; }
.sidebar nav { display: grid; gap: 6px; }
.sidebar .nav-tab { color: #5f6f82; justify-content: flex-start; gap: 12px; width: 100%; padding: 12px 16px; border-radius: 10px; min-height: 48px; box-shadow: none; }
.sidebar .nav-tab:hover { background: #f2f5f8; color: #0a2540; }
.sidebar .nav-tab.active { background: #e9f6f0; border-color: transparent; color: #087f64; font-weight: 700; }
.sidebar .nav-tab .material-symbols-outlined { font-size: 20px; }
.sidebar-bottom { margin-top: auto; border-top: 1px solid #e9edf2; padding: 18px 12px 0; display: grid; gap: 8px; }
.sidebar-bottom a { font-size: 12px; text-decoration: none; color: #5f6f82; padding: 8px 0; }
.sidebar-bottom a:hover { color: #087f64; }
.sidebar-note { display: flex; gap: 8px; align-items: center; font-size: 11px; color: #79889a; margin-top: 12px; }
.sidebar-note .recent-dot { margin: 0; width: 6px; height: 6px; }
.topbar { margin-left: 248px; width: auto; background: rgba(255,255,255,.96); color: var(--navy); border-bottom: 1px solid var(--border); box-shadow: none; min-height: 84px; padding: 18px 32px; gap: 16px; position: sticky; top: 0; z-index: 20; }
.topbar-sub { display: block; color: #8b98a8; font-size: 9px; letter-spacing: .12em; }
.topbar-title { display: block; margin: 4px 0 0; font-size: 16px; font-weight: 700; }
.topbar-username { color: #516276; }
.topbar-user .icon-btn { color: #64748b; border-color: #e4e9ef; background: #fff; }
.topbar-user .icon-btn:hover { color: #0a2540; background: #f2f5f8; }
.user-avatar, .chat-avatar { width: 34px; height: 34px; display: grid; place-items: center; background: #e9f6f0; color: #087f64; border-radius: 50%; font-size: 11px; font-weight: 700; }
.menu-toggle { display: none; }
.content { margin: 0 0 0 248px; max-width: none; padding: 32px; display: block; }
.content > .view { max-width: 1260px; margin: 0 auto; }
.view-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 24px; }
.eyebrow { font-size: 10px; color: #087f64; letter-spacing: .1em; font-weight: 700; }
.view-title { font-size: clamp(22px, 2vw, 28px); line-height: 1.3; margin: 8px 0; }
.view-description { font-size: 13px; color: #6f7d8f; line-height: 1.7; margin: 0; max-width: 580px; }
.btn { text-decoration: none; font-size: 13px; min-height: 44px; }
.btn-primary { background: #087f64; border-color: #087f64; }
.btn-primary:hover { background: #066b54; border-color: #066b54; }
.btn-secondary { background: #fff; border-color: #dce3ec; color: #0a2540; }
.btn-secondary:hover { background: #f4f7fa; }
.quick-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; margin-bottom: 24px; }
.quick-card { text-align: left; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 20px; border: 1px solid #e2e8f0; border-radius: 12px; background: #fff; cursor: pointer; color: #0a2540; transition: border-color .2s, transform .2s; }
.quick-card:hover { border-color: #9dcab9; transform: translateY(-2px); }
.quick-card strong { font-size: 14px; }
.quick-card > span:not(.quick-icon) { color: #758397; font-size: 12px; line-height: 1.6; }
.quick-card b { font-size: 12px; color: #087f64; margin-top: auto; padding-top: 6px; }
.quick-icon { background: #f0f7f3; color: #087f64; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-size: 20px; }
.stat-grid { margin: 0 0 24px; }
.stat-card { text-align: left; cursor: pointer; min-width: 0; font: inherit; color: var(--navy); }
.stat-value { font-size: 28px; }
.stat-label { font-size: 10px; letter-spacing: .025em; }
.card { box-shadow: 0 2px 6px #0a254004; }
.card-head h3, .stacked-form h3 { font-size: 15px; margin: 0; }
.recent-item { align-items: center; padding: 16px 10px; }
.recent-item .recent-dot { margin-top: 0; }
.recent-msg { margin-top: 4px; }
.recent-meta { font-size: 11px; max-width: 190px; text-align: right; overflow-wrap: anywhere; }
.recent-open { border: 0; background: transparent; padding: 0; color: var(--navy-vivid); font: inherit; text-align: left; cursor: pointer; }
.filter-bar { margin: 0 0 20px; }
.table th { padding: 14px 16px; background: #f8fafc; }
.table td { padding: 16px; }
.table-scroll { width: 100%; overflow: auto; }
.pagination { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; gap: 12px; font-size: 12px; color: #6f7d8f; }
.pagination > div { display: flex; gap: 8px; }
.workflow { display: flex; gap: 24px; margin-bottom: 24px; flex-wrap: wrap; color: #63758a; font-size: 12px; }
.workflow > span { display: flex; align-items: center; gap: 8px; }
.workflow b { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: #e9f6f0; color: #087f64; }
.upload-zone { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; border: 1.5px dashed #c5d2df; border-radius: 12px; padding: 32px 16px; background: #f9fbfd; cursor: pointer; }
.upload-zone:focus-within { outline: 2px solid #1351b4; outline-offset: 3px; }
.upload-zone > .material-symbols-outlined { font-size: 28px; color: #087f64; }
.upload-zone > span:not(.material-symbols-outlined) { font-size: 12px; color: #79889a; }
.upload-zone input { width: min(320px,100%); font-size: 12px; margin-top: 8px; }
.check-label { display: flex; align-items: center; gap: 10px; font-size: 13px; margin-top: 20px; }
.check-label input { accent-color: #087f64; width: 18px; height: 18px; }
.inline-feedback { color: #6f7d8f; font-size: 13px; line-height: 1.6; }
.inline-feedback.error, .import-errors { color: #a53232; }
.inline-feedback.success { color: #087f64; }
.import-card { margin-bottom: 20px; }
.review-summary { display: flex; flex-wrap: wrap; gap: 12px; font-size: 13px; padding: 16px 0; }
.review-summary span { background: #f1f5f9; padding: 8px 12px; border-radius: 8px; }
.import-errors { max-height: 220px; overflow: auto; background: #fff5f5; border-radius: 8px; }
.import-errors:empty { display: none; }
.import-errors p { margin: 0; padding: 8px 12px; font-size: 12px; border-bottom: 1px solid #ffe5e5; }
.action-row { display: flex; gap: 12px; margin-top: 20px; flex-wrap: wrap; }
.hint { font-size: 12px; color: #79889a; line-height: 1.7; margin: 8px 0 0; }
.workspace-grid { display: grid; grid-template-columns: minmax(0,1.25fr) minmax(0,1fr); gap: 24px; align-items: start; }
.stacked-form { display: grid; gap: 20px; }
.stacked-form .btn { justify-self: start; }
.message-preview { background: #f1f6f3; border-color: #dceae2; padding: 24px; }
.chat-preview { display: flex; align-items: center; gap: 12px; margin: 24px 0 20px; }
.chat-preview strong { display: block; font-size: 13px; }
.chat-preview small { font-size: 11px; color: #79889a; }
.chat-bubble { background: #fff; padding: 18px; border-radius: 0 12px 12px; font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.8; box-shadow: 0 2px 4px #0a254009; margin-bottom: 20px; }
.brand-settings { display: grid; gap: 20px; }
.brand-settings img { width: 220px; max-width: 100%; height: auto; }
.brand-settings h3 { margin: 0; font-size: 16px; }
.brand-settings a { justify-self: start; }
.drawer-links { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.drawer-links .btn-primary { grid-column: 1/-1; }
.sidebar-overlay { position: fixed; inset: 0; background: #0a254060; z-index: 31; }
.sidebar-close { display: none; }
.upload-zone input::file-selector-button { border: 1px solid #dce3ec; border-radius: 8px; padding: 10px 12px; background: #fff; color: #0a2540; font: inherit; font-weight: 600; cursor: pointer; margin-right: 8px; min-height: 40px; }
.upload-zone.dragging { border-color: #087f64; background: #e9f6f0; }
.sidebar svg, .quick-icon svg { width: 20px; height: 20px; flex-shrink: 0; }
@media (max-width: 1200px) { .stat-grid { grid-template-columns: repeat(3,minmax(0,1fr)); } }
@media (max-width: 1000px) { .sidebar { width: 220px; } .sidebar-brand img { width: 160px; } .topbar, .content { margin-left: 220px; } .workspace-grid { grid-template-columns: 1fr; } .quick-grid { gap: 12px; } }
@media (max-width: 800px) {
  .sidebar { z-index: 32; width: 264px; transform: translateX(-100%); transition: transform .2s ease; }
  .sidebar.open { transform: none; }
  .sidebar-brand img { width: 184px; }
  .sidebar-close { display: inline-flex; position: absolute; top: 8px; right: 8px; border: 0; }
  .topbar { margin-left: 0; padding: 16px; flex-wrap: nowrap; min-height: 76px; }
  .content { margin-left: 0; padding: 24px 16px; }
  .menu-toggle { display: inline-flex; font-size: 20px; color: #0a2540; }
  .quick-grid { grid-template-columns: 1fr; }
  .quick-card { display: grid; grid-template-columns: 38px 1fr; align-items: center; gap: 6px 14px; padding: 16px; }
  .quick-card .quick-icon { grid-row: 1 / span 3; }
  .quick-card b { padding: 0; }
  .view-heading { align-items: flex-start; }
}
@media (max-width: 560px) {
  .topbar-sub { display: block; font-size: 8px; }
  .topbar-title { font-size: 14px; }
  .topbar-username { display: none; }
  .topbar-user { gap: 8px; }
  .user-avatar { width: 30px; height: 30px; }
  .view-heading { flex-direction: column; gap: 16px; }
  .stat-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .stat-card { padding: 16px 12px; }
  .card { padding: 18px; }
  .table-card { padding: 0; }
  .pagination { flex-wrap: wrap; }
  .pagination > div { width: 100%; justify-content: space-between; }
  .workflow { gap: 12px; }
  .workflow > span { font-size: 11px; }
  .stacked-form .btn { width: 100%; justify-self: stretch; }
  .recent-meta { max-width: 100px; }
}
/* Gateways */
.gateway-overview { display:grid; grid-template-columns:auto auto minmax(0,1fr); gap:32px; align-items:center; background:#eaf5f1; border:1px solid #d6e9e2; border-radius:14px; padding:24px; margin-bottom:20px; }
.gateway-overview strong { display:block; font-size:24px; color:#0a2540; }
.gateway-overview span { display:block; color:#527066; font-size:12px; margin-top:4px; }
.gateway-overview p { font-size:12px; line-height:1.7; color:#527066; margin:0; max-width:520px; }
.gateway-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:20px; }
.gateway-card { display:flex; flex-direction:column; min-width:0; padding:24px; }
.gateway-card-heading { display:flex; flex-direction:column; align-items:flex-start; gap:16px; }
.gateway-logo { display:flex; align-items:center; justify-content:center; width:150px; height:62px; border-radius:9px; background:#0a2540; padding:10px 14px; }
.gateway-logo img { width:100%; height:100%; object-fit:contain; }
.gateway-logo-axxonpay { width:62px; }
.gateway-logo-flevopay { background:#f3f6fa; border:1px solid #e8edf2; }
.gateway-logo-asaas { overflow:hidden; }
.gateway-logo-asaas img { transform:scale(1.7); }
.gateway-status { display:inline-flex; padding:5px 9px; font-size:10px; font-weight:600; border-radius:6px; background:#f0f3f7; color:#64748b; }
.gateway-status-verified { background:#e6f6ee; color:#087f64; }
.gateway-status-configured { background:#eaf0ff; color:#4265a9; }
.gateway-status-error { background:#fff1e8; color:#a25320; }
.gateway-card h3 { font-size:18px; margin:18px 0 10px; }
.gateway-methods { display:flex; gap:6px; flex-wrap:wrap; }
.gateway-methods span { border:1px solid #e0e6ee; padding:3px 9px; border-radius:5px; color:#556679; font-size:11px; }
.gateway-note { font-size:12px; line-height:1.7; color:#64748b; margin:16px 0; flex:1; }
.gateway-meta { font-size:10px; color:#79889a; display:grid; gap:5px; }
.gateway-result { color:#527066; font-size:11px; min-height:36px; line-height:1.6; margin:12px 0 18px; }
.gateway-result.error { color:#a25320; }
.gateway-actions { display:grid; gap:8px; }
.gateway-actions .btn { width:100%; justify-content:center; }
.gateway-card-footer { display:flex; flex-wrap:wrap; justify-content:space-between; align-items:center; gap:10px; border-top:1px solid #eef1f5; padding-top:16px; margin-top:20px; font-size:11px; }
.gateway-card-footer a { color:#64748b; text-decoration:none; }
.gateway-remove { font:inherit; background:none; border:0; color:#a25320; cursor:pointer; padding:6px 0; }
.gateway-security { display:flex; gap:12px; margin-top:28px; color:#64748b; }
.gateway-security svg { flex-shrink:0; }
.gateway-security strong { font-size:12px; }
.gateway-security p { font-size:12px; line-height:1.7; margin:4px 0 0; }
.gateway-dialog { border:1px solid #e0e6ee; border-radius:18px; padding:28px; width:min(520px,calc(100% - 32px)); max-height:calc(100dvh - 32px); overflow:auto; color:#0a2540; box-shadow:0 24px 80px #0a254030; }
.gateway-dialog::backdrop { background:#0a254070; }
.gateway-dialog-head { display:flex; justify-content:space-between; align-items:center; gap:20px; }
.gateway-dialog-head h2 { margin:6px 0 0; font-size:24px; }
.gateway-dialog .view-description { margin:0; font-size:13px; }
.gateway-fields { display:grid; gap:20px; min-width:0; }
.gateway-secret-field { display:flex; align-items:center; gap:8px; }
.gateway-secret-field input { flex:1; min-width:0; width:100%; }
.gateway-reveal { border:0; background:#f0f3f7; color:#526579; padding:10px; border-radius:7px; cursor:pointer; font:inherit; font-size:11px; min-height:44px; }
.gateway-dialog-actions { display:flex; justify-content:space-between; gap:10px; flex-wrap:wrap; }
@media(max-width:1200px) { .gateway-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:800px) { .gateway-overview { grid-template-columns:1fr 1fr; gap:20px; } .gateway-overview p { grid-column:1/-1; } }
@media(max-width:560px) { .gateway-grid { grid-template-columns:1fr; } .gateway-card-heading { flex-direction:row; align-items:center; justify-content:space-between; gap:10px; } .gateway-logo { width:120px; height:56px; } .gateway-logo-axxonpay { width:56px; } .gateway-status { max-width:130px; } .gateway-dialog { padding:20px; } .gateway-dialog-actions { flex-direction:column-reverse; } .gateway-dialog-actions .btn { width:100%; } }
