/*
 * FUEGO SOCIAL — Admin v2 — Design tokens + base layout
 * Tokens mirror /home/tenant/workspace/fuegosocial/brand.config.ts (sole source of truth on the platform).
 * Dual theme: [data-theme="dark"] (default) and [data-theme="light"].
 */

/* ---------- TOKENS ---------- */
:root {
  /* Brand (theme-invariant) */
  --primary: #FF5A00;
  --primary-dark: #CC4800;
  --primary-light: #FF7A2E;
  --gold: #D4A847;

  /* Status (theme-invariant) */
  --success: #4CAF50;
  --warning: #F5A623;
  --danger: #E53935;
  --info: #3B7BFF;

  /* Typography */
  --font-sans: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* Sizing */
  --sidebar-w: 240px;
  --header-h: 56px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-pill: 100px;

  /* Spacing */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-8: 48px;

  /* Motion */
  --t-fast: 120ms ease;
  --t-mid: 200ms ease;
}

[data-theme="dark"] {
  --bg: #0C0A08;
  --surface: #161210;
  --surface-2: #1C1714;
  --surface-3: #221C18;
  --border: #2A211C;
  --border-strong: #3A2E26;
  --text: #F2EDE4;
  --text-muted: #9A8C7C;
  --text-subtle: #6A5E52;
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.55);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.35);
  --overlay: rgba(0, 0, 0, 0.72);
  --primary-soft: rgba(255, 90, 0, 0.12);
  --success-soft: rgba(76, 175, 80, 0.14);
  --warning-soft: rgba(245, 166, 35, 0.14);
  --danger-soft: rgba(229, 57, 53, 0.14);
  --info-soft: rgba(59, 123, 255, 0.14);
}

[data-theme="light"] {
  --bg: #FAF7F2;
  --surface: #FFFFFF;
  --surface-2: #F2EDE4;
  --surface-3: #E8DFD2;
  --border: #E0D5C4;
  --border-strong: #C8B89E;
  --text: #1E1813;
  --text-muted: #6B5C4D;
  --text-subtle: #9A8C7C;
  --shadow-lg: 0 12px 40px rgba(60, 30, 0, 0.10);
  --shadow-md: 0 4px 14px rgba(60, 30, 0, 0.06);
  --overlay: rgba(28, 18, 10, 0.45);
  --primary-soft: rgba(255, 90, 0, 0.10);
  --success-soft: rgba(76, 175, 80, 0.12);
  --warning-soft: rgba(245, 166, 35, 0.16);
  --danger-soft: rgba(229, 57, 53, 0.10);
  --info-soft: rgba(59, 123, 255, 0.10);
}

/* ---------- RESET ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background var(--t-mid), color var(--t-mid);
}
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; background: none; border: none; color: inherit; padding: 0; }
input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }

/* ---------- APP SHELL ---------- */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: var(--header-h) 1fr;
  grid-template-areas:
    "sidebar header"
    "sidebar main";
  height: 100vh;
}

.header {
  grid-area: header;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--sp-5);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: relative;
  z-index: 10;
}

.header-left { display: flex; align-items: center; gap: var(--sp-4); }
.header-right { display: flex; align-items: center; gap: var(--sp-2); }

.header .menu-toggle {
  display: none;
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  align-items: center; justify-content: center;
  color: var(--text);
}
.header .menu-toggle:hover { background: var(--surface-2); }

.wordmark { display: flex; align-items: baseline; gap: 0; font-weight: 800; font-size: 18px; letter-spacing: 0.5px; }
.wordmark .wm-fuego { color: var(--text); }
.wordmark .wm-social { color: var(--primary); font-weight: 900; margin-left: 4px; }
.env-badge {
  font-size: 10px; font-weight: 800; letter-spacing: 1px;
  padding: 2px 8px; border-radius: var(--radius-pill);
  background: var(--primary-soft); color: var(--primary);
  margin-left: var(--sp-3);
}

.icon-btn {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  transition: background var(--t-fast), color var(--t-fast);
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; }

.user-chip {
  display: flex; align-items: center; gap: var(--sp-2);
  padding: 4px 10px 4px 4px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
}
.user-chip .avatar { width: 28px; height: 28px; }
.user-chip .user-name { font-size: 13px; font-weight: 600; }

/* ---------- SIDEBAR ---------- */
.sidebar {
  grid-area: sidebar;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  overflow-y: auto;
  z-index: 11;
}

.sidebar-brand {
  height: var(--header-h);
  display: flex; align-items: center; gap: var(--sp-3);
  padding: 0 var(--sp-5);
  border-bottom: 1px solid var(--border);
  font-weight: 800;
}
.sidebar-brand img { width: 28px; height: 28px; border-radius: 6px; }

.sidebar-nav {
  flex: 1;
  padding: var(--sp-3) var(--sp-2);
  display: flex; flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 14px; font-weight: 500;
  border-left: 3px solid transparent;
  margin-left: -3px;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
  position: relative;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active {
  background: var(--surface-2);
  color: var(--text);
  border-left-color: var(--primary);
}
.nav-item.active svg { color: var(--primary); }
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; color: var(--text-muted); }
.nav-item .nav-label { flex: 1; }
.nav-item .nav-badge {
  font-size: 11px; font-weight: 700;
  padding: 1px 7px; border-radius: var(--radius-pill);
  background: var(--primary); color: white;
  min-width: 18px; text-align: center;
}

.sidebar-footer {
  padding: var(--sp-3);
  border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-2);
}
.sidebar-footer .footer-meta { font-size: 11px; color: var(--text-subtle); }
.theme-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  color: var(--text);
  font-size: 12px; font-weight: 600;
  transition: background var(--t-fast);
}
.theme-toggle:hover { background: var(--surface-3); }
.theme-toggle svg { width: 14px; height: 14px; }

/* ---------- MAIN ---------- */
.main {
  grid-area: main;
  overflow-y: auto;
  padding: var(--sp-5);
}

.view-header {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: var(--sp-4);
  gap: var(--sp-3);
  flex-wrap: wrap;
}
.view-title { font-size: 22px; font-weight: 800; margin: 0; letter-spacing: -0.01em; }
.view-subtitle { color: var(--text-muted); font-size: 13px; margin: 4px 0 0 0; }

/* ---------- TABS ---------- */
.tabbar {
  display: flex; gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--sp-5);
  overflow-x: auto;
  scrollbar-width: none;
}
.tabbar::-webkit-scrollbar { display: none; }
.tabbar .tab {
  position: relative;
  padding: 10px 16px;
  font-size: 13px; font-weight: 600;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  display: inline-flex; align-items: center; gap: var(--sp-2);
  transition: color var(--t-fast);
}
.tabbar .tab:hover { color: var(--text); }
.tabbar .tab.active { color: var(--text); border-bottom-color: var(--primary); }
.tabbar .tab-badge {
  font-size: 11px; font-weight: 700;
  padding: 1px 7px; border-radius: var(--radius-pill);
  background: var(--surface-2); color: var(--text-muted);
}
.tabbar .tab.active .tab-badge { background: var(--primary-soft); color: var(--primary); }

/* ---------- CARDS / PLACEHOLDERS ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-5);
}
.placeholder {
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  padding: var(--sp-8);
  text-align: center;
  color: var(--text-muted);
}
.placeholder h3 { margin: 0 0 var(--sp-2) 0; color: var(--text); font-weight: 700; }
.placeholder p { margin: 0; font-size: 13px; }
.placeholder .ph-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 56px; height: 56px;
  border-radius: var(--radius-pill);
  background: var(--primary-soft); color: var(--primary);
  margin-bottom: var(--sp-3);
}

/* ---------- COMMAND PALETTE ---------- */
.cp-backdrop {
  position: fixed; inset: 0;
  background: var(--overlay);
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 12vh;
  z-index: 100;
  animation: cp-fade var(--t-mid);
}
.cp-backdrop[hidden] { display: none !important; }
@keyframes cp-fade { from { opacity: 0; } to { opacity: 1; } }
.cp-panel {
  width: min(620px, 92vw);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: cp-pop var(--t-mid);
}
@keyframes cp-pop { from { transform: translateY(-8px); opacity: 0; } to { transform: none; opacity: 1; } }
.cp-input-row {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-4);
  border-bottom: 1px solid var(--border);
}
.cp-input-row svg { width: 18px; height: 18px; color: var(--text-muted); flex-shrink: 0; }
.cp-input {
  flex: 1;
  background: transparent; border: none; outline: none;
  font-size: 16px; color: var(--text);
}
.cp-input::placeholder { color: var(--text-subtle); }
.cp-kbd {
  font-family: var(--font-mono); font-size: 11px;
  padding: 2px 6px; border-radius: 4px;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text-muted);
}
.cp-list { max-height: 50vh; overflow-y: auto; padding: 6px; }
.cp-section-label {
  font-size: 10px; font-weight: 800; letter-spacing: 1.5px;
  color: var(--text-subtle); text-transform: uppercase;
  padding: 8px 10px 4px 10px;
}
.cp-item {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
}
.cp-item svg { width: 16px; height: 16px; color: var(--text-muted); flex-shrink: 0; }
.cp-item.selected, .cp-item:hover { background: var(--surface-2); }
.cp-item.selected svg { color: var(--primary); }
.cp-item .cp-item-hint { margin-left: auto; font-size: 11px; color: var(--text-subtle); }
.cp-empty {
  padding: var(--sp-5);
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}
.cp-footer {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px var(--sp-4);
  border-top: 1px solid var(--border);
  font-size: 11px; color: var(--text-subtle);
}
.cp-footer .cp-foot-keys { display: flex; gap: 10px; }

/* ---------- TOAST ---------- */
.toast-stack {
  position: fixed;
  top: 18px; right: 18px;
  display: flex; flex-direction: column; gap: 10px;
  z-index: 200;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex; align-items: center; gap: var(--sp-3);
  font-size: 13px;
  box-shadow: var(--shadow-md);
  min-width: 260px; max-width: 380px;
  animation: toast-in 200ms ease;
}
.toast.toast-success { border-left-color: var(--success); }
.toast.toast-warning { border-left-color: var(--warning); }
.toast.toast-error { border-left-color: var(--danger); }
.toast.toast-info { border-left-color: var(--info); }
.toast .toast-msg { flex: 1; }
.toast .toast-action {
  font-weight: 700; color: var(--primary); cursor: pointer;
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px;
}
.toast .toast-close {
  color: var(--text-subtle); width: 20px; height: 20px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 4px;
}
.toast .toast-close:hover { color: var(--text); background: var(--surface-2); }
@keyframes toast-in { from { transform: translateX(20px); opacity: 0; } to { transform: none; opacity: 1; } }
.toast.toast-leaving { animation: toast-out 180ms ease forwards; }
@keyframes toast-out { to { transform: translateX(20px); opacity: 0; } }

/* ---------- SKELETON ---------- */
.skel { background: var(--surface-2); border-radius: var(--radius-sm); position: relative; overflow: hidden; }
.skel::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent 0%, var(--surface-3) 50%, transparent 100%);
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.skel-row { height: 14px; margin: 8px 0; }
.skel-text { height: 12px; margin: 6px 0; }
.skel-circle { border-radius: 50%; }
.skel-card { height: 110px; }

/* ---------- EMPTY STATE ---------- */
.empty-state {
  text-align: center;
  padding: var(--sp-8) var(--sp-5);
  color: var(--text-muted);
}
.empty-state .es-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 64px; height: 64px;
  border-radius: var(--radius-pill);
  background: var(--surface-2); color: var(--text-muted);
  margin-bottom: var(--sp-4);
}
.empty-state h3 { color: var(--text); margin: 0 0 var(--sp-2) 0; font-size: 16px; font-weight: 700; }
.empty-state p { margin: 0 0 var(--sp-4) 0; font-size: 13px; }
.empty-state .btn { display: inline-flex; }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600;
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border);
  transition: background var(--t-fast);
}
.btn:hover { background: var(--surface-3); }
.btn-primary { background: var(--primary); color: white; border-color: transparent; }
.btn-primary:hover { background: var(--primary-dark); }

/* ---------- BADGES ---------- */
.status-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.status-badge.status-active   { background: var(--success-soft); color: var(--success); }
.status-badge.status-paid     { background: var(--success-soft); color: var(--success); }
.status-badge.status-confirmed{ background: var(--success-soft); color: var(--success); }
.status-badge.status-paused   { background: var(--warning-soft); color: var(--warning); }
.status-badge.status-pending  { background: var(--warning-soft); color: var(--warning); }
.status-badge.status-rejected { background: var(--danger-soft);  color: var(--danger); }
.status-badge.status-cancelled{ background: var(--danger-soft);  color: var(--danger); }
.status-badge.status-refunded { background: var(--danger-soft);  color: var(--danger); }
.status-badge.status-disputed { background: var(--warning-soft); color: var(--warning); }
.status-badge.status-neutral  { background: var(--surface-2); color: var(--text-muted); }

/* ---------- AVATAR ---------- */
.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--primary-soft); color: var(--primary);
  font-weight: 700;
  border-radius: 50%;
  font-size: 12px;
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.size-sm { width: 24px; height: 24px; font-size: 10px; }
.avatar.size-md { width: 36px; height: 36px; font-size: 13px; }
.avatar.size-lg { width: 56px; height: 56px; font-size: 18px; }
.avatar .status-ring {
  position: absolute; bottom: 0; right: 0;
  width: 30%; height: 30%;
  border-radius: 50%;
  border: 2px solid var(--surface);
  background: var(--text-subtle);
}
.avatar .status-ring.online { background: var(--success); }

/* ---------- HELP MODAL ---------- */
.help-modal .cp-list { padding: var(--sp-4); }
.help-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.help-row:last-child { border-bottom: none; }
.help-row .help-keys { display: flex; gap: 4px; }

/* ---------- STATCARD ---------- */
.statcard {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-4) var(--sp-5);
  display: flex; flex-direction: column;
  gap: var(--sp-2);
  transition: transform var(--t-fast), box-shadow var(--t-fast), border-color var(--t-fast);
  min-width: 0;
}
.statcard-link {
  text-decoration: none; color: inherit;
  cursor: pointer;
}
.statcard-link:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}
.statcard .sc-label {
  font-size: 11px; font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
}
.statcard .sc-value-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-3);
}
.statcard .sc-value {
  font-family: var(--font-sans);
  font-size: 30px; font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--text);
}
.statcard .sc-spark-wrap { color: var(--primary); opacity: 0.55; flex-shrink: 0; }
.statcard .sc-spark { display: block; }
.statcard .sc-meta {
  display: flex; align-items: center; gap: var(--sp-2);
  font-size: 12px; color: var(--text-muted); min-height: 18px;
}
.statcard .sc-delta {
  display: inline-flex; align-items: center; gap: 4px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}
.statcard .sc-delta-good { background: var(--success-soft); color: var(--success); }
.statcard .sc-delta-bad { background: var(--danger-soft); color: var(--danger); }
.statcard .sc-delta-flat { background: var(--surface-2); color: var(--text-muted); }

