/* ═══════════════════════════════════════════════════════════
   DLK-Avi-Smart Broiler v1.0 — SuperOperador Admin Panel
   Premium SaaS Administration Design System
   ═══════════════════════════════════════════════════════════ */

:root {
  --sidebar-w: 270px;
  --topbar-h: 60px;

  /* Dark premium palette */
  --bg: #0c0e14;
  --bg-surface: #13161f;
  --bg-card: #191d2a;
  --bg-card-hover: #1f2437;
  --bg-input: rgba(0,0,0,.3);

  /* Borders */
  --border: rgba(255,255,255,.06);
  --border-hover: rgba(255,255,255,.12);
  --border-focus: rgba(218,165,32,.4);

  /* Text */
  --text: #e8e6e1;
  --text-muted: #7d7b78;
  --text-dim: #555350;

  /* Accent — warm gold */
  --primary: #daa520;
  --primary-light: #f0c850;
  --primary-soft: rgba(218,165,32,.1);
  --primary-glow: rgba(218,165,32,.2);

  /* Semantic */
  --success: #2cb67d;
  --success-soft: rgba(44,182,125,.1);
  --warning: #e8a838;
  --warning-soft: rgba(232,168,56,.1);
  --danger: #e0544a;
  --danger-soft: rgba(224,84,74,.1);
  --info: #5b9bd5;
  --info-soft: rgba(91,155,213,.1);

  /* Effects */
  --shadow-sm: 0 2px 8px rgba(0,0,0,.25);
  --shadow: 0 4px 24px rgba(0,0,0,.4);
  --shadow-lg: 0 8px 40px rgba(0,0,0,.5);
  --radius: 14px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --transition: .2s ease;
  --transition-slow: .35s ease;
}

/* ─── RESET ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Outfit', system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3, h4, p { margin-top: 0; }
a { color: var(--primary); text-decoration: none; }

/* ─── APP SHELL ─── */
.app-shell { display: flex; height: 100vh; overflow: hidden; }

/* ═══════════════════════════════════════════
   SIDEBAR
   ═══════════════════════════════════════════ */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  height: 100vh;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform var(--transition-slow);
  z-index: 100;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 22px 20px 18px;
  border-bottom: 1px solid var(--border);
}

.brand-icon {
  font-size: 1.6rem;
  width: 44px; height: 44px;
  display: flex;
  align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--primary-soft), rgba(218,165,32,.05));
  border: 1px solid rgba(218,165,32,.15);
  border-radius: var(--radius-sm);
}

.brand-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: .04em;
}

.brand-sub {
  font-size: .68rem;
  color: var(--text-dim);
  letter-spacing: .1em;
  text-transform: uppercase;
  display: block;
  margin-top: 2px;
}

/* Navigation */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 8px 10px 20px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.06) transparent;
}

.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.08); border-radius: 2px; }

.nav-group-label {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--text-dim);
  padding: 18px 14px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 9px 14px;
  border: none;
  border-left: 3px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: .82rem;
  font-weight: 400;
  cursor: pointer;
  transition: all var(--transition);
  text-align: left;
  position: relative;
}

.nav-item:hover {
  background: rgba(255,255,255,.04);
  color: var(--text);
}

.nav-item.active {
  background: rgba(218,165,32,.06);
  color: var(--primary-light);
  font-weight: 700;
  border-left-color: var(--primary);
}

.nav-icon { font-size: .95rem; width: 22px; text-align: center; flex-shrink: 0; }

.nav-badge {
  margin-left: auto;
  min-width: 20px; height: 20px;
  padding: 0 6px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px;
  background: var(--danger);
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 14px 14px 18px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar-admin-info {
  padding: 8px 12px;
  border-radius: var(--radius-xs);
  background: rgba(218,165,32,.05);
  border: 1px solid rgba(218,165,32,.1);
  font-size: .78rem;
}

.sidebar-admin-name { font-weight: 700; color: var(--primary-light); display: block; }
.sidebar-admin-role { color: var(--text-dim); font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; }

/* ═══════════════════════════════════════════
   MAIN CONTENT
   ═══════════════════════════════════════════ */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* Topbar */
.topbar {
  height: var(--topbar-h);
  min-height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 28px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
}

.menu-toggle {
  display: none;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-xs);
}

