/* ═══════════════════════════════════════════════════════════════════════
   Fuego Social — Admin Dashboard
   Brand: Plus Jakarta Sans, warm brown-blacks, #FF5A00 primary
   ═══════════════════════════════════════════════════════════════════════ */

/* Global hidden override — must beat ID-level display rules like
   "#login { display: flex }" further down. Without this, setting
   element.hidden = true from JS does nothing on those nodes. */
[hidden] { display: none !important; }

:root {
  /* Brand colors — from brand.config.ts */
  --primary: #FF5A00;
  --primary-dark: #CC4800;
  --primary-light: #FF7A2E;
  --gold: #D4A847;

  /* Backgrounds */
  --bg: #0C0A08;
  --bg-alt: #100D0A;
  --surface: #161210;
  --card: #1C1714;
  --card-hover: #221C18;

  /* Borders */
  --border: #2A211C;
  --border-light: #3A2E26;

  /* Text */
  --text: #F2EDE4;
  --text-muted: #9A8C7C;
  --text-subtle: #6A5E52;

  /* Status */
  --success: #4CAF50;
  --success-bg: rgba(76,175,80,0.12);
  --warning: #F5A623;
  --warning-bg: rgba(245,166,35,0.12);
  --error: #E53935;
  --error-bg: rgba(229,57,53,0.12);
  --info: #29B6F6;
  --info-bg: rgba(41,182,246,0.12);

  /* Spacing */
  --sidebar-w: 260px;
  --topbar-h: 56px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;

  /* Motion */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);

  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  color: var(--text);
}

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

body {
  background: var(--bg);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-light); }

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

/* ═══════════════════════════════════════════════════════════════════
   LOGIN
   ═══════════════════════════════════════════════════════════════════ */

#login {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg);
  padding: 20px;
}

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

.login-logo {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  margin-bottom: 20px;
  filter: drop-shadow(0 0 24px rgba(255,90,0,0.4));
}

.login-card h1 {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.login-sub {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 28px;
}

/* ═══════════════════════════════════════════════════════════════════
   FORM ELEMENTS
   ═══════════════════════════════════════════════════════════════════ */

.field {
  margin-bottom: 16px;
  text-align: left;
}

.field label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.field input, .field textarea, .field select {
  width: 100%;
}

input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="search"], input[type="date"],
textarea, select {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.9375rem;
  font-family: inherit;
  transition: border-color 0.2s var(--ease);
  outline: none;
}

input:focus, textarea:focus, select:focus {
  border-color: var(--primary);
}

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

.search-input {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 0.875rem;
  font-family: inherit;
  outline: none;
  min-width: 240px;
  transition: border-color 0.2s var(--ease);
}
.search-input:focus { border-color: var(--primary); }

.filter-select {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 0.875rem;
  font-family: inherit;
  outline: none;
  cursor: pointer;
  min-width: 160px;
}
.filter-select:focus { border-color: var(--primary); }

.mono-textarea {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.875rem;
  line-height: 1.6;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 14px;
  width: 100%;
  resize: vertical;
  outline: none;
}
.mono-textarea:focus { border-color: var(--primary); }

.error {
  color: var(--error);
  font-size: 0.8125rem;
  margin-top: 12px;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.875rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 9px 20px;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover { background: var(--primary-dark); }

.btn-success {
  background: var(--success);
  color: #fff;
}
.btn-success:hover { opacity: 0.9; }

.btn-danger {
  background: var(--error);
  color: #fff;
}
.btn-danger:hover { opacity: 0.9; }

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

.btn-sm { padding: 5px 12px; font-size: 0.8125rem; }
.btn-lg { padding: 12px 28px; font-size: 1rem; width: 100%; }
.btn-icon { padding: 8px; width: 36px; height: 36px; }
.btn-icon svg { width: 20px; height: 20px; }

.btn:disabled, .btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

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

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--bg-alt);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
  overflow-x: hidden;
  transition: transform 0.3s var(--ease);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  filter: drop-shadow(0 0 12px rgba(255,90,0,0.35));
}