.dash-kpis {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: var(--sp-3);
  margin-bottom: var(--sp-5);
}

/* ---------- ALERT CENTER ---------- */
.alert-center {
  display: flex; flex-direction: column;
  gap: var(--sp-2);
  margin-bottom: var(--sp-5);
}
.ac-row {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: 12px var(--sp-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border-strong);
  border-radius: var(--radius-md);
  text-decoration: none; color: var(--text);
  animation: ac-in 220ms ease backwards;
}
a.ac-row { cursor: pointer; transition: background var(--t-fast), transform var(--t-fast); }
a.ac-row:hover { background: var(--surface-2); transform: translateX(2px); }
@keyframes ac-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.ac-row.ac-sev-high { border-left-color: var(--danger); }
.ac-row.ac-sev-medium { border-left-color: var(--warning); }
.ac-row.ac-sev-low { border-left-color: var(--info); }
.ac-sev-dot {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.ac-sev-high + .ac-body, .ac-row.ac-sev-high .ac-sev-dot { background: transparent; }
.ac-row.ac-sev-high .ac-sev-dot { background: var(--danger-soft); color: var(--danger); }
.ac-row.ac-sev-medium .ac-sev-dot { background: var(--warning-soft); color: var(--warning); }
.ac-row.ac-sev-low .ac-sev-dot { background: var(--info-soft); color: var(--info); }
.ac-body { flex: 1; min-width: 0; }
.ac-title-row { display: flex; align-items: center; gap: var(--sp-2); }
.ac-title { font-weight: 600; font-size: 14px; color: var(--text); }
.ac-count {
  font-size: 11px; font-weight: 800;
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  background: var(--surface-2); color: var(--text-muted);
}
.ac-desc { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.ac-action {
  display: inline-flex; align-items: center; gap: 4px;
  flex-shrink: 0;
  font-weight: 600; font-size: 12px;
}
.ac-row-skel { padding: 14px var(--sp-4); }
.alert-center-empty { margin: 0; }
.alert-center-empty .empty-state {
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-6);
}

/* ---------- ACTIVITY FEED ---------- */
.activity-feed {
  display: flex; flex-direction: column;
  gap: 2px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-2);
}
.af-row {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: 10px var(--sp-3);
  border-radius: var(--radius-sm);
  text-decoration: none; color: var(--text);
  transition: background var(--t-fast);
}
.af-row-link { cursor: pointer; }
.af-row-link:hover { background: var(--surface-2); }
.af-avatar { position: relative; flex-shrink: 0; }
.af-kind-icon {
  position: absolute; bottom: -2px; right: -4px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--surface-2); color: var(--primary);
  display: inline-flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--surface);
}
.af-kind-icon svg { width: 8px; height: 8px; }
.af-body { flex: 1; min-width: 0; }
.af-summary {
  font-size: 13px; color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.af-ts { font-size: 11px; color: var(--text-subtle); white-space: nowrap; flex-shrink: 0; }
.af-row-skel { padding: 8px var(--sp-3); }
.activity-feed-empty { padding: 0; border: none; background: transparent; }
.activity-feed-empty .empty-state {
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-6);
}

/* ---------- DASHBOARD VIEW ---------- */
.dash-header-row {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--sp-3);
}
.dash-header-actions { display: flex; align-items: center; gap: var(--sp-3); }
.dash-period-selector {
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 3px;
  gap: 2px;
}
.dash-period-btn {
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 12px; font-weight: 600;
  color: var(--text-muted);
  transition: background var(--t-fast), color var(--t-fast);
}
.dash-period-btn:hover { color: var(--text); }
.dash-period-btn.active { background: var(--primary); color: white; }
.dash-section-title {
  font-size: 13px; font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: var(--sp-5) 0 var(--sp-3) 0;
}
.dash-two-col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: var(--sp-4);
  align-items: start;
}
.dash-col { min-width: 0; }
.dash-col .dash-section-title { margin-top: 0; }
.dash-payouts-card { padding: var(--sp-3); }
.dash-payouts-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 2px; }
.dash-payout-row {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: 10px var(--sp-3);
  border-radius: var(--radius-sm);
  transition: background var(--t-fast);
}
.dash-payout-row:hover { background: var(--surface-2); }
.dash-payout-row.overdue { background: var(--danger-soft); }
.dash-payout-body { flex: 1; min-width: 0; }
.dash-payout-host { font-weight: 600; font-size: 13px; color: var(--text); }
.dash-payout-when { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.dash-payout-row.overdue .dash-payout-when { color: var(--danger); font-weight: 600; }
.dash-payout-amount { font-weight: 700; font-size: 14px; color: var(--text); }
.dash-payouts-empty .empty-state { padding: var(--sp-5); }
.dash-error { padding: var(--sp-4); }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1200px) {
  .dash-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1024px) {
  .dash-two-col { grid-template-columns: 1fr; }
}

/* ---------- DETAIL (F0-6): SlideoutDrawer desktop + FullScreenModal móvil ---------- */
body.detail-open { overflow: hidden; }

/* --- Desktop slideout drawer (480px from right) --- */
.detail-drawer {
  position: fixed;
  inset: 0;
  z-index: 80;
  pointer-events: none;
}
.detail-drawer .dd-backdrop {
  position: absolute;
  inset: 0;
  background: var(--overlay, rgba(0, 0, 0, 0.45));
  opacity: 0;
  transition: opacity var(--t-mid);
  pointer-events: auto;
}
.detail-drawer .dd-panel {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: min(480px, 100vw);
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  transform: translateX(100%);
  transition: transform var(--t-mid);
  display: flex;
  flex-direction: column;
  pointer-events: auto;
}
.detail-drawer.open .dd-backdrop { opacity: 1; }
.detail-drawer.open .dd-panel { transform: none; }
.detail-drawer .dd-header {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.detail-drawer .dd-titles {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.detail-drawer .dd-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.detail-drawer .dd-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.detail-drawer .dd-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}
.detail-drawer .dd-close:hover { background: var(--surface-2); color: var(--text); }
.detail-drawer .dd-close svg { width: 20px; height: 20px; display: block; }
.detail-drawer .dd-body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--sp-4);
}
.detail-drawer .dd-footer {
  padding: var(--sp-3) var(--sp-4) calc(var(--sp-3) + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}
.detail-drawer .dd-footer[hidden] { display: none; }

/* --- Mobile full-screen modal (slides up) --- */
.detail-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  pointer-events: none;
}
.detail-modal .dm-shell {
  position: absolute;
  inset: 0;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform var(--t-mid);
  pointer-events: auto;
}
.detail-modal.open .dm-shell { transform: none; }
.detail-modal .dm-header {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: calc(env(safe-area-inset-top) + 10px) var(--sp-4) 10px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  /* Subtle handle bar to hint swipe-down */
  position: relative;
}
.detail-modal .dm-header::before {
  content: "";
  position: absolute;
  top: calc(env(safe-area-inset-top) + 4px);
  left: 50%;
  transform: translateX(-50%);
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: var(--border);
}
.detail-modal .dm-titles {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 4px;
}
.detail-modal .dm-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.detail-modal .dm-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.detail-modal .dm-subtitle[hidden] { display: none; }
.detail-modal .dm-back,
.detail-modal .dm-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.detail-modal .dm-back:active,
.detail-modal .dm-close:active { background: var(--surface-2); color: var(--text); }
.detail-modal .dm-back svg,
.detail-modal .dm-close svg { width: 22px; height: 22px; display: block; }
.detail-modal .dm-body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: var(--sp-4);
}
.detail-modal .dm-footer {
  padding: var(--sp-3) var(--sp-4) calc(var(--sp-3) + env(safe-area-inset-bottom));
  background: var(--surface);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.detail-modal .dm-footer[hidden] { display: none; }

/* On desktop hide modal variant if accidentally invoked, and vice-versa */
@media (min-width: 769px) {
  .detail-modal { display: none; }
}
@media (max-width: 768px) {
  .detail-drawer { display: none; }
  /* Hide the bottom-nav while a modal is open so it doesn't peek over content */
  body.detail-open .bottom-nav { display: none; }
  body.detail-open .search-mobile-mount { display: none; }
}

/* ---------- SEARCH MOBILE (F0-4M, mobile only) ---------- */
.search-mobile-mount { display: none; }
@media (max-width: 768px) {
  .search-mobile-mount {
    display: block;
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    z-index: 25;
    padding: 8px var(--sp-4) 6px;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: saturate(160%) blur(14px);
    -webkit-backdrop-filter: saturate(160%) blur(14px);
    border-bottom: 1px solid var(--border);
  }
  .search-mobile { position: relative; }
  .sm-row {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 42px;
    padding: 0 10px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: border-color var(--t-fast), background var(--t-fast);
  }
  .sm-row:focus-within {
    border-color: var(--primary);
    background: var(--surface);
  }
  .sm-icon {
    display: inline-flex;
    width: 18px; height: 18px;
    color: var(--text-muted);
    flex-shrink: 0;
  }
  .sm-icon svg { width: 100%; height: 100%; display: block; }
  .sm-input {
    flex: 1;
    height: 100%;
    border: 0;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 15px;
    outline: none;
    min-width: 0;
    -webkit-appearance: none;
  }
  .sm-input::placeholder { color: var(--text-muted); }
  .sm-input::-webkit-search-decoration,
  .sm-input::-webkit-search-cancel-button,
  .sm-input::-webkit-search-results-button,
  .sm-input::-webkit-search-results-decoration { -webkit-appearance: none; }
  .sm-clear {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px; height: 28px;
    border: 0;
    background: transparent;
    color: var(--text-muted);
    border-radius: 999px;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
  }
  .sm-clear:active { background: var(--surface-3, var(--surface-2)); }
  .sm-clear svg { width: 18px; height: 18px; display: block; }

  .sm-panel {
    position: absolute;
    left: 0; right: 0;
    top: calc(100% + 6px);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    max-height: 60vh;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
  .sm-group {
    padding: 8px 12px 4px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    font-weight: 700;
  }
  .sm-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border: 0;
    background: transparent;
    color: var(--text);
    text-align: left;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background var(--t-fast);
  }
  .sm-item + .sm-item { border-top: 1px solid var(--border); }
  .sm-item.active,
  .sm-item:active { background: var(--surface-2); }
  .sm-item-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
  }
  .sm-item-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .sm-item-hint {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .sm-item-arrow {
    display: inline-flex;
    width: 16px; height: 16px;
    color: var(--text-muted);
    flex-shrink: 0;
  }
  .sm-item.active .sm-item-arrow { color: var(--primary); }
  .sm-item-arrow svg { width: 100%; height: 100%; display: block; }
  .sm-empty {
    padding: 18px 14px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
  }
}

/* ---------- BOTTOM NAV (F0-2M, mobile only) ---------- */
.bottom-nav {
  display: none;
}
@media (max-width: 768px) {
  .bottom-nav {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 30;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom)) 4px;
    background: color-mix(in srgb, var(--surface) 78%, transparent);
    backdrop-filter: saturate(160%) blur(18px);
    -webkit-backdrop-filter: saturate(160%) blur(18px);
    border-top: 1px solid var(--border);
    box-shadow: 0 -6px 18px rgba(0, 0, 0, 0.25);
  }
  .bn-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 8px 4px 4px;
    text-decoration: none;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    transition: color var(--t-fast), background var(--t-fast);
    min-height: 48px;
    -webkit-tap-highlight-color: transparent;
  }
  .bn-item:active { background: var(--surface-2); }
  .bn-item.active { color: var(--primary); }
  .bn-icon {
    display: inline-flex;
    width: 22px; height: 22px;
  }
  .bn-icon svg { width: 100%; height: 100%; display: block; }
  .bn-label {
    font-size: 10px;
    line-height: 1;
    font-weight: 600;
    letter-spacing: 0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }
}

@media (max-width: 768px) {
  /* Prevent any descendant content (wide kpi pills, long headlines) from pushing
     the grid track past the viewport. minmax(0, 1fr) + min-width:0 on children
     is the canonical fix per Mobile-LAW #12 (Fuego Social CLAUDE.md). */
  html, body { overflow-x: hidden; max-width: 100vw; }
  .app {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "header"
      "main";
    max-width: 100vw;
  }
  .header, .main { min-width: 0; max-width: 100%; }
  .sidebar {
    position: fixed;
    top: 0; bottom: 0; left: 0;
    width: 280px;
    transform: translateX(-100%);
    transition: transform var(--t-mid);
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: none; }
  .header .menu-toggle { display: inline-flex; }
  /* Compress header to fit narrow viewports — without this the wordmark + badge +
     icons + avatar sum to ~453px which overflows a 390px iPhone. */
  .header { padding: 0 var(--sp-4); }
  .header-left { min-width: 0; gap: var(--sp-3); flex: 1 1 auto; overflow: hidden; }
  .header-right { flex: 0 0 auto; gap: var(--sp-1); }
  .header .wordmark { font-size: 16px; flex-shrink: 0; }
  .env-badge { white-space: nowrap; flex-shrink: 0; }
  .sidebar-backdrop {
    position: fixed; inset: 0;
    background: var(--overlay);
    z-index: 10;
    display: none;
  }
  .sidebar-backdrop.open { display: block; }
  .user-chip .user-name { display: none; }
  .main {
    padding: var(--sp-4);
    /* F0-4M: top padding clears the fixed search-mobile bar (~56px). */
    padding-top: calc(var(--sp-4) + 56px);
    padding-bottom: calc(var(--sp-4) + 64px + env(safe-area-inset-bottom));
  }

  /* Dashboard mobile shell */
  .dash-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-2); }
  .statcard { padding: var(--sp-3); }
  .statcard .sc-value { font-size: 22px; }
  .statcard .sc-spark { width: 56px; height: 20px; }
  .dash-header-row { align-items: flex-start; }
  .dash-header-actions { width: 100%; }
  .dash-period-selector { width: 100%; justify-content: space-between; }
  .dash-period-btn { flex: 1; padding: 8px 4px; }
  .ac-row { padding: 12px; align-items: flex-start; flex-wrap: wrap; }
  .ac-action {
    width: 100%;
    margin-top: 6px;
    justify-content: center;
    background: var(--surface-2);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
  }
  .af-summary { -webkit-line-clamp: 3; }
  .dash-payout-row { padding: 10px; }
}

/* Extra-narrow phones (iPhone SE, iPhone 14 base, etc.) — hide the decorative
   "ADMIN · v2" badge so the avatar fits onscreen. The badge is visual cue, not
   functional; the env stays clear from the wordmark + admin scope. */
@media (max-width: 480px) {
  .header .env-badge { display: none; }
  .header .wordmark { font-size: 15px; }
  .header { padding: 0 12px; }
}

/* ---------- DASHBOARD TABS (F1-3D) ---------- */
.dash-tabs-mount { margin: var(--sp-4) 0 var(--sp-3); }
.dash-tab-content { display: flex; flex-direction: column; gap: var(--sp-5); }

