/* ══════════════════════════════════════════════════════════════
   API BRIDGE — Chora API Revolution (Light)
   Tokens from design-system-light.html
══════════════════════════════════════════════════════════════ */

:root {
  --rev-orange:        #ff5b00;
  --rev-orange-light:  #ff7a2e;
  --rev-orange-pale:   #ff9955;
  --rev-orange-ghost:  rgba(255,91,0,.07);
  --rev-orange-border: rgba(255,91,0,.22);
  --rev-orange-glow:   rgba(255,91,0,.20);
  --rev-bg:            #ffffff;
  --rev-s1:            #fafaf9;
  --rev-s2:            #f4f3f1;
  --rev-s3:            #ecebe8;
  --rev-s4:            #e2e0dc;
  --rev-s5:            #d4d1cd;
  --rev-border:        #ebe9e5;
  --rev-border-strong: #d8d5d0;
  --rev-t1:            #0a0a0a;
  --rev-t2:            #1f1f1f;
  --rev-t3:            #525252;
  --rev-t4:            #737373;
  --rev-t5:            #a3a3a3;
  --rev-green:         #00cc66;
  --rev-blue:          #0099ff;
  --rev-red:           #ff4444;
  --rev-yellow:        #ffaa00;
  --font-display:      'Sora', sans-serif;
  --font-body:         'Outfit', sans-serif;
  --font-mono:         'JetBrains Mono', monospace;
  --ease-out:          cubic-bezier(0.16,1,0.3,1);
  --ease-base:         cubic-bezier(0.4,0,0.2,1);
  --dur-fast:          150ms;
  --dur-base:          200ms;

  /* Density tokens — toggled via Tweaks */
  --density-pad:       16px;
  --density-gap:       14px;
  --density-card-pad:  22px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-font-smoothing: antialiased; }

body {
  font-family: var(--font-body);
  background: var(--rev-bg);
  color: var(--rev-t2);
  line-height: 1.55;
  overflow: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,91,0,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,91,0,.04) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: 0;
}

::selection { background: rgba(255,91,0,.25); color: #000; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--rev-s4); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--rev-s5); }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

/* ══════════════════════════════════════════════════════════════
   APP SHELL
══════════════════════════════════════════════════════════════ */

#root { position: relative; z-index: 1; height: 100vh; overflow: hidden; }

.app-shell {
  display: grid;
  grid-template-rows: auto 1fr;
  height: 100vh;
}

.app-body {
  display: grid;
  grid-template-columns: var(--sidebar-w, 232px) 1fr;
  overflow: hidden;
  min-height: 0;
}

.app-main {
  overflow-y: auto;
  overflow-x: hidden;
  padding: 32px 40px 64px;
  position: relative;
}

.app-main-narrow { max-width: 1180px; margin: 0 auto; }

/* ══════════════════════════════════════════════════════════════
   MARQUEE
══════════════════════════════════════════════════════════════ */

.marquee {
  background: linear-gradient(90deg, var(--rev-bg) 0%, var(--rev-orange-ghost) 50%, var(--rev-bg) 100%);
  border-bottom: 1px solid var(--rev-border);
  overflow: hidden;
  position: relative;
  z-index: 50;
}
.marquee-track {
  display: flex;
  gap: 48px;
  white-space: nowrap;
  padding: 7px 0;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--rev-t3);
  animation: marquee-scroll 38s linear infinite;
  will-change: transform;
}
.marquee-item { display: inline-flex; align-items: center; gap: 12px; }
.marquee-diamond { color: var(--rev-orange); font-size: 8px; }
.marquee-hl { color: var(--rev-orange); }
@keyframes marquee-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ══════════════════════════════════════════════════════════════
   SIDEBAR
══════════════════════════════════════════════════════════════ */

.sidebar {
  background: var(--rev-s1);
  border-right: 1px solid var(--rev-border);
  padding: 20px 14px 24px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  position: relative;
  z-index: 10;
}

.sb-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 18px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--rev-border);
}
.sb-brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--rev-orange) 0%, var(--rev-orange-pale) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 12px;
  color: #000;
  letter-spacing: -0.02em;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(255,91,0,0.25);
}
.sb-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.sb-brand-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 14px;
  letter-spacing: -0.02em;
  color: var(--rev-t1);
}
.sb-brand-sub {
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--rev-orange);
  margin-top: 2px;
}

.sb-section {
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--rev-t5);
  padding: 12px 10px 6px;
}

