/* ============================================================
   PlayerPROAR Light Theme v2.0
   Professional Light Theme — Single source of truth
   ============================================================ */

/* --- CSS Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; -webkit-font-smoothing: antialiased; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f1f5f9;
  color: #1e293b;
  min-height: 100vh;
  display: flex;
}
a { color: #3b82f6; text-decoration: none; }
a:hover { color: #2563eb; text-decoration: underline; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; }

/* --- Layout --- */
.sidebar {
  width: 240px;
  min-width: 240px;
  background: #1e293b;
  border-right: 1px solid #334155;
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: fixed;
  top: 0; left: 0;
  z-index: 100;
  overflow-y: auto;
}
.main-content, main {
  margin-left: 240px;
  flex: 1;
  min-height: 100vh;
  background: #f1f5f9;
  padding: 24px 32px;
}

/* --- Sidebar Logo --- */
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 16px 16px;
  border-bottom: 1px solid rgba(51,65,85,.5);
  margin-bottom: 8px;
}
.sidebar-logo .logo-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
}
.sidebar-logo .logo-icon svg { width: 18px; height: 18px; fill: white; }
.sidebar-logo .logo-text {
  font-size: 15px;
  font-weight: 700;
  color: #f1f5f9;
  letter-spacing: .3px;
}
.sidebar-logo .logo-version {
  font-size: 10px;
  color: #64748b;
  font-weight: 400;
}

/* --- Sidebar Sections --- */
.sidebar-section {
  padding: 0 12px;
  margin-bottom: 4px;
}
.sidebar-section-title {
  font-size: 10px;
  font-weight: 700;
  color: #475569;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  padding: 12px 8px 6px;
}

/* --- Sidebar Nav Items --- */
.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  color: #94a3b8;
  font-size: 13.5px;
  font-weight: 500;
  transition: all .15s ease;
  text-decoration: none;
  margin: 1px 0;
}
.sidebar-nav-item:hover {
  background: #334155;
  color: #cbd5e1;
  text-decoration: none;
}
.sidebar-nav-item.active {
  background: rgba(59,130,246,.2);
  color: #60a5fa;
}
.sidebar-nav-item svg {
  width: 18px; height: 18px;
  flex-shrink: 0;
  opacity: .7;
}
.sidebar-nav-item.active svg { opacity: 1; }

/* --- Sidebar Language Switcher --- */
.sidebar-lang-switcher {
  display: flex;
  gap: 4px;
  padding: 8px 20px 4px;
  border-top: 1px solid rgba(51,65,85,.4);
  margin-top: 4px;
}
.sidebar-lang-btn {
  background: transparent;
  border: 1px solid rgba(71,85,105,.6);
  color: #64748b;
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 11px;
  cursor: pointer;
  transition: all .15s;
  font-family: Inter, sans-serif;
  line-height: 1.4;
}
.sidebar-lang-btn:hover { border-color: #60a5fa; color: #e2e8f0; }
.sidebar-lang-btn.active { background: rgba(37,99,235,.2); border-color: #3b82f6; color: #60a5fa; font-weight: 600; }

/* --- Sidebar Footer --- */
.sidebar-footer {
  margin-top: auto;
  padding: 12px 16px;
  border-top: 1px solid rgba(51,65,85,.5);
}
.sidebar-footer .status-badge {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; color: #64748b;
}
.sidebar-footer .status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #22c55e;
}

/* --- Page Header --- */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e2e8f0;
}
.page-header h1 {
  font-size: 22px;
  font-weight: 700;
  color: #0f172a;
}
.page-header .subtitle, .subtitle {
  font-size: 13px;
  color: #64748b;
  margin-top: 2px;
}

/* --- Cards --- */
.card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.card-title {
  font-size: 15px;
  font-weight: 600;
  color: #0f172a;
}