/* ---------- DASHBOARD MOBILE STACK (F1-3M) ---------- */
/* Vertical accordion shown only at <=768px. Hidden on desktop (would never render). */
.dash-mobile-stack {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  margin-top: var(--sp-2);
}
.dash-msec {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.dash-msec[open] {
  border-color: color-mix(in srgb, var(--primary) 35%, var(--border));
}
.dash-msec-summary {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 14px 16px;
  list-style: none;
  cursor: pointer;
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.dash-msec-summary::-webkit-details-marker { display: none; }
.dash-msec-summary::marker { content: ''; }
.dash-msec-label { flex: 1; }
.dash-msec-badge {
  display: inline-flex;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.dash-msec-chev {
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  transform: rotate(45deg);
  transition: transform var(--t-fast);
  margin-right: 4px;
}
.dash-msec[open] .dash-msec-chev {
  transform: rotate(-135deg);
}
.dash-msec-body {
  padding: 0 14px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}
/* Inside the mobile stack, headings already implicit in the summary — soften inner section titles. */
.dash-msec-body .dash-section-title {
  margin-top: var(--sp-2);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}
/* Compactar two-col dentro del stack móvil. */
.dash-msec-body .dash-two-col { gap: var(--sp-3); }
/* Desktop: Finanzas KPI row de 3 cards. */
.dash-kpis-finanzas { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dash-fin-note { padding: var(--sp-2) 0; }
.dash-fin-note p { margin: 0; font-size: 13px; line-height: 1.45; }
@media (max-width: 768px) {
  /* Móvil: 1 col para legibilidad de números grandes. */
  .dash-kpis-finanzas { grid-template-columns: 1fr; }
}

/* ---------- SUPPORT INBOX (F1-3D) ---------- */
.si-card { padding: 0; overflow: hidden; }
.si-list { list-style: none; margin: 0; padding: 0; }
.si-item { border-bottom: 1px solid var(--border); }
.si-item:last-child { border-bottom: none; }

.si-row {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: var(--sp-3);
  align-items: center;
  width: 100%;
  padding: 12px 16px;
  background: transparent;
  border: none;
  text-align: left;
  cursor: pointer;
  color: var(--text);
  font-family: inherit;
  transition: background var(--t-fast);
}
.si-row:hover { background: var(--surface-2); }
.si-row[aria-expanded="true"] { background: var(--surface-2); }

.si-avatar { display: flex; align-items: center; justify-content: center; }
.si-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.si-line1 { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.si-name { font-weight: 600; font-size: 14px; color: var(--text); }
.si-preview {
  font-size: 13px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.si-time {
  font-size: 12px;
  color: var(--text-subtle);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.si-channel-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  background: var(--surface-3);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.si-channel-landing { background: rgba(59, 123, 255, 0.12); color: var(--info); border-color: rgba(59, 123, 255, 0.25); }
.si-channel-founder { background: var(--primary-soft); color: var(--primary); border-color: rgba(255, 90, 0, 0.25); }
.si-channel-tickets { background: rgba(212, 168, 71, 0.12); color: var(--gold); border-color: rgba(212, 168, 71, 0.25); }

.si-detail {
  padding: 12px 16px 16px 64px;
  background: var(--surface-2);
  border-top: 1px solid var(--border);
}
.si-detail-meta {
  display: flex;
  gap: var(--sp-3);
  align-items: center;
  margin-bottom: var(--sp-3);
  font-size: 13px;
  flex-wrap: wrap;
}
.si-email { color: var(--primary); text-decoration: none; }
.si-email:hover { text-decoration: underline; }
.si-email-missing { color: var(--text-subtle); font-style: italic; }
.si-status {
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: var(--surface-3);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.si-detail-body {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

.si-load-more-row {
  display: flex;
  justify-content: center;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}
.si-load-more {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: background var(--t-fast);
}
.si-load-more:hover:not(:disabled) { background: var(--surface-3); border-color: var(--border-strong); }
.si-load-more:disabled { opacity: 0.6; cursor: not-allowed; }

.si-empty, .si-error, .si-loading { padding: var(--sp-4); }

@media (max-width: 720px) {
  .si-row { grid-template-columns: 32px 1fr auto; padding: 10px 12px; gap: var(--sp-2); }
  .si-detail { padding: 12px; }
  .si-preview { font-size: 12px; }
}

/* ===================================================================
   DATATABLE (F2-1D) — reusable master-table component.
   =================================================================== */
.dt-host { margin-top: var(--sp-3); }
.dt-root {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--sp-3);
  position: relative;
}
.dt-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  flex-wrap: wrap;
}
.dt-search {
  position: relative;
  flex: 1 1 280px;
  max-width: 420px;
}
.dt-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  display: inline-flex;
}
.dt-search-icon svg { width: 16px; height: 16px; }
.dt-search-input {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  padding: 9px 12px 9px 34px;
  transition: border-color var(--t-fast), background var(--t-fast);
}
.dt-search-input:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--surface);
}
.dt-toolbar-right {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  position: relative;
}
.dt-result-count {
  font-size: 12px;
  color: var(--text-muted);
}
.dt-col-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast);
}
.dt-col-toggle:hover { background: var(--surface-3); border-color: var(--border-strong); }
.dt-col-toggle svg { width: 14px; height: 14px; }
.dt-col-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 6px;
  min-width: 180px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.dt-col-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
}
.dt-col-menu-item:hover { background: var(--surface-2); }
.dt-col-menu-item input { accent-color: var(--primary); }

.dt-table-wrap {
  width: 100%;
  overflow-x: auto;
}
.dt-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}
.dt-table thead th {
  background: var(--surface-2);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  text-align: left;
}
.dt-th-select { width: 36px; padding: 10px 8px 10px 12px; }
.dt-th-inner {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.dt-th-icon {
  display: inline-flex;
  width: 12px;
  height: 12px;
  color: var(--text-muted);
  opacity: 0.7;
}
.dt-th-icon svg { width: 12px; height: 12px; }
.dt-th.sortable { cursor: pointer; user-select: none; }
.dt-th.sortable:hover { background: var(--surface-3); }
.dt-th.sorted { color: var(--text); }
.dt-th.sorted .dt-th-icon { color: var(--primary); opacity: 1; }

.dt-table tbody td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text);
}
.dt-td-select { width: 36px; padding: 12px 8px 12px 12px; }
.dt-row {
  cursor: pointer;
  transition: background var(--t-fast);
}
.dt-row:hover { background: var(--surface-2); }
.dt-row.selected { background: color-mix(in srgb, var(--primary) 8%, var(--surface)); }
.dt-row.selected:hover { background: color-mix(in srgb, var(--primary) 14%, var(--surface)); }
.dt-check-all, .dt-check-row { accent-color: var(--primary); cursor: pointer; }
.dt-stacked { display: flex; flex-direction: column; gap: 2px; line-height: 1.3; }
.dt-stacked strong { font-weight: 600; }
.dt-sub { font-size: 11px; color: var(--text-muted); }
.dt-mono { font-family: var(--font-mono, ui-monospace, "JetBrains Mono", monospace); font-size: 12px; color: var(--text-muted); }

.dt-empty-row td { padding: var(--sp-5); }
.dt-empty {
  text-align: center;
  color: var(--text-muted);
}
.dt-empty strong { color: var(--text); display: block; margin-bottom: 4px; }

.dt-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  padding-top: var(--sp-2);
  border-top: 1px dashed var(--border);
}
.dt-page-info { font-size: 12px; color: var(--text-muted); }
.dt-pager { display: inline-flex; gap: 4px; align-items: center; }
.dt-pager-btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  min-width: 28px;
  transition: background var(--t-fast);
}
.dt-pager-btn:hover:not(:disabled) { background: var(--surface-3); }
.dt-pager-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.dt-pager-curr { font-size: 12px; color: var(--text-muted); padding: 0 6px; }

.dt-bulk-bar {
  position: sticky;
  bottom: 12px;
  margin-top: var(--sp-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  background: var(--surface);
  border: 1px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  z-index: 5;
}
.dt-bulk-label { font-size: 13px; font-weight: 600; color: var(--text); }
.dt-bulk-actions { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.dt-bulk-clear {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 12px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.dt-bulk-clear:hover { color: var(--text); border-color: var(--border-strong); }
.dt-bulk-action {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast);
}
.dt-bulk-action:hover { background: var(--surface-3); border-color: var(--border-strong); }
.dt-bulk-action.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.dt-bulk-action.primary:hover { filter: brightness(1.08); }
.dt-bulk-action.danger { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 40%, transparent); color: var(--danger); }
.dt-bulk-action.danger:hover { background: color-mix(in srgb, var(--danger) 20%, transparent); }

.dt-loading { padding: var(--sp-3); }

/* DataTable detail drawer extras (used by views/reservas.js). */
.dt-detail-dl {
  display: grid;
  grid-template-columns: minmax(120px, 35%) 1fr;
  gap: 8px 16px;
  margin: 0;
  padding: 0;
  font-size: 13px;
}
.dt-detail-dl dt {
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  align-self: center;
}
.dt-detail-dl dd {
  margin: 0;
  color: var(--text);
  word-break: break-word;
}
.dt-detail-dl dd code {
  font-family: var(--font-mono, ui-monospace, "JetBrains Mono", monospace);
  font-size: 12px;
  color: var(--text-muted);
}
.dt-detail-dl .muted { color: var(--text-muted); font-size: 12px; }
.dt-detail-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.dt-detail-actions .btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--t-fast);
}
.dt-detail-actions .btn:hover:not(:disabled) { background: var(--surface-3); border-color: var(--border-strong); }
.dt-detail-actions .btn:disabled { opacity: 0.6; cursor: not-allowed; }
.dt-detail-actions .btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.dt-detail-actions .btn-primary:hover:not(:disabled) { filter: brightness(1.08); }
.dt-detail-actions .btn-danger { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 40%, transparent); color: var(--danger); }
.dt-detail-actions .btn-danger:hover:not(:disabled) { background: color-mix(in srgb, var(--danger) 20%, transparent); }

@media (max-width: 768px) {
  .dt-root { padding: var(--sp-2); }
  .dt-toolbar { gap: var(--sp-2); }
  .dt-search { max-width: none; flex: 1 1 auto; }
  .dt-table thead th { font-size: 10px; padding: 8px 10px; }
  .dt-table tbody td { padding: 10px; }
  .dt-stacked .dt-sub { font-size: 10px; }
  .dt-detail-dl { grid-template-columns: 1fr; gap: 4px 0; }
  .dt-detail-dl dt { margin-top: 8px; }
  .dt-bulk-bar { flex-direction: column; align-items: stretch; }
  .dt-bulk-actions { justify-content: flex-end; }
}


/* ---------- RESERVAS MÓVIL (F2-1M) ---------- */
.rsv-mobile {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding: var(--sp-2) 0 var(--sp-5);
}
.rsv-search-wrap {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--surface);
  padding: var(--sp-2) 0;
  margin: 0 calc(-1 * var(--sp-2));
  padding-left: var(--sp-2);
  padding-right: var(--sp-2);
}
.rsv-search {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color var(--t-fast), background var(--t-fast);
  -webkit-appearance: none;
  appearance: none;
}
.rsv-search::placeholder { color: var(--text-subtle); }
.rsv-search:focus {
  border-color: var(--primary);
  background: var(--surface);
}
.rsv-mobile-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}
.rsv-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  isolation: isolate;
}
.rsv-card-swipe-bg {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 var(--sp-5);
  background: var(--danger-soft);
  color: var(--danger);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.02em;
  z-index: 0;
  pointer-events: none;
}
.rsv-card.rsv-card-swipeable.swiping .rsv-card-swipe-bg {
  background: color-mix(in srgb, var(--danger) 22%, transparent);
}
.rsv-card.swipe-left-armed .rsv-card-swipe-bg {
  background: var(--danger);
  color: #fff;
}
.rsv-card:not(.rsv-card-swipeable) .rsv-card-swipe-bg {
  display: none;
}
.rsv-card-body {
  position: relative;
  z-index: 1;
  background: var(--surface);
  padding: var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  transition: transform var(--t-fast);
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}
.rsv-card.swiping .rsv-card-body { transition: none; }
.rsv-card-body:active {
  background: var(--surface-2);
}
.rsv-card-row1 {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-3);
}
.rsv-card-guest {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex: 1 1 auto;
}
.rsv-card-total {
  font-size: 16px;
  font-weight: 800;
  color: var(--primary);
  white-space: nowrap;
}
.rsv-card-row2 {
  color: var(--text-muted);
  font-size: 13px;
}
.rsv-card-listing {
  color: var(--text);
  font-weight: 500;
}
.rsv-card-city {
  color: var(--text-muted);
  margin-left: 4px;
}
.rsv-card-row3 {
  display: flex;
  justify-content: space-between;
  gap: var(--sp-3);
  color: var(--text-muted);
  font-size: 12px;
}
.rsv-card-host {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex: 1 1 auto;
}
.rsv-card-seats {
  color: var(--text-subtle);
  white-space: nowrap;
}
.rsv-card-row4 {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.rsv-card-row4 .status-badge {
  font-size: 10.5px;
}
.rsv-card-date {
  margin-left: auto;
  color: var(--text-subtle);
  font-size: 11.5px;
}
.rsv-mobile-empty {
  padding: var(--sp-6) var(--sp-4);
  text-align: center;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  color: var(--text-muted);
}
.rsv-mobile-empty h3 {
  margin: 0 0 4px;
  color: var(--text);
  font-size: 15px;
}
.rsv-mobile-empty p {
  margin: 0;
  font-size: 13px;
}

@media (max-width: 400px) {
  .rsv-card-body { padding: var(--sp-3); }
  .rsv-card-guest { font-size: 14px; }
  .rsv-card-total { font-size: 15px; }
  .rsv-search { font-size: 14px; padding: 10px 12px; }
}

/* ---------- BOOKING DETAIL SECTIONS (F2-2D) ---------- */
.bd-section {
  margin-bottom: var(--sp-5);
}
.bd-section:last-child { margin-bottom: 0; }
.bd-section-title {
  margin: 0 0 var(--sp-3);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ---------- TIMELINE (F2-2D) ---------- */
.tl {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.tl-empty {
  padding: var(--sp-4);
  text-align: center;
  color: var(--text-muted);
  background: var(--surface-2);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  font-size: 13px;
}
.tl-item {
  position: relative;
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: var(--sp-3);
  padding: 0 0 var(--sp-4) 0;
}
.tl-item-last { padding-bottom: 0; }
.tl-item:not(.tl-item-last)::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 18px;
  bottom: 0;
  width: 2px;
  background: var(--border);
}
.tl-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  margin-top: 4px;
  margin-left: 3px;
  background: var(--text-subtle);
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 2px var(--text-subtle);
  z-index: 1;
}
.tl-dot-neutral { background: var(--text-muted); box-shadow: 0 0 0 2px var(--text-muted); }
.tl-dot-success { background: var(--success); box-shadow: 0 0 0 2px var(--success); }
.tl-dot-warning { background: var(--warning); box-shadow: 0 0 0 2px var(--warning); }
.tl-dot-danger  { background: var(--danger);  box-shadow: 0 0 0 2px var(--danger); }
.tl-dot-info    { background: var(--info);    box-shadow: 0 0 0 2px var(--info); }
.tl-dot-pending {
  background: var(--surface);
  box-shadow: 0 0 0 2px var(--text-subtle);
}
.tl-dot-pending.tl-dot-warning { box-shadow: 0 0 0 2px var(--warning); }
.tl-dot-pending.tl-dot-success { box-shadow: 0 0 0 2px var(--success); }
.tl-body {
  min-width: 0;
}
.tl-label {
  color: var(--text);
  font-weight: 600;
  font-size: 13px;
  line-height: 1.3;
}
.tl-ts {
  display: block;
  color: var(--text-muted);
  font-size: 11.5px;
  margin-top: 2px;
}
.tl-ts-pending {
  color: var(--warning);
  font-style: italic;
}
.tl-desc {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.4;
}

/* ---------- MONEY FLOW (F2-2D) ---------- */
.mf {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: var(--sp-2);
  padding: var(--sp-3);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow-x: auto;
  scrollbar-width: thin;
}
.mf-empty {
  padding: var(--sp-4);
  text-align: center;
  color: var(--text-muted);
  background: var(--surface-2);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  font-size: 13px;
}
.mf-step {
  flex: 1 1 0;
  min-width: 110px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: flex-start;
}
.mf-step-in    { border-color: color-mix(in srgb, var(--success) 50%, var(--border)); }
.mf-step-out   { border-color: color-mix(in srgb, var(--primary) 60%, var(--border)); }
.mf-step-fee   { border-color: var(--border); }
.mf-step-refund{ border-color: color-mix(in srgb, var(--danger) 50%, var(--border)); }
.mf-amount {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
  white-space: nowrap;
}
.mf-step-in .mf-amount    { color: var(--success); }
.mf-step-out .mf-amount   { color: var(--primary); }
.mf-step-refund .mf-amount{ color: var(--danger); }
.mf-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}
.mf-sub {
  font-size: 11px;
  color: var(--text-subtle);
  margin-top: 2px;
}
.mf-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-subtle);
  flex: 0 0 18px;
}

