/* ============================================================
   WEB DEV — Bit System v2.1.0 aligned
   Fonts: VT323 (display/CTAs) + Inconsolata (body)
   Dark theme: neutral surfaces, neon #00FFD1, fuchsia #FF00FF
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=VT323&family=Inconsolata:wght@300;400;500;600;700&display=swap');

/* ============================================================
   DESIGN TOKENS
   ============================================================ */
:root {
  /* ── Brand colors ── */
  --neon:           #00FFD1;
  --neon-dark:      #00CCA6;
  --neon-glow:      rgba(0,255,209,0.15);
  --neon-glow-str:  rgba(0,255,209,0.30);
  --fuchsia:        #FF00FF;
  --fuchsia-dark:   #CC00CC;
  --fuchsia-glow:   rgba(255,0,255,0.15);
  --tolopea:        #2409A9;

  /* ── Neutral surfaces (Bit System dark theme) ── */
  --bg:             #100F0F;   /* neutral-950 – page background */
  --surface:        #221F20;   /* neutral-900 – cards, sidebar */
  --raised:         #393838;   /* neutral-800 – borders, inputs bg */
  --hover-bg:       #2E2B2C;   /* between surface and raised */

  /* ── Legacy aliases (keep for template compatibility) ── */
  --tolopea-bg:     #100F0F;
  --tolopea-card:   #221F20;
  --tolopea-border: #393838;
  --tolopea-hover:  #2E2B2C;
  --neutral-black:  #100F0F;
  --neutral-dark:   #221F20;

  /* ── Text scale ── */
  --text-base:    #FAFAFA;   /* neutral-0 */
  --text-muted:   #AFAEAF;   /* neutral-600 – secondary text */
  --text-subtle:  #7E7C7D;   /* neutral-500 – tertiary / placeholder */
  --neutral-700:  #4C4A4A;
  --neutral-500:  #AFAEAF;   /* hoisted to neutral-600 for WCAG */
  --neutral-300:  #AFAEAF;
  --neutral-100:  #E4E4E4;

  /* ── Semantic feedback ── */
  --success:  #4CFF4C;   /* green-400 dark */
  --warning:  #FFD54C;   /* amber-400 dark */
  --error:    #FF7C71;   /* red-400 dark — Bit System standard */

  /* ── Typography ── */
  --font-display: 'VT323', monospace;
  --font-body:    'Inconsolata', monospace;

  /* ── Border radius ── */
  --radius-none: 0px;
  --radius-xs:   2px;
  --radius-sm:   4px;
  --radius:      4px;    /* default component radius = sm */
  --radius-md:   6px;
  --radius-lg:   8px;
  --radius-full: 9999px;

  /* ── Pixel hard shadows ── */
  --shadow-sm:      2px 2px 0 var(--bg);
  --shadow-md:      4px 4px 0 var(--bg);
  --shadow-neon:    4px 4px 0 var(--neon-dark);
  --shadow-fuchsia: 4px 4px 0 var(--fuchsia-dark);
  --shadow-error:   4px 4px 0 #C02020;

  /* ── Motion ── */
  --motion-fast:    100ms;
  --motion-base:    200ms;
  --motion-slow:    400ms;
  --ease-pixel:     steps(8, end);
  --ease-blink:     steps(2, end);
  --ease-smooth:    cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-out-back:  cubic-bezier(0.34, 1.56, 0.64, 1);
  --transition:     var(--motion-base) var(--ease-pixel);

  /* ── Layout ── */
  --sidebar-w: 240px;
}

/* ============================================================
   LUCIDE ICONS
   ============================================================ */
[data-lucide], svg.lucide {
  width: 16px; height: 16px;
  stroke-width: 2;
  vertical-align: middle;
  flex-shrink: 0;
}
.nav-icon [data-lucide], .nav-icon svg.lucide { width: 18px; height: 18px; }
.card-title [data-lucide], .card-title svg.lucide,
.form-section-title [data-lucide], .form-section-title svg.lucide { width: 16px; height: 16px; }