.sb-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  color: var(--rev-t4);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  transition: color var(--dur-fast), background var(--dur-fast);
  position: relative;
}
.sb-item:hover { color: var(--rev-t2); background: var(--rev-s2); }
.sb-item.active {
  color: var(--rev-t1);
  background: var(--rev-bg);
  font-weight: 600;
  box-shadow: 0 1px 0 var(--rev-border), 0 0 0 1px var(--rev-border);
}
.sb-item.active::before {
  content: '';
  position: absolute;
  left: -14px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--rev-orange);
  border-radius: 0 2px 2px 0;
}
.sb-item-icon {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--rev-t5);
  flex-shrink: 0;
}
.sb-item.active .sb-item-icon { color: var(--rev-orange); }

.sb-badge {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  background: var(--rev-orange-ghost);
  color: var(--rev-orange);
  padding: 1px 6px;
  border-radius: 9999px;
  border: 1px solid var(--rev-orange-border);
}

.sb-user {
  margin-top: auto;
  padding: 10px;
  border-top: 1px solid var(--rev-border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sb-user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--rev-s4);
  border: 2px solid var(--rev-bg);
  box-shadow: 0 0 0 1px var(--rev-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 11px;
  color: var(--rev-t2);
  flex-shrink: 0;
}
.sb-user-info { flex: 1; min-width: 0; }
.sb-user-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--rev-t1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sb-user-mail {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--rev-t4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Rail sidebar (icon-only) */
.app-body.rail { --sidebar-w: 64px; }
.app-body.rail .sb-brand-text,
.app-body.rail .sb-section,
.app-body.rail .sb-item span:not(.sb-item-icon):not(.sb-badge),
.app-body.rail .sb-badge,
.app-body.rail .sb-user-info { display: none; }
.app-body.rail .sidebar { padding: 16px 8px; align-items: center; }
.app-body.rail .sb-brand { padding: 4px 0 14px; justify-content: center; width: 100%; }
.app-body.rail .sb-item {
  justify-content: center;
  padding: 10px 0;
  width: 40px;
  height: 40px;
}
.app-body.rail .sb-item.active::before { left: -8px; }
.app-body.rail .sb-user { padding: 8px 0; justify-content: center; }

/* ══════════════════════════════════════════════════════════════
   PAGE HEADER
══════════════════════════════════════════════════════════════ */

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 20px;
}
.page-head-left { display: flex; flex-direction: column; gap: 6px; }
.page-overline {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--rev-orange);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.page-overline::before {
  content: '';
  width: 18px;
  height: 1px;
  background: var(--rev-orange);
  opacity: 0.5;
}
.page-title {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.035em;
  color: var(--rev-t1);
  line-height: 1.1;
}
.page-sub {
  font-size: 14px;
  color: var(--rev-t4);
  margin-top: 4px;
  max-width: 560px;
}
.page-actions { display: flex; align-items: center; gap: 10px; }

/* ══════════════════════════════════════════════════════════════
   BUTTONS
══════════════════════════════════════════════════════════════ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  border: 1px solid transparent;
  letter-spacing: 0.01em;
  transition: background var(--dur-fast), color var(--dur-fast), border-color var(--dur-fast), box-shadow var(--dur-fast);
  white-space: nowrap;
}
.btn-primary {
  background: var(--rev-orange);
  color: #000;
  box-shadow: 0 1px 0 rgba(0,0,0,0.05), 0 0 0 1px rgba(255,91,0,0.4);
}
.btn-primary:hover { background: var(--rev-orange-light); box-shadow: 0 0 20px rgba(255,91,0,0.25); }
.btn-primary:disabled, .btn-primary[disabled] {
  background: var(--rev-s3);
  color: var(--rev-t5);
  cursor: not-allowed;
  box-shadow: none;
}
.btn-ghost {
  background: transparent;
  border-color: var(--rev-border);
  color: var(--rev-t3);
}
.btn-ghost:hover { color: var(--rev-t1); border-color: var(--rev-border-strong); background: var(--rev-s1); }
.btn-outline {
  background: transparent;
  border-color: var(--rev-orange-border);
  color: var(--rev-orange);
}
.btn-outline:hover { background: var(--rev-orange-ghost); }
.btn-danger {
  background: transparent;
  border-color: rgba(255,68,68,0.3);
  color: var(--rev-red);
}
.btn-danger:hover { background: rgba(255,68,68,0.06); }
.btn-sm { padding: 7px 14px; font-size: 12px; border-radius: 6px; }
.btn-lg { padding: 13px 26px; font-size: 14px; }
.btn-icon {
  padding: 8px;
  border-radius: 7px;
  background: var(--rev-bg);
  border: 1px solid var(--rev-border);
  color: var(--rev-t4);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-icon:hover { color: var(--rev-t1); border-color: var(--rev-border-strong); }
.btn-arrow { display: inline-block; transition: transform var(--dur-fast); }
.btn:hover .btn-arrow { transform: translateX(2px); }
.btn-block { width: 100%; }

/* ══════════════════════════════════════════════════════════════
   BADGES
══════════════════════════════════════════════════════════════ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
  border: 1px solid;
}
.badge-orange { background: var(--rev-orange-ghost); border-color: var(--rev-orange-border); color: var(--rev-orange); }
.badge-green { background: rgba(0,204,102,0.08); border-color: rgba(0,204,102,0.25); color: #00873f; }
.badge-blue { background: rgba(0,153,255,0.08); border-color: rgba(0,153,255,0.25); color: #0066b3; }
.badge-red { background: rgba(255,68,68,0.08); border-color: rgba(255,68,68,0.25); color: #c22929; }
.badge-yellow { background: rgba(255,170,0,0.10); border-color: rgba(255,170,0,0.30); color: #b07000; }
.badge-neutral { background: var(--rev-s2); border-color: var(--rev-s4); color: var(--rev-t4); }

.badge-dot { width: 6px; height: 6px; border-radius: 50%; }
.badge-dot-pulse {
  position: relative;
}
.badge-dot-pulse::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  background: inherit;
  opacity: 0.3;
  animation: pulse-ring 2s ease-out infinite;
}
@keyframes pulse-ring {
  0% { transform: scale(1); opacity: 0.5; }
  100% { transform: scale(2.5); opacity: 0; }
}

/* ══════════════════════════════════════════════════════════════
   CARDS
══════════════════════════════════════════════════════════════ */

.card {
  background: var(--rev-s1);
  border: 1px solid var(--rev-border);
  border-radius: 14px;
  overflow: hidden;
  transition: border-color var(--dur-base), box-shadow var(--dur-base);
}
.card-plain { background: var(--rev-bg); }
.card-accent {
  height: 3px;
  background: linear-gradient(90deg, var(--rev-orange), var(--rev-orange-pale));
}
.card-body { padding: var(--density-card-pad); display: flex; flex-direction: column; gap: 10px; }
.card-label {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--rev-orange);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 600;
}
.card-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--rev-t1);
}
.card-desc { font-size: 13px; color: var(--rev-t4); line-height: 1.6; }
.card-footer {
  padding: 12px 22px;
  border-top: 1px solid var(--rev-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--rev-bg);
}