@media (max-width: 768px) {
  .mf {
    flex-direction: column;
    overflow-x: visible;
  }
  .mf-step {
    flex: 1 1 auto;
    width: 100%;
  }
  .mf-arrow {
    transform: rotate(90deg);
    align-self: center;
  }
}

/* === SegmentedControl (F2-2M) ============================================= */
.sc-root {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill, 999px);
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.sc-root::-webkit-scrollbar { display: none; }

.sc-seg {
  flex: 1 1 auto;
  min-width: max-content;
  appearance: none;
  background: transparent;
  border: 0;
  color: var(--text-muted, var(--text-subtle));
  font: inherit;
  font-weight: 600;
  font-size: 13px;
  padding: 8px 14px;
  border-radius: var(--radius-pill, 999px);
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--t-fast, 120ms) ease, color var(--t-fast, 120ms) ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.sc-seg:hover { color: var(--text); }
.sc-seg.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0,0,0,0.18), 0 1px 1px rgba(0,0,0,0.12);
}
.sc-seg:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.sc-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--danger-soft, rgba(255,90,0,0.18));
  color: var(--danger, var(--primary));
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

/* === Booking detail tabs container (F2-2M) ================================ */
.bd-tabs-mount {
  position: sticky;
  top: 0;
  z-index: 2;
  margin: 0 calc(-1 * var(--sp-3, 12px)) var(--sp-3, 12px);
  padding: var(--sp-2, 8px) var(--sp-3, 12px);
  background: linear-gradient(to bottom, var(--surface) 70%, transparent);
}
.bd-panels { display: block; }
.bd-panel[hidden] { display: none !important; }
.bd-panel { animation: bd-panel-in 160ms ease both; }
@keyframes bd-panel-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.bd-panel[data-panel="actions"] .dt-detail-actions {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2, 8px);
  margin: 0;
}
.bd-panel[data-panel="actions"] .dt-detail-actions .btn { width: 100%; }
.bd-empty-actions {
  padding: var(--sp-4, 16px);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md, 8px);
  color: var(--text-muted, var(--text-subtle));
  text-align: center;
  font-size: 13px;
}

/* === Reservas tabs (F2-3) ================================================= */
.reservas-tabseg { width: 100%; }
@media (max-width: 768px) {
  .tabs-mount { margin-bottom: var(--sp-3, 12px); }
}

/* === DisputeResolution (F2-4D) ============================================ */
.dr-root {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4, 16px);
}
.dr-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3, 12px);
  flex-wrap: wrap;
}
.dr-header-left { display: flex; flex-direction: column; gap: 2px; }
.dr-eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted, var(--text-subtle));
}
.dr-title { margin: 0; font-size: 16px; font-weight: 700; color: var(--text); }
.dr-sla {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  white-space: nowrap;
}
.dr-sla::before {
  content: '';
  width: 8px; height: 8px; border-radius: 50%;
  background: currentColor;
}
.dr-sla-green   { color: var(--success, #2ea043); border-color: rgba(46,160,67,0.35); }
.dr-sla-amber   { color: var(--warning, #d99012); border-color: rgba(217,144,18,0.35); }
.dr-sla-red     { color: var(--danger, #d4262c);  border-color: rgba(212,38,44,0.45); background: rgba(212,38,44,0.08); }
.dr-sla-unknown { color: var(--text-muted, var(--text-subtle)); }

.dr-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--sp-3, 12px);
}
.dr-col {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 10px);
  padding: var(--sp-3, 12px);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2, 8px);
  min-width: 0;
}
.dr-col-head { display: flex; flex-direction: column; gap: 2px; }
.dr-col-title { margin: 0; font-size: 13px; font-weight: 700; color: var(--text); }
.dr-col-meta { font-size: 12px; color: var(--text-muted, var(--text-subtle)); overflow-wrap: anywhere; }
.dr-col-body { font-size: 13px; line-height: 1.5; color: var(--text); }
.dr-quote {
  margin: 0;
  padding: 10px 12px;
  background: var(--surface);
  border-left: 3px solid var(--border);
  border-radius: 0 var(--radius-sm, 6px) var(--radius-sm, 6px) 0;
  font-style: italic;
}
.dr-col-guest .dr-quote { border-left-color: var(--info, #3b7bff); }
.dr-col-host  .dr-quote { border-left-color: var(--primary, #FF5A00); }
.dr-empty { color: var(--text-muted, var(--text-subtle)); font-size: 12px; margin: 0; }

.dr-facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  column-gap: var(--sp-3, 12px);
  row-gap: 4px;
  margin: 0;
  font-size: 12px;
}
.dr-facts dt { color: var(--text-muted, var(--text-subtle)); }
.dr-facts dd { margin: 0; color: var(--text); overflow-wrap: anywhere; }

.dr-resolution {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2, 8px);
  padding-top: var(--sp-3, 12px);
  border-top: 1px solid var(--border);
}
.dr-templates {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.dr-template-btn {
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  white-space: normal;
  line-height: 1.2;
}
.dr-template-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.dr-textarea {
  width: 100%;
  resize: vertical;
  min-height: 90px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 8px);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  line-height: 1.5;
}
.dr-textarea:focus {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
  border-color: var(--primary);
}
.dr-hint {
  margin: 0;
  font-size: 11px;
  color: var(--text-muted, var(--text-subtle));
}
.dr-hint code { font-family: var(--font-mono, ui-monospace, monospace); font-size: 10.5px; }

@media (max-width: 1023px) {
  .dr-grid { grid-template-columns: 1fr; }
}

/* F2-4M — DisputeResolution mobile shell.
   Sticky header con SLA badge, SegmentedControl mount, 4 panels (guest / host /
   facts / resolve). Mobile-LAW: action buttons full-width con white-space normal. */
.dr-mob { display: flex; flex-direction: column; gap: var(--sp-3); padding: var(--sp-3); }
.dr-mob-header {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--border);
}
.dr-mob-header-titles { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dr-mob-title { font-size: 18px; font-weight: 700; color: var(--text); margin: 0; line-height: 1.25; word-break: break-word; }
.dr-mob-header-sla { flex-shrink: 0; }
.dr-mob-tabs-mount { position: sticky; top: 60px; z-index: 1; background: var(--surface); padding-bottom: var(--sp-2); }
.dr-mob-panels { display: block; }
.dr-mob-panel { display: block; }
.dr-mob-panel[hidden] { display: none; }
.dr-mob-panel .dr-col { background: transparent; padding: 0; border: 0; }
.dr-mob-panel .dr-col-head { padding: 0 0 var(--sp-2) 0; }
.dr-mob-panel .dr-quote { font-size: 15px; line-height: 1.5; }
.dr-resolution-mob { gap: var(--sp-3); }
.dr-templates-mob { display: flex; flex-direction: column; gap: var(--sp-2); }
.dr-templates-mob .dr-template-btn {
  width: 100%;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.3;
  padding: 12px 14px;
}
.dr-mob-actions {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin-top: var(--sp-3);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--border);
}
.dr-mob-actions .btn {
  width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.25;
  padding: 13px 16px;
  text-align: center;
}

/* F2-5D — ReportResolution desktop drawer (2 columnas + Resolución).
   Severity badges con paleta token-aligned. */
.rr-root { display: flex; flex-direction: column; gap: var(--sp-3); padding: var(--sp-3); }
.rr-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-3);
  padding-bottom: var(--sp-2);
  border-bottom: 1px solid var(--border);
}
.rr-eyebrow {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.rr-title { font-size: 18px; font-weight: 700; color: var(--text); margin: 2px 0 0 0; }
.rr-sev {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-pill, 999px);
  font-size: 12px;
  font-weight: 700;
  border: 1px solid transparent;
  white-space: nowrap;
}
.rr-sev-critical { background: var(--danger-soft, rgba(220, 38, 38, 0.14)); color: var(--danger, #DC2626); border-color: var(--danger, #DC2626); }
.rr-sev-high     { background: rgba(245, 166, 35, 0.16); color: var(--warning, #F5A623); border-color: var(--warning, #F5A623); }
.rr-sev-medium   { background: rgba(245, 166, 35, 0.08); color: var(--warning, #F5A623); border-color: rgba(245, 166, 35, 0.4); }
.rr-sev-low      { background: rgba(99, 102, 241, 0.08); color: var(--info, #6366F1); border-color: rgba(99, 102, 241, 0.4); }
.rr-sev-unknown  { background: var(--surface-2, rgba(255, 255, 255, 0.04)); color: var(--text-muted); border-color: var(--border); }

.rr-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: var(--sp-3);
}
.rr-col {
  background: var(--surface-2, rgba(255, 255, 255, 0.02));
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 12px);
  padding: var(--sp-3);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.rr-col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
}
.rr-col-title { font-size: 14px; font-weight: 700; color: var(--text); margin: 0; }
.rr-col-meta { display: flex; align-items: center; gap: var(--sp-2); }
.rr-cat { font-size: 12px; color: var(--text-muted); text-transform: capitalize; }
.rr-col-body { display: flex; flex-direction: column; gap: var(--sp-2); }
.rr-reporter { font-size: 13px; color: var(--text); margin: 0; }
.rr-when { font-size: 12px; color: var(--text-muted); margin: 0; }
.rr-quote {
  background: var(--surface, rgba(255, 255, 255, 0.04));
  border-left: 3px solid var(--border);
  padding: 10px 12px;
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text);
  border-radius: 0 var(--radius-sm, 6px) var(--radius-sm, 6px) 0;
}
.rr-empty { font-size: 13px; color: var(--text-muted); font-style: italic; }
.rr-evidence { display: flex; flex-direction: column; gap: 4px; }
.rr-evidence a { font-size: 12px; color: var(--info, #6366F1); word-break: break-all; }
.rr-object-link {
  display: inline-block;
  padding: 8px 12px;
  background: var(--surface, rgba(255, 255, 255, 0.04));
  border: 1px solid var(--border);
  border-radius: var(--radius-sm, 6px);
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  transition: background var(--t-fast, 0.12s);
}
.rr-object-link:hover { background: var(--surface-3, rgba(255, 255, 255, 0.08)); }
.rr-facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 0; font-size: 12.5px; }
.rr-facts dt { color: var(--text-muted); }
.rr-facts dd { margin: 0; color: var(--text); }

.rr-resolution {
  background: var(--surface-2, rgba(255, 255, 255, 0.02));
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 12px);
  padding: var(--sp-3);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.rr-templates {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-2);
}
.rr-template-btn { text-align: left; white-space: normal; line-height: 1.3; }
.rr-template-btn.active { border-color: var(--primary); background: rgba(255, 90, 0, 0.08); }
.rr-textarea {
  width: 100%;
  min-height: 96px;
  resize: vertical;
  background: var(--surface, rgba(255, 255, 255, 0.04));
  border: 1px solid var(--border);
  border-radius: var(--radius-sm, 6px);
  padding: 10px 12px;
  font-size: 13px;
  color: var(--text);
  font-family: inherit;
}
.rr-textarea:focus { outline: none; border-color: var(--primary); }
.rr-hint { font-size: 11.5px; color: var(--text-muted); margin: 0; }

@media (max-width: 1023px) {
  .rr-grid { grid-template-columns: 1fr; }
  .rr-templates { grid-template-columns: 1fr; }
}

/* F2-5M scaffold — solo estructura, F2-5M lo termina de cablear. */
.rr-mob { display: flex; flex-direction: column; gap: var(--sp-3); padding: var(--sp-3); }
.rr-mob-header {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--border);
}
.rr-mob-title { font-size: 18px; font-weight: 700; color: var(--text); margin: 0; line-height: 1.25; }
.rr-mob-header-titles { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rr-mob-header-sev { flex-shrink: 0; }
.rr-mob-tabs-mount { position: sticky; top: 60px; z-index: 1; background: var(--surface); padding-bottom: var(--sp-2); }
.rr-mob-panels { display: block; }
.rr-mob-panel { display: block; }
.rr-mob-panel[hidden] { display: none; }
.rr-mob-panel .rr-col { background: transparent; padding: 0; border: 0; }
.rr-mob-panel .rr-col-head { padding: 0 0 var(--sp-2) 0; }
.rr-mob-panel .rr-quote { font-size: 15px; line-height: 1.5; }
.rr-mob-panel .rr-templates { grid-template-columns: 1fr; }
.rr-mob-actions { display: flex; flex-direction: column; gap: var(--sp-2); margin-top: var(--sp-3); padding-top: var(--sp-3); border-top: 1px solid var(--border); }
.rr-mob-actions .btn { width: 100%; white-space: normal; overflow-wrap: anywhere; line-height: 1.25; padding: 13px 16px; text-align: center; }

/* ---------- Listings (F3-1D) ---------- */
.ls-thumb {
  display: block;
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.ls-thumb-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 18px;
}
.ls-seats { display: flex; flex-direction: column; gap: 4px; min-width: 70px; }
.ls-seats-text { font-size: 12px; color: var(--text); font-variant-numeric: tabular-nums; }
.ls-seats-bar { display: block; width: 100%; height: 4px; background: var(--surface-2); border-radius: 2px; overflow: hidden; }
.ls-seats-fill { display: block; height: 100%; background: var(--primary); transition: width var(--t-mid); }
.ls-pending {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--warning) 18%, var(--surface));
  color: var(--warning);
  font-size: 11px;
  font-weight: 600;
}

/* F3-3 sub-tick (a): chips de flag_reasons en title col (desktop) y
   mcard (mobile). Color warning para llamar la atencion sin ser destructivo
   (rojo se reserva para suspendido/baneado). Wrap libre si hay varios chips. */
.ls-flag-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}
.ls-flag-chip {
  display: inline-block;
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--warning) 16%, var(--surface));
  color: var(--warning);
  border: 1px solid color-mix(in srgb, var(--warning) 28%, transparent);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}
.ls-mcard .ls-flag-chips {
  margin-top: 6px;
}

/* Hover preview popover */
.ls-popover-wrap {
  position: fixed;
  z-index: 9000;
  pointer-events: none;
  animation: lsPopFade var(--t-fast) ease both;
}
@keyframes lsPopFade {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.ls-popover {
  width: 320px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 18px 48px rgba(0,0,0,0.45), 0 2px 6px rgba(0,0,0,0.25);
  padding: var(--sp-3);
  pointer-events: none;
}
.ls-pop-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin-bottom: var(--sp-3);
}
.ls-pop-gallery img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 6px;
  background: var(--surface-2);
}
.ls-pop-gallery-empty {
  padding: var(--sp-4);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  margin-bottom: var(--sp-3);
}
.ls-pop-title { font-weight: 700; font-size: 14px; color: var(--text); line-height: 1.3; }
.ls-pop-host { font-size: 12px; color: var(--text-muted); margin-top: 2px; margin-bottom: var(--sp-3); }
.ls-pop-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px var(--sp-3); margin: 0; }
.ls-pop-fact dt { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.ls-pop-fact dd { font-size: 13px; color: var(--text); margin: 0 0 4px 0; }

.ls-detail-gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-2); }
.ls-detail-gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius-sm); background: var(--surface-2); }