/* ============================================================
   RESET
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  background: var(--bg);
  color: var(--text-base);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}
a { color: var(--neon); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--neon-dark); }
input, textarea, select, button { font-family: var(--font-body); }

/* Global focus ring — Bit System standard */
:focus-visible {
  outline: 2px solid var(--neon);
  outline-offset: 2px;
}

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

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--surface); }
::-webkit-scrollbar-thumb { background: var(--raised); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--neon-dark); }

/* ============================================================
   LAYOUT
   ============================================================ */
.layout { display: flex; min-height: 100vh; }

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--raised);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform var(--transition);
}

/* Logo area */
.sidebar-logo {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--raised);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  min-height: 72px;
}
.sidebar-logo img {
  height: 40px;
  width: auto;
  display: block;
  flex-shrink: 0;
}
.sidebar-logo-label {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.25em;
  color: var(--text-subtle);
  text-transform: uppercase;
  line-height: 1.2;
}

/* Legacy text logo — kept as fallback */
.logo-vt {
  font-family: var(--font-display);
  font-size: 2.2rem;
  color: var(--neon);
  line-height: 1;
}
.logo-sub {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.3em;
  color: var(--text-subtle);
  text-transform: uppercase;
}

/* Nav */
.sidebar-nav {
  flex: 1;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}
.sidebar-sep {
  height: 1px;
  background: var(--raised);
  margin: 8px 4px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 500;
  transition: all var(--transition);
  cursor: pointer;
  border-left: 2px solid transparent;
}
.nav-item:hover {
  background: var(--hover-bg);
  color: var(--neon);
  border-left-color: rgba(0,255,209,0.4);
}
.nav-item.active {
  background: var(--neon-glow);
  color: var(--neon);
  border-left-color: var(--neon);
  font-weight: 600;
}
.nav-icon {
  width: 18px;
  text-align: center;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Sidebar footer */
.sidebar-footer {
  padding: 14px 10px;
  border-top: 1px solid var(--raised);
  display: flex;
  align-items: center;
  gap: 8px;
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}
.user-avatar {
  width: 32px; height: 32px;
  background: var(--neon-glow);
  border: 1px solid var(--neon);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--neon);
  flex-shrink: 0;
}
.user-info { display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.user-name { font-size: 0.8rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-base); }
.user-role { font-size: 0.72rem; color: var(--text-subtle); text-transform: uppercase; letter-spacing: 0.1em; }
.btn-logout {
  color: var(--text-subtle);
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  flex-shrink: 0;
  display: flex;
  align-items: center;
}
.btn-logout:hover { color: var(--error); background: rgba(255,124,113,0.1); }

/* ── MAIN CONTENT ── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 56px;
  background: var(--surface);
  border-bottom: 1px solid var(--raised);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: color var(--transition);
}
.sidebar-toggle:hover { color: var(--neon); }
.page-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--text-base);
  flex: 1;
  letter-spacing: 0.04em;
}
.topbar-right { display: flex; align-items: center; gap: 10px; }

/* Topbar badges */
.topbar-badge {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 3px 10px;
  border-radius: var(--radius-xs);
  text-transform: uppercase;
}
.badge-admin { background: var(--neon-glow); color: var(--neon); border: 1px solid rgba(0,255,209,0.3); }
.badge-colab { background: var(--fuchsia-glow); color: var(--fuchsia); border: 1px solid rgba(255,0,255,0.3); }

.page-body {
  flex: 1;
  padding: 28px;
  max-width: 1400px;
  width: 100%;
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--raised);
  border-radius: var(--radius-sm);
  padding: 24px;
  transition: border-color var(--motion-base) var(--ease-smooth),
              box-shadow   var(--motion-base) var(--ease-smooth),
              transform    var(--motion-base) var(--ease-smooth);
}
.card-sm { padding: 16px; }
.card-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--neon);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.04em;
}