.menu-toggle:hover { background: rgba(255,255,255,.06); }

.topbar-info { flex: 1; }
.topbar-section { font-size: .95rem; font-weight: 600; color: var(--text); }
.topbar-sub { font-size: .75rem; color: var(--text-muted); margin-left: 12px; }

.btn-logout {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  padding: 7px 18px;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-logout:hover {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: rgba(224,84,74,.3);
}

/* Content Area */
.content-area {
  flex: 1;
  overflow-y: auto;
  padding: 28px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.08) transparent;
}

.content-area::-webkit-scrollbar { width: 5px; }
.content-area::-webkit-scrollbar-thumb { background: rgba(255,255,255,.08); border-radius: 3px; }

/* ═══════════════════════════════════════════
   SECTIONS
   ═══════════════════════════════════════════ */
.section { display: none; animation: fadeSection .3s ease; }
.section.active { display: block; }

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

.section-header { margin-bottom: 24px; }
.section-header h2 { font-size: 1.5rem; font-weight: 700; margin-bottom: 4px; }
.section-header p { color: var(--text-muted); font-size: .88rem; }

/* ═══════════════════════════════════════════
   CARDS
   ═══════════════════════════════════════════ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  transition: border-color var(--transition);
}

.card:hover { border-color: var(--border-hover); }

.card h3 {
  font-size: .95rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card h3 .card-icon { font-size: 1rem; }

/* ═══════════════════════════════════════════
   KPI STATS
   ═══════════════════════════════════════════ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.kpi-card {
  padding: 18px 20px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px; height: 100%;
  background: var(--kpi-color, var(--primary));
  opacity: .6;
}

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

.kpi-label { display: block; margin-bottom: 6px; color: var(--text-muted); font-size: .76rem; font-weight: 500; text-transform: uppercase; letter-spacing: .06em; }
.kpi-value { display: block; font-size: 1.5rem; font-weight: 800; line-height: 1.2; }
.kpi-sub { display: block; margin-top: 6px; color: var(--text-muted); font-size: .74rem; }

.kpi-card.accent-success { --kpi-color: var(--success); }
.kpi-card.accent-warning { --kpi-color: var(--warning); }
.kpi-card.accent-danger { --kpi-color: var(--danger); }
.kpi-card.accent-info { --kpi-color: var(--info); }
.kpi-card.accent-primary { --kpi-color: var(--primary); }

/* ═══════════════════════════════════════════
   FORMS
   ═══════════════════════════════════════════ */
.form-panel { display: grid; gap: 14px; }

.form-panel label {
  display: grid;
  gap: 5px;
  color: var(--text-muted);
  font-size: .8rem;
  font-weight: 500;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

input, textarea, select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--bg-input);
  color: var(--text);
  font-size: .86rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%237d7b78' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 34px;
}

input::placeholder, textarea::placeholder { color: var(--text-dim); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: .85rem;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #c49418);
  color: #1a1400;
  box-shadow: 0 2px 12px rgba(218,165,32,.25);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(218,165,32,.35);
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.btn-secondary:hover {
  background: rgba(255,255,255,.04);
  color: var(--text);
  border-color: var(--border-hover);
}

.btn-danger {
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid rgba(224,84,74,.2);
}

.btn-danger:hover {
  background: rgba(224,84,74,.2);
}

.btn-success {
  background: var(--success-soft);
  color: var(--success);
  border: 1px solid rgba(44,182,125,.2);
}

.btn-success:hover {
  background: rgba(44,182,125,.2);
}

.btn-sm { padding: 6px 14px; font-size: .78rem; border-radius: var(--radius-xs); }
.btn-xs { padding: 4px 10px; font-size: .72rem; border-radius: var(--radius-xs); }

.btn:disabled { opacity: .4; pointer-events: none; }

.btn-group { display: flex; gap: 8px; flex-wrap: wrap; }

/* ═══════════════════════════════════════════
   TABLES
   ═══════════════════════════════════════════ */
.data-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .82rem;
}