@media (max-width: 768px) {
  .ls-popover-wrap { display: none; }
}

/* ---------- Listings F3-1M: mobile cards ---------- */
.ls-mshell { display: block; }
.ls-mlist {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding: var(--sp-3) 0 var(--sp-5);
}
.ls-mcard {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: transform var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast);
}
.ls-mcard:hover,
.ls-mcard:focus-visible {
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  outline: none;
}
.ls-mcard:active { transform: scale(0.99); }
.ls-mcard-photo {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: var(--surface-2);
  display: block;
}
.ls-mcard-photo-empty {
  background: linear-gradient(135deg, var(--surface-2) 0%, var(--surface) 100%);
}
.ls-mcard-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: var(--sp-3);
}
.ls-mcard-title {
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.ls-mcard-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-2);
  font-size: 13px;
  color: var(--text-muted);
  flex-wrap: wrap;
}
.ls-mcard-price {
  font-weight: 700;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
}
.ls-mcard-loc {
  font-size: 12px;
  color: var(--text-muted);
  overflow-wrap: anywhere;
  text-align: right;
}
.ls-mcard-seats {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.ls-mcard-status { display: inline-flex; }

/* ---------- Listings F3-2D: Geo coverage stub ---------- */
.ls-geo-stub {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: var(--sp-3);
  padding: var(--sp-6) var(--sp-4);
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  margin: var(--sp-4) 0;
}
.ls-geo-stub-icon {
  font-size: 40px;
  line-height: 1;
  color: var(--primary);
  opacity: 0.7;
}
.ls-geo-stub h3 {
  font-size: 17px;
  font-weight: 700;
  margin: 0;
  color: var(--text);
}
.ls-geo-stub p {
  font-size: 14px;
  color: var(--text-muted);
  max-width: 520px;
  margin: 0;
  line-height: 1.5;
}
@media (max-width: 768px) {
  .ls-geo-stub { padding: var(--sp-5) var(--sp-3); }
  .ls-geo-stub-icon { font-size: 32px; }
  .ls-geo-stub h3 { font-size: 16px; }
  .ls-geo-stub p { font-size: 13px; }
}

/* ---------- Listings F3-2D sub-tick 2: Geo coverage map ---------- */
.ls-geo-shell {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  margin: var(--sp-3) 0;
}
.ls-geo-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-2);
  padding: 0 var(--sp-1);
}
.ls-geo-meta-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.01em;
}
.ls-geo-meta-count {
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.ls-geo-map-wrap {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.ls-geo-map {
  width: 100%;
  height: min(60vh, 540px);
  min-height: 360px;
}
.ls-geo-foot {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
  padding: 0 var(--sp-1);
  line-height: 1.4;
}
.ls-geo-pop {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 180px;
  font-family: inherit;
}
.ls-geo-pop strong {
  font-size: 13px;
  color: var(--text);
  line-height: 1.3;
}
.ls-geo-pop-line {
  font-size: 12px;
  color: var(--text-muted);
}
.ls-geo-pop-warn {
  font-size: 11px;
  color: var(--primary);
  margin-top: 2px;
}
/* Leaflet popups con tema de la app (no toca branding, solo bg/border) */
.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: 0 12px 24px rgba(0,0,0,0.35);
}
.leaflet-popup-content { margin: 10px 12px; }
.leaflet-container a { color: var(--primary); }

/* Mobile: Geo coverage full-screen (F3-2M sub-tick c).
   Mapa ocupa todo el viewport disponible entre la top bar / tabs
   (~108px combinados) y el bottom nav (~64px + safe-area).
   Sin border-radius para que el mapa llegue a los bordes. Foot
   se esconde porque Leaflet ya muestra su propia atribucion. */
@media (max-width: 768px) {
  .ls-geo-shell {
    margin: 0;
    gap: 8px;
    /* full-bleed contra los paddings horizontales del view content */
    margin-left: calc(var(--sp-3) * -1);
    margin-right: calc(var(--sp-3) * -1);
  }
  .ls-geo-meta {
    padding: 0 var(--sp-3);
  }
  .ls-geo-meta-label { font-size: 12px; }
  .ls-geo-meta-count { font-size: 11px; }
  .ls-geo-map-wrap {
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }
  .ls-geo-map {
    /* Top: ~56 header + ~52 tabs + ~30 meta + ~50 nav-tabs row = ~280px arriba.
       Bottom: ~64 bottom-nav + env(safe-area-inset-bottom). Total ~344px. */
    height: calc(100dvh - 340px);
    min-height: 360px;
    max-height: none;
  }
  .ls-geo-foot { display: none; }
}
@media (max-width: 390px) {
  .ls-geo-map {
    height: calc(100dvh - 330px);
    min-height: 340px;
  }
}

/* === Tinder-swipe moderation (F3-2M sub-tick b) =========================== */
.ls-tinder-shell {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 8px 0 12px;
}
.ls-tinder-stack {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  max-height: min(64vh, 520px);
  margin: 0 auto;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-y;
}
.ls-tcard {
  position: absolute;
  inset: 0;
  border-radius: 18px;
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--border);
  box-shadow: 0 10px 28px rgba(0,0,0,0.35), 0 2px 6px rgba(0,0,0,0.25);
  transform-origin: 50% 100%;
  will-change: transform, opacity;
  cursor: grab;
}
.ls-tcard:active { cursor: grabbing; }
.ls-tcard[data-depth="0"] { z-index: 3; }
.ls-tcard[data-depth="1"] { z-index: 2; transform: scale(0.95) translateY(10px); opacity: 0.85; pointer-events: none; }
.ls-tcard[data-depth="2"] { z-index: 1; transform: scale(0.9) translateY(20px); opacity: 0.7; pointer-events: none; }
.ls-tcard-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  -webkit-user-drag: none;
  pointer-events: none;
}
.ls-tcard-photo-empty {
  background: linear-gradient(135deg, var(--surface-3, #2a2422), var(--surface-2));
}
.ls-tcard-meta {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 16px 16px 18px;
  background: linear-gradient(to top, rgba(12,10,8,0.92) 35%, rgba(12,10,8,0.55) 75%, rgba(12,10,8,0) 100%);
  color: var(--text);
  pointer-events: none;
}
.ls-tcard-title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 4px;
  overflow-wrap: anywhere;
}
.ls-tcard-sub {
  font-size: 13px;
  color: var(--text-muted, var(--text-subtle));
  margin-bottom: 6px;
  overflow-wrap: anywhere;
}
.ls-tcard-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
}
.ls-tcard-price { font-weight: 700; color: var(--primary); }
.ls-tcard-loc { color: var(--text-muted, var(--text-subtle)); }

.ls-tcard-tag {
  position: absolute;
  top: 22px;
  padding: 6px 14px;
  border-radius: 8px;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0;
  transition: opacity 120ms ease;
  pointer-events: none;
  border: 3px solid currentColor;
}
.ls-tcard-tag-approve {
  right: 18px;
  color: var(--success, #2ecc71);
  transform: rotate(14deg);
}
.ls-tcard-tag-reject {
  left: 18px;
  color: var(--danger, #ff4d4d);
  transform: rotate(-14deg);
}
.ls-tcard.swipe-right .ls-tcard-tag-approve { opacity: 1; }
.ls-tcard.swipe-left  .ls-tcard-tag-reject  { opacity: 1; }

.ls-tinder-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  padding: 0 4px;
}
.ls-tinder-btn {
  appearance: none;
  border: 0;
  flex: 1 1 auto;
  max-width: 200px;
  padding: 13px 16px;
  border-radius: 999px;
  font: inherit;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.2;
  transition: background var(--t-fast, 120ms) ease, transform 80ms ease;
}
.ls-tinder-btn:active { transform: translateY(1px); }
.ls-tinder-btn-reject {
  background: var(--danger-soft, rgba(255,77,77,0.18));
  color: var(--danger, #ff4d4d);
}
.ls-tinder-btn-approve {
  background: var(--primary);
  color: #fff;
}
.ls-tinder-progress {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted, var(--text-subtle));
  letter-spacing: 0.04em;
}

@media (max-width: 390px) {
  .ls-tinder-stack { max-height: min(60vh, 480px); }
  .ls-tcard-title { font-size: 17px; }
  .ls-tinder-btn { padding: 12px 14px; font-size: 13px; }
}

/* ===========================================================================
 * F4-2D — Personas (desktop) + F4-2M scaffold (mobile)
 * Chips de rol multi-select (host/guest/lead/admin) + DataTable con
 * columna Roles inline. Mobile: cards stacked con pills.
 * =========================================================================== */

.pe-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) 0 var(--sp-4) 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--sp-4);
}
.pe-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}
.pe-chip {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.pe-chip:hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
}
.pe-chip.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.pe-chip-clear {
  border-style: dashed;
  color: var(--text-muted);
}
.pe-chip-clear:hover { color: var(--text); }

.pe-search-wrap {
  flex: 1 1 220px;
  min-width: 200px;
}
.pe-search {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  padding: 9px 12px;
}
.pe-search:focus {
  outline: 2px solid var(--primary);
  outline-offset: -1px;
  border-color: transparent;
}

.pe-total {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}

/* F4-4 (c): Export CSV action en el toolbar. Tonalmente igual al chip
 * inactivo (sin background sólido) para no robarle protagonismo al chip
 * activo de filtro — Export es un side-action, no el flow primario. */
.pe-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}
.pe-export-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
  white-space: nowrap;
}
.pe-export-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--surface-2);
}
.pe-export-btn:active {
  background: var(--surface-3, var(--surface-2));
}

/* F4-4 sub-tick (b.3) — Select toggle button. Sólo visible en mobile (≤720px).
 * En desktop el bulk-select vive en el checkbox column nativo de DataTable
 * (configurado via bulkActions en F4-4 b.2), así que escondemos este botón
 * para no duplicar la affordance. */
.pe-select-toggle {
  display: none; /* desktop default — override en mobile media query */
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
  white-space: nowrap;
}
.pe-select-toggle:hover { border-color: var(--primary); color: var(--primary); background: var(--surface-2); }
.pe-select-toggle.is-active {
  background: var(--primary);
  color: var(--on-primary, #fff);
  border-color: var(--primary);
}
.pe-select-toggle.is-active:hover { background: var(--primary-strong, var(--primary)); }

/* Name cell (avatar + nombre + email/ciudad) */
.pe-name-cell {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  min-width: 0;
}
.pe-name-stack {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.pe-name-stack strong {
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 240px;
}
.pe-sub {
  color: var(--text-muted);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 240px;
}
.pe-empty { color: var(--text-subtle); }

/* Roles pills */
.pe-roles {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
}
.pe-roles-empty { color: var(--text-subtle); }
.pe-role-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid transparent;
  line-height: 1.4;
}
.pe-role-host  { background: var(--primary-soft); color: var(--primary); border-color: var(--primary-soft); }
.pe-role-guest { background: var(--info-soft);    color: var(--info);    border-color: var(--info-soft); }
.pe-role-lead  { background: var(--warning-soft); color: var(--warning); border-color: var(--warning-soft); }
.pe-role-admin { background: var(--success-soft); color: var(--success); border-color: var(--success-soft); }

/* Mobile cards (F4-2M scaffold; polish completo en F4-2M) */
.pe-mlist {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.pe-mcard {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--sp-3);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  cursor: pointer;
  transition: border-color var(--t-fast), background var(--t-fast);
}
.pe-mcard:hover, .pe-mcard:active { border-color: var(--border-strong); background: var(--surface-2); }
.pe-mcard-head {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}
.pe-mcard-name {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}
.pe-mcard-name strong {
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pe-mcard-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-2);
  padding-top: var(--sp-2);
  border-top: 1px dashed var(--border);
}

/* F4-4 sub-tick (b.3) — Mobile select-mode visuals.
 * En .pe-mlist.is-selecting cada card lleva un check circular ANTES del avatar.
 * Click sobre la card togglea selección (handler en personas.js). Cards
 * seleccionadas: borde primary + fondo surface-2 para destacar. Lead-only sin
 * user_id queda is-disabled (opacity reducida + cursor not-allowed). */
