/* ═══════════════════════════════════════════════════════════
   NotaFacil — NOCTURNE Design System
   Dark financial terminal × Stripe Dashboard × Vercel Console
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,400&display=swap');

/* ── Tokens ─────────────────────────────────────────────── */
:root {
  --bg:          #050A14;
  --surface:     #0D1626;
  --surface2:    #132030;
  --surface3:    #182840;
  --border:      #1E2D42;
  --border2:     #253450;

  --cyan:        #38BDF8;
  --cyan-dim:    rgba(56,189,248,.12);
  --cyan-glow:   rgba(56,189,248,.25);
  --teal:        #10E6A0;
  --teal-dim:    rgba(16,230,160,.12);
  --amber:       #F59E0B;
  --amber-dim:   rgba(245,158,11,.12);
  --rose:        #EF4444;
  --rose-dim:    rgba(239,68,68,.12);
  --violet:      #A78BFA;
  --violet-dim:  rgba(167,139,250,.12);

  --text:        #E2EAF4;
  --text-muted:  #6B8AAD;
  --text-faint:  #3A5070;

  --font-sans:   'DM Sans', system-ui, sans-serif;
  --font-display:'Syne', sans-serif;
  --font-mono:   'JetBrains Mono', monospace;

  --radius-sm:   6px;
  --radius:      10px;
  --radius-lg:   16px;
  --sidebar-w:   240px;
  --header-h:    60px;

  --shadow:      0 4px 24px rgba(0,0,0,.4);
  --shadow-glow: 0 0 0 1px var(--border), 0 4px 24px rgba(0,0,0,.4);
}

/* ── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Typography ─────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--text);
  margin: 0 0 .5rem;
}

.page-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.02em;
}

.mono { font-family: var(--font-mono); }
code, kbd, pre, .code { font-family: var(--font-mono); }

code {
  background: var(--surface3);
  color: var(--cyan);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-size: .85em;
}

/* ── Scrollbar ──────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--surface); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }

/* ══════════════════════════════════════════════════════════
   AUTH LAYOUT
   ══════════════════════════════════════════════════════════ */

.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}

/* Animated grid background */
.auth-wrapper::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: .4;
  animation: gridPan 20s linear infinite;
}

.auth-wrapper::after {
  content: '';
  position: absolute;
  top: -40%;
  left: -20%;
  width: 80%;
  height: 80%;
  background: radial-gradient(ellipse, rgba(56,189,248,.08) 0%, transparent 70%);
  animation: orb 8s ease-in-out infinite alternate;
}

@keyframes gridPan {
  from { background-position: 0 0, 0 0; }
  to   { background-position: 48px 48px, 48px 48px; }
}

@keyframes orb {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(10%, 5%) scale(1.1); }
}

.auth-box {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 420px;
  padding: 1rem;
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow), 0 0 60px rgba(56,189,248,.06);
  animation: slideUp .5s cubic-bezier(.16,1,.3,1);
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 2rem;
}

.auth-logo-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--cyan), var(--teal));
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: var(--bg);
  flex-shrink: 0;
}

.auth-logo-text {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.03em;
}

.auth-logo-sub {
  font-size: .75rem;
  color: var(--text-muted);
  margin-top: -2px;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ══════════════════════════════════════════════════════════
   MAIN LAYOUT — HEADER
   ══════════════════════════════════════════════════════════ */

.app-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: rgba(5,10,20,.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  z-index: 1000;
  padding: 0 1.25rem;
  gap: 1rem;
}

.app-header-brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  text-decoration: none;
  width: var(--sidebar-w);
  flex-shrink: 0;
}

.app-header-brand-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--cyan), var(--teal));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .9rem;
  color: var(--bg);
  flex-shrink: 0;
}

.app-header-brand-name {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.03em;
}

.app-header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: .5rem;
}

.header-user-btn {
  display: flex;
  align-items: center;
  gap: .5rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .4rem .75rem;
  color: var(--text);
  font-size: .85rem;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  text-decoration: none;
}