.sidebar-title {
  font-size: 0.9375rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.wm-fuego { color: var(--primary); }
.wm-social { color: var(--text); margin-left: 2px; }

.sidebar-badge {
  background: var(--primary);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.06em;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 10px;
  overflow-y: auto;
}

.nav-group-label {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-subtle);
  padding: 16px 12px 6px;
}
.nav-group-label:first-child { padding-top: 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.875rem;
  font-weight: 500;
  transition: all 0.15s var(--ease);
  text-decoration: none;
}

.nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  stroke-width: 1.8;
}

.nav-item:hover {
  color: var(--text);
  background: var(--surface);
}

.nav-item.active {
  color: var(--primary);
  background: rgba(255, 90, 0, 0.08);
  font-weight: 600;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.admin-user {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-logout {
  width: 100%;
}

/* ═══════════════════════════════════════════════════════════════════
   MOBILE TOPBAR
   ═══════════════════════════════════════════════════════════════════ */

.mobile-topbar {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--topbar-h);
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  z-index: 90;
}

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

#main {
  margin-left: var(--sidebar-w);
  padding: 32px;
  min-height: 100vh;
}

.view { animation: fadeIn 0.2s var(--ease); }

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

.view-header {
  margin-bottom: 28px;
}

.view-header h1 {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.2;
}

.view-sub {
  color: var(--text-muted);
  font-size: 0.9375rem;
  margin-top: 4px;
}

.view-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.view-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

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

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 16px;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.card-head h2 {
  font-size: 1rem;
  font-weight: 700;
}

/* ═══════════════════════════════════════════════════════════════════
   STATS GRID
   ═══════════════════════════════════════════════════════════════════ */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  transition: border-color 0.2s var(--ease);
}
.stat-card:hover { border-color: var(--border-light); }

.stat-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.1;
}

.stat-sub {
  font-size: 0.8125rem;
  color: var(--text-subtle);
  margin-top: 6px;
}

.stat-card.accent { border-left: 3px solid var(--primary); }
.stat-card.success-accent { border-left: 3px solid var(--success); }
.stat-card.warning-accent { border-left: 3px solid var(--warning); }
.stat-card.error-accent { border-left: 3px solid var(--error); }

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

.dash-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
}

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

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

thead th {
  text-align: left;
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  position: sticky;
  top: 0;
  background: var(--card);
}

tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text);
}

tbody tr { transition: background 0.15s var(--ease); }
tbody tr:hover { background: var(--surface); }
tbody tr:last-child td { border-bottom: none; }

td.mono {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8125rem;
}

td.muted { color: var(--text-muted); }
td.truncate { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.row-link { cursor: pointer; }
.row-link:hover { background: rgba(255,90,0,0.04) !important; }

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

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-error   { background: var(--error-bg);   color: var(--error);   }
.badge-info    { background: var(--info-bg);     color: var(--info);    }
.badge-muted   { background: rgba(154,140,124,0.12); color: var(--text-muted); }
.badge-primary { background: rgba(255,90,0,0.12);    color: var(--primary);    }

/* ═══════════════════════════════════════════════════════════════════
   PAGINATION
   ═══════════════════════════════════════════════════════════════════ */

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 16px 0 4px;
}

.pagination .btn {
  min-width: 36px;
  padding: 6px 12px;
}

.pagination .page-info {
  font-size: 0.8125rem;
  color: var(--text-muted);
  padding: 0 12px;
}

/* ═══════════════════════════════════════════════════════════════════
   MODAL
   ═══════════════════════════════════════════════════════════════════ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 60px 20px;
  z-index: 200;
  overflow-y: auto;
  backdrop-filter: blur(4px);
  animation: fadeOverlay 0.2s var(--ease);
}

@keyframes fadeOverlay {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 700px;
  padding: 28px;
  animation: slideUp 0.25s var(--ease);
}

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

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.modal-head h2 {
  font-size: 1.25rem;
  font-weight: 800;
}

.modal-close {
  flex-shrink: 0;
}

.modal-section {
  margin-bottom: 20px;
}

.modal-section h3 {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 12px;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.detail-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.detail-value {
  font-size: 0.9375rem;
  color: var(--text);
  word-break: break-word;
}

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

/* ═══════════════════════════════════════════════════════════════════
   SETTINGS
   ═══════════════════════════════════════════════════════════════════ */

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.setting-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
}