.pe-mlist.is-selecting .pe-mcard { cursor: pointer; }
.pe-mlist.is-selecting .pe-mcard.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.pe-mcard.is-selected {
  border-color: var(--primary);
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--primary);
}
.pe-mcard.is-selected:hover,
.pe-mcard.is-selected:active {
  border-color: var(--primary);
  background: var(--surface-2);
}
.pe-mcard-check {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border: 1.5px solid var(--border-strong, var(--border));
  border-radius: 50%;
  background: var(--surface);
  color: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.pe-mcard-check svg {
  width: 14px;
  height: 14px;
  display: block;
}
.pe-mcard-check.is-checked {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary, #fff);
}
.pe-mcard-check.is-disabled,
.pe-mcard-check[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
}

/* F4-4 sub-tick (b.3) — Sticky bottom action sheet.
 * Aparece sólo en mobile cuando _selectMode=true. Sticky al borde inferior
 * del viewport con safe-area-inset-bottom para no chocar con la home bar de
 * iOS. Aparece por encima del bottom-nav (que está oculto cuando hay un modal
 * de PersonDetail abierto, pero acá no estamos en modal — así que z-index
 * suficiente para overlap si el nav re-aparece). */
.pe-bulk-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4) calc(var(--sp-3) + env(safe-area-inset-bottom));
  background: var(--surface);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 18px rgba(0, 0, 0, 0.22);
}
.pe-bulk-sheet-count {
  font-weight: 700;
  color: var(--text);
  font-size: 14px;
}
.pe-bulk-sheet-actions {
  display: flex;
  gap: var(--sp-2);
}
.pe-bulk-cancel,
.pe-bulk-tag {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.pe-bulk-cancel {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}
.pe-bulk-cancel:hover { border-color: var(--border-strong); background: var(--surface-2); }
.pe-bulk-tag {
  border: 1px solid var(--primary);
  background: var(--primary);
  color: var(--on-primary, #fff);
}
.pe-bulk-tag:hover { background: var(--primary-strong, var(--primary)); }
.pe-bulk-tag[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--text-muted);
}
/* Si el desktop entra en estado select-mode por un bug, escondemos la sheet
 * sí o sí (defense in depth). El JS sólo entra en select-mode desde mobile. */
@media (min-width: 769px) {
  .pe-bulk-sheet { display: none !important; }
}

/* Detail drawer (stub; F4-3D agrega tabs completas) */
.pe-detail { padding: var(--sp-4); }
.pe-detail-head {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding-bottom: var(--sp-4);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--sp-4);
}
.pe-detail-head h2 { margin: 0 0 4px 0; font-size: 20px; }
.pe-detail-head p { margin: 0; color: var(--text-muted); font-size: 13px; }
.pe-detail-meta {
  margin: var(--sp-4) 0 0 0;
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: var(--sp-2) var(--sp-4);
  font-size: 13px;
}
.pe-detail-meta dt {
  color: var(--text-muted);
  font-weight: 500;
}
.pe-detail-meta dd {
  margin: 0;
  color: var(--text);
}
.pe-detail-note {
  margin-top: var(--sp-5);
  padding: var(--sp-3);
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
}

/* F4-3D — PersonDetail tabs nav inside drawer */
.pe-ptabs {
  display: flex;
  gap: 0;
  margin: var(--sp-4) 0 var(--sp-3) 0;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.pe-ptabs::-webkit-scrollbar { display: none; }
.pe-ptab {
  flex: 0 0 auto;
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 14px;
  cursor: pointer;
  transition: color var(--t-fast), border-color var(--t-fast);
  white-space: nowrap;
}
.pe-ptab:hover { color: var(--text); }
.pe-ptab.is-active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}
.pe-ptab-panels { margin-top: var(--sp-2); }
.pe-ptab-panel { min-height: 120px; }
.pe-tab-stub {
  padding: var(--sp-5) var(--sp-3);
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.pe-tab-stub p { margin: 0 0 var(--sp-2) 0; }
.pe-tab-stub p:last-child { margin-bottom: 0; }
.pe-tab-stub strong { color: var(--text); font-size: 14px; }

/* F4-3M — PersonDetail mobile: SegmentedControl mount dentro del FullScreenModal.
 * En mobile (≤768px) reemplazamos el nav horizontal `.pe-ptabs` por el pill-row
 * iOS-style de SegmentedControl. Sticky al tope del `.dm-body` (que scrollea)
 * para que los 6 tabs siempre estén accesibles mientras el usuario explora
 * el contenido del panel activo. Los márgenes negativos compensan el padding
 * de `.dm-body` (var(--sp-4)) para bleed-to-edges de la pill row. */
.pe-ptabs-sc-mount {
  /* placeholder; los estilos vivos van en .pe-ptabs-sc (clase agregada por JS
   * cuando se monta el SegmentedControl). */
}
.pe-ptabs-sc {
  position: sticky;
  top: 0;
  z-index: 5;
  margin: calc(var(--sp-4) * -1) calc(var(--sp-4) * -1) var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
/* Cuando el SC vive adentro del mount, la pill-row hereda overflow auto
 * desde .sc-root — los 6 segmentos scrollean horizontal si no entran a 375px. */
.pe-ptabs-sc .sc-root {
  margin: 0;
}

/* Timeline tab (F4-3D sub-tick b) — lista vertical con punto por evento,
 * línea de tiempo a la izquierda. Cada item agrupa badge de tipo + timestamp
 * + título + subtítulo. Colores por kind (email/audit/booking/request/review)
 * dejados al dot para no pelear con el branding principal (#FF5A00). */
.pe-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}
.pe-timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--border);
}
.pe-tl-item {
  position: relative;
  padding: 0 0 var(--sp-4) 28px;
  display: block;
}
.pe-tl-item:last-child { padding-bottom: 0; }
.pe-tl-dot {
  position: absolute;
  left: 2px;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--text-muted);
  border: 2px solid var(--surface);
  box-sizing: border-box;
}
.pe-tl-kind-audit   .pe-tl-dot { background: var(--text-muted); }
.pe-tl-kind-email   .pe-tl-dot { background: #3b7bff; }
.pe-tl-kind-booking .pe-tl-dot { background: var(--primary); }
.pe-tl-kind-request .pe-tl-dot { background: #f5a623; }
.pe-tl-kind-review  .pe-tl-dot { background: #00c9a7; }
.pe-tl-body { min-width: 0; }
.pe-tl-head {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: 2px;
  font-size: 11px;
  color: var(--text-muted);
}
.pe-tl-badge {
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text-muted);
}
.pe-tl-ts { font-variant-numeric: tabular-nums; }
.pe-tl-title {
  margin: 0;
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
  line-height: 1.35;
  word-break: break-word;
}
.pe-tl-sub {
  margin: 2px 0 0 0;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
  word-break: break-word;
}

/* Mini-list (F4-3D sub-tick c) — listas compactas para Reservas y Listings
 * en el PersonDetail. Cada item: head (badge + status + ts) + título + sub.
 * Misma jerarquía visual que el timeline pero sin la línea vertical. */
.pe-mini-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.pe-mini-item {
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--border);
}
.pe-mini-item:last-child { border-bottom: 0; }
.pe-mini-head {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: 4px;
  font-size: 11px;
  color: var(--text-muted);
  flex-wrap: wrap;
}
.pe-mini-badge {
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text-muted);
}
.pe-mini-badge-host,
.pe-mini-badge-published { background: rgba(255,90,0,0.15); color: var(--primary); }
.pe-mini-badge-guest { background: rgba(59,123,255,0.15); color: #3b7bff; }
.pe-mini-badge-paused { background: rgba(245,166,35,0.15); color: #f5a623; }
.pe-mini-badge-draft { background: var(--surface-2); color: var(--text-muted); }
.pe-mini-status { font-variant-numeric: tabular-nums; }
.pe-mini-ts { margin-left: auto; font-variant-numeric: tabular-nums; }
.pe-mini-title {
  margin: 0;
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
  line-height: 1.35;
  word-break: break-word;
}
.pe-mini-sub {
  margin: 2px 0 0 0;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
  word-break: break-word;
}

/* F4-3D (d.1) — Notas internas tab. Form arriba (textarea 4000 chars +
 * counter + submit), lista debajo separadas por border-bottom. Delete
 * por ítem (soft-delete server-side via deleted_at). Visualmente alineado
 * con .pe-mini-* para mantener jerarquía coherente con las otras tabs. */
.pe-notes-empty {
  padding: var(--sp-4);
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
  background: var(--surface-1);
  border-radius: var(--radius-md);
}
.pe-note-form {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin-bottom: var(--sp-4);
}
.pe-note-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}
.pe-note-input {
  width: 100%;
  min-height: 84px;
  resize: vertical;
  padding: 10px 12px;
  background: var(--surface-1);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 13px;
  line-height: 1.45;
  box-sizing: border-box;
}
.pe-note-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(255,90,0,0.18);
}
.pe-note-form-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
}
.pe-note-counter {
  font-size: 11px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.pe-note-counter.is-over { color: #ef4444; font-weight: 600; }
.pe-note-submit {
  padding: 8px 14px;
  background: var(--primary);
  color: #fff;
  border: 0;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s ease;
}
.pe-note-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.pe-note-submit:not(:disabled):hover { opacity: 0.9; }
.pe-notes-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
}
.pe-note-item {
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--border);
}
.pe-note-item:last-child { border-bottom: 0; }
.pe-note-head {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: 4px;
  font-size: 11px;
  color: var(--text-muted);
}
.pe-note-author {
  font-weight: 600;
  color: var(--text);
}
.pe-note-ts {
  font-variant-numeric: tabular-nums;
}
.pe-note-del {
  margin-left: auto;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--text-muted);
  border: 0;
  border-radius: var(--radius-sm);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.pe-note-item:hover .pe-note-del,
.pe-note-del:focus { opacity: 1; }
.pe-note-del:hover { background: rgba(239,68,68,0.12); color: #ef4444; }
.pe-note-body {
  margin: 0;
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Mobile-LAW (doctrina #12) — chequear a 375/390/414. La toolbar
 * envuelve naturalmente; reducimos paddings y permitimos que la búsqueda
 * ocupe el ancho completo cuando los chips quedan en una fila propia.
 *
 * F4-2M: chips se convierten en pill-row horizontal scrollable (no wrap)
 * para que ocupen una sola fila siempre y el usuario las desliza con el
 * pulgar. Scrollbar oculta visualmente pero accesible con teclado/scroll.
 * Snap por chip para que el deslizamiento se sienta firme. Padding lateral
 * mínimo para que los chips de los bordes no queden cortados. */
@media (max-width: 720px) {
  .pe-toolbar { padding: var(--sp-3) 0; gap: var(--sp-2); }
  .pe-chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    width: 100%;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    padding-bottom: 2px;
  }
  .pe-chips::-webkit-scrollbar { display: none; }
  .pe-chip {
    flex: 0 0 auto;
    scroll-snap-align: start;
  }
  .pe-search-wrap { flex-basis: 100%; }
  /* F4-4 (c): en mobile el botón Export ocupa toda la fila para no comprimir
   * el search ni el total. La descarga sigue funcionando — anchor click
   * dispara Content-Disposition: attachment como en desktop. */
  .pe-actions { flex-basis: 100%; }
  .pe-export-btn { width: 100%; padding: 11px 14px; font-size: 14px; }
  .pe-total { width: 100%; text-align: right; }
  .pe-name-stack strong { max-width: 180px; }
  .pe-sub { max-width: 180px; }

  /* Mobile cards: avatar grande, jerarquía clara, role pills al lado del
   * nombre (no debajo del card como bloque suelto). */
  .pe-mcard {
    padding: var(--sp-4);
    gap: var(--sp-3);
  }
  .pe-mcard-head {
    align-items: flex-start;
    gap: var(--sp-3);
  }
  .pe-mcard-name {
    gap: 4px;
    display: flex;
    flex-direction: column;
  }
  .pe-mcard-name strong {
    font-size: 16px;
    line-height: 1.25;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }
  .pe-mcard-name .pe-sub {
    max-width: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .pe-mcard-name .pe-roles {
    margin-top: 4px;
  }
  .pe-mcard-foot {
    font-size: 12px;
  }
  .pe-sub-loc {
    flex: 1 1 auto;
    min-width: 0;
  }
  .pe-sub-date {
    flex: 0 0 auto;
    color: var(--text-subtle);
  }

  /* F4-3D (d.1) — Notas en mobile: textarea más alta (más fácil tipear con
   * pulgar), submit full-width, delete siempre visible (no hover en touch). */
  .pe-note-input { min-height: 110px; font-size: 14px; }
  .pe-note-form-foot {
    flex-wrap: wrap;
    gap: var(--sp-2);
  }
  .pe-note-counter { order: 2; width: 100%; text-align: right; }
  .pe-note-submit { order: 1; width: 100%; padding: 11px 14px; font-size: 14px; }
  .pe-note-del { opacity: 1; }
  .pe-note-body { font-size: 14px; }

  /* F4-4 (b.3) — Mobile bulk-select. El toggle se vuelve visible, queda
   * lado a lado con el botón Export en .pe-actions (que ya es flex-basis:100%
   * row propia). Ambos botones comparten la row: dividimos 50/50 con flex:1
   * para que ninguno apriete al otro. La sticky sheet usa padding bottom con
   * safe-area-inset para iOS. Cuando hay selecciones, agregamos padding
   * inferior al body de la vista para que la sheet no tape la última card. */
  .pe-select-toggle {
    display: inline-block;
    flex: 1 1 50%;
    width: 100%;
    padding: 11px 14px;
    font-size: 14px;
  }
  .pe-export-btn {
    flex: 1 1 50%;
  }
  .pe-actions {
    display: flex;
    gap: var(--sp-2);
    flex-wrap: nowrap;
  }
  /* Espacio extra abajo cuando el sheet está montado, para que la última
   * card no quede tapada. El selector apunta al ancestro de la sheet vía
   * :has() — moderno pero ampliamente soportado en iOS 15.4+ / Chrome 105+.
   * Fallback: la sheet usa box-shadow para indicar overlap igualmente. */
  .view:has(.pe-bulk-sheet) .pe-content-mount {
    padding-bottom: 88px;
  }
}
@media (max-width: 400px) {
  .pe-chip { padding: 5px 10px; font-size: 12px; }
  .pe-mcard { padding: var(--sp-3); }
  .pe-mcard-name strong { font-size: 15px; }
  .pe-role-pill { font-size: 10px; padding: 2px 6px; }
}

/* --- F5-1D Finanzas shell (sub-tick a) --- */
.view-finanzas { display: block; }
.view-finanzas .fn-tabs-desktop {
  margin: 0 0 var(--sp-3);
}
.view-finanzas .fn-tabs-mobile { display: none; }
.view-finanzas .fn-panels {
  display: block;
}
.fn-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--sp-4);
  min-height: 200px;
}
.fn-panel[hidden] { display: none; }
.fn-stub {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--sp-2);
  padding: var(--sp-3);
}
.fn-stub-icon {
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  background: var(--primary-soft);
  color: var(--primary);
  display: inline-flex; align-items: center; justify-content: center;
}
.fn-stub h3 {
  margin: 0;
  font: 600 17px/1.3 var(--font-sans);
  color: var(--text);
}
.fn-stub p {
  margin: 0;
  font: 14px/1.5 var(--font-sans);
  color: var(--text-muted);
  max-width: 60ch;
}