.card-clickable { cursor: pointer; }
.card-clickable:hover {
  border-color: var(--rev-orange-border);
  box-shadow: 0 4px 24px rgba(255,91,0,0.10), 0 2px 8px rgba(0,0,0,0.03);
}

/* ══════════════════════════════════════════════════════════════
   FORMS
══════════════════════════════════════════════════════════════ */

.field { display: flex; flex-direction: column; gap: 6px; }
.field-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--rev-t3);
  display: flex;
  align-items: center;
  gap: 6px;
}
.field-label-req::after {
  content: '*';
  color: var(--rev-orange);
  font-weight: 700;
}
.field-hint { font-size: 11px; color: var(--rev-t4); }
.field-error { font-size: 11px; color: var(--rev-red); display: flex; align-items: center; gap: 4px; }

.input, .select, .textarea {
  background: var(--rev-s2);
  border: 1px solid var(--rev-border);
  border-radius: 8px;
  padding: 11px 14px;
  font-size: 14px;
  color: var(--rev-t1);
  outline: none;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast), background var(--dur-fast);
  width: 100%;
}
.input::placeholder, .textarea::placeholder { color: var(--rev-t5); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--rev-border-strong); }
.input:focus, .select:focus, .textarea:focus {
  background: var(--rev-bg);
  border-color: rgba(255,91,0,0.5);
  box-shadow: 0 0 0 3px rgba(255,91,0,0.08);
}
.input.is-error, .select.is-error { border-color: rgba(255,68,68,0.5); box-shadow: 0 0 0 3px rgba(255,68,68,0.08); }
.input.is-success { border-color: rgba(0,204,102,0.5); box-shadow: 0 0 0 3px rgba(0,204,102,0.06); }

.input-affix {
  display: flex;
  align-items: stretch;
  background: var(--rev-s2);
  border: 1px solid var(--rev-border);
  border-radius: 8px;
  overflow: hidden;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.input-affix:focus-within {
  border-color: rgba(255,91,0,0.5);
  box-shadow: 0 0 0 3px rgba(255,91,0,0.08);
  background: var(--rev-bg);
}
.input-affix .input {
  border: none;
  background: transparent;
  border-radius: 0;
  padding-left: 12px;
}
.input-affix .input:focus { box-shadow: none; background: transparent; }
.input-affix-prefix, .input-affix-suffix {
  display: flex;
  align-items: center;
  padding: 0 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--rev-t4);
  background: var(--rev-s3);
}
.input-affix-prefix { border-right: 1px solid var(--rev-border); }
.input-affix-suffix { border-left: 1px solid var(--rev-border); }