.data-table th {
  padding: 12px 16px;
  text-align: left;
  font-weight: 700;
  font-size: .74rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
  background: rgba(0,0,0,.2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.data-table tr:last-child td { border-bottom: none; }

.data-table tr:hover td { background: rgba(255,255,255,.02); }

/* ═══════════════════════════════════════════
   BADGES & TAGS
   ═══════════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
  gap: 4px;
}

.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-neutral { background: rgba(255,255,255,.06); color: var(--text-muted); }
.badge-primary { background: var(--primary-soft); color: var(--primary); }

.plan-badge { text-transform: uppercase; letter-spacing: .06em; }

/* ═══════════════════════════════════════════
   MODALS
   ═══════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn .2s ease;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  width: 90%;
  max-width: 600px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: slideUp .3s ease;
}

.modal h3 { font-size: 1.1rem; margin-bottom: 18px; color: var(--primary-light); }

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

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

/* ═══════════════════════════════════════════
   GRIDS & LAYOUTS
   ═══════════════════════════════════════════ */
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.three-col { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.four-col { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }

.card-list { display: grid; gap: 10px; }

.list-item {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.02);
  border: 1px solid var(--border);
  transition: all var(--transition);
}

.list-item:hover { border-color: var(--border-hover); background: rgba(255,255,255,.03); }

.list-item-header { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 6px; }
.list-item-title { font-weight: 700; font-size: .88rem; }
.list-item-body { color: var(--text-muted); font-size: .82rem; line-height: 1.5; }
.list-item-footer { display: flex; gap: 8px; margin-top: 10px; align-items: center; flex-wrap: wrap; }

/* ═══════════════════════════════════════════
   UTILITY
   ═══════════════════════════════════════════ */
.hidden { display: none !important; }
.mt-sm { margin-top: 10px; }
.mt-md { margin-top: 18px; }
.mt-lg { margin-top: 28px; }
.mb-sm { margin-bottom: 10px; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: .82rem; }
.text-xs { font-size: .74rem; }
.text-center { text-align: center; }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-primary { color: var(--primary); }
.fw-bold { font-weight: 700; }

.empty-state {
  padding: 24px;
  text-align: center;
  color: var(--text-dim);
  font-size: .86rem;
}

.divider { border: none; border-top: 1px solid var(--border); margin: 18px 0; }

.search-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
}

.search-bar input {
  flex: 1;
}

/* Toggle switch */
.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .85rem;
}

.toggle-switch {
  position: relative;
  width: 40px;
  height: 22px;
}

.toggle-switch input { opacity: 0; width: 0; height: 0; }

.toggle-slider {
  position: absolute; inset: 0;
  background: rgba(255,255,255,.1);
  border-radius: 11px;
  cursor: pointer;
  transition: var(--transition);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px; height: 16px;
  left: 3px; bottom: 3px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: var(--transition);
}

.toggle-switch input:checked + .toggle-slider { background: var(--primary-soft); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(18px); background: var(--primary); }

/* ═══════════════════════════════════════════
   LOGIN SCREEN
   ═══════════════════════════════════════════ */
.login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg);
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.login-card .brand-icon {
  margin: 0 auto 16px;
  width: 56px; height: 56px;
  font-size: 2rem;
}

.login-card h1 {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 4px;
}

.login-card .login-sub {
  color: var(--text-dim);
  font-size: .78rem;
  margin-bottom: 28px;
  text-transform: uppercase;
  letter-spacing: .12em;
}

.login-card .form-panel { text-align: left; }

.login-card .btn-primary { width: 100%; padding: 12px; margin-top: 8px; }

.login-error {
  padding: 10px 14px;
  border-radius: var(--radius-xs);
  background: var(--danger-soft);
  color: var(--danger);
  font-size: .82rem;
  margin-top: 10px;
}

/* Password field with toggle */
.password-field {
  position: relative;
  display: flex;
  align-items: center;
}

.password-field input {
  padding-right: 44px;
}

.toggle-password {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px 8px;
  font-size: .9rem;
  border-radius: var(--radius-xs);
  transition: color var(--transition), background var(--transition);
  line-height: 1;
}

.toggle-password:hover {
  color: var(--text);
  background: rgba(255,255,255,.06);
}