/* ============================================================
   BUTTONS — Bit System compliant
   CTA (primary) = no radius, VT323 font, pixel shadow
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 8px 20px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--motion-base) var(--ease-pixel);
  white-space: nowrap;
  position: relative;
}
.btn:focus-visible {
  outline: 2px solid var(--neon);
  outline-offset: 3px;
}
.btn:disabled, .btn[aria-disabled="true"] {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* Primary — CTA: no radius, pixel font, neon bg */
.btn-primary {
  background: var(--neon);
  color: var(--bg);
  border-color: var(--neon);
  border-radius: var(--radius-none);
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  box-shadow: var(--shadow-neon);
}
.btn-primary:hover {
  background: var(--neon-dark);
  border-color: var(--neon-dark);
  color: var(--bg);
  transform: translate(-1px, -1px);
  box-shadow: 6px 6px 0 var(--neon-dark);
}
.btn-primary:active {
  transform: translate(2px, 2px);
  box-shadow: none;
}

/* Outline */
.btn-outline {
  background: transparent;
  color: var(--neon);
  border-color: var(--neon);
}
.btn-outline:hover {
  background: var(--neon-glow);
  color: var(--neon);
  transform: translate(-1px, -1px);
}
.btn-outline:active { transform: translate(1px, 1px); }

/* Ghost */
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--raised);
}
.btn-ghost:hover {
  background: var(--hover-bg);
  color: var(--text-base);
  border-color: var(--text-subtle);
}

/* Danger */
.btn-danger {
  background: transparent;
  color: var(--error);
  border-color: var(--error);
}
.btn-danger:hover {
  background: rgba(255,124,113,0.12);
  color: var(--error);
  transform: translate(-1px, -1px);
}
.btn-danger:active { transform: translate(1px, 1px); }

/* Sizes */
.btn-sm {
  min-height: 32px;
  padding: 5px 14px;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}
.btn-sm.btn-primary { font-size: 0.9rem; }

/* Icon button */
.btn-icon {
  min-height: 32px;
  padding: 5px 8px;
  background: transparent;
  border: 1px solid var(--raised);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.85rem;
}
.btn-icon:hover { color: var(--neon); border-color: var(--neon); background: var(--neon-glow); }
.btn-copy { color: var(--text-subtle); }
.btn-copy:hover { color: var(--neon); }
.btn-copy.copied { color: var(--success); border-color: var(--success); }
.btn-danger-icon:hover { color: var(--error); border-color: var(--error); background: rgba(255,124,113,0.08); }

/* ============================================================
   FORMS
   ============================================================ */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-subtle);
  margin-bottom: 6px;
}
.form-input, .form-select, .form-textarea {
  width: 100%;
  min-height: 42px;
  background: var(--bg);
  border: 2px solid var(--raised);
  border-radius: var(--radius-sm);
  color: var(--text-base);
  padding: 9px 14px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  transition: border-color var(--motion-base) var(--ease-smooth),
              box-shadow   var(--motion-base) var(--ease-smooth);
}
.form-input::placeholder, .form-textarea::placeholder {
  color: var(--text-subtle);
}
.form-input:hover, .form-select:hover { border-color: var(--text-subtle); }
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--neon);
  box-shadow: 0 0 0 3px var(--neon-glow);
}
.form-input[aria-invalid="true"], .form-input.error {
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgba(255,124,113,0.15);
}
.form-textarea { resize: vertical; min-height: 80px; }
.form-select option { background: var(--surface); }
.input-group { display: flex; gap: 8px; align-items: center; }
.input-group .form-input { flex: 1; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.form-section-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--fuchsia);
  margin: 24px 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--raised);
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Password field */
.pass-field { position: relative; }
.pass-field .form-input { padding-right: 42px; }
.pass-toggle {
  position: absolute;
  right: 10px; top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-subtle);
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  transition: color var(--transition);
}
.pass-toggle:hover { color: var(--neon); }

/* ============================================================
   SEARCH / AUTOCOMPLETE
   ============================================================ */