.header-user-btn:hover {
  border-color: var(--border2);
  background: var(--surface3);
  color: var(--text);
}

.header-user-avatar {
  width: 26px;
  height: 26px;
  background: linear-gradient(135deg, var(--cyan), var(--teal));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .7rem;
  font-weight: 700;
  color: var(--bg);
  font-family: var(--font-display);
}

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

.app-sidebar {
  position: fixed;
  top: var(--header-h);
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  z-index: 900;
  padding: 1.5rem 0 2rem;
  display: flex;
  flex-direction: column;
}

.sidebar-section {
  margin-bottom: .25rem;
}

.sidebar-label {
  font-family: var(--font-mono);
  font-size: .65rem;
  font-weight: 600;
  letter-spacing: .12em;
  color: var(--text-faint);
  text-transform: uppercase;
  padding: 1rem 1.25rem .4rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .5rem 1.25rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: .85rem;
  font-weight: 500;
  border-radius: 0;
  transition: color .15s, background .15s;
  position: relative;
}

.sidebar-link:hover {
  color: var(--text);
  background: rgba(255,255,255,.03);
}

.sidebar-link.active {
  color: var(--cyan);
  background: var(--cyan-dim);
}

.sidebar-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  background: var(--cyan);
  border-radius: 0 3px 3px 0;
}

.sidebar-link i {
  font-size: 1rem;
  width: 1.1rem;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-footer {
  margin-top: auto;
  padding: 0 .75rem 0;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}

.sidebar-logout {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .5rem .75rem;
  color: var(--text-faint);
  text-decoration: none;
  font-size: .85rem;
  border-radius: var(--radius-sm);
  transition: color .15s, background .15s;
}

.sidebar-logout:hover {
  color: var(--rose);
  background: var(--rose-dim);
}

/* ══════════════════════════════════════════════════════════
   MAIN CONTENT
   ══════════════════════════════════════════════════════════ */

.app-main {
  margin-left: var(--sidebar-w);
  margin-top: var(--header-h);
  padding: 2rem 2rem 3rem;
  min-height: calc(100vh - var(--header-h));
  animation: fadeIn .3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.page-header-left {
  display: flex;
  flex-direction: column;
  gap: .25rem;
}

.page-breadcrumb {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .75rem;
  color: var(--text-faint);
  font-family: var(--font-mono);
  margin-bottom: .25rem;
}

.page-breadcrumb a { color: var(--text-muted); text-decoration: none; }
.page-breadcrumb a:hover { color: var(--cyan); }

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

.nf-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.nf-card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.nf-card-title {
  font-family: var(--font-display);
  font-size: .9rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -.01em;
}

.nf-card-body { padding: 1.25rem; }

/* KPI cards */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  position: relative;
  overflow: hidden;
  transition: border-color .2s, transform .2s;
}

.kpi-card:hover {
  border-color: var(--border2);
  transform: translateY(-1px);
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
}

.kpi-card.kpi-success::before { background: linear-gradient(90deg, var(--teal), transparent); }
.kpi-card.kpi-danger::before  { background: linear-gradient(90deg, var(--rose), transparent); }
.kpi-card.kpi-primary::before { background: linear-gradient(90deg, var(--cyan), transparent); }
.kpi-card.kpi-warning::before { background: linear-gradient(90deg, var(--amber), transparent); }
.kpi-card.kpi-violet::before  { background: linear-gradient(90deg, var(--violet), transparent); }

.kpi-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  margin-bottom: .9rem;
}

.kpi-card.kpi-success .kpi-icon { background: var(--teal-dim);   color: var(--teal); }
.kpi-card.kpi-danger .kpi-icon  { background: var(--rose-dim);   color: var(--rose); }
.kpi-card.kpi-primary .kpi-icon { background: var(--cyan-dim);   color: var(--cyan); }
.kpi-card.kpi-warning .kpi-icon { background: var(--amber-dim);  color: var(--amber); }
.kpi-card.kpi-violet .kpi-icon  { background: var(--violet-dim); color: var(--violet); }