.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--rev-t3);
}
.checkbox-box {
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--rev-border-strong);
  border-radius: 4px;
  background: var(--rev-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: border-color var(--dur-fast), background var(--dur-fast);
}
.checkbox input { display: none; }
.checkbox input:checked + .checkbox-box {
  background: var(--rev-orange);
  border-color: var(--rev-orange);
}
.checkbox input:checked + .checkbox-box::after {
  content: '';
  width: 8px;
  height: 4px;
  border-left: 2px solid #000;
  border-bottom: 2px solid #000;
  transform: rotate(-45deg) translate(1px, -1px);
}

/* ══════════════════════════════════════════════════════════════
   ALERTS
══════════════════════════════════════════════════════════════ */

.alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid;
  font-size: 13px;
  line-height: 1.55;
}
.alert-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: -1px;
}
.alert-body { flex: 1; }
.alert-title { font-weight: 700; margin-bottom: 2px; }
.alert-info { background: rgba(0,153,255,0.06); border-color: rgba(0,153,255,0.22); color: #0066b3; }
.alert-info .alert-icon { background: rgba(0,153,255,0.15); }
.alert-success { background: rgba(0,204,102,0.06); border-color: rgba(0,204,102,0.22); color: #007a38; }
.alert-success .alert-icon { background: rgba(0,204,102,0.15); }
.alert-warning { background: rgba(255,170,0,0.08); border-color: rgba(255,170,0,0.28); color: #a86600; }
.alert-warning .alert-icon { background: rgba(255,170,0,0.18); }
.alert-danger { background: rgba(255,68,68,0.06); border-color: rgba(255,68,68,0.22); color: #c22929; }
.alert-danger .alert-icon { background: rgba(255,68,68,0.15); }

/* ══════════════════════════════════════════════════════════════
   COPY TOAST
══════════════════════════════════════════════════════════════ */

.copy-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--rev-t1);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 10px 18px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.06);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s var(--ease-out);
  pointer-events: none;
  z-index: 9999;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}
.copy-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.copy-toast::before {
  content: '';
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--rev-orange);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ══════════════════════════════════════════════════════════════
   AUTH (LOGIN/SIGNUP) SCREEN
══════════════════════════════════════════════════════════════ */

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  background: var(--rev-bg);
}
.auth-aside {
  background: linear-gradient(160deg, var(--rev-s1) 0%, var(--rev-s2) 100%);
  border-right: 1px solid var(--rev-border);
  padding: 56px 56px 48px;
  display: flex;
  flex-direction: column;
  gap: 32px;
  position: relative;
  overflow: hidden;
}
.auth-aside::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,91,0,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,91,0,.06) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  mask-image: radial-gradient(ellipse at top right, black 0%, transparent 70%);
}
.auth-aside-content {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 32px;
  flex: 1;
}
.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.auth-brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--rev-orange) 0%, var(--rev-orange-pale) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 16px;
  color: #000;
  box-shadow: 0 6px 24px rgba(255,91,0,0.3);
}
.auth-brand-name {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--rev-t1);
}
.auth-brand-sub {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--rev-orange);
  margin-top: 2px;
}

.auth-hero {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: auto;
  margin-bottom: 24px;
}
.auth-hero-overline {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--rev-orange);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.auth-hero-overline::before {
  content: '';
  width: 22px;
  height: 1px;
  background: var(--rev-orange);
  opacity: 0.5;
}
.auth-hero-title {
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.05;
  color: var(--rev-t1);
}
.auth-hero-title .grad {
  background: linear-gradient(135deg, var(--rev-orange), var(--rev-orange-pale));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.auth-hero-sub {
  font-size: 15px;
  color: var(--rev-t4);
  line-height: 1.65;
  max-width: 420px;
}

.auth-bullets {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.auth-bullet {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 13px;
  color: var(--rev-t3);
  line-height: 1.55;
}
.auth-bullet-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--rev-orange-border);
  background: var(--rev-orange-ghost);
  color: var(--rev-orange);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.auth-trust {
  border-top: 1px solid var(--rev-border);
  padding-top: 18px;
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  color: var(--rev-t4);
  text-transform: uppercase;
  letter-spacing: 0.15em;
}
.auth-trust-item {
  display: flex;
  align-items: center;
  gap: 6px;
}
.auth-trust-item::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--rev-orange);
}

.auth-pane {
  padding: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--rev-bg);
  position: relative;
  z-index: 1;
}
.auth-form-wrap {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.auth-tabs {
  display: flex;
  gap: 4px;
  background: var(--rev-s2);
  border: 1px solid var(--rev-border);
  border-radius: 10px;
  padding: 4px;
}
.auth-tab {
  flex: 1;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 8px 12px;
  border-radius: 7px;
  border: none;
  background: transparent;
  color: var(--rev-t4);
  transition: all var(--dur-fast);
}
.auth-tab.active {
  background: var(--rev-bg);
  color: var(--rev-t1);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.auth-form-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--rev-t1);
}
.auth-form-sub {
  font-size: 13px;
  color: var(--rev-t4);
  margin-top: -16px;
}
.auth-meta {
  font-size: 12px;
  color: var(--rev-t4);
  text-align: center;
}
.auth-meta a { color: var(--rev-orange); font-weight: 600; }