.fn-mobile-redirect {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  align-items: flex-start;
}
.fn-mobile-redirect-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  background: var(--primary-soft);
  color: var(--primary);
  display: inline-flex; align-items: center; justify-content: center;
}
.fn-mobile-redirect h3 {
  margin: var(--sp-1) 0 0;
  font: 700 18px/1.25 var(--font-sans);
  color: var(--text);
}
.fn-mobile-redirect p {
  margin: 0;
  font: 14px/1.55 var(--font-sans);
  color: var(--text-muted);
  max-width: 56ch;
}
.fn-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}
.fn-link:hover { text-decoration: underline; }

@media (max-width: 720px) {
  /* Mobile shell del standalone /finanzas: tabs ocultos, mobile-redirect ocupa full width. */
  .view-finanzas .fn-tabs-desktop { display: none; }
  .view-finanzas .fn-panels { display: none; }
  .fn-mobile-redirect { padding: var(--sp-3); }
  .fn-mobile-redirect h3 { font-size: 17px; }
  .fn-mobile-redirect p { font-size: 13px; }
}
@media (max-width: 400px) {
  .fn-mobile-redirect-icon { width: 38px; height: 38px; }
}

/* F5-1D sub-tick (b): CashPositionCard.
 * 3-tile row con KPIs + breakdown per-currency grid.
 * Mobile-LAW doctrina #12: tiles stackean en <=720px y el grid colapsa a 1 col. */