.kpi-label {
  font-size: .72rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: .3rem;
}

.kpi-value {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1;
  color: var(--text);
  letter-spacing: -.04em;
}

.kpi-value.kpi-money {
  font-family: var(--font-mono);
  font-size: 1.3rem;
  letter-spacing: -.02em;
}

/* ══════════════════════════════════════════════════════════
   TABLES
   ══════════════════════════════════════════════════════════ */

.nf-table {
  width: 100%;
  border-collapse: collapse;
}

.nf-table thead th {
  font-family: var(--font-mono);
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-faint);
  padding: .65rem 1rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  text-align: left;
}

.nf-table tbody td {
  padding: .75rem 1rem;
  border-bottom: 1px solid rgba(30,45,66,.5);
  color: var(--text-muted);
  font-size: .875rem;
  vertical-align: middle;
}

.nf-table tbody td.td-primary { color: var(--text); font-weight: 500; }
.nf-table tbody td.td-mono    { font-family: var(--font-mono); font-size: .8rem; color: var(--cyan); }
.nf-table tbody td.td-money   { font-family: var(--font-mono); color: var(--teal); font-weight: 600; }

.nf-table tbody tr { transition: background .12s; }
.nf-table tbody tr:hover { background: rgba(255,255,255,.02); }
.nf-table tbody tr:last-child td { border-bottom: none; }

.nf-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-faint);
}

.nf-empty i { font-size: 2.5rem; display: block; margin-bottom: .75rem; opacity: .4; }
.nf-empty p { margin: 0; font-size: .85rem; }

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

.form-label {
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: .02em;
  text-transform: uppercase;
  margin-bottom: .4rem;
  display: block;
}

.form-control, .form-select {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: .55rem .85rem;
  font-size: .875rem;
  font-family: var(--font-sans);
  transition: border-color .2s, box-shadow .2s;
  width: 100%;
}

.form-control::placeholder { color: var(--text-faint); }

.form-control:focus, .form-select:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px var(--cyan-glow);
  background: var(--surface2);
  color: var(--text);
}

.form-control:focus { caret-color: var(--cyan); }

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236B8AAD' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .85rem center;
  padding-right: 2.5rem;
  appearance: none;
  cursor: pointer;
}

.form-select option {
  background: var(--surface2);
  color: var(--text);
}

.form-control-lg { padding: .7rem 1rem; font-size: 1rem; }

textarea.form-control { resize: vertical; min-height: 90px; }

.form-check-input {
  background-color: var(--surface2);
  border: 1px solid var(--border2);
  cursor: pointer;
}

.form-check-input:checked {
  background-color: var(--cyan);
  border-color: var(--cyan);
}

.form-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.form-section-title {
  font-family: var(--font-display);
  font-size: .85rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 1.25rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--border);
}

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .5rem 1rem;
  font-size: .85rem;
  font-weight: 600;
  font-family: var(--font-sans);
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all .15s ease;
  white-space: nowrap;
  line-height: 1.4;
}

.btn:active { transform: scale(.98); }

.btn-primary {
  background: var(--cyan);
  color: #050A14;
  border-color: var(--cyan);
}

.btn-primary:hover {
  background: #67D2FB;
  border-color: #67D2FB;
  color: #050A14;
  box-shadow: 0 0 20px var(--cyan-glow);
}

.btn-success {
  background: var(--teal);
  color: #050A14;
  border-color: var(--teal);
}

.btn-success:hover {
  background: #3AEDA8;
  border-color: #3AEDA8;
  color: #050A14;
  box-shadow: 0 0 20px rgba(16,230,160,.3);
}

.btn-danger {
  background: transparent;
  color: var(--rose);
  border-color: var(--rose);
}

.btn-danger:hover {
  background: var(--rose-dim);
  color: var(--rose);
}

.btn-warning {
  background: transparent;
  color: var(--amber);
  border-color: var(--amber);
}