/* ══════════════════════════════════════════════════════════════
   EMPRESAS LIST
══════════════════════════════════════════════════════════════ */

.empresas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: var(--density-gap);
}
.empresa-card {
  background: var(--rev-s1);
  border: 1px solid var(--rev-border);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  cursor: pointer;
  transition: border-color var(--dur-base), box-shadow var(--dur-base), transform var(--dur-base);
}
.empresa-card:hover {
  border-color: var(--rev-orange-border);
  box-shadow: 0 6px 24px rgba(255,91,0,0.10), 0 2px 8px rgba(0,0,0,0.03);
}
.empresa-card.is-error { border-color: rgba(255,68,68,0.25); }
.empresa-card.is-error:hover { border-color: rgba(255,68,68,0.4); box-shadow: 0 6px 24px rgba(255,68,68,0.08); }
.empresa-card-top {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 20px 14px;
}
.empresa-logo {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--rev-bg);
  border: 1px solid var(--rev-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 16px;
  color: var(--rev-orange);
  flex-shrink: 0;
  letter-spacing: -0.02em;
}
.empresa-info { flex: 1; min-width: 0; }
.empresa-name {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--rev-t1);
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.empresa-cnpj {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--rev-t4);
  letter-spacing: 0.04em;
}

.empresa-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--rev-border);
  border-top: 1px solid var(--rev-border);
  border-bottom: 1px solid var(--rev-border);
}
.empresa-stat {
  background: var(--rev-s1);
  padding: 10px 20px;
}
.empresa-stat-label {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--rev-t5);
  margin-bottom: 3px;
}
.empresa-stat-val {
  font-size: 13px;
  font-weight: 600;
  color: var(--rev-t2);
}

.empresa-card-foot {
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--rev-bg);
  gap: 10px;
}
.empresa-foot-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--rev-t4);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Inline card variant */
.empresa-card.layout-row .empresa-card-top { flex: 1; align-items: center; }
.empresa-card.layout-row .empresa-stats { display: none; }
.empresa-card.layout-row .empresa-card-foot {
  padding: 14px 20px;
  background: var(--rev-s1);
  border-top: 1px solid var(--rev-border);
}

/* Empty new-empresa card */
.empresa-new {
  border: 1.5px dashed var(--rev-border-strong);
  border-radius: 14px;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 10px;
  padding: 32px 20px;
  cursor: pointer;
  color: var(--rev-t4);
  font-size: 13px;
  font-weight: 600;
  transition: border-color var(--dur-base), background var(--dur-base), color var(--dur-base);
  min-height: 180px;
}
.empresa-new:hover {
  border-color: var(--rev-orange-border);
  background: var(--rev-orange-ghost);
  color: var(--rev-orange);
}
.empresa-new-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1.5px dashed var(--rev-border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color var(--dur-base), color var(--dur-base);
}
.empresa-new:hover .empresa-new-icon { border-color: var(--rev-orange); color: var(--rev-orange); }

/* ══════════════════════════════════════════════════════════════
   DASHBOARD
══════════════════════════════════════════════════════════════ */

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 20px;
  align-items: start;
}
.dashboard-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.connection-header {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  padding: 22px 24px;
  background: var(--rev-s1);
  border: 1px solid var(--rev-border);
  border-radius: 14px;
}
.connection-header-info { flex: 1; min-width: 0; }
.connection-header-top {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.connection-name {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--rev-t1);
}
.connection-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--rev-t4);
}
.connection-meta-item { display: inline-flex; align-items: center; gap: 6px; }
.connection-meta-sep { color: var(--rev-s5); }

/* OAuth Flow Map */
.flow-map {
  background: var(--rev-bg);
  border: 1px solid var(--rev-border);
  border-radius: 14px;
  padding: 24px;
}
.flow-map-title {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--rev-t4);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.flow-map-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--rev-border);
}
.flow-nodes {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr;
  align-items: center;
  gap: 8px;
}
.flow-node {
  background: var(--rev-s1);
  border: 1px solid var(--rev-border);
  border-radius: 10px;
  padding: 12px 8px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: all var(--dur-base);
}
.flow-node.active {
  border-color: var(--rev-orange-border);
  background: var(--rev-orange-ghost);
  box-shadow: 0 0 0 3px rgba(255,91,0,0.04);
}
.flow-node-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--rev-bg);
  border: 1px solid var(--rev-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--rev-t3);
}
.flow-node.active .flow-node-icon {
  border-color: var(--rev-orange-border);
  background: var(--rev-bg);
  color: var(--rev-orange);
}
.flow-node-label {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--rev-t3);
}
.flow-node.active .flow-node-label { color: var(--rev-orange); }
.flow-arrow {
  color: var(--rev-s5);
  display: flex;
  align-items: center;
}
.flow-arrow.active { color: var(--rev-orange); }
.flow-arrow-line {
  width: 100%;
  height: 1px;
  background: var(--rev-s4);
  position: relative;
}
.flow-arrow.active .flow-arrow-line {
  background: linear-gradient(90deg, var(--rev-orange), var(--rev-orange-pale));
}