/* Forgot password link */
.forgot-link {
  display: inline-block;
  margin-top: 12px;
  color: var(--text-muted);
  font-size: .8rem;
  text-decoration: none;
  transition: color var(--transition);
}

.forgot-link:hover {
  color: var(--primary);
}

/* Success message */
.success-message {
  padding: 10px 14px;
  border-radius: var(--radius-xs);
  background: var(--success-soft);
  color: var(--success);
  font-size: .82rem;
  margin-top: 10px;
  border: 1px solid rgba(44,182,125,.15);
}

/* ═══════════════════════════════════════════
   ALERTS PANEL (Dashboard)
   ═══════════════════════════════════════════ */
.alerts-panel {
  display: flex; flex-direction: column; gap: 8px;
}
.alert-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 18px; border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  font-size: .88rem; line-height: 1.5;
  transition: border-color .2s;
}
.alert-item:hover { border-color: var(--border-hover); }

.alert-icon {
  font-size: 1.3rem; flex-shrink: 0;
  margin-top: 1px;
}
.alert-item strong { color: var(--text); }
.alert-detail {
  font-size: .8rem; color: var(--text-muted);
  margin-top: 4px;
}

.alert-warning {
  background: rgba(230,160,40,.06);
  border-color: rgba(230,160,40,.18);
}
.alert-danger {
  background: rgba(220,60,60,.06);
  border-color: rgba(220,60,60,.18);
}
.alert-info {
  background: rgba(60,140,220,.06);
  border-color: rgba(60,140,220,.18);
}
.alert-muted {
  background: rgba(120,120,120,.06);
  border-color: rgba(120,120,120,.18);
}
.alert-ok {
  background: rgba(44,182,125,.06);
  border-color: rgba(44,182,125,.18);
}

/* ═══════════════════════════════════════════
   TELEGRAM STATUS PANEL
   ═══════════════════════════════════════════ */