.btn-warning:hover {
  background: var(--amber-dim);
  color: var(--amber);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}

.btn-ghost:hover {
  background: var(--surface2);
  border-color: var(--border2);
  color: var(--text);
}

.btn-sm {
  padding: .3rem .65rem;
  font-size: .78rem;
}

.btn-lg {
  padding: .7rem 1.5rem;
  font-size: .95rem;
}

.btn-icon {
  padding: .4rem;
  aspect-ratio: 1;
  justify-content: center;
}

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

.badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .2rem .6rem;
  font-size: .72rem;
  font-weight: 600;
  font-family: var(--font-mono);
  border-radius: 100px;
  letter-spacing: .02em;
}

.badge::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.badge-success { background: var(--teal-dim);   color: var(--teal);   border: 1px solid rgba(16,230,160,.25); }
.badge-danger  { background: var(--rose-dim);   color: var(--rose);   border: 1px solid rgba(239,68,68,.25); }
.badge-warning { background: var(--amber-dim);  color: var(--amber);  border: 1px solid rgba(245,158,11,.25); }
.badge-info    { background: var(--cyan-dim);   color: var(--cyan);   border: 1px solid rgba(56,189,248,.25); }
.badge-secondary{ background: var(--surface3); color: var(--text-muted); border: 1px solid var(--border); }
.badge-violet  { background: var(--violet-dim); color: var(--violet); border: 1px solid rgba(167,139,250,.25); }

/* Bootstrap compat */
.bg-success { background: var(--teal-dim)   !important; color: var(--teal)   !important; }
.bg-danger  { background: var(--rose-dim)   !important; color: var(--rose)   !important; }
.bg-warning { background: var(--amber-dim)  !important; color: var(--amber)  !important; }
.bg-info    { background: var(--cyan-dim)   !important; color: var(--cyan)   !important; }
.bg-secondary{ background: var(--surface3) !important; color: var(--text-muted) !important; }

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

.nf-alert {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .85rem 1.1rem;
  border-radius: var(--radius);
  font-size: .875rem;
  animation: slideDown .3s cubic-bezier(.16,1,.3,1);
  margin-bottom: 1rem;
}

.nf-alert i { font-size: 1rem; flex-shrink: 0; margin-top: .05rem; }

.nf-alert-success { background: var(--teal-dim);  border: 1px solid rgba(16,230,160,.3);  color: #4EFFC0; }
.nf-alert-danger  { background: var(--rose-dim);  border: 1px solid rgba(239,68,68,.3);  color: #FF7A7A; }
.nf-alert-warning { background: var(--amber-dim); border: 1px solid rgba(245,158,11,.3); color: #FFC542; }
.nf-alert-info    { background: var(--cyan-dim);  border: 1px solid rgba(56,189,248,.3); color: #71D8FF; }

.nf-alert-close {
  margin-left: auto;
  background: none;
  border: none;
  color: currentColor;
  cursor: pointer;
  opacity: .6;
  padding: 0;
  font-size: 1rem;
  line-height: 1;
  flex-shrink: 0;
}

.nf-alert-close:hover { opacity: 1; }

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ══════════════════════════════════════════════════════════
   VALUE SUMMARY (NFS-e form)
   ══════════════════════════════════════════════════════════ */

.value-summary {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.5rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.vs-item { text-align: center; }

.vs-label {
  font-family: var(--font-mono);
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-faint);
  margin-bottom: .3rem;
}

.vs-value {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
}

.vs-value.vs-primary { color: var(--cyan); }
.vs-value.vs-success { color: var(--teal); }

/* ══════════════════════════════════════════════════════════
   DETAIL GRID (NFS-e show)
   ══════════════════════════════════════════════════════════ */

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem 1.5rem;
}

.detail-item {}

.detail-label {
  font-family: var(--font-mono);
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-faint);
  margin-bottom: .2rem;
}

.detail-value {
  font-size: .9rem;
  color: var(--text);
  font-weight: 500;
}

.detail-value.mono { font-family: var(--font-mono); color: var(--cyan); font-size: .85rem; }

/* ══════════════════════════════════════════════════════════
   LOG TIMELINE
   ══════════════════════════════════════════════════════════ */

.log-list {
  max-height: 280px;
  overflow-y: auto;
}

.log-item {
  padding: .65rem 1.25rem;
  border-bottom: 1px solid rgba(30,45,66,.4);
}

.log-item:last-child { border-bottom: none; }

.log-item-head {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .25rem;
}

.log-item-time {
  font-family: var(--font-mono);
  font-size: .68rem;
  color: var(--text-faint);
  margin-left: auto;
}

.log-content {
  font-family: var(--font-mono);
  font-size: .72rem;
  color: var(--text-faint);
  word-break: break-all;
  line-height: 1.4;
}

/* ══════════════════════════════════════════════════════════
   DESCRIPTION LIST (empresa)
   ══════════════════════════════════════════════════════════ */

.dl-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .6rem 1.5rem;
  align-items: baseline;
}

.dl-label {
  font-family: var(--font-mono);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-faint);
  white-space: nowrap;
}