/* URL Box variants */
.url-block { display: flex; flex-direction: column; gap: 10px; }
.url-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--rev-t3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.url-label-sub {
  font-family: var(--font-mono);
  font-size: 9px;
  text-transform: none;
  letter-spacing: 0.04em;
  color: var(--rev-t5);
  font-weight: 500;
}

/* URL Style: Input + Button */
.url-input-row {
  display: flex;
  background: var(--rev-s2);
  border: 1px solid var(--rev-border);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.url-input-row:hover { border-color: var(--rev-border-strong); }
.url-input-row .url-text {
  flex: 1;
  padding: 12px 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--rev-t2);
  background: transparent;
  border: none;
  outline: none;
  min-width: 0;
  letter-spacing: 0.02em;
}
.url-input-row .url-copy {
  background: var(--rev-orange);
  color: #000;
  padding: 0 20px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: background var(--dur-fast);
}
.url-input-row .url-copy:hover { background: var(--rev-orange-light); }

/* URL Style: Monospace card */
.url-mono {
  background: var(--rev-bg);
  border: 1px solid var(--rev-border);
  border-radius: 10px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.url-mono-text {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--rev-t2);
  line-height: 1.6;
  word-break: break-all;
  letter-spacing: 0.02em;
}
.url-mono-text .url-host { color: var(--rev-t4); }
.url-mono-text .url-token { color: var(--rev-orange); font-weight: 600; }
.url-mono-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px dashed var(--rev-border);
  gap: 8px;
}

/* URL Style: Terminal */
.url-term {
  background: #0c0c0c;
  border: 1px solid #1f1f1f;
  border-radius: 10px;
  overflow: hidden;
}
.url-term-head {
  padding: 9px 14px;
  background: #131313;
  border-bottom: 1px solid #1f1f1f;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
}
.url-term-dots { display: flex; gap: 5px; }
.url-term-dot { width: 7px; height: 7px; border-radius: 50%; background: #2a2a2a; }
.url-term-dot.live { background: var(--rev-orange); box-shadow: 0 0 6px rgba(255,91,0,0.5); }
.url-term-body { padding: 14px 16px; }
.url-term-line {
  font-family: var(--font-mono);
  font-size: 12px;
  color: rgba(255,255,255,0.85);
  line-height: 1.7;
  word-break: break-all;
}
.url-term-line .term-prompt { color: var(--rev-orange); }
.url-term-line .term-host { color: rgba(255,255,255,0.5); }
.url-term-line .term-token { color: var(--rev-orange); }
.url-term-foot {
  border-top: 1px solid #1f1f1f;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
}
.url-term-copy {
  background: rgba(255,91,0,0.15);
  border: 1px solid rgba(255,91,0,0.3);
  color: var(--rev-orange);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 5px;
  cursor: pointer;
  transition: background var(--dur-fast);
}
.url-term-copy:hover { background: rgba(255,91,0,0.25); }

/* Stat tiles */
.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}
.stat-tile {
  background: var(--rev-s1);
  border: 1px solid var(--rev-border);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat-tile-label {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--rev-t5);
}
.stat-tile-val {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--rev-t1);
  line-height: 1;
}
.stat-tile-sub {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--rev-t4);
}
.stat-tile-trend {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--rev-green);
}

/* Token timer (30min) */
.token-timer {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.token-timer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.token-timer-title {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--rev-t3);
}
.token-timer-ring-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 0 6px;
}
.token-timer-ring {
  width: 168px;
  height: 168px;
  position: relative;
}
.token-timer-ring svg {
  transform: rotate(-90deg);
  width: 100%;
  height: 100%;
}
.token-timer-ring-bg { stroke: var(--rev-s3); }
.token-timer-ring-fill { stroke: var(--rev-orange); transition: stroke-dashoffset 0.6s var(--ease-out), stroke 0.3s; }
.token-timer-ring-fill.warn { stroke: var(--rev-yellow); }
.token-timer-ring-fill.danger { stroke: var(--rev-red); }
.token-timer-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}
.token-timer-num {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--rev-t1);
  line-height: 1;
}
.token-timer-unit {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--rev-t4);
}
.token-timer-foot {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: center;
  padding-top: 4px;
  border-top: 1px solid var(--rev-border);
  padding-top: 14px;
}
.token-timer-explain {
  font-size: 12px;
  color: var(--rev-t4);
  line-height: 1.55;
}
.token-timer-explain .strong { color: var(--rev-t2); font-weight: 600; }