.search-wrap { position: relative; max-width: 440px; }
.search-input {
  width: 100%;
  min-height: 42px;
  background: var(--surface);
  border: 2px solid var(--raised);
  border-radius: var(--radius-sm);
  color: var(--text-base);
  padding: 9px 16px 9px 40px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  transition: border-color var(--motion-base) var(--ease-smooth),
              box-shadow   var(--motion-base) var(--ease-smooth);
}
.search-input:focus {
  outline: none;
  border-color: var(--neon);
  box-shadow: 0 0 0 3px var(--neon-glow);
}
.search-icon {
  position: absolute;
  left: 13px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-subtle);
  pointer-events: none;
}
.autocomplete-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: var(--surface);
  border: 2px solid var(--neon);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-neon);
  z-index: 200;
  max-height: 260px;
  overflow-y: auto;
  display: none;
}
.autocomplete-list.show { display: block; }
.autocomplete-item {
  padding: 10px 16px;
  cursor: pointer;
  font-size: 0.88rem;
  transition: background var(--transition);
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--raised);
}
.autocomplete-item:last-child { border-bottom: none; }
.autocomplete-item:hover, .autocomplete-item.highlighted { background: var(--hover-bg); color: var(--neon); }
.autocomplete-item .status-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.dot-ativo   { background: var(--success); }
.dot-inativo { background: var(--text-subtle); }

/* ============================================================
   TABLE
   ============================================================ */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
thead tr {
  background: var(--bg);
  border-bottom: 2px solid var(--raised);
}
th {
  padding: 10px 14px;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-subtle);
  white-space: nowrap;
}
td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--raised);
  vertical-align: middle;
}
tr:hover td { background: var(--hover-bg); }
.tr-link { cursor: pointer; }
.td-name  { font-weight: 600; color: var(--text-base); }
.td-mono  { font-family: var(--font-body); font-size: 0.82rem; color: var(--text-muted); }

/* ============================================================
   BADGES & STATUS
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-xs);  /* 2px – Bit System */
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.badge-ok      { background: rgba(76,255,76,0.12);   color: var(--success); border: 1px solid rgba(76,255,76,0.30); }
.badge-notok   { background: rgba(255,124,113,0.12); color: var(--error);   border: 1px solid rgba(255,124,113,0.30); }
.badge-na      { background: rgba(127,124,125,0.15); color: var(--text-subtle); border: 1px solid rgba(127,124,125,0.25); }
.badge-pending { background: rgba(255,213,76,0.12);  color: var(--warning); border: 1px solid rgba(255,213,76,0.30); }
.badge-ativo   { background: rgba(76,255,76,0.10);   color: var(--success); border: 1px solid rgba(76,255,76,0.25); }
.badge-inativo { background: rgba(127,124,125,0.12); color: var(--text-subtle); border: 1px solid rgba(127,124,125,0.20); }

/* Live badge — blinking dot */
.badge-live::before {
  content: '●';
  font-size: 0.6rem;
  animation: blink-dot 1s var(--ease-blink) infinite;
}
@keyframes blink-dot { 0%,100% { opacity:1; } 50% { opacity:0; } }

/* ============================================================
   DASHBOARD STATS — "Boss Stats" recipe
   ============================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--raised);
  border-radius: var(--radius-sm);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: border-color var(--motion-base) var(--ease-smooth),
              box-shadow   var(--motion-base) var(--ease-smooth),
              transform    var(--motion-base) var(--ease-smooth);
}
/* Top accent stripe */
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
}
.stat-neon::before    { background: var(--neon); }
.stat-fuchsia::before { background: var(--fuchsia); }
.stat-warn::before    { background: var(--warning); }
.stat-success::before { background: var(--success); }
/* Hover: pixel lift */
.stat-card:hover {
  border-color: var(--neon);
  box-shadow: var(--shadow-neon);
  transform: translate(-2px, -2px);
}
.stat-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-subtle);
  margin-bottom: 8px;
}
.stat-value {
  font-family: var(--font-display);
  font-size: 2.8rem;
  line-height: 1;
  color: var(--text-base);
}
.stat-sub { font-size: 0.75rem; color: var(--text-subtle); margin-top: 4px; }

/* ============================================================
   PROTOCOLS CHECKLIST
   ============================================================ */