.dl-value {
  font-size: .875rem;
  color: var(--text);
}

/* ══════════════════════════════════════════════════════════
   MOBILE TOGGLE
   ══════════════════════════════════════════════════════════ */

.sidebar-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: .3rem .55rem;
  cursor: pointer;
  font-size: 1.1rem;
}

@media (max-width: 768px) {
  .sidebar-toggle { display: flex; align-items: center; justify-content: center; }
  .app-sidebar { transform: translateX(-100%); transition: transform .25s ease; }
  .app-sidebar.open { transform: translateX(0); }
  .app-main { margin-left: 0; padding: 1.25rem; }
  .app-header-brand { width: auto; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .value-summary { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════════════════════
   SEARCH INPUT
   ══════════════════════════════════════════════════════════ */

.search-wrap {
  position: relative;
  flex: 1;
  max-width: 340px;
}

.search-wrap i {
  position: absolute;
  left: .75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-faint);
  font-size: .9rem;
  pointer-events: none;
}

.search-wrap .form-control {
  padding-left: 2.2rem;
}

/* ══════════════════════════════════════════════════════════
   DROPDOWN
   ══════════════════════════════════════════════════════════ */

.dropdown-menu {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: .4rem;
  min-width: 180px;
  animation: fadeIn .15s ease;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .45rem .75rem;
  color: var(--text-muted);
  font-size: .85rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: background .12s, color .12s;
}

.dropdown-item:hover {
  background: var(--surface3);
  color: var(--text);
}

.dropdown-item.text-danger { color: var(--rose); }
.dropdown-item.text-danger:hover { background: var(--rose-dim); color: var(--rose); }

.dropdown-divider {
  border-color: var(--border);
  margin: .3rem 0;
}

/* ══════════════════════════════════════════════════════════
   FILTER BAR
   ══════════════════════════════════════════════════════════ */

.filter-bar {
  display: flex;
  align-items: center;
  gap: .65rem;
  flex-wrap: wrap;
  padding: .85rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

/* ══════════════════════════════════════════════════════════
   MISC
   ══════════════════════════════════════════════════════════ */

.text-muted   { color: var(--text-muted) !important; }
.text-faint   { color: var(--text-faint) !important; }
.text-cyan    { color: var(--cyan) !important; }
.text-teal    { color: var(--teal) !important; }
.text-amber   { color: var(--amber) !important; }
.text-rose    { color: var(--rose) !important; }

.divider { border-color: var(--border); }

.spinner {
  display: inline-block;
  width: 16px; height: 16px;
  border: 2px solid var(--border2);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin .6s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Quick action bar ────────────────────────────────────── */
.quick-actions {
  display: flex;
  gap: .75rem;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
}

/* ── Table wrapper ───────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  border-radius: 0 0 var(--radius) var(--radius);
}