/* Live indicator */
.live-pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--rev-green);
  position: relative;
  flex-shrink: 0;
}
.live-pulse::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: var(--rev-green);
  opacity: 0.4;
  animation: live-ping 1.8s ease-out infinite;
}
@keyframes live-ping {
  0% { transform: scale(0.6); opacity: 0.5; }
  100% { transform: scale(2); opacity: 0; }
}

/* ══════════════════════════════════════════════════════════════
   OAUTH FLOW STAGE
══════════════════════════════════════════════════════════════ */

.oauth-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 56px 40px;
  background: var(--rev-s1);
  border: 1px solid var(--rev-border);
  border-radius: 16px;
  min-height: 540px;
  gap: 24px;
  position: relative;
  overflow: hidden;
}
.oauth-stage::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--rev-orange), transparent);
}
.oauth-step {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--rev-orange);
}
.oauth-stage-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.035em;
  color: var(--rev-t1);
  line-height: 1.15;
  max-width: 480px;
}
.oauth-stage-sub {
  font-size: 14px;
  color: var(--rev-t4);
  line-height: 1.65;
  max-width: 420px;
}
.oauth-spinner {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 3px solid var(--rev-s3);
  border-top-color: var(--rev-orange);
  animation: spin 1s linear infinite;
}
.oauth-spinner-lg {
  width: 86px;
  height: 86px;
  border-width: 4px;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.oauth-check {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(0,204,102,0.08);
  border: 2px solid rgba(0,204,102,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--rev-green);
  animation: check-pop 0.5s var(--ease-out);
}
@keyframes check-pop {
  0% { transform: scale(0.5); opacity: 0; }
  60% { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}

.oauth-progress {
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.oauth-progress-bar {
  height: 4px;
  background: var(--rev-s3);
  border-radius: 4px;
  overflow: hidden;
}
.oauth-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--rev-orange), var(--rev-orange-pale));
  border-radius: 4px;
  transition: width 0.4s var(--ease-out);
}
.oauth-progress-meta {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--rev-t4);
}

.oauth-checklist {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}
.oauth-check-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--rev-bg);
  border: 1px solid var(--rev-border);
  border-radius: 10px;
  font-size: 13px;
  color: var(--rev-t3);
  transition: border-color var(--dur-base), color var(--dur-base);
}
.oauth-check-item.active { color: var(--rev-t1); border-color: var(--rev-orange-border); }
.oauth-check-item.done { color: var(--rev-t3); }
.oauth-check-item-mark {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--rev-s3);
  border: 1px solid var(--rev-border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.oauth-check-item.active .oauth-check-item-mark {
  background: var(--rev-bg);
  border-color: var(--rev-orange);
  color: var(--rev-orange);
}
.oauth-check-item.done .oauth-check-item-mark {
  background: var(--rev-green);
  border-color: var(--rev-green);
  color: #fff;
}

/* ══════════════════════════════════════════════════════════════
   LOGS TABLE
══════════════════════════════════════════════════════════════ */

.logs-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 9999px;
  border: 1px solid var(--rev-border);
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--rev-t4);
  background: var(--rev-bg);
  cursor: pointer;
  transition: all var(--dur-fast);
  font-weight: 600;
  letter-spacing: 0.05em;
}
.chip:hover { border-color: var(--rev-border-strong); color: var(--rev-t2); }
.chip.active {
  border-color: var(--rev-orange-border);
  color: var(--rev-orange);
  background: var(--rev-orange-ghost);
}
.chip-count {
  background: var(--rev-s3);
  color: var(--rev-t4);
  padding: 0 5px;
  border-radius: 3px;
  font-size: 9px;
}
.chip.active .chip-count { background: var(--rev-orange-border); color: var(--rev-orange); }

.search-input {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--rev-s2);
  border: 1px solid var(--rev-border);
  border-radius: 8px;
  padding: 0 12px;
  transition: border-color var(--dur-fast);
  min-width: 240px;
}
.search-input:focus-within {
  border-color: rgba(255,91,0,0.5);
  box-shadow: 0 0 0 3px rgba(255,91,0,0.08);
  background: var(--rev-bg);
}
.search-input svg { color: var(--rev-t5); flex-shrink: 0; }
.search-input input {
  background: transparent;
  border: none;
  outline: none;
  padding: 8px 10px;
  font-size: 13px;
  flex: 1;
  color: var(--rev-t1);
  font-family: inherit;
}
.search-input input::placeholder { color: var(--rev-t5); }