/* --- Stats Grid --- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.stat-card .stat-label {
  font-size: 12px;
  color: #64748b;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 6px;
}
.stat-card .stat-value {
  font-size: 28px;
  font-weight: 700;
  color: #0f172a;
}
.stat-card .stat-sub {
  font-size: 12px;
  color: #64748b;
  margin-top: 4px;
}
.stat-card.green { border-left: 4px solid #22c55e; }
.stat-card.green .stat-value { color: #16a34a; }
.stat-card.red { border-left: 4px solid #ef4444; }
.stat-card.red .stat-value { color: #dc2626; }
.stat-card.blue { border-left: 4px solid #3b82f6; }
.stat-card.blue .stat-value { color: #2563eb; }
.stat-card.yellow { border-left: 4px solid #f59e0b; }
.stat-card.yellow .stat-value { color: #d97706; }
.stat-card.purple { border-left: 4px solid #8b5cf6; }
.stat-card.purple .stat-value { color: #7c3aed; }

/* --- Tables --- */
.table-container {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
thead {
  background: #f8fafc;
}
th {
  text-align: left;
  padding: 12px 16px;
  font-weight: 600;
  color: #64748b;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .5px;
  border-bottom: 2px solid #e2e8f0;
}
td {
  padding: 10px 16px;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
}
tr:hover td { background: #f8fafc; }
tr:last-child td { border-bottom: none; }

/* --- Badges --- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}
.badge.online { background: #dcfce7; color: #166534; }
.badge.offline { background: #fee2e2; color: #991b1b; }
.badge.unknown { background: #f1f5f9; color: #64748b; }
.badge.warning { background: #fef3c7; color: #92400e; }
.badge.info { background: #dbeafe; color: #1e40af; }
.badge.purple { background: #ede9fe; color: #5b21b6; }
.badge-success { background: #dcfce7; color: #166534; }
.badge-info { background: #dbeafe; color: #1e40af; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  border: none;
  transition: all .15s ease;
}
.btn-primary { background: #3b82f6; color: white; }
.btn-primary:hover { background: #2563eb; }
.btn-secondary { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }
.btn-secondary:hover { background: #e2e8f0; }
.btn-danger { background: #dc2626; color: white; }
.btn-danger:hover { background: #b91c1c; }
.btn-success { background: #16a34a; color: white; }
.btn-success:hover { background: #15803d; }
.btn-warning { background: #f59e0b; color: white; }
.btn-warning:hover { background: #d97706; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-icon {
  width: 32px; height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #e2e8f0;
}
.btn-icon:hover { background: #e2e8f0; color: #3b82f6; border-color: #3b82f6; }

/* --- Forms --- */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .3px;
}
.form-input, .form-select,
input[type="text"], input[type="url"], input[type="number"], input[type="password"],
select, textarea {
  width: 100%;
  padding: 9px 12px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  color: #1e293b;
  font-size: 13px;
}
.form-input:focus, .form-select:focus,
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59,130,246,.12);
}
.form-input::placeholder, input::placeholder { color: #94a3b8; }

/* --- Search Bar --- */
.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 8px 12px;
}
.search-bar input {
  flex: 1;
  background: transparent;
  border: none;
  color: #1e293b;
  font-size: 13px;
  outline: none;
}
.search-bar svg { width: 16px; height: 16px; color: #94a3b8; }

/* --- Toolbar / Filter Bar --- */
.toolbar, .filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.filter-bar input[type="text"] { max-width: 300px; }
.filter-bar select { max-width: 200px; }

/* --- Pagination --- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 16px;
}
.pagination button {
  padding: 6px 12px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  color: #64748b;
  font-size: 12px;
}
.pagination button:hover { background: #f1f5f9; color: #3b82f6; border-color: #3b82f6; }
.pagination button.active { background: #3b82f6; color: white; border-color: #3b82f6; }
.pagination button:disabled { opacity: .4; cursor: not-allowed; }

/* --- Modal / Overlay --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  overflow: hidden;
}
.modal {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 24px;
  max-width: 600px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.15);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.modal-title {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
}

/* --- Player Modal --- */
.player-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}
.player-container {
  width: 90%;
  max-width: 900px;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
  border-radius: 12px;
  overflow: hidden;
}
.player-video {
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
  display: block;
}
.player-info {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-top: none;
  padding: 16px;
}
.player-title {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 12px;
}
.player-url-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  background: #f8fafc;
  border-radius: 8px;
  padding: 8px 12px;
}
.player-url-label {
  font-size: 10px;
  font-weight: 700;
  color: #3b82f6;
  text-transform: uppercase;
  letter-spacing: .5px;
  white-space: nowrap;
}
.player-url-value {
  flex: 1;
  font-size: 12px;
  color: #64748b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: 'JetBrains Mono', monospace;
}
.player-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