.setting-key {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

.setting-value {
  display: flex;
  align-items: center;
  gap: 10px;
}

.setting-value input, .setting-value select {
  flex: 1;
}

/* ═══════════════════════════════════════════════════════════════════
   SQL CONSOLE
   ═══════════════════════════════════════════════════════════════════ */

.sql-status {
  font-size: 0.8125rem;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.sql-results {
  overflow-x: auto;
}

.sql-results table {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8125rem;
}

.sql-results thead th {
  background: var(--surface);
  font-size: 0.6875rem;
}

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

.alert-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.alert-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
}

.alert-item.alert-error   { background: var(--error-bg);   }
.alert-item.alert-warning { background: var(--warning-bg); }
.alert-item.alert-info    { background: var(--info-bg);    }
.alert-item.alert-success { background: var(--success-bg); }

.alert-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}

.alert-item.alert-error   .alert-icon { color: var(--error);   }
.alert-item.alert-warning .alert-icon { color: var(--warning); }
.alert-item.alert-info    .alert-icon { color: var(--info);    }
.alert-item.alert-success .alert-icon { color: var(--success); }

/* ═══════════════════════════════════════════════════════════════════
   EMPTY STATE
   ═══════════════════════════════════════════════════════════════════ */

.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-subtle);
}

.empty-state svg {
  width: 48px;
  height: 48px;
  margin-bottom: 12px;
  opacity: 0.4;
}

.empty-state p {
  font-size: 0.9375rem;
}

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

.toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  z-index: 999;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  animation: toastIn 0.3s var(--ease);
}

.toast.toast-error { border-color: var(--error); color: var(--error); }
.toast.toast-success { border-color: var(--success); color: var(--success); }

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

/* ═══════════════════════════════════════════════════════════════════
   LOADING SKELETON
   ═══════════════════════════════════════════════════════════════════ */

.skeleton {
  background: linear-gradient(90deg, var(--surface) 25%, var(--border) 50%, var(--surface) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-line {
  height: 16px;
  margin-bottom: 10px;
  border-radius: 4px;
}

.skeleton-line:last-child { width: 60%; }

/* ═══════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════ */

@media (max-width: 1200px) {
  .dash-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .settings-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0,0,0,0.5);
  }

  .mobile-topbar { display: flex; }

  #main {
    margin-left: 0;
    padding: 16px;
    padding-top: calc(var(--topbar-h) + 16px);
  }

  .view-header h1 { font-size: 1.375rem; }
  .stat-value { font-size: 1.25rem; }
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .stat-card { padding: 12px; }
  .stat-label { font-size: 0.6875rem; margin-bottom: 4px; }
  .stat-sub { font-size: 0.6875rem; margin-top: 4px; }
  .view-header-row { flex-direction: column; }
  .view-actions { width: 100%; }
  .search-input { min-width: unset; width: 100%; }

  .modal {
    max-width: 100%;
    padding: 20px;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .stat-card { padding: 10px; }
  .stat-value { font-size: 1.125rem; }
  .stat-label { font-size: 0.625rem; }
  .stat-sub { font-size: 0.625rem; }
}