.fn-cash-card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}
.fn-cash-tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--sp-3);
}
.fn-cash-tile {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: var(--sp-3);
  background: var(--bg-elevated, var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.fn-cash-tile.is-warn {
  border-color: var(--warning, #d97706);
  background: var(--warning-soft, rgba(217, 119, 6, 0.08));
}
.fn-tile-label {
  font: 600 12px/1.2 var(--font-sans);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.fn-tile-value {
  font: 700 26px/1.1 var(--font-sans);
  color: var(--text);
}
.fn-cash-tile.is-warn .fn-tile-value { color: var(--warning, #d97706); }
.fn-tile-meta {
  font: 11px/1.3 var(--font-sans);
  color: var(--text-muted);
}

.fn-cash-breakdown {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.fn-cash-breakdown h4 {
  margin: 0;
  font: 600 14px/1.3 var(--font-sans);
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.fn-cash-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-3);
}
.fn-cash-grid-col {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  padding: var(--sp-3);
  background: var(--bg-elevated, var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.fn-cash-grid-col h5 {
  margin: 0 0 var(--sp-1);
  font: 600 12px/1.2 var(--font-sans);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.fn-cash-table {
  width: 100%;
  border-collapse: collapse;
  font: 13px/1.4 var(--font-sans);
}
.fn-cash-table th,
.fn-cash-table td {
  text-align: left;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
}
.fn-cash-table tbody tr:last-child td { border-bottom: none; }
.fn-cash-table th {
  font: 600 11px/1.2 var(--font-sans);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.fn-cash-table .fn-cur { width: 22%; color: var(--text-muted); }
.fn-cash-table .fn-amt { width: 56%; color: var(--text); font-weight: 600; }
.fn-cash-table .fn-cnt { width: 22%; text-align: right; color: var(--text-muted); }

.fn-cash-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-2);
  padding-top: var(--sp-2);
  border-top: 1px dashed var(--border);
  font: 12px/1.3 var(--font-sans);
  color: var(--text-muted);
}
.fn-cash-stripe-stub { font-style: italic; }
.fn-cash-generated { font-variant-numeric: tabular-nums; }

/* F5-1D sub-tick (b.2): Stripe live balance row. */
.fn-cash-stripe {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: var(--sp-2) 0;
  border-top: 1px dashed var(--border);
}
.fn-cash-stripe-head {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}
.fn-cash-stripe-label {
  font: 600 12px/1.2 var(--font-sans);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.fn-cash-stripe-unavailable {
  font: 12px/1.3 var(--font-sans);
  color: var(--text-muted);
  font-style: italic;
}
.fn-stripe-badge {
  display: inline-block;
  font: 600 10px/1 var(--font-sans);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 7px;
  border-radius: 999px;
  border: 1px solid var(--border);
}
.fn-stripe-badge.is-live { background: var(--success-soft, rgba(16, 163, 74, 0.10)); color: var(--success, #15803d); border-color: var(--success, #15803d); }
.fn-stripe-badge.is-test { background: var(--warning-soft, rgba(245, 166, 35, 0.10)); color: var(--warning, #b45309); border-color: var(--warning, #b45309); }
.fn-cash-stripe-rows {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-2);
}
.fn-cash-stripe-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: var(--sp-2);
  background: var(--surface-2, rgba(255, 255, 255, 0.02));
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  min-width: 0;
}
.fn-stripe-row-label {
  font: 500 11px/1.2 var(--font-sans);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.fn-stripe-row-value {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  font: 600 15px/1.3 var(--font-sans);
  color: var(--text);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.fn-stripe-amt { white-space: nowrap; }
.fn-stripe-sep { color: var(--text-muted); font-weight: 400; }
.fn-stripe-empty { color: var(--text-muted); font-weight: 500; font-style: italic; }

/* F5-1D sub-tick (c): EscrowFlow. */
.fn-escrow-card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding: var(--sp-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.fn-escrow-summary {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.fn-escrow-summary-label {
  font: 600 11px/1.2 var(--font-sans);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.fn-escrow-summary-value {
  font: 800 28px/1.1 var(--font-sans);
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.fn-escrow-summary-meta {
  font: 13px/1.4 var(--font-sans);
  color: var(--text-muted);
}
.fn-escrow-buckets {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-2);
}
.fn-escrow-bucket {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: var(--sp-2);
  background: var(--surface-2, rgba(255, 255, 255, 0.02));
  border: 1px solid var(--border);
  border-left: 3px solid var(--border);
  border-radius: var(--radius-sm);
  min-width: 0;
}
.fn-escrow-bucket.is-empty { opacity: 0.55; }
.fn-escrow-bucket.is-danger  { border-left-color: var(--danger,  #dc2626); }
.fn-escrow-bucket.is-warn    { border-left-color: var(--warning, #b45309); }
.fn-escrow-bucket.is-info    { border-left-color: var(--info,    #2563eb); }
.fn-escrow-bucket.is-neutral { border-left-color: var(--text-muted, #6B655A); }
.fn-escrow-bucket-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-2);
}
.fn-escrow-bucket-label {
  font: 600 12px/1.2 var(--font-sans);
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.fn-escrow-bucket-count {
  font: 500 11px/1 var(--font-sans);
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.fn-escrow-bucket-value {
  font: 700 22px/1.15 var(--font-sans);
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.fn-escrow-bucket.is-danger  .fn-escrow-bucket-value { color: var(--danger,  #dc2626); }
.fn-escrow-bucket.is-warn    .fn-escrow-bucket-value { color: var(--warning, #b45309); }
.fn-escrow-bucket-bar {
  position: relative;
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}
.fn-escrow-bucket-bar-fill {
  display: block;
  height: 100%;
  background: var(--text-muted, #6B655A);
  border-radius: inherit;
  transition: width 240ms ease-out;
}
.fn-escrow-bucket.is-danger  .fn-escrow-bucket-bar-fill { background: var(--danger,  #dc2626); }
.fn-escrow-bucket.is-warn    .fn-escrow-bucket-bar-fill { background: var(--warning, #b45309); }
.fn-escrow-bucket.is-info    .fn-escrow-bucket-bar-fill { background: var(--info,    #2563eb); }
.fn-escrow-bucket.is-neutral .fn-escrow-bucket-bar-fill { background: var(--text-muted, #6B655A); }
.fn-escrow-bucket-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  font: 12px/1.3 var(--font-sans);
  color: var(--text);
}
.fn-escrow-cur { white-space: nowrap; font-variant-numeric: tabular-nums; }
.fn-escrow-cur-n { color: var(--text-muted); }
.fn-escrow-empty { color: var(--text-muted); font-style: italic; }
.fn-escrow-bucket-hint {
  margin: 0;
  font: 11px/1.4 var(--font-sans);
  color: var(--text-muted);
}
.fn-escrow-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-2);
  padding-top: var(--sp-2);
  border-top: 1px dashed var(--border);
  font: 12px/1.4 var(--font-sans);
  color: var(--text-muted);
}
.fn-escrow-footnote { max-width: 70ch; }
.fn-escrow-footnote code { font-family: var(--font-mono, monospace); font-size: 11px; }

.fn-cash-error {
  align-items: flex-start;
  padding: var(--sp-3);
  background: var(--danger-soft, rgba(220, 38, 38, 0.06));
  border: 1px solid var(--danger, #dc2626);
  border-radius: var(--radius-sm);
}
.fn-cash-error h3 {
  margin: 0 0 var(--sp-1);
  font: 600 15px/1.3 var(--font-sans);
  color: var(--danger, #dc2626);
}
.fn-cash-error p {
  margin: 0 0 var(--sp-2);
  font: 13px/1.5 var(--font-sans);
  color: var(--text);
}
.fn-retry-btn {
  appearance: none;
  border: 1px solid var(--primary);
  background: var(--primary);
  color: #fff;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font: 600 13px/1 var(--font-sans);
  cursor: pointer;
}
.fn-retry-btn:hover { filter: brightness(1.05); }

@media (max-width: 720px) {
  /* Mobile-LAW doctrina #12: tiles stack vertically + breakdown collapses to 1 col.
   * Aunque /finanzas standalone redirige en mobile, este CashPositionCard se va a
   * embeber en el Dashboard mobile (F5-1M / F5-2M), así que necesita ser mobile-OK. */
  .fn-cash-tiles { grid-template-columns: 1fr; gap: var(--sp-2); }
  .fn-tile-value { font-size: 22px; }
  .fn-cash-grid { grid-template-columns: 1fr; gap: var(--sp-2); }
  .fn-cash-footer { flex-direction: column; align-items: flex-start; }
  /* Stripe live balance stacks to 1 col on mobile (375/390/414px) so the
   * "Disponible" / "Pendiente" rows stay readable without horizontal overflow. */
  .fn-cash-stripe-rows { grid-template-columns: 1fr; }
  .fn-stripe-row-value { font-size: 14px; }
  /* F5-1D sub-tick (c): EscrowFlow stacks vertically on mobile.
   * El grid 3-col del desktop colapsa a 1-col en <720px para que cada bucket
   * tenga ancho completo y los montos de 22px se vean sin clipping. */
  .fn-escrow-buckets { grid-template-columns: 1fr; gap: var(--sp-2); }
  .fn-escrow-summary-value { font-size: 24px; }
  .fn-escrow-footer { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 400px) {
  .fn-tile-value { font-size: 20px; }
  .fn-cash-table { font-size: 12px; }
  .fn-cash-table th, .fn-cash-table td { padding: 5px 6px; }
  .fn-stripe-row-value { font-size: 13px; }
  .fn-escrow-summary-value { font-size: 22px; }
  .fn-escrow-bucket-value { font-size: 20px; }
  .fn-escrow-bucket-label { font-size: 11px; }
}

/* F5-2D sub-tick (a): PayoutsQueue panel */
.fn-payouts-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.fn-payouts-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.fn-payouts-windows {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.fn-payout-win {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface-2, var(--surface));
  color: var(--text-muted);
  padding: 7px 12px;
  border-radius: 999px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}
.fn-payout-win:hover { color: var(--text); border-color: var(--text-muted); }
.fn-payout-win.is-active {
  background: var(--primary);
  color: var(--on-primary, #fff);
  border-color: var(--primary);
}
.fn-payouts-totals {
  font-size: 13px;
  color: var(--text-muted);
}
.fn-payouts-totals strong {
  color: var(--text);
  font-variant-numeric: tabular-nums;
  margin-left: 4px;
}
.fn-payouts-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.fn-payout-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  background: var(--surface-2, var(--surface));
  border: 1px solid var(--border);
  border-radius: 10px;
}
.fn-payout-stat.is-danger { border-color: var(--danger, #d33); }
.fn-payout-stat.is-warn { border-color: var(--warning, #f5a623); }
.fn-payout-stat.is-success { border-color: var(--success, #2ea96a); }
.fn-payout-stat-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
.fn-payout-stat-value {
  font-size: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.fn-payouts-table {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.fn-payouts-thead, .fn-payouts-row {
  display: grid;
  grid-template-columns: 36px 1.6fr 1.4fr 0.9fr 1fr 1.1fr;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  background: var(--surface);
  font-size: 13px;
}
.fn-payouts-thead {
  background: var(--surface-2, var(--surface));
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
.fn-payouts-row.is-danger { border-left: 3px solid var(--danger, #d33); }
.fn-payouts-row.is-selected { background: var(--primary-soft, rgba(255,90,0,0.08)); }
.fn-payout-check-col {
  display: flex;
  align-items: center;
  justify-content: center;
}
.fn-payout-check-col input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}
.fn-payout-check-col input[type="checkbox"]:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}
.fn-payout-host-name {
  font-weight: 600;
  color: var(--text);
}
.fn-payout-host-meta {
  font-size: 11px;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}
.fn-payout-listing {
  color: var(--text);
  overflow-wrap: anywhere;
}
.fn-payout-amount {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  white-space: nowrap;
}
.fn-payout-when {
  color: var(--text-muted);
  font-size: 12px;
}
.fn-payout-status {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.fn-payout-chip {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid transparent;
}
.fn-payout-chip.is-danger { background: var(--danger-soft, rgba(220,53,69,0.12)); color: var(--danger, #d33); border-color: var(--danger, #d33); }
.fn-payout-chip.is-warn { background: var(--warning-soft, rgba(245,166,35,0.12)); color: var(--warning, #f5a623); border-color: var(--warning, #f5a623); }
.fn-payout-chip.is-info { background: var(--primary-soft, rgba(255,90,0,0.10)); color: var(--primary); border-color: var(--primary); }
.fn-payout-chip.is-success-soft { background: var(--success-soft, rgba(46,169,106,0.12)); color: var(--success, #2ea96a); border-color: var(--success, #2ea96a); }
.fn-payout-chip.is-warn-soft { background: var(--surface-2, var(--surface)); color: var(--text-muted); border-color: var(--border); }
.fn-payouts-empty {
  padding: 24px 16px;
  text-align: center;
  color: var(--text-muted);
  font-style: italic;
  border: 1px dashed var(--border);
  border-radius: 10px;
}
.fn-payouts-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
  font-size: 12px;
  color: var(--text-muted);
}
.fn-payouts-hint { font-style: italic; }
.fn-payouts-generated { font-variant-numeric: tabular-nums; }

@media (max-width: 960px) {
  .fn-payouts-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fn-payouts-thead { display: none; }
  .fn-payouts-row {
    grid-template-columns: 28px 1fr;
    grid-template-areas:
      "check host"
      "check listing"
      "check amount"
      "check when"
      "check status";
    gap: 6px 10px;
    padding: 12px;
  }
  .fn-payouts-row .fn-payout-check-col { grid-area: check; align-self: flex-start; padding-top: 2px; }
  .fn-payouts-row .fn-payout-host { grid-area: host; }
  .fn-payouts-row .fn-payout-listing { grid-area: listing; }
  .fn-payouts-row .fn-payout-amount { grid-area: amount; }
  .fn-payouts-row .fn-payout-when { grid-area: when; }
  .fn-payouts-row .fn-payout-status { grid-area: status; }
  .fn-payout-host-name { font-size: 14px; }
  .fn-payout-listing::before { content: 'Asado: '; color: var(--text-muted); font-size: 11px; }
  .fn-payout-amount::before { content: 'Monto: '; color: var(--text-muted); font-size: 11px; font-weight: 400; }
  .fn-payout-when::before { content: 'Cuándo: '; color: var(--text-muted); font-size: 11px; }
}

@media (max-width: 720px) {
  .fn-payouts-card { padding: 16px; }
  .fn-payouts-head { flex-direction: column; align-items: flex-start; }
  .fn-payouts-totals { font-size: 12px; }
  .fn-payouts-summary { gap: 8px; }
  .fn-payout-stat-value { font-size: 20px; }
  .fn-payouts-footer { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 400px) {
  .fn-payouts-summary { grid-template-columns: 1fr 1fr; }
  .fn-payout-stat-value { font-size: 18px; }
  .fn-payout-win { font-size: 12px; padding: 6px 10px; }
  .fn-payout-host-name { font-size: 13px; }
  .fn-payout-host-meta { font-size: 10px; }
}

/* Bulk action bar (sticky footer-style above viewport bottom) */
.fn-payouts-bulkbar {
  position: sticky;
  bottom: 12px;
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--primary);
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.18);
  z-index: 5;
}
.fn-payouts-bulk-count {
  font-weight: 600;
  color: var(--text);
  font-size: 13px;
}
.fn-payouts-bulk-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.fn-bulk-primary,
.fn-bulk-secondary {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 8px 14px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: filter 120ms ease, background 120ms ease;
}
.fn-bulk-primary {
  background: var(--primary);
  color: #fff;
}
.fn-bulk-primary:hover { filter: brightness(1.05); }
.fn-bulk-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.fn-bulk-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.fn-bulk-secondary:hover { background: var(--surface-2, var(--surface)); }

/* Dry-run preview modal */
.fn-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 1000;
  animation: fnFadeIn 140ms ease both;
}
@keyframes fnFadeIn { from { opacity: 0; } to { opacity: 1; } }
.fn-modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  width: min(680px, 100%);
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,0.4);
}
.fn-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.fn-modal-head h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.fn-modal-close {
  appearance: none;
  background: transparent;
  border: none;
  font-size: 22px;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}
.fn-modal-close:hover { background: var(--surface-2, var(--surface)); color: var(--text); }
.fn-modal-body {
  padding: 16px 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.fn-modal-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 16px;
  padding: 12px 14px;
  background: var(--surface-2, var(--surface));
  border: 1px solid var(--border);
  border-radius: 10px;
}
.fn-modal-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--text-muted);
}
.fn-modal-summary-row strong {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.fn-modal-summary-row.is-success strong { color: var(--success, #2ea96a); }
.fn-modal-summary-row.is-warn strong { color: var(--warning, #f5a623); }
.fn-modal-plan {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.fn-modal-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
}
.fn-modal-row.is-ok { border-left-color: var(--success, #2ea96a); }
.fn-modal-row.is-blocked { border-left-color: var(--warning, #f5a623); }
.fn-modal-row-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.fn-modal-row-host {
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fn-modal-row-listing {
  font-size: 12px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fn-modal-row-amount {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  white-space: nowrap;
}
.fn-modal-row-state { font-size: 12px; }
.fn-modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  background: var(--surface-2, var(--surface));
}
.fn-modal-warning {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
}

@media (max-width: 720px) {
  .fn-payouts-bulkbar {
    position: sticky;
    bottom: 8px;
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
  }
  .fn-payouts-bulk-actions { justify-content: stretch; }
  .fn-payouts-bulk-actions .fn-bulk-primary,
  .fn-payouts-bulk-actions .fn-bulk-secondary { flex: 1 1 auto; }
  .fn-modal-backdrop { padding: 12px; }
  .fn-modal { max-height: calc(100vh - 24px); border-radius: 12px; }
  .fn-modal-head { padding: 12px 14px; }
  .fn-modal-body { padding: 12px 14px; }
  .fn-modal-foot { padding: 10px 14px; flex-direction: column; align-items: stretch; }
  .fn-modal-foot .fn-bulk-secondary { width: 100%; }
  .fn-modal-summary { grid-template-columns: 1fr; }
  .fn-modal-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .fn-modal-row-amount { white-space: normal; }
}

@media (max-width: 400px) {
  .fn-payouts-bulkbar { padding: 10px; gap: 8px; }
  .fn-bulk-primary, .fn-bulk-secondary { font-size: 12px; padding: 8px 10px; }
  .fn-modal-head h3 { font-size: 15px; }
  .fn-modal-row { font-size: 12px; }
}

/* ============================================================================
 * F5-3D sub-tick (a): StripeConnectList styles.
 * ============================================================================ */
.fn-stripe-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
}

.fn-stripe-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.fn-stripe-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.fn-stripe-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  max-width: 60ch;
  line-height: 1.45;
}

.fn-stripe-bulk-stub {
  opacity: 0.6;
  cursor: not-allowed;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.25;
}

.fn-stripe-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-start;
}

.fn-stripe-refresh {
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.25;
}

.fn-stripe-refresh:disabled {
  opacity: 0.7;
  cursor: progress;
}

.fn-stripe-poll-banner {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.4;
  font-weight: 500;
  border: 1px solid var(--border);
}

.fn-stripe-poll-banner.is-success-soft {
  background: rgba(16, 185, 129, 0.08);
  color: var(--success, #047857);
  border-color: rgba(16, 185, 129, 0.25);
}

.fn-stripe-poll-banner.is-warn {
  background: rgba(245, 166, 35, 0.10);
  color: var(--warn, #b45309);
  border-color: rgba(245, 166, 35, 0.30);
}

.fn-stripe-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.fn-stripe-table {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.fn-stripe-thead {
  display: grid;
  grid-template-columns: 36px 1.6fr 1.4fr 0.7fr 1fr 1.4fr;
  gap: 12px;
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.fn-stripe-row {
  display: grid;
  grid-template-columns: 36px 1.6fr 1.4fr 0.7fr 1fr 1.4fr;
  gap: 12px;
  padding: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  align-items: center;
  font-size: 13px;
}

.fn-stripe-checkcol {
  display: flex;
  align-items: center;
  justify-content: center;
}

.fn-stripe-check-na {
  color: var(--text-muted);
  font-size: 12px;
  user-select: none;
}

.fn-stripe-row.is-danger {
  border-left: 4px solid var(--danger, #dc2626);
}

.fn-stripe-host-name {
  font-weight: 600;
  color: var(--text);
}

.fn-stripe-host-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  overflow-wrap: anywhere;
}

.fn-stripe-state {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
}

.fn-stripe-reqs {
  font-size: 11px;
  color: var(--warning, #d97706);
  font-style: italic;
}

.fn-stripe-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
}

.fn-stripe-held {
  color: var(--danger, #dc2626);
  font-weight: 600;
}

.fn-stripe-acctid {
  font-size: 11px;
  background: var(--surface);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  overflow-wrap: anywhere;
}

.fn-stripe-noacct {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
}

/* Mobile-LAW doctrina #12 (Stripe Connect list responsive). */
@media (max-width: 960px) {
  .fn-stripe-summary { grid-template-columns: repeat(2, 1fr); }
  .fn-stripe-thead { display: none; }
  .fn-stripe-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .fn-stripe-row > [data-label]::before {
    content: attr(data-label) ': ';
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    font-weight: 600;
    margin-right: 4px;
  }
}

@media (max-width: 720px) {
  .fn-stripe-head { flex-direction: column; align-items: stretch; }
  .fn-stripe-bulk-stub { width: 100%; }
  .fn-stripe-actions { flex-direction: column; width: 100%; gap: 8px; }
  .fn-stripe-actions > button { width: 100%; }
  .fn-stripe-title { font-size: 15px; }
  .fn-stripe-subtitle { font-size: 11px; }
  .fn-stripe-poll-banner { font-size: 12px; padding: 8px 12px; }
}

@media (max-width: 400px) {
  .fn-stripe-summary { gap: 8px; }
  .fn-stripe-row { padding: 10px; font-size: 12px; }
  .fn-stripe-host-name { font-size: 13px; }
  .fn-stripe-host-meta { font-size: 10px; }
}

/* === F5-4D P&L mensual (read-only desde finance MCP / DB peter) === */

.fn-pnl-card {
  background: var(--panel, #1a1410);
  border: 1px solid var(--border-soft, rgba(255, 255, 255, 0.08));
  border-radius: 12px;
  padding: 20px;
}

.fn-pnl-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.fn-pnl-head-info { display: flex; flex-direction: column; gap: 4px; }

.fn-pnl-title {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-weight: 700;
  font-size: 16px;
  color: var(--text, #F2EDE4);
  margin: 0;
}

.fn-pnl-subtitle {
  font-size: 12px;
  color: var(--text-muted, rgba(242, 237, 228, 0.6));
  margin: 0;
}

.fn-pnl-windows {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
  padding: 4px;
  border-radius: 10px;
  border: 1px solid var(--border-soft, rgba(255, 255, 255, 0.06));
}

.fn-pnl-win {
  background: transparent;
  border: none;
  color: var(--text-muted, rgba(242, 237, 228, 0.7));
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.fn-pnl-win:hover { color: var(--text, #F2EDE4); }
.fn-pnl-win.is-active {
  background: var(--brand, #FF5A00);
  color: #fff;
}

.fn-pnl-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.fn-pnl-stat {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-soft, rgba(255, 255, 255, 0.06));
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.fn-pnl-stat-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted, rgba(242, 237, 228, 0.55));
}

.fn-pnl-stat-value {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-weight: 700;
  font-size: 18px;
  color: var(--text, #F2EDE4);
}

.fn-pnl-stat.is-success .fn-pnl-stat-value { color: #2bb673; }
.fn-pnl-stat.is-danger  .fn-pnl-stat-value { color: #d4503d; }

.fn-pnl-breakdown {
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed var(--border-soft, rgba(255, 255, 255, 0.08));
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 16px;
}

.fn-pnl-breakdown-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted, rgba(242, 237, 228, 0.6));
  margin: 0 0 8px;
}

.fn-pnl-breakdown-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.fn-pnl-breakdown-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text, #F2EDE4);
}

.fn-pnl-cur {
  font-weight: 600;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  background: rgba(255, 90, 0, 0.12);
  color: #FF7E33;
  padding: 1px 6px;
  border-radius: 4px;
}

.fn-pnl-cur-amt {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12px;
}

.fn-pnl-table {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr 0.8fr;
  gap: 1px;
  background: var(--border-soft, rgba(255, 255, 255, 0.06));
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border-soft, rgba(255, 255, 255, 0.06));
}

.fn-pnl-thead, .fn-pnl-row {
  display: contents;
}

.fn-pnl-thead > div,
.fn-pnl-row > div {
  background: var(--panel, #1a1410);
  padding: 10px 12px;
  font-size: 12px;
  color: var(--text, #F2EDE4);
}

.fn-pnl-thead > div {
  background: rgba(255, 255, 255, 0.04);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted, rgba(242, 237, 228, 0.65));
}

.fn-pnl-amt {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  text-align: right;
}

.fn-pnl-amt-h {
  text-align: right;
}

.fn-pnl-amt.is-pos { color: #2bb673; }
.fn-pnl-amt.is-neg { color: #d4503d; }

.fn-pnl-ym {
  font-weight: 600;
}

.fn-pnl-row-skel {
  background: var(--panel, #1a1410);
  padding: 14px;
  border-bottom: 1px solid var(--border-soft, rgba(255, 255, 255, 0.06));
}

.fn-pnl-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--border-soft, rgba(255, 255, 255, 0.08));
  flex-wrap: wrap;
  gap: 8px;
}

.fn-pnl-hint, .fn-pnl-generated {
  font-size: 11px;
  color: var(--text-muted, rgba(242, 237, 228, 0.5));
}

.fn-pnl-empty {
  text-align: center;
  padding: 40px 20px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 10px;
  border: 1px dashed var(--border-soft, rgba(255, 255, 255, 0.1));
}

.fn-pnl-empty-icon {
  font-size: 32px;
  color: var(--text-muted, rgba(242, 237, 228, 0.3));
  margin-bottom: 10px;
}

.fn-pnl-empty h3 {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-weight: 700;
  font-size: 15px;
  color: var(--text, #F2EDE4);
  margin: 0 0 8px;
}

.fn-pnl-empty p {
  font-size: 12px;
  color: var(--text-muted, rgba(242, 237, 228, 0.6));
  margin: 0;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.5;
}

.fn-pnl-conn-banner {
  background: rgba(245, 166, 35, 0.08);
  border: 1px solid rgba(245, 166, 35, 0.3);
  color: #F5A623;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 12px;
  margin-bottom: 14px;
}

@media (max-width: 960px) {
  .fn-pnl-summary { grid-template-columns: repeat(2, 1fr); }

  .fn-pnl-table {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .fn-pnl-thead { display: none; }
  .fn-pnl-row {
    display: flex;
    flex-direction: column;
    background: var(--panel, #1a1410);
    border-bottom: 1px solid var(--border-soft, rgba(255, 255, 255, 0.06));
    padding: 12px 14px;
    gap: 6px;
  }
  .fn-pnl-row:last-child { border-bottom: none; }
  .fn-pnl-row > div {
    background: transparent;
    padding: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
  }
  .fn-pnl-row > div::before {
    content: attr(data-label) ': ';
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted, rgba(242, 237, 228, 0.55));
  }
  .fn-pnl-amt, .fn-pnl-amt-h { text-align: right; }
}

@media (max-width: 720px) {
  .fn-pnl-head { flex-direction: column; align-items: stretch; }
  .fn-pnl-windows { width: 100%; justify-content: space-between; }
  .fn-pnl-win { flex: 1; text-align: center; }
  .fn-pnl-card { padding: 16px; }
}

@media (max-width: 400px) {
  .fn-pnl-stat { padding: 10px; }
  .fn-pnl-stat-value { font-size: 16px; }
  .fn-pnl-row { padding: 10px 12px; font-size: 12px; }
  .fn-pnl-card { padding: 12px; }
}