.proto-category { margin-bottom: 24px; }
.proto-cat-header {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--fuchsia);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--raised);
  letter-spacing: 0.06em;
}
.proto-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 8px;
}
.proto-item {
  background: var(--bg);
  border: 1px solid var(--raised);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: border-color var(--transition);
  cursor: default;
}
.proto-item:hover { border-color: var(--neon); }
.proto-item.clickable { cursor: pointer; }
.proto-check {
  width: 20px; height: 20px;
  border: 2px solid var(--raised);
  border-radius: var(--radius-xs);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem;
  transition: all var(--transition);
}
.proto-item[data-status="ok"]      .proto-check { background: rgba(76,255,76,0.15);   border-color: var(--success); color: var(--success); }
.proto-item[data-status="not_ok"]  .proto-check { background: rgba(255,124,113,0.10); border-color: var(--error);   color: var(--error); }
.proto-item[data-status="na"]      .proto-check { background: rgba(127,124,125,0.10); border-color: var(--text-subtle); color: var(--text-subtle); }
.proto-item[data-status="pendente"] .proto-check { color: transparent; }
.proto-task-name { font-size: 0.83rem; flex: 1; color: var(--text-muted); }
.proto-meta { font-size: 0.75rem; color: var(--text-subtle); }

/* Protocol status cycle (admin) */
.status-cycle { display: flex; gap: 4px; align-items: center; }
.status-btn {
  padding: 3px 8px;
  border-radius: var(--radius-xs);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition);
  background: transparent;
}
.status-btn-ok     { color: var(--success); border-color: rgba(76,255,76,0.30); }
.status-btn-ok:hover, .status-btn-ok.active { background: rgba(76,255,76,0.15); border-color: var(--success); }
.status-btn-notok  { color: var(--error);   border-color: rgba(255,124,113,0.30); }
.status-btn-notok:hover, .status-btn-notok.active { background: rgba(255,124,113,0.12); border-color: var(--error); }
.status-btn-na     { color: var(--text-subtle); border-color: rgba(127,124,125,0.30); }
.status-btn-na:hover, .status-btn-na.active { background: rgba(127,124,125,0.12); border-color: var(--text-subtle); }

/* ============================================================
   FIELD DISPLAY (senha mascarada + copy)
   ============================================================ */
.field-row {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg);
  border: 1px solid var(--raised);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin-bottom: 4px;
  transition: border-color var(--transition);
}
.field-row:hover { border-color: var(--text-subtle); }
.field-label-sm {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-subtle);
  min-width: 120px;
  flex-shrink: 0;
}
.field-value {
  flex: 1;
  font-size: 0.85rem;
  color: var(--text-base);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.field-value.masked { letter-spacing: 0.2em; color: var(--text-subtle); }
.field-actions { display: flex; gap: 4px; flex-shrink: 0; }
.field-link { color: var(--neon); font-size: 0.8rem; display: inline-flex; align-items: center; gap: 4px; }

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination { display: flex; align-items: center; gap: 6px; margin-top: 20px; justify-content: center; }
.page-btn {
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--raised);
  color: var(--text-muted);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.82rem;
  transition: all var(--transition);
  text-decoration: none;
}
.page-btn:hover   { border-color: var(--neon); color: var(--neon); }
.page-btn.active  { background: var(--neon); color: var(--bg); border-color: var(--neon); font-weight: 700; }
.page-btn:disabled{ opacity: 0.4; pointer-events: none; }

/* ============================================================
   TOAST — pixel shadow, no blur
   ============================================================ */