/* ─── Founder DM (admin) ─── */
.nav-badge {
  background: var(--color-primary, #FF5A00);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: 100px;
  margin-left: auto;
  min-width: 18px;
  text-align: center;
}
.founder-dm-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 16px;
  align-items: stretch;
}
.founder-dm-inbox {
  max-height: 70vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.founder-dm-inbox-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--color-border, rgba(255,255,255,0.05));
  cursor: pointer;
  transition: background 0.12s ease;
}
.founder-dm-inbox-item:hover { background: rgba(255, 90, 0, 0.06); }
.founder-dm-inbox-item.active { background: rgba(255, 90, 0, 0.10); }
.founder-dm-inbox-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
  background-size: cover;
  background-position: center;
  font-size: 13px;
}
.founder-dm-inbox-body { flex: 1; min-width: 0; }
.founder-dm-inbox-name {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.founder-dm-inbox-preview {
  font-size: 12px;
  color: var(--color-text-muted, rgba(255,255,255,0.6));
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-top: 2px;
}
.founder-dm-inbox-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}
.founder-dm-inbox-time {
  font-size: 10px;
  color: var(--color-text-muted, rgba(255,255,255,0.5));
}
.founder-dm-unread-pill {
  background: var(--color-primary, #FF5A00);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: 100px;
  min-width: 18px;
  text-align: center;
}
/* Back button — desktop default hidden; mobile @media block below shows it. */
.founder-dm-back-btn { display: none; }
.founder-dm-msgs {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 280px;
  max-height: 55vh;
  overflow-y: auto;
  padding: 12px 4px;
}
.founder-dm-msg-row {
  display: flex;
  width: 100%;
  min-width: 0;
}
.founder-dm-msg-row.from-founder { justify-content: flex-end; }
.founder-dm-msg-row.from-user { justify-content: flex-start; }
.founder-dm-msg-bubble {
  padding: 10px 14px;
  border-radius: 14px;
  max-width: 78%;
  min-width: 0;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: anywhere;
  box-sizing: border-box;
}
.founder-dm-msg-row.from-founder .founder-dm-msg-bubble {
  background: var(--color-primary, #FF5A00);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.founder-dm-msg-row.from-user .founder-dm-msg-bubble {
  background: rgba(255,255,255,0.06);
  color: var(--color-text, #F2EDE4);
  border-bottom-left-radius: 4px;
}
.founder-dm-msg-time {
  display: block;
  font-size: 10px;
  opacity: 0.7;
  margin-top: 4px;
}
.founder-dm-msg-receipt {
  display: inline-block;
  margin-left: 6px;
  font-size: 11px;
  letter-spacing: -1px;
  opacity: 0.65;
  cursor: help;
}
.founder-dm-msg-receipt.seen {
  color: #5CE0FF;
  opacity: 1;
  font-weight: 700;
}
.founder-dm-thread-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 0 0;
  border-top: 1px solid var(--color-border, rgba(255,255,255,0.05));
}
.founder-dm-thread-form textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--color-border, rgba(255,255,255,0.1));
  background: rgba(0,0,0,0.25);
  color: inherit;
  font: inherit;
  font-size: 14px;
  resize: vertical;
}
.founder-dm-thread-form textarea:focus {
  outline: none;
  border-color: var(--color-primary, #FF5A00);
}
.founder-dm-thread-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.founder-dm-empty {
  padding: 32px 16px;
  color: var(--color-text-muted, rgba(255,255,255,0.6));
  text-align: center;
  font-size: 13px;
  word-break: break-word;
  overflow-wrap: anywhere;
}
@media (max-width: 900px) {
  .founder-dm-layout {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  /* Grid children default to min-width:auto and grow to fit unbroken content
     (long emails, no-space previews). Force them to shrink-fit the column. */
  .founder-dm-layout > .card { min-width: 0; max-width: 100%; overflow: hidden; }

  /* Mobile: collapse the empty thread placeholder so the inbox isn't pushed off-screen. */
  .founder-dm-thread-card:not(.has-active) { display: none; }

  /* Mobile: when a thread is open, swap views entirely — hide the inbox, show only the thread.
     Without this, the thread card renders below the inbox (single-column grid) and the user has
     to scroll down to find it — bug paradigma sesión 22 ("le doy click y no pasa nada"). */
  .founder-dm-layout:has(.founder-dm-thread-card.has-active) > .card:not(.founder-dm-thread-card) {
    display: none;
  }

  /* Back button — only visible on mobile inside the thread card head. */
  .founder-dm-thread-card .founder-dm-back-btn { display: inline-flex; }
  .founder-dm-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 1px solid var(--border, #2a2520);
    color: var(--text, #F2EDE4);
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    margin-bottom: 10px;
    -webkit-tap-highlight-color: transparent;
  }
  .founder-dm-back-btn:active { background: rgba(255,255,255,0.04); }

  .founder-dm-msgs { min-height: 200px; max-height: 60vh; min-width: 0; }
  .founder-dm-thread-card .card-head { min-width: 0; }
  .founder-dm-thread-card .card-head h2 {
    font-size: 1.05rem;
    word-break: break-word;
    overflow-wrap: anywhere;
    line-height: 1.25;
  }
  .founder-dm-thread-card .card-head .view-sub,
  #founder-dm-thread-sub {
    display: block;
    word-break: break-all;
    overflow-wrap: anywhere;
    font-size: 11px;
    line-height: 1.35;
    margin-top: 4px;
  }
  .founder-dm-msg-row { max-width: 100%; }
  .founder-dm-msg-bubble {
    max-width: 85%;
    font-size: 13px;
  }
  .founder-dm-inbox-item { min-width: 0; }
  .founder-dm-inbox-preview { max-width: 100%; }
}

/* Listings admin: cover thumbnail + seats bar */
.lst-thumb {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
  background: rgba(255,255,255,0.04);
}
.lst-thumb-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.35);
  font-size: 18px;
}
.lst-seats {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 70px;
}
.lst-seats-text {
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  font-weight: 600;
}
.lst-seats-bar {
  display: block;
  width: 100%;
  height: 4px;
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
  overflow: hidden;
}
.lst-seats-fill {
  display: block;
  height: 100%;
  background: var(--brand, #FF5A00);
  border-radius: 2px;
  transition: width 0.2s ease;
}
.lst-pending {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(255,90,0,0.15);
  color: var(--brand, #FF5A00);
  font-size: 11px;
  font-weight: 700;
  vertical-align: middle;
}
.lst-host { display: flex; flex-direction: column; gap: 2px; }
.lst-host-name { font-weight: 600; font-size: 13px; }
.lst-host-email { color: rgba(255,255,255,0.5); font-size: 11px; }
.lst-actions { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.lst-actions a.btn,
.lst-actions button.btn { white-space: nowrap; }

/* Asado-requests (beta_free AR) admin view */
.ar-pill {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  vertical-align: middle;
}
.ar-pill.ar-pending   { background: rgba(245,166,35,0.18); color: #f5a623; }
.ar-pill.ar-confirmed { background: rgba(34,197,94,0.18);  color: #4ade80; }
.ar-pill.ar-rejected  { background: rgba(239,68,68,0.18);  color: #f87171; }
.ar-pill.ar-cancelled { background: rgba(148,163,184,0.18); color: #cbd5e1; }
.ar-msg { color: rgba(255,255,255,0.7); font-size: 12px; }
.ar-link { color: var(--brand, #FF5A00); text-decoration: none; margin-left: 4px; }
.ar-link:hover { text-decoration: underline; }

/* Home feed (pendientes + movimiento) */
.feed-list {
  display: flex;
  flex-direction: column;
}
.feed-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 4px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.feed-item:last-child { border-bottom: none; }
.feed-emoji {
  flex: 0 0 auto;
  width: 22px;
  text-align: center;
  font-size: 15px;
  line-height: 1.5;
  margin-top: 1px;
}
/* Confirmed bookings (money in) get a subtle green tint so revenue pops. */
.feed-type-booking_confirmed .feed-label { color: #6BCB77; }
.feed-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 6px;
  background: rgba(255,255,255,0.3);
}
.feed-sev-error   { background: #E5484D; box-shadow: 0 0 0 3px rgba(229,72,77,0.15); }
.feed-sev-warning { background: #F5A623; box-shadow: 0 0 0 3px rgba(245,166,35,0.15); }
.feed-sev-info    { background: #4D8AF0; box-shadow: 0 0 0 3px rgba(77,138,240,0.12); }
.feed-body {
  flex: 1 1 auto;
  min-width: 0;
}
.feed-label {
  font-size: 13.5px;
  line-height: 1.4;
  color: var(--text, #F2EDE4);
  word-break: break-word;
}
.feed-meta {
  margin-top: 2px;
  font-size: 11.5px;
  color: rgba(255,255,255,0.45);
  font-variant-numeric: tabular-nums;
}
.feed-time { color: rgba(255,255,255,0.5); }
.feed-action {
  flex: 0 0 auto;
  align-self: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--brand, #FF5A00);
  text-decoration: none;
  white-space: nowrap;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.15s ease;
}
.feed-action:hover { background: rgba(255,90,0,0.1); }

/* Analytics cockpit */
.view-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}
.view-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.subtabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  margin-top: 16px;
  overflow-x: auto;
}
.subtabs a {
  padding: 10px 14px;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  font-weight: 500;
  text-decoration: none;
}
.subtabs a:hover { color: var(--text); }
.subtabs a.active { color: var(--primary); border-bottom-color: var(--primary); }

.subtab-panel { padding-top: 16px; }

.date-range-picker {
  display: inline-flex;
  gap: 4px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 4px;
}
.date-range-picker button {
  background: transparent;
  border: 0;
  color: var(--text-muted);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
}
.date-range-picker button:hover { color: var(--text); }
.date-range-picker button.active {
  background: var(--primary);
  color: #fff;
}

.chart-wrap {
  position: relative;
  height: 280px;
  max-width: 100%;
}

.an-empty { padding: 16px; color: var(--text-muted); font-size: 14px; }
.an-banner-warn {
  background: rgba(245,166,35,0.08);
  border: 1px solid rgba(245,166,35,0.3);
  color: var(--text);
  padding: 12px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  margin-bottom: 16px;
}

@media (max-width: 720px) {
  .subtabs { padding-bottom: 0; }
  .chart-wrap { height: 220px; }
  .view-header-row { flex-direction: column; align-items: stretch; }
}

/* Cockpit Ads — hero metric ─────────────────────────────────────────────── */
.ads-hero { padding: 28px 24px; text-align: center; }
.ads-hero-amount { font-size: 44px; font-weight: 800; color: var(--primary); line-height: 1.1; letter-spacing: -0.02em; }
.ads-hero-label { font-size: 13px; color: var(--text-muted); margin-top: 6px; text-transform: uppercase; letter-spacing: 0.06em; }
.ads-hero-delta { font-size: 14px; margin-top: 12px; font-weight: 500; }
.ads-hero-delta.up { color: #FF9966; }
.ads-hero-delta.down { color: #5AC988; }
.ads-hero-delta.flat { color: var(--text-muted); }

/* Analytics KPI improvements */
.an-kpi { position: relative; }
.an-kpi-big { grid-column: span 2; }
.an-kpi-big .stat-value { font-size: 2.5rem; }
.an-kpi-primary { border-left: 3px solid var(--primary); }
.an-kpi-success { border-left: 3px solid var(--success); }
.an-kpi-warn { border-left: 3px solid var(--warning); }
.an-kpi-icon {
  font-size: 20px;
  line-height: 1;
  margin-bottom: 10px;
  display: block;
}
.an-kpi-trend {
  font-size: 0.75rem;
  font-weight: 600;
  margin-left: 6px;
  vertical-align: middle;
}
.an-kpi-trend-up { color: #4ade80; }
.an-kpi-trend-down { color: #f87171; }
.an-kpi-trend-flat { color: var(--text-muted); }

/* Funnel bars nicer */
.an-funnel-step { margin: 14px 0; }
.an-funnel-header { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; align-items: center; }
.an-funnel-label { font-weight: 600; }
.an-funnel-count { font-weight: 800; font-size: 15px; }
.an-funnel-drop { font-size: 12px; color: var(--text-muted); background: var(--surface); padding: 2px 8px; border-radius: 100px; }
.an-funnel-bar { background: var(--surface); height: 10px; border-radius: 5px; overflow: hidden; }
.an-funnel-fill { background: var(--primary); height: 100%; transition: width 0.5s cubic-bezier(.4,0,.2,1); border-radius: 5px; }

/* Leads segmentation */
.leads-table table {
  min-width: 1040px;
}
.lead-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.lead-main {
  color: var(--text);
  font-weight: 650;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lead-sub {
  color: var(--text-muted);
  font-size: 0.75rem;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mono-small {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8125rem;
  font-weight: 500;
}