.logs-table {
  background: var(--rev-s1);
  border: 1px solid var(--rev-border);
  border-radius: 12px;
  overflow: hidden;
}
.logs-thead {
  display: grid;
  grid-template-columns: 110px 1fr 1.6fr 80px 100px 90px;
  padding: 10px 18px;
  background: var(--rev-s2);
  border-bottom: 1px solid var(--rev-border);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--rev-t4);
  gap: 16px;
}
.logs-row {
  display: grid;
  grid-template-columns: 110px 1fr 1.6fr 80px 100px 90px;
  padding: 11px 18px;
  border-bottom: 1px solid var(--rev-border);
  font-size: 12px;
  color: var(--rev-t3);
  align-items: center;
  gap: 16px;
  cursor: pointer;
  transition: background var(--dur-fast);
}
.logs-row:last-child { border-bottom: none; }
.logs-row:hover { background: var(--rev-bg); }
.logs-cell-ts {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--rev-t4);
}
.logs-cell-empresa {
  font-weight: 600;
  color: var(--rev-t2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.logs-cell-endpoint {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--rev-t3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.logs-method {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 2px 6px;
  border-radius: 4px;
  margin-right: 8px;
}
.logs-method-get { background: rgba(0,153,255,0.10); color: #0066b3; }
.logs-method-post { background: rgba(0,204,102,0.10); color: #007a38; }
.logs-cell-status { display: flex; }
.logs-cell-dur {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--rev-t4);
}
.logs-cell-action {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 4px;
}
.logs-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--rev-t4);
  font-size: 13px;
}

.refresh-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--rev-orange-ghost);
  color: var(--rev-orange);
  border: 1px solid var(--rev-orange-border);
  margin-left: 6px;
}

/* ══════════════════════════════════════════════════════════════
   CONTA / PROFILE
══════════════════════════════════════════════════════════════ */

.profile-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 20px;
  align-items: start;
}
.profile-card {
  background: var(--rev-s1);
  border: 1px solid var(--rev-border);
  border-radius: 14px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.profile-card-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--rev-t1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--rev-border);
}

.avatar-block {
  display: flex;
  align-items: center;
  gap: 18px;
}
.avatar-lg {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--rev-orange) 0%, var(--rev-orange-pale) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 22px;
  color: #000;
  flex-shrink: 0;
  box-shadow: 0 4px 18px rgba(255,91,0,0.25);
}
.avatar-info { display: flex; flex-direction: column; gap: 2px; }
.avatar-name {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--rev-t1);
}
.avatar-mail {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--rev-t4);
}

.kv-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--rev-border);
  gap: 12px;
}
.kv-row:last-child { border-bottom: none; }
.kv-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--rev-t4);
}
.kv-val {
  font-size: 13px;
  color: var(--rev-t2);
  font-weight: 500;
}

/* ══════════════════════════════════════════════════════════════
   NEW EMPRESA FORM
══════════════════════════════════════════════════════════════ */

.form-wrap {
  max-width: 640px;
  background: var(--rev-s1);
  border: 1px solid var(--rev-border);
  border-radius: 14px;
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.form-grid-full { grid-column: 1 / -1; }
.form-step-head { display: flex; flex-direction: column; gap: 6px; }
.form-step-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--rev-t1);
}
.form-step-sub {
  font-size: 13px;
  color: var(--rev-t4);
}

/* ══════════════════════════════════════════════════════════════
   TWEAKS PANEL OVERRIDE (light theme)
══════════════════════════════════════════════════════════════ */

.tweaks-panel-light {
  background: var(--rev-bg);
  border: 1px solid var(--rev-border);
  color: var(--rev-t2);
  font-family: var(--font-body);
  box-shadow: 0 12px 40px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.04);
}

/* ══════════════════════════════════════════════════════════════
   UTILITIES
══════════════════════════════════════════════════════════════ */

.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-4 { gap: 4px; }
.gap-6 { gap: 6px; }
.gap-8 { gap: 8px; }
.gap-10 { gap: 10px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-20 { gap: 20px; }
.gap-24 { gap: 24px; }
.flex-1 { flex: 1; }
.muted { color: var(--rev-t4); }
.mono { font-family: var(--font-mono); }
.text-xs { font-size: 11px; }
.text-sm { font-size: 13px; }
.text-base { font-size: 14px; }

/* Density variants */
.density-compact { --density-pad: 12px; --density-gap: 10px; --density-card-pad: 16px; }
.density-cozy { --density-pad: 16px; --density-gap: 14px; --density-card-pad: 22px; }
.density-comfortable { --density-pad: 20px; --density-gap: 18px; --density-card-pad: 26px; }