.toast {
  position: fixed;
  bottom: 28px; right: 28px;
  background: var(--surface);
  border: 2px solid var(--neon);
  color: var(--neon);
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  box-shadow: var(--shadow-neon);
  z-index: 9999;
  animation: slideInToast var(--motion-base) var(--ease-smooth);
  max-width: 360px;
}
.toast.error {
  border-color: var(--error);
  color: var(--error);
  box-shadow: var(--shadow-error);
}
.toast.hidden { display: none; }
@keyframes slideInToast {
  from { opacity:0; transform: translateY(12px); }
  to   { opacity:1; transform: translateY(0); }
}

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}
.login-page::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  background: radial-gradient(circle, var(--neon-glow) 0%, transparent 70%);
  top: -200px; left: -200px;
  pointer-events: none;
}
.login-page::after {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  background: radial-gradient(circle, var(--fuchsia-glow) 0%, transparent 70%);
  bottom: -150px; right: -100px;
  pointer-events: none;
}
.login-box {
  background: var(--surface);
  border: 2px solid var(--raised);
  border-radius: var(--radius-sm);
  padding: 48px 40px;
  width: 100%;
  max-width: 420px;
  position: relative;
  z-index: 1;
  box-shadow: var(--shadow-md);
}
.login-logo {
  text-align: center;
  margin-bottom: 36px;
}
.login-logo img {
  height: 72px;
  width: auto;
  display: block;
  margin: 0 auto 12px;
}
.login-logo .vt {
  font-family: var(--font-display);
  font-size: 4rem;
  color: var(--neon);
  line-height: 1;
  display: block;
}
.login-logo .sub {
  font-size: 0.7rem;
  letter-spacing: 0.4em;
  color: var(--text-subtle);
  text-transform: uppercase;
  margin-top: 4px;
  display: block;
}
.login-btn {
  width: 100%;
  padding: 13px;
  background: var(--neon);
  color: var(--bg);
  border: 2px solid var(--neon);
  border-radius: var(--radius-none);
  font-family: var(--font-display);
  font-size: 1.4rem;
  letter-spacing: 0.12em;
  cursor: pointer;
  transition: all var(--transition);
  margin-top: 8px;
  box-shadow: var(--shadow-neon);
}
.login-btn:hover {
  background: var(--neon-dark);
  border-color: var(--neon-dark);
  color: var(--bg);
  transform: translate(-1px, -1px);
  box-shadow: 6px 6px 0 var(--neon-dark);
}
.login-btn:active {
  transform: translate(2px, 2px);
  box-shadow: none;
}
.login-error {
  background: rgba(255,124,113,0.10);
  border: 1px solid rgba(255,124,113,0.35);
  color: var(--error);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.login-info {
  background: rgba(0,255,209,0.07);
  border: 1px solid rgba(0,255,209,0.25);
  color: var(--neon);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.83rem;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ============================================================
   PAGE TOOLBAR
   ============================================================ */
.page-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.toolbar-spacer { flex: 1; }

/* ============================================================
   DETAIL PAGE
   ============================================================ */
.detail-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.detail-client-name {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--neon);
  line-height: 1;
}
/* Tabs */
.tabs-container { margin-bottom: 16px; }
.detail-tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--raised);
  padding-bottom: 0;
}
.tab-btn {
  padding: 8px 18px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-subtle);
  font-family: var(--font-body);
  font-size: 0.83rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: all var(--transition);
  margin-bottom: -2px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.tab-btn:hover { color: var(--text-muted); }
.tab-btn.active { color: var(--neon); border-bottom-color: var(--neon); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ============================================================
   LOG TABLE
   ============================================================ */
.log-action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.log-create { background: rgba(76,255,76,0.10);   color: var(--success); }
.log-update { background: rgba(0,255,209,0.10);   color: var(--neon); }
.log-delete { background: rgba(255,124,113,0.10); color: var(--error); }
.log-login  { background: rgba(255,213,76,0.10);  color: var(--warning); }
.log-check  { background: rgba(255,0,255,0.10);   color: var(--fuchsia); }

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-subtle); }
.empty-icon  { font-size: 3rem; margin-bottom: 12px; opacity: 0.4; }
.empty-title { font-family: var(--font-display); font-size: 1.3rem; color: var(--text-muted); margin-bottom: 8px; }
.empty-sub   { font-size: 0.85rem; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 0 var(--raised);
  }
  .main-content { margin-left: 0; }
  .sidebar-toggle { display: flex; }
  .page-body { padding: 16px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
  .proto-grid { grid-template-columns: 1fr; }
  .detail-client-name { font-size: 1.6rem; }
}
@media (max-width: 560px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .login-box { padding: 32px 24px; }
  .topbar { padding: 0 14px; }
  .page-body { padding: 12px; }
}