/* --- Tabs --- */
.tabs {
  display: flex;
  gap: 2px;
  background: #f1f5f9;
  border-radius: 10px;
  padding: 3px;
  margin-bottom: 16px;
}
.tab, .tab-btn {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: #64748b;
  background: transparent;
  border: none;
  transition: all .15s ease;
  cursor: pointer;
}
.tab:hover, .tab-btn:hover { color: #1e293b; }
.tab.active, .tab-btn.active { background: #ffffff; color: #0f172a; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* --- Toast / Notifications --- */
.toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 300px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  animation: slideIn .3s ease;
  color: #1e293b;
  font-size: 13px;
  font-weight: 500;
}
.toast.success { border-left: 4px solid #22c55e; }
.toast.error { border-left: 4px solid #ef4444; }
.toast.info { border-left: 4px solid #3b82f6; }
.toast.warning { border-left: 4px solid #f59e0b; }
@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* --- Loading Spinner --- */
.spinner {
  width: 24px; height: 24px;
  border: 3px solid #e2e8f0;
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Checkbox --- */
.checkbox-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: #475569; cursor: pointer;
}
input[type="checkbox"] {
  width: 16px; height: 16px; accent-color: #3b82f6; cursor: pointer;
}

/* --- Progress Bar --- */
.progress-bar {
  width: 100%; height: 8px;
  background: #e2e8f0;
  border-radius: 4px; overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s;
}
.progress-fill.green { background: #22c55e; }
.progress-fill.red { background: #ef4444; }
.progress-fill.yellow { background: #f59e0b; }
.progress-fill.blue { background: #3b82f6; }

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* --- Responsive --- */
@media (max-width: 768px) {
  .sidebar { width: 60px; min-width: 60px; }
  .sidebar .logo-text, .sidebar .logo-version,
  .sidebar .sidebar-section-title,
  .sidebar .sidebar-nav-item span { display: none; }
  .sidebar .sidebar-nav-item { justify-content: center; padding: 12px; }
  .main-content, main { margin-left: 60px; padding: 16px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .filter-bar { flex-direction: column; }
  .filter-bar input, .filter-bar select { max-width: 100%; }
}

/* ============================================================
   FASE 12.1 — Polish profesional (Inter font + microinteracciones)
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

body, html {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  font-feature-settings: 'cv11', 'ss01', 'ss03';   /* Inter stylistic alternates */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { letter-spacing: -0.02em; font-weight: 700; }
.page-header h1 { font-size: 26px; }

/* Botones — micro-interacciones suaves */
.btn {
  transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease, border-color 0.12s ease;
  font-family: inherit;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 2px solid #3b82f6; outline-offset: 2px; }

/* Stat cards — sombras refinadas */
.stat-card {
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  border: 1px solid rgba(255,255,255,0.06);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(0,0,0,0.35); }

/* Tablas — row hover sutil */
.card table tbody tr { transition: background 0.12s ease; }
.card table tbody tr:hover { background: rgba(59,130,246,0.06); }

/* Badges — alineacion vertical mas precisa */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 5px;
}

/* Modales — entrada animada */
.modal-overlay {
  animation: ppar-fadein 0.18s ease;
  backdrop-filter: blur(4px);
  background: rgba(0,0,0,0.55);
}
.modal {
  animation: ppar-modalin 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}
@keyframes ppar-fadein  { from { opacity: 0 } to { opacity: 1 } }
@keyframes ppar-modalin { from { opacity: 0; transform: translateY(-12px) scale(0.98) }
                          to   { opacity: 1; transform: translateY(0)     scale(1) } }

/* Inputs — focus profesional */
.form-input, .form-select, input[type="text"], input[type="number"],
input[type="password"], input[type="email"], textarea, select {
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
  font-family: inherit;
}
.form-input:focus, .form-select:focus, input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* Sidebar — items con hover suave */
.sidebar-nav-item {
  transition: background 0.12s ease, color 0.12s ease, padding-left 0.12s ease;
}
.sidebar-nav-item:hover {
  padding-left: calc(var(--sidebar-item-padding, 16px) + 2px);
  background: rgba(59, 130, 246, 0.1);
}

/* Scrollbars — discretas (Firefox + WebKit) */
* { scrollbar-width: thin; scrollbar-color: #475569 transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #475569; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #64748b; }

/* Code y URLs */
code, pre {
  font-family: 'JetBrains Mono', 'Menlo', 'Consolas', 'Courier New', monospace;
  font-size: 0.92em;
}

/* Skeleton loader (usable con class="ppar-skel") */
.ppar-skel {
  background: linear-gradient(90deg, rgba(148,163,184,0.1) 25%, rgba(148,163,184,0.2) 50%, rgba(148,163,184,0.1) 75%);
  background-size: 200% 100%;
  animation: ppar-shimmer 1.4s linear infinite;
  border-radius: 4px;
  display: inline-block;
}
@keyframes ppar-shimmer { 0% { background-position: 200% 0 } 100% { background-position: -200% 0 } }

/* Selección de texto consistente */
::selection { background: rgba(59,130,246,0.35); color: #fff; }

/* ═══════════════════════════════════════════════════════════════════════════
   FASE 18 — Enterprise polish addons (LIGHT theme aware)
   Replaces FASE 17 block. The panel is light-themed by default — these
   components match #f1f5f9 background and dark-on-light text.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ---------- 1. Data-table (works on light card background) ---------- */
table.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
  background: transparent;
}
table.data-table thead {
  background: #f8fafc;
}
table.data-table thead th {
  text-align: left;
  padding: 12px 14px;
  font-size: 10.5px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .06em;
  border-bottom: 1px solid #e2e8f0;
  background: transparent;
  white-space: nowrap;
}
table.data-table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
  vertical-align: middle;
  background: transparent;
}
table.data-table tbody td > div + div {
  margin-top: 4px;
}
table.data-table tbody tr {
  transition: background 0.12s ease;
}
table.data-table tbody tr:hover td {
  background: #f8fafc;
}
table.data-table tbody tr:last-child td { border-bottom: 0; }

/* ---------- 2. Action group: pill of small icon buttons (light theme) ---------- */
.action-group {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 2px;
  box-shadow: 0 1px 2px rgba(15,23,42,0.04);
}
.action-group .action-btn {
  width: 30px; height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: #475569;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.12s ease;
  position: relative;
  text-decoration: none;
}
.action-group .action-btn:hover {
  background: #eff6ff;
  color: #2563eb;
}
.action-group .action-btn.success { color: #16a34a; }
.action-group .action-btn.success:hover { background: #f0fdf4; color: #15803d; }
.action-group .action-btn.danger { color: #dc2626; }
.action-group .action-btn.danger:hover { background: #fef2f2; color: #b91c1c; }
.action-group .action-btn.warning { color: #d97706; }
.action-group .action-btn.warning:hover { background: #fffbeb; color: #b45309; }
.action-group .action-btn:focus-visible { outline: 2px solid #3b82f6; outline-offset: 1px; }
.action-group .action-btn svg { display: block; }

/* tooltip: data-tip attribute */
[data-tip] { position: relative; }
[data-tip]::before {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #0f172a;
  color: #ffffff;
  font-size: 11px;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: 5px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s ease, transform 0.12s ease;
  transform: translateX(-50%) translateY(4px);
  z-index: 9999;
  letter-spacing: 0;
  text-transform: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
[data-tip]::after {
  content: '';
  position: absolute;
  bottom: calc(100% + 3px);
  left: 50%;
  transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid #0f172a;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s ease;
  z-index: 9999;
}
[data-tip]:hover::before, [data-tip]:hover::after {
  opacity: 1;
}
[data-tip]:hover::before { transform: translateX(-50%) translateY(0); }

/* ---------- Mass Edit field tags ---------- */
.mass-field-tag {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  background: #e2e8f0;
  color: #475569;
  transition: all 0.15s;
  white-space: nowrap;
}
.mass-field-tag:hover { background: #cbd5e1; color: #1e293b; }
.mass-field-tag.active { background: #dbeafe; color: #1d4ed8; border-color: #3b82f6; }
.mass-field-tag.active:hover { background: #bfdbfe; }

/* ---------- 3. Kebab menu (dropdown of actions) ---------- */
.kebab-wrap { position: relative; display: inline-block; }
.kebab-btn {
  width: 30px; height: 30px;
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  color: #475569;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.12s;
}
.kebab-btn:hover { background: #eff6ff; color: #2563eb; }
.kebab-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  min-width: 200px;
  padding: 5px;
  box-shadow: 0 12px 28px rgba(15,23,42,0.12), 0 4px 8px rgba(15,23,42,0.04);
  z-index: 1000;
  display: none;
}
.kebab-menu.open { display: block; }
.kebab-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  border-radius: 5px;
  font-size: 13px;
  color: #334155;
  cursor: pointer;
  transition: background 0.1s;
  background: transparent;
  border: 0;
  width: 100%;
  text-align: left;
  font-family: inherit;
}
.kebab-item:hover { background: #f1f5f9; color: #0f172a; }
.kebab-item.danger { color: #dc2626; }
.kebab-item.danger:hover { background: #fef2f2; color: #b91c1c; }
.kebab-item .kebab-icon { color: #94a3b8; flex-shrink: 0; display: inline-flex; }
.kebab-item:hover .kebab-icon { color: inherit; }
.kebab-divider { height: 1px; background: #e2e8f0; margin: 4px 0; }

/* ---------- 4. Metric card (LIGHT) ---------- */
.metric-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(15,23,42,0.04);
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(15,23,42,0.08);
  border-color: #cbd5e1;
}
.metric-card .metric-label {
  font-size: 11px;
  text-transform: uppercase;
  color: #64748b;
  letter-spacing: 0.06em;
  font-weight: 600;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.metric-card .metric-value {
  font-size: 28px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
  font-variant-numeric: tabular-nums;
}
.metric-card .metric-sub {
  font-size: 12px;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 6px;
}
.metric-card.is-warning { border-color: #f59e0b; box-shadow: 0 0 0 1px rgba(245,158,11,0.25); }
.metric-card.is-warning .metric-value { color: #b45309; }
.metric-card.is-danger  { border-color: #ef4444; box-shadow: 0 0 0 1px rgba(239,68,68,0.25); }
.metric-card.is-danger .metric-value { color: #b91c1c; }
.metric-card.is-good    { border-color: #22c55e; box-shadow: 0 0 0 1px rgba(34,197,94,0.20); }
.metric-card.is-good .metric-value { color: #15803d; }

/* ---------- 5. Progress bars ---------- */
.progress-bar {
  width: 100%;
  height: 8px;
  background: #e2e8f0;
  border-radius: 100px;
  overflow: hidden;
  position: relative;
}
.progress-bar > .progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #2563eb);
  border-radius: 100px;
  transition: width 0.5s ease;
}
.progress-bar.warning > .progress-fill { background: linear-gradient(90deg, #f59e0b, #d97706); }
.progress-bar.danger > .progress-fill { background: linear-gradient(90deg, #ef4444, #dc2626); }
.progress-bar.success > .progress-fill { background: linear-gradient(90deg, #22c55e, #16a34a); }

/* ---------- 6. Alert banner (LIGHT) ---------- */
.alert-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 8px;
  border-left: 3px solid;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  font-size: 13px;
  color: #334155;
  margin-bottom: 10px;
  box-shadow: 0 1px 2px rgba(15,23,42,0.03);
}
.alert-banner.info     { border-left: 3px solid #3b82f6; background: #eff6ff; border-color: #bfdbfe; }
.alert-banner.success  { border-left: 3px solid #22c55e; background: #f0fdf4; border-color: #bbf7d0; }
.alert-banner.warning  { border-left: 3px solid #f59e0b; background: #fffbeb; border-color: #fde68a; }
.alert-banner.danger   { border-left: 3px solid #ef4444; background: #fef2f2; border-color: #fecaca; animation: alert-pulse 1.8s ease-in-out infinite; }
@keyframes alert-pulse { 0%,100%{box-shadow:0 0 0 0 rgba(239,68,68,0)} 50%{box-shadow:0 0 0 4px rgba(239,68,68,0.10)} }
.alert-banner .alert-icon { flex-shrink: 0; padding-top: 2px; color: inherit; }
.alert-banner.info .alert-icon { color: #1d4ed8; }
.alert-banner.success .alert-icon { color: #15803d; }
.alert-banner.warning .alert-icon { color: #b45309; }
.alert-banner.danger .alert-icon { color: #b91c1c; }
.alert-banner .alert-body { flex: 1; min-width: 0; }
.alert-banner .alert-title { font-weight: 600; color: #0f172a; margin-bottom: 2px; }
.alert-banner .alert-meta { font-size: 11px; color: #64748b; margin-top: 4px; }
.alert-banner .alert-close { background: transparent; border: 0; color: #94a3b8; cursor: pointer; padding: 0; font-size: 18px; line-height: 1; }
.alert-banner .alert-close:hover { color: #334155; }

/* ---------- 7. Drag-handle indicators ---------- */
.drag-handle {
  cursor: grab;
  color: #94a3b8;
  padding: 4px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
}
.drag-handle:hover { color: #2563eb; background: #eff6ff; }
.drag-handle:active { cursor: grabbing; }
.drag-ghost {
  opacity: 0.4;
  background: #eff6ff;
  border: 1px dashed #3b82f6;
}
.drag-over {
  background: #eff6ff;
  outline: 2px dashed #3b82f6;
  outline-offset: -2px;
}

/* ---------- 8. Empty-state ---------- */
.empty-state {
  padding: 60px 20px;
  text-align: center;
  color: #64748b;
}
.empty-state .empty-icon {
  display: inline-flex;
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: #eff6ff;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  color: #3b82f6;
}
.empty-state .empty-title {
  font-size: 16px;
  color: #0f172a;
  font-weight: 600;
  margin-bottom: 6px;
}
.empty-state .empty-msg { font-size: 13px; line-height: 1.55; max-width: 380px; margin: 0 auto 14px; }

/* ---------- 9. Disabled-but-readable mass-edit fields ---------- */
.field-row .value-cell {
  opacity: 0.5;
  filter: grayscale(0.3);
  pointer-events: none;
  transition: opacity 0.15s, filter 0.15s;
}
.field-row.enabled .value-cell {
  opacity: 1;
  filter: none;
  pointer-events: auto;
}
.field-row.enabled label { color: #0f172a; font-weight: 600; }

/* ---------- 10. Severity dot (live status indicator) ---------- */
.dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  vertical-align: middle;
  margin-right: 4px;
  flex-shrink: 0;
}
.dot.online   { background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,0.20); animation: dot-pulse 2s ease-in-out infinite; }
.dot.offline  { background: #ef4444; }
.dot.degraded { background: #f59e0b; }
.dot.unknown  { background: #94a3b8; }
@keyframes dot-pulse {
  0%,100% { box-shadow: 0 0 0 3px rgba(34,197,94,0.20); }
  50%     { box-shadow: 0 0 0 6px rgba(34,197,94,0.05); }
}

/* ---------- 11. Toolbar separator ---------- */
.toolbar-sep {
  width: 1px;
  height: 22px;
  background: #e2e8f0;
  margin: 0 6px;
  display: inline-block;
}

/* ---------- 12. Section title with action ---------- */
.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 12px;
  flex-wrap: wrap;
}
.section-title-row h2, .section-title-row h3 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ---------- 13. Mini sparkline ---------- */
.sparkline {
  width: 100%;
  height: 36px;
  margin-top: 8px;
  display: block;
}

/* ---------- 14. Pulse for live-update elements ---------- */
.live-pulse::before {
  content: '';
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #ef4444;
  margin-right: 6px;
  vertical-align: middle;
  animation: live-blink 1.4s ease-in-out infinite;
}
@keyframes live-blink { 0%,100%{opacity:1} 50%{opacity:0.3} }

/* ---------- 15. Sidebar collapsible sections ---------- */
.sidebar-section {
  margin-bottom: 4px;
}
.sidebar-section.collapsible .sidebar-section-title {
  cursor: pointer;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
  font-weight: 700;
  user-select: none;
  border-radius: 4px;
  margin: 0 8px;
  transition: background 0.12s, color 0.12s;
}
.sidebar-section.collapsible .sidebar-section-title:hover {
  background: rgba(255,255,255,0.05);
  color: #e2e8f0;
}
.sidebar-section.collapsible .sidebar-section-title .chev {
  transition: transform 0.18s ease;
  display: inline-flex;
}
.sidebar-section.collapsed .sidebar-section-title .chev {
  transform: rotate(-90deg);
}
.sidebar-section .sidebar-section-items {
  overflow: hidden;
  max-height: 1200px;
  transition: max-height 0.25s ease, opacity 0.18s;
  opacity: 1;
}
.sidebar-section.collapsed .sidebar-section-items {
  max-height: 0;
  opacity: 0;
}

/* Inline icon-text alignment helper */
.icon-text {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  vertical-align: middle;
}

/* badge specifically for count / KPI inside cells */
.cell-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.cell-pill.green { background: #dcfce7; color: #166534; }
.cell-pill.red   { background: #fee2e2; color: #991b1b; }
.cell-pill.blue  { background: #dbeafe; color: #1e40af; }
.cell-pill.purple{ background: #ede9fe; color: #5b21b6; }
.cell-pill.gray  { background: #f1f5f9; color: #475569; }
.cell-pill.amber { background: #fef3c7; color: #92400e; }

/* ═══════════════════════════════════════════════════════════════════════════
   FASE 20 — Mobile responsive addons
   Appended after FASE 18 light addons. All breakpoints ≤768px.
   ═══════════════════════════════════════════════════════════════════════════ */

/* Sidebar collapsible on mobile */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 999;
    width: 260px;
    box-shadow: 4px 0 16px rgba(0,0,0,0.15);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-content, main {
    margin-left: 0 !important;
    padding: 14px 12px !important;
  }
  .sidebar-toggle-mobile {
    position: fixed;
    top: 14px;
    left: 14px;
    z-index: 1001;
    width: 40px; height: 40px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.10);
    color: #0f172a;
  }
  .sidebar-backdrop {
    position: fixed; inset: 0; background: rgba(0,0,0,0.4);
    z-index: 998; display: none;
  }
  .sidebar-backdrop.open { display: block; }
  .page-header {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .page-header h1 { font-size: 22px; }
  .page-header .subtitle { font-size: 12px; }
  .page-header > div:last-child {
    flex-wrap: wrap;
  }
  .page-header > div:last-child .btn {
    flex: 1 1 auto;
    min-width: 110px;
    font-size: 13px;
    padding: 8px 10px;
  }
  /* Show toggle only on mobile */
  body { padding-top: 0; }
  /* Padding header so it doesn't overlap toggle */
  .main-content > .page-header:first-of-type { padding-top: 50px; }

  /* Filter bars */
  .filter-bar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px;
  }
  .filter-bar input,
  .filter-bar select {
    max-width: none !important;
    width: 100%;
  }

  /* Tables: scroll horizontally */
  table.data-table,
  table {
    font-size: 12px;
  }
  .table-container,
  .card {
    overflow-x: auto;
  }
  table th, table td {
    padding: 8px !important;
    white-space: nowrap;
  }

  /* Modals: full-screen on mobile */
  .modal-overlay .modal,
  .modal {
    width: 100vw !important;
    max-width: none !important;
    max-height: 100vh !important;
    height: 100vh;
    border-radius: 0 !important;
    margin: 0 !important;
  }
  .modal-overlay {
    padding: 0 !important;
    align-items: flex-start !important;
  }
  .modal-body { padding: 14px !important; }
  .modal-header { padding: 14px !important; }
  .modal-footer { padding: 12px 14px !important; flex-wrap: wrap; }

  /* Form grids → 1 column on mobile */
  div[style*="grid-template-columns:1fr 1fr"],
  div[style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* Stats grid */
  .stats-grid,
  .docs-stats,
  .proxy-stats {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px;
  }

  /* Action group: keep horizontal but smaller */
  .action-group .action-btn {
    width: 32px; height: 32px;
  }

  /* Kebab menu: position-aware */
  .kebab-menu {
    right: auto;
    left: 0;
    min-width: 180px;
  }

  /* Hide some non-critical columns on mobile */
  table .hide-mobile,
  table th.hide-mobile,
  table td.hide-mobile { display: none !important; }
}

/* Tablet */
@media (max-width: 1024px) and (min-width: 769px) {
  .stats-grid,
  .docs-stats {
    grid-template-columns: repeat(3, 1fr) !important;
  }
  .page-header { gap: 10px; }
}

/* Always: prevent horizontal page scroll */
body, html {
  max-width: 100vw;
  overflow-x: hidden;
}

/* Scrollbars on touch */
.table-container,
.card,
.preview-list,
.kebab-menu {
  -webkit-overflow-scrolling: touch;
}

/* Better touch targets */
@media (max-width: 640px) {
  .btn { min-height: 38px; }
  input, select, textarea { font-size: 16px !important; /* prevents iOS zoom */ }
}

/* Sidebar item bigger touch target on mobile */
@media (max-width: 768px) {
  .sidebar-nav-item {
    padding: 12px 16px !important;
    font-size: 14px;
  }
  .sidebar-section-title {
    padding: 10px 16px !important;
    font-size: 11px;
  }
}