.telegram-status-panel {
  background: rgba(0,0,0,.2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}

.tg-status-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.tg-status-card {
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  text-align: center;
  transition: all .25s ease;
}
.tg-status-card.tg-ok {
  border-color: rgba(44,182,125,.35);
  background: rgba(44,182,125,.06);
}
.tg-status-card.tg-warn {
  border-color: rgba(230,160,40,.35);
  background: rgba(230,160,40,.06);
}
.tg-status-card.tg-off {
  border-color: rgba(120,120,120,.2);
  background: rgba(120,120,120,.04);
}

.tg-status-icon {
  font-size: 1.6rem;
  margin-bottom: 6px;
}
.tg-status-label {
  font-size: .75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 4px;
}
.tg-status-value {
  font-size: .95rem;
  font-weight: 600;
  color: var(--text);
}
.tg-status-card.tg-ok .tg-status-value { color: #2cb67d; }
.tg-status-card.tg-warn .tg-status-value { color: #e6a028; }
.tg-status-card.tg-off .tg-status-value { color: var(--text-muted); }

/* Feed items (reused in telegram farms list) */
.feed-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.feed-item:last-child { border-bottom: none; }
.feed-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.feed-icon { font-size: 1.1rem; }

/* Badges */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: .75rem;
  font-weight: 600;
  white-space: nowrap;
}
.badge-ok { background: rgba(44,182,125,.12); color: #2cb67d; }
.badge-warn { background: rgba(230,160,40,.12); color: #e6a028; }

/* Button group */
.btn-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* KPI accent-muted */
.stat-card.accent-muted { border-top-color: #555; }
.stat-card.accent-success { border-top-color: #2cb67d; }

/* ═══════════════════════════════════════════
   BENCHMARK & GENETICS
   ═══════════════════════════════════════════ */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.rank-top { background: rgba(44,182,125,.06); }
.rank-top td:first-child strong { color: #2cb67d; font-size: 1.1rem; }
.badge-ok { background: rgba(44,182,125,.12); color: #2cb67d; padding: 2px 10px; border-radius: 12px; font-size: .78rem; }
.badge-warn { background: rgba(230,160,40,.12); color: #e6a028; padding: 2px 10px; border-radius: 12px; font-size: .78rem; }
.badge-danger { background: rgba(230,96,74,.12); color: #e6604a; padding: 2px 10px; border-radius: 12px; font-size: .78rem; }
.btn-danger { background: rgba(230,96,74,.15); color: #e6604a; border: 1px solid rgba(230,96,74,.3); }
.btn-danger:hover { background: rgba(230,96,74,.25); }
.btn-sm { padding: 4px 10px; font-size: .78rem; border-radius: 6px; }
.card-list { display: flex; flex-direction: column; gap: 10px; }
.feed-item { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; background: rgba(255,255,255,.03); border: 1px solid var(--border); border-radius: 8px; }
.feed-left { display: flex; align-items: center; gap: 10px; }
.feed-icon { font-size: 1.2rem; }
.text-xs { font-size: .72rem; }
.text-sm { font-size: .82rem; }
.text-muted { opacity: .6; }
.mt-sm { margin-top: 10px; }
.mt-md { margin-top: 20px; }
.mb-md { margin-bottom: 20px; }

/* ═══════════════════════════════════════════
   IA ZOOTÉCNICA
   ═══════════════════════════════════════════ */
.ia-score-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px; border-radius: 16px; margin-bottom: 20px;
  border: 2px solid var(--border); background: rgba(255,255,255,.03);
}
.ia-score-card.tg-ok { border-color: rgba(44,182,125,.5); background: rgba(44,182,125,.08); }
.ia-score-card.tg-warn { border-color: rgba(230,160,40,.5); background: rgba(230,160,40,.08); }
.ia-score-card.tg-off { border-color: rgba(230,96,74,.5); background: rgba(230,96,74,.08); }
.ia-score-number { font-size: 3rem; font-weight: 800; font-family: 'Inter', sans-serif; }
.ia-score-card.tg-ok .ia-score-number { color: #2cb67d; }
.ia-score-card.tg-warn .ia-score-number { color: #e6a028; }
.ia-score-card.tg-off .ia-score-number { color: #e6604a; }
.ia-score-label { font-size: .85rem; opacity: .7; margin-top: 4px; }
.ia-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; margin-bottom: 20px; }
.ia-card {
  background: rgba(255,255,255,.03); border: 1px solid var(--border);
  border-left: 4px solid var(--border); border-radius: 10px; padding: 16px;
}
.ia-card h4 { margin: 0 0 8px; font-size: .95rem; }
.ia-card p { margin: 0; font-size: .82rem; opacity: .8; line-height: 1.5; }
.ia-card.ia-info { border-left-color: #7f5af0; }
.ia-card.ia-warning { border-left-color: #e6a028; background: rgba(230,160,40,.04); }
.ia-card.ia-critical { border-left-color: #e6604a; background: rgba(230,96,74,.04); }
.ia-list { list-style: none; padding: 0; margin: 12px 0 0; }
.ia-list li { padding: 8px 12px; margin-bottom: 6px; background: rgba(255,255,255,.03); border-radius: 6px; font-size: .85rem; line-height: 1.4; }
.ia-list li::before { content: '💡'; margin-right: 8px; }
.ia-alert-list li::before { content: '🚨'; }

/* Modal overlay */
.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.6); z-index: 1000; display: flex; align-items: center; justify-content: center; }
.modal-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 28px; max-width: 480px; width: 90%; max-height: 90vh; overflow-y: auto; }
.modal-card h3 { margin: 0 0 16px; }
.btn-group { display: flex; gap: 10px; margin-top: 16px; }

/* ═══════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════ */
@media (max-width: 1200px) {
  .four-col { grid-template-columns: repeat(2, 1fr); }
  .three-col { grid-template-columns: repeat(2, 1fr); }
  .tg-status-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
  .sidebar {
    position: fixed; top: 0; left: 0;
    transform: translateX(-100%);
  }
  .sidebar.open { transform: translateX(0); box-shadow: 4px 0 30px rgba(0,0,0,.5); }
  .menu-toggle { display: block; }
  .two-col, .three-col, .four-col { grid-template-columns: 1fr; }
  .content-area { padding: 18px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .tg-status-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .stats-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .login-card { padding: 28px 20px; }
  .tg-status-grid { grid-template-columns: 1fr; }
}
