/* ================================================================
   MY-OOH ADMIN — STYLES v5
   Premium Dark/Light — Minimal, Secure, Professional
   ================================================================ */

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

/* ── DESIGN TOKENS ─────────────────────────────────────────────── */
:root {
  --sidebar-w: 260px;
  --sidebar-col: 72px;
  --topbar-h: 64px;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Poppins', sans-serif;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.12);
  --brand: #06B6D4;
  --brand-hover: #0891B2;
  --brand-soft: rgba(6,182,212,0.08);
  --brand-glow: rgba(6,182,212,0.15);
}

/* ── DARK THEME ────────────────────────────────────────────────── */
[data-theme="dark"] {
  --bg-body:        #09090b;
  --bg-sidebar:     #0f0f11;
  --bg-topbar:      rgba(15,15,17,0.85);
  --bg-card:        #131316;
  --bg-card-hover:  #1a1a1e;
  --bg-input:       #0f0f11;
  --bg-modal:       #131316;
  --bg-overlay:     rgba(0,0,0,0.8);
  --bg-table-hover: #16161a;
  --bg-surface:     #1a1a1e;

  --border:         rgba(255,255,255,0.06);
  --border-l:       rgba(255,255,255,0.1);
  --border-focus: rgba(6,182,212,0.4);

  --text:           #fafafa;
  --text-sub:       #a1a1aa;
  --text-muted:     #52525b;
  --text-dim:       #27272a;

  --accent: #06B6D4;
  --accent-hover: #0891B2;
  --accent-glow: rgba(6,182,212,0.12);
  --accent-soft: rgba(6,182,212,0.08);

  --green:          #10b981;
  --green-soft:     rgba(16,185,129,0.1);
  --red:            #ef4444;
  --red-soft:       rgba(239,68,68,0.08);
  --orange: #06B6D4;
  --orange-soft: rgba(6,182,212,0.08);
  --cyan:           #06b6d4;
  --cyan-soft:      rgba(6,182,212,0.08);
  --blue:           #3b82f6;
  --blue-soft:      rgba(59,130,246,0.08);
}

/* ── LIGHT THEME ───────────────────────────────────────────────── */
[data-theme="light"] {
  --bg-body:        #f4f4f5;
  --bg-sidebar:     #fafafa;
  --bg-topbar:      rgba(250,250,250,0.92);
  --bg-card:        #ffffff;
  --bg-card-hover:  #fafafa;
  --bg-input:       #f0f0f2;
  --bg-modal:       #ffffff;
  --bg-overlay:     rgba(0,0,0,0.45);
  --bg-table-hover: #f8f8fa;
  --bg-surface:     #f0f0f2;

  --border:         rgba(0,0,0,0.07);
  --border-l:       rgba(0,0,0,0.12);
  --border-focus: rgba(6,182,212,0.5);

  --text:           #1a1a1a;
  --text-sub:       #4a4a4a;
  --text-muted:     #8a8a8a;
  --text-dim:       #d4d4d8;

  --accent: #0891B2;
  --accent-hover: #065f73;
  --accent-glow: rgba(6,182,212,0.1);
  --accent-soft: rgba(6,182,212,0.07);

  --green:          #16a34a;
  --green-soft:     rgba(22,163,74,0.08);
  --red:            #dc2626;
  --red-soft:       rgba(220,38,38,0.07);
  --orange: #0891B2;
  --orange-soft: rgba(6,182,212,0.07);
  --cyan:           #0e7490;
  --cyan-soft:      rgba(14,116,144,0.07);
  --blue:           #2563eb;
  --blue-soft:      rgba(37,99,235,0.07);
}

/* ── RESET & BASE ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body { font-family: var(--font); background: var(--bg-body); color: var(--text); line-height: 1.5; overflow-x: hidden; min-height: 100vh; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; font-size: inherit; }
img { max-width: 100%; display: block; }
::selection { background: var(--brand); color: #000; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-l); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }


/* ── LAYOUT ────────────────────────────────────────────────────── */
.sidebar { position: fixed; top: 0; left: 0; width: var(--sidebar-w); height: 100vh; background: var(--bg-sidebar); border-right: 1px solid var(--border); display: flex; flex-direction: column; z-index: 100; transition: width var(--transition), transform var(--transition); overflow: hidden; }
.sidebar.collapsed { width: var(--sidebar-col); }
.sidebar.collapsed .nav-label, .sidebar.collapsed .logo-text, .sidebar.collapsed .nav-section-label, .sidebar.collapsed .nav-badge, .sidebar.collapsed .sidebar-toggle svg { opacity: 0; pointer-events: none; }
.sidebar.collapsed .nav-item { justify-content: center; padding-left: 0; padding-right: 0; }
.sidebar.collapsed .nav-icon { margin: 0; }

.main { margin-left: var(--sidebar-w); min-height: 100vh; transition: margin-left var(--transition); }
.main.expanded { margin-left: var(--sidebar-col); }

/* ── SIDEBAR HEADER ────────────────────────────────────────────── */
.sidebar-header { padding: 20px 20px 16px; display: flex; align-items: center; justify-content: space-between; }
.logo { display: flex; align-items: center; gap: 12px; }
.logo-icon { width: 36px; height: 36px; flex-shrink: 0; }
.logo-text { display: flex; flex-direction: column; transition: opacity var(--transition); }
.logo-name { font-size: 16px; font-weight: 800; color: var(--text); font-family: var(--font-display); letter-spacing: -0.3px; }
.logo-sub { font-size: 10px; font-weight: 500; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }
.sidebar-toggle { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border-radius: 6px; color: var(--text-muted); transition: all var(--transition); }
.sidebar-toggle:hover { background: var(--bg-surface); color: var(--text); }

/* ── SIDEBAR NAV ───────────────────────────────────────────────── */
.sidebar-nav { flex: 1; padding: 8px 12px; overflow-y: auto; }
.nav-section-label { display: block; font-size: 10px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1.2px; padding: 16px 12px 6px; transition: opacity var(--transition); }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--radius-sm); color: var(--text-sub); font-size: 13px; font-weight: 500; transition: all var(--transition); position: relative; margin-bottom: 2px; }
.nav-item:hover { background: var(--bg-surface); color: var(--text); }
.nav-item.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.nav-item.active::before { content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 3px; height: 20px; background: var(--brand); border-radius: 0 3px 3px 0; }
.nav-icon { width: 18px; height: 18px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.nav-icon svg { width: 17px; height: 17px; }
.nav-label { white-space: nowrap; transition: opacity var(--transition); }
.nav-badge { margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; background: var(--brand); color: #000; border-radius: 9px; transition: opacity var(--transition); }

/* ── TOPBAR ────────────────────────────────────────────────────── */
.topbar { position: sticky; top: 0; z-index: 50; height: var(--topbar-h); display: flex; align-items: center; justify-content: space-between; padding: 0 24px; background: var(--bg-topbar); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.topbar-left { display: flex; align-items: center; gap: 16px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-date { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.topbar-sep { width: 1px; height: 24px; background: var(--border); }
.topbar-search { position: relative; display: flex; align-items: center; }
.topbar-search svg { position: absolute; left: 12px; color: var(--text-muted); pointer-events: none; }
.topbar-search input { width: 240px; height: 36px; padding: 0 12px 0 34px; background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); font-size: 13px; transition: all var(--transition); }
.topbar-search input:focus { outline: none; border-color: var(--border-focus); background: var(--bg-card); width: 300px; }
.topbar-search input::placeholder { color: var(--text-muted); }
.menu-btn { display: none; width: 36px; height: 36px; align-items: center; justify-content: center; border-radius: var(--radius-sm); color: var(--text-sub); }
.icon-btn { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); color: var(--text-sub); transition: all var(--transition); }
.icon-btn:hover { background: var(--bg-surface); color: var(--text); }

/* ── TOPBAR USER ───────────────────────────────────────────────── */
.topbar-user { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: var(--radius-sm); cursor: pointer; transition: background var(--transition); }
.topbar-user:hover { background: var(--bg-surface); }
.user-avatar { width: 32px; height: 32px; border-radius: 8px; background: var(--brand); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; color: #000; flex-shrink: 0; }
.user-name { font-size: 13px; font-weight: 600; color: var(--text); display: block; }
.user-role { font-size: 10px; color: var(--text-muted); display: block; }
.dropdown-wrap { position: relative; }
.dropdown { position: absolute; top: calc(100% + 8px); right: 0; min-width: 220px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); opacity: 0; visibility: hidden; transform: translateY(-4px); transition: all 0.2s; z-index: 200; }
.dropdown.open { opacity: 1; visibility: visible; transform: translateY(0); }
.user-dropdown { min-width: 240px; }
.user-drop-head { padding: 16px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--border); }
.dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }
.drop-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 16px; font-size: 13px; color: var(--text-sub); transition: all var(--transition); }
.drop-item:hover { background: var(--bg-surface); color: var(--text); }
.drop-item-danger:hover { background: var(--red-soft); color: var(--red); }


/* ── CONTENT AREA ──────────────────────────────────────────────── */
.content { padding: 24px; max-width: 1400px; }
.section { display: none; }
.section.active { display: block; animation: fadeUp 0.3s ease; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.page-header { margin-bottom: 24px; }
.page-header h1 { font-size: 22px; font-weight: 800; color: var(--text); font-family: var(--font-display); letter-spacing: -0.5px; }
.page-header p { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* ── CARDS ─────────────────────────────────────────────────────── */
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; transition: border-color var(--transition); }
.card:hover { border-color: var(--border-l); }
.card-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.card-header h2 { font-size: 14px; font-weight: 700; color: var(--text); }
.card-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.card-more { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border-radius: 6px; color: var(--text-muted); transition: all var(--transition); }
.card-more:hover { background: var(--bg-surface); color: var(--text); }

/* ── STAT CARDS ────────────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; transition: all var(--transition); position: relative; overflow: hidden; }
.stat-card:hover { border-color: var(--border-l); transform: translateY(-1px); }
.stat-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 12px; }
.stat-label { font-size: 12px; font-weight: 500; color: var(--text-muted); }
.stat-icon { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.stat-icon.blue { background: var(--blue-soft); color: var(--blue); }
.stat-icon.green { background: var(--green-soft); color: var(--green); }
.stat-icon.orange { background: var(--orange-soft); color: var(--orange); }
.stat-icon.cyan { background: var(--cyan-soft); color: var(--cyan); }
.stat-value { font-size: 26px; font-weight: 800; color: var(--text); font-family: var(--font-display); letter-spacing: -0.5px; display: block; }
.stat-trend { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--text-muted); margin-top: 6px; }
.stat-trend.up { color: var(--green); }
.stat-trend.neutral { color: var(--text-muted); }
.sparkline-wrap { position: absolute; bottom: 0; right: 0; width: 100px; height: 40px; opacity: 0.6; }

/* ── CHARTS ────────────────────────────────────────────────────── */
.charts-row { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; margin-bottom: 24px; }
.chart-wrap { padding: 16px 20px 20px; }
.donut-center { display: flex; justify-content: center; padding: 20px; }
.legend-list { padding: 0 20px 16px; display: flex; flex-direction: column; gap: 8px; }
.legend-row { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.legend-lbl { color: var(--text-sub); flex: 1; }
.legend-val { font-weight: 700; color: var(--text); }

/* ── TABLES ────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table thead { border-bottom: 1px solid var(--border); }
.data-table th { padding: 12px 16px; text-align: left; font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; white-space: nowrap; }
.data-table td { padding: 14px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg-table-hover); }
.data-table .folio { font-family: 'SF Mono', 'Fira Code', monospace; font-size: 12px; font-weight: 600; color: var(--text); background: var(--bg-surface); padding: 3px 8px; border-radius: 4px; }

/* ── CLIENT CELLS ──────────────────────────────────────────────── */
.client-cell { display: flex; align-items: center; gap: 10px; }
.client-avatar { width: 32px; height: 32px; border-radius: 8px; background: var(--brand); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; color: #000; flex-shrink: 0; }
.client-name { font-size: 13px; font-weight: 600; color: var(--text); }
.client-sub { font-size: 11px; color: var(--text-muted); }


/* ── BUTTONS ───────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-size: 13px; font-weight: 600; padding: 8px 14px; border-radius: var(--radius-sm); transition: all var(--transition); white-space: nowrap; }
.btn-primary { background: var(--brand); color: #000; }
.btn-primary:hover { background: var(--brand-hover); transform: translateY(-1px); box-shadow: 0 4px 12px var(--brand-glow); }
.btn-green { background: var(--green-soft); color: var(--green); }
.btn-green:hover { background: var(--green); color: #fff; }
.btn-red { background: var(--red-soft); color: var(--red); }
.btn-red:hover { background: var(--red); color: #fff; }
.btn-orange { background: var(--orange-soft); color: var(--orange); }
.btn-orange:hover { background: var(--orange); color: #fff; }
.btn-ghost { background: transparent; color: var(--text-sub); }
.btn-ghost:hover { background: var(--bg-surface); color: var(--text); }
.btn-whatsapp { background: rgba(37,211,102,0.1); color: #25d366; }
.btn-whatsapp:hover { background: #25d366; color: #fff; }
.btn-sm { font-size: 12px; padding: 6px 10px; }
.btn-lg { font-size: 14px; padding: 10px 18px; border-radius: var(--radius); }
.btn-icon { width: 32px; height: 32px; padding: 0; border-radius: var(--radius-sm); }
.link-btn { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--brand); transition: all var(--transition); cursor: pointer; }
.link-btn:hover { color: var(--brand-hover); gap: 6px; }

/* ── BADGES ────────────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 99px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.badge-revision { background: var(--orange-soft); color: var(--orange); }
.badge-aprobada { background: var(--cyan-soft); color: var(--cyan); }
.badge-instalada { background: var(--green-soft); color: var(--green); }
.badge-activa { background: var(--blue-soft); color: var(--blue); }
.badge-finalizada { background: var(--bg-surface); color: var(--text-muted); }
.badge-rechazada { background: var(--red-soft); color: var(--red); }
.badge-disponible { background: var(--green-soft); color: var(--green); }
.badge-ocupado { background: var(--red-soft); color: var(--red); }
.badge-proxima { background: var(--cyan-soft); color: var(--cyan); }
.badge-mantenimiento { background: var(--orange-soft); color: var(--orange); }
.badge-info { background: var(--blue-soft); color: var(--blue); }

/* ── FILTERS ───────────────────────────────────────────────────── */
.filters-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.search-box { position: relative; display: flex; align-items: center; }
.search-box svg { position: absolute; left: 12px; color: var(--text-muted); pointer-events: none; }
.search-box input { width: 220px; height: 36px; padding: 0 12px 0 34px; background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); font-size: 13px; transition: all var(--transition); }
.search-box input:focus { outline: none; border-color: var(--border-focus); background: var(--bg-card); }
.filter-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.pill { padding: 6px 14px; border-radius: 99px; font-size: 12px; font-weight: 500; color: var(--text-sub); background: var(--bg-surface); border: 1px solid transparent; transition: all var(--transition); cursor: pointer; }
.pill:hover { color: var(--text); border-color: var(--border-l); }
.pill.active { background: var(--brand-soft); color: var(--brand); border-color: var(--brand); font-weight: 600; }

/* ── FORMS ─────────────────────────────────────────────────────── */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .span-2 { grid-column: span 2; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 12px; font-weight: 600; color: var(--text-sub); }
.form-control { width: 100%; height: 40px; padding: 0 12px; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); font-size: 13px; transition: all var(--transition); }
.form-control:focus { outline: none; border-color: var(--border-focus); background: var(--bg-card); }
.form-control::placeholder { color: var(--text-muted); }
textarea.form-control { height: auto; padding: 10px 12px; resize: vertical; min-height: 80px; }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
.form-hint { font-size: 11px; color: var(--text-muted); }

/* ── MODALS ────────────────────────────────────────────────────── */
.modal-overlay { position: fixed; inset: 0; background: var(--bg-overlay); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; z-index: 1000; opacity: 0; visibility: hidden; pointer-events: none; transition: all 0.2s; }
.modal-overlay.open { opacity: 1; visibility: visible; pointer-events: auto; }
.modal { background: var(--bg-modal); border: 1px solid var(--border); border-radius: var(--radius-xl); width: 90%; max-width: 560px; max-height: 85vh; overflow-y: auto; transform: scale(0.96); transition: transform 0.25s; }
.modal-overlay.open .modal { transform: scale(1); }
.modal-xl { max-width: 720px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--bg-modal); z-index: 1; }
.modal-header h2 { font-size: 15px; font-weight: 700; color: var(--text); }
.modal-close { width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; border-radius: 8px; color: var(--text-muted); transition: all var(--transition); }
.modal-close:hover { background: var(--bg-surface); color: var(--text); }
.modal-body { padding: 22px; }
.modal-divider { height: 1px; background: var(--border); margin: 16px 0; }
.modal-footer { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-top: 8px; }


/* ── PROGRESS ──────────────────────────────────────────────────── */
.progress-wrap { display: flex; align-items: center; gap: 8px; }
.progress-bar { flex: 1; height: 4px; background: var(--bg-surface); border-radius: 2px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--brand); border-radius: 2px; transition: width 0.5s ease; }
.progress-pct { font-size: 11px; font-weight: 700; color: var(--text-sub); min-width: 28px; }

/* ── PIPELINE ──────────────────────────────────────────────────── */
.pipeline-section { margin-top: 16px; }
.pipeline-title { display: flex; align-items: center; justify-content: space-between; font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 14px; }
.stepper { position: relative; display: flex; justify-content: space-between; padding: 0 4px; margin-bottom: 16px; }
.stepper-track { position: absolute; top: 14px; left: 20px; right: 20px; height: 2px; background: var(--border); border-radius: 1px; }
.stepper-fill { height: 100%; background: var(--brand); border-radius: 1px; transition: width 0.5s ease; }
.stepper-step { display: flex; flex-direction: column; align-items: center; gap: 6px; position: relative; z-index: 1; }
.step-circle { width: 28px; height: 28px; border-radius: 50%; background: var(--bg-surface); border: 2px solid var(--border); display: flex; align-items: center; justify-content: center; color: var(--text-muted); transition: all var(--transition); }
.step-circle.done { background: var(--brand); border-color: var(--brand); color: #000; }
.step-circle.current { border-color: var(--brand); color: var(--brand); box-shadow: 0 0 0 3px var(--brand-glow); }
.step-label { font-size: 9px; font-weight: 500; color: var(--text-muted); text-align: center; max-width: 70px; }
.step-label.done { color: var(--text-sub); }
.step-label.active { color: var(--brand); font-weight: 600; }
.next-hint { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); margin-bottom: 10px; }
.pipeline-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.step-log { display: flex; flex-direction: column; gap: 6px; }
.log-row { display: flex; align-items: center; gap: 8px; font-size: 12px; padding: 6px 0; }
.log-icon { width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; color: var(--text-muted); flex-shrink: 0; }
.log-text { flex: 1; color: var(--text-sub); }
.log-date { font-size: 11px; color: var(--text-muted); white-space: nowrap; }

/* ── SPECTACULARS ──────────────────────────────────────────────── */
.spec-control-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.view-toggle { display: flex; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.view-btn { width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; color: var(--text-muted); transition: all var(--transition); }
.view-btn.active { background: var(--brand-soft); color: var(--brand); }
.view-btn:hover:not(.active) { background: var(--bg-surface); }
.specs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.spec-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; transition: all var(--transition); }
.spec-card:hover { border-color: var(--border-l); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.spec-img-area { position: relative; height: 160px; background: var(--bg-surface); display: flex; align-items: center; justify-content: center; color: var(--text-dim); overflow: hidden; }
.spec-img-area img { width: 100%; height: 100%; object-fit: cover; }
.spec-avail { position: absolute; top: 10px; right: 10px; }
.spec-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.7); display: flex; align-items: center; justify-content: center; gap: 8px; opacity: 0; transition: opacity 0.2s; flex-wrap: wrap; padding: 12px; }
.spec-card:hover .spec-overlay { opacity: 1; }
.spec-body { padding: 16px; }
.spec-name { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.spec-meta { font-size: 11px; color: var(--text-muted); display: flex; align-items: center; gap: 4px; margin-bottom: 6px; }
.spec-dims { font-size: 11px; color: var(--text-muted); }
.spec-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.spec-price { font-size: 16px; font-weight: 800; color: var(--brand); font-family: var(--font-display); }
.spec-price span { font-size: 11px; font-weight: 500; color: var(--text-muted); }
.spec-camps { font-size: 11px; color: var(--text-muted); }
.spec-card-add { background: var(--bg-card); border: 2px dashed var(--border); border-radius: var(--radius-lg); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px; cursor: pointer; transition: all var(--transition); min-height: 280px; }
.spec-card-add:hover { border-color: var(--brand); background: var(--brand-soft); }
.add-label { font-size: 14px; font-weight: 600; color: var(--text); margin-top: 12px; }
.add-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.spec-strip { display: flex; gap: 12px; overflow-x: auto; padding: 12px 0; }
.spec-mini { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--bg-surface); border-radius: var(--radius-sm); min-width: 220px; flex-shrink: 0; }
.spec-mini-icon { color: var(--text-muted); }
.spec-mini-name { font-size: 12px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.spec-mini-sub { font-size: 11px; color: var(--text-muted); }

/* ── EVIDENCIAS ────────────────────────────────────────────────── */
.evidencias-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.evidencia-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.evid-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.evid-folio { font-size: 13px; font-weight: 700; color: var(--text); }
.evid-cliente { font-size: 11px; color: var(--text-muted); }
.foto-zone { height: 180px; display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; transition: all var(--transition); background: var(--bg-surface); }
.foto-zone:hover { background: var(--bg-card-hover); }
.foto-zone.has-image { padding: 0; }
.foto-zone.has-image img { width: 100%; height: 100%; object-fit: cover; }
.foto-zone-text { font-size: 12px; color: var(--text-muted); margin-top: 8px; }
.evid-meta { padding: 12px 16px; font-size: 11px; color: var(--text-muted); line-height: 1.8; }
.evid-actions { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border); }

/* ── UPLOAD ZONE ───────────────────────────────────────────────── */
.upload-zone { border: 2px dashed var(--border); border-radius: var(--radius); padding: 40px; text-align: center; cursor: pointer; transition: all var(--transition); margin-bottom: 16px; }
.upload-zone:hover { border-color: var(--brand); background: var(--brand-soft); }
.upload-zone.has-image { border: none; padding: 0; border-radius: var(--radius); overflow: hidden; }
.upload-zone.has-image img { width: 100%; max-height: 300px; object-fit: cover; }
.upload-title { font-size: 14px; font-weight: 600; color: var(--text); margin-top: 12px; }
.upload-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ── DETAIL MODAL ──────────────────────────────────────────────── */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.detail-group { display: flex; flex-direction: column; gap: 10px; }
.detail-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.detail-row label { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.detail-row span { font-size: 13px; color: var(--text); font-weight: 500; text-align: right; }
.detail-row .amount { font-size: 15px; font-weight: 800; color: var(--green); font-family: var(--font-display); }
.info-box { background: var(--bg-surface); border-radius: var(--radius); padding: 14px 16px; margin: 12px 0; }
.info-box-title { font-size: 11px; font-weight: 700; color: var(--text-sub); text-transform: uppercase; letter-spacing: 0.5px; }
.info-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 13px; }
.info-row label { color: var(--text-muted); }
.info-row span { color: var(--text); font-weight: 500; }

/* ── WHATSAPP PREVIEW ──────────────────────────────────────────── */
.wa-preview { background: var(--bg-surface); border-radius: var(--radius); padding: 14px 16px; margin: 12px 0; font-size: 13px; color: var(--text-sub); white-space: pre-wrap; line-height: 1.6; }
.wa-preview-label { font-size: 11px; font-weight: 600; color: var(--text-muted); margin-bottom: 8px; }

/* ── SEARCH RESULTS ────────────────────────────────────────────── */
.search-results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); max-height: 360px; overflow-y: auto; opacity: 0; visibility: hidden; transition: all 0.2s; z-index: 300; }
.search-results.open { opacity: 1; visibility: visible; }
.sr-section-title { font-size: 10px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; padding: 10px 14px 4px; }
.sr-item { display: flex; align-items: center; gap: 10px; padding: 8px 14px; cursor: pointer; transition: background var(--transition); }
.sr-item:hover { background: var(--bg-surface); }
.sr-item-icon { width: 28px; height: 28px; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex-shrink: 0; }
.sr-item-icon.order { background: var(--blue-soft); color: var(--blue); }
.sr-item-icon.client { background: var(--brand-soft); color: var(--brand); }
.sr-title { font-size: 13px; font-weight: 500; color: var(--text); }
.sr-sub { font-size: 11px; color: var(--text-muted); }
.sr-empty { padding: 20px; text-align: center; font-size: 13px; color: var(--text-muted); }
.sr-footer { padding: 8px 14px; font-size: 11px; color: var(--text-dim); border-top: 1px solid var(--border); }

/* ── TOAST ─────────────────────────────────────────────────────── */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 20px; font-size: 13px; font-weight: 500; color: var(--text); display: flex; align-items: center; gap: 8px; box-shadow: var(--shadow-lg); opacity: 0; visibility: hidden; transition: all 0.3s; z-index: 9999; max-width: 400px; }
.toast.show { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }

/* ── TOGGLE SWITCH ─────────────────────────────────────────────── */
.toggle-switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; inset: 0; background: var(--bg-surface); border: 1px solid var(--border); border-radius: 12px; cursor: pointer; transition: all var(--transition); }
.toggle-slider::before { content: ''; position: absolute; width: 18px; height: 18px; left: 2px; top: 2px; background: var(--text-muted); border-radius: 50%; transition: all var(--transition); }
.toggle-switch input:checked + .toggle-slider { background: var(--brand); border-color: var(--brand); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); background: #000; }

/* ── ANIMATIONS ────────────────────────────────────────────────── */
.anim-in { animation: fadeUp 0.35s ease both; }
@keyframes blink { 50% { opacity: 0.4; } }

/* ── RESPONSIVE ────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .charts-row { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: span 1; }
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); width: 280px; }
  .sidebar.mobile-open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .main { margin-left: 0; }
  .main.expanded { margin-left: 0; }
  .menu-btn { display: flex; }
  .content { padding: 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .specs-grid { grid-template-columns: 1fr; }
  .evidencias-grid { grid-template-columns: 1fr; }
  .topbar-search input { width: 160px; }
  .topbar-search input:focus { width: 200px; }
  .topbar-date { display: none; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .filter-pills { overflow-x: auto; flex-wrap: nowrap; }
}

/* ── BANNER CARDS ──────────────────────────────────────────────── */
.banner-card { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; background: var(--bg-card); }
.banner-img-wrap { cursor: pointer; }
.banner-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px; color: var(--text-dim); font-size: 12px; gap: 8px; }
.banner-link-row { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--border); }
.banner-link-row input { flex: 1; background: transparent; border: none; color: var(--text); font-size: 12px; outline: none; }
.banner-link-row input::placeholder { color: var(--text-muted); }
.banner-actions { display: flex; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--border); }

/* ── EMPTY STATE ───────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 60px 20px; }
.empty-state-icon { margin-bottom: 16px; color: var(--text-dim); }
.empty-state-title { font-size: 16px; font-weight: 600; color: var(--text-sub); margin-bottom: 4px; }
.empty-state-sub { font-size: 13px; color: var(--text-muted); }

#globalLoadingBar { pointer-events: none !important; }

/* ── FEED ADMIN ───────────────────────────────────────────────── */
.feed-sort-hint {
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
  font-size: 12px;
  color: var(--text-muted);
}

#feedSeccionesList {
  position: relative;
}

#feedSeccionesSortList {
  position: relative;
}

.feed-seccion-row {
  position: relative;
  background: var(--bg-card);
}

.feed-pos-badge {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--brand);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 15px;
  flex-shrink: 0;
  transition: transform 0.2s ease, background 0.2s ease;
}

.feed-seccion-row.feed-sort-saving .feed-pos-badge {
  background: var(--text-muted);
  animation: feedPulse 0.8s ease infinite;
}

.feed-items-sort-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

@keyframes feedPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

/* ── FAQ ADMIN — lista editorial numerada ─────────────────────── */
.faq-admin-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}

.faq-admin-note {
  margin-bottom: 14px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  color: var(--text-muted);
  font-size: 12px;
}

.faq-admin-status {
  min-height: 20px;
  margin-bottom: 8px;
  color: var(--text-muted);
  font-size: 12px;
}

.faq-admin-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq-admin-item {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
}

.faq-admin-order {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
}

.faq-admin-number {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 11px;
  background: var(--brand);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
}

.faq-admin-move {
  display: grid;
  width: 34px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-input);
  color: var(--text-sub);
  cursor: pointer;
}

.faq-admin-move:hover:not(:disabled) {
  border-color: var(--brand);
  color: var(--brand);
}

.faq-admin-move:disabled {
  cursor: not-allowed;
  opacity: .35;
}

.faq-admin-form {
  min-width: 0;
}

.faq-admin-fields {
  display: grid;
  gap: 12px;
}

.faq-admin-fields label {
  display: block;
  margin-bottom: 6px;
  color: var(--text-sub);
  font-size: 12px;
  font-weight: 650;
}

.faq-admin-question {
  min-height: 46px;
  font-size: 15px;
  font-weight: 650;
}

.faq-admin-answer {
  min-height: 112px;
  line-height: 1.55;
}

.faq-admin-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.faq-admin-meta {
  color: var(--text-muted);
  font-size: 11px;
}

.faq-admin-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.faq-admin-empty {
  padding: 52px 20px;
  border: 1px dashed var(--border-l);
  border-radius: var(--radius-lg);
  color: var(--text-muted);
  text-align: center;
}

@media (max-width: 640px) {
  .faq-admin-header .btn { width: 100%; justify-content: center; }
  .faq-admin-item { grid-template-columns: 1fr; padding: 15px; }
  .faq-admin-order { flex-direction: row; justify-content: flex-start; }
  .faq-admin-actions { align-items: stretch; }
  .faq-admin-buttons { width: 100%; }
  .faq-admin-buttons .btn { flex: 1; justify-content: center; }
}

/* ═══════════════════════════════════════════════════════════════
   MENSAJES CONTACTO — dossier de lectura (Hablemos)
   Color: tokens admin · Firma: canal + REF folio
   Layout: ficha de correspondencia, no modal genérico
═══════════════════════════════════════════════════════════════ */
.msg-overlay {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: msgFadeIn 0.18s ease;
}
.msg-sheet {
  width: min(720px, 100%);
  max-height: min(88vh, 760px);
  display: flex;
  flex-direction: column;
  background: var(--bg-modal);
  border: 1px solid var(--border-l);
  border-radius: 14px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  animation: msgSheetIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
.msg-sheet-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--border);
  background:
    linear-gradient(90deg, var(--brand) 0 3px, transparent 3px),
    var(--bg-modal);
}
.msg-channel {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 10px;
}
.msg-channel-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.msg-subject {
  font-family: var(--font-display);
  font-size: clamp(18px, 2.4vw, 24px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--text);
  margin: 0;
  max-width: 34ch;
}
.msg-close {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: var(--text-muted);
  transition: background var(--transition), color var(--transition);
}
.msg-close:hover {
  background: var(--bg-surface);
  color: var(--text);
}
.msg-close:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}
.msg-sheet-body {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 0;
  flex: 1;
  overflow: hidden;
}
.msg-rail {
  padding: 20px 18px;
  border-right: 1px solid var(--border);
  background: var(--bg-surface);
  overflow-y: auto;
}
.msg-from {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 20px;
}
.msg-avatar {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--brand);
  color: #000;
  font-weight: 800;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
}
.msg-from-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.25;
}
.msg-from-mail {
  font-size: 12px;
  margin-top: 4px;
  word-break: break-all;
}
.msg-from-mail a {
  color: var(--brand);
  text-decoration: none;
}
.msg-from-mail a:hover {
  text-decoration: underline;
}
.msg-meta-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.msg-meta-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.msg-meta-item strong {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.msg-meta-item span {
  font-size: 13px;
  color: var(--text-sub);
  line-height: 1.4;
  word-break: break-word;
}
.msg-letter {
  padding: 22px 24px;
  overflow-y: auto;
  min-height: 0;
}
.msg-letter-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.msg-letter-text {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}
.msg-sheet-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg-card);
}
.msg-id {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
.msg-foot-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-left: auto;
}
@keyframes msgFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes msgSheetIn {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to { opacity: 1; transform: none; }
}
@media (max-width: 640px) {
  .msg-sheet-body {
    grid-template-columns: 1fr;
  }
  .msg-rail {
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 16px 18px;
  }
  .msg-from {
    flex-direction: row;
    align-items: center;
    margin-bottom: 14px;
  }
  .msg-meta-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .msg-subject {
    max-width: none;
  }
  .msg-sheet-foot {
    flex-direction: column;
    align-items: stretch;
  }
  .msg-foot-actions {
    margin-left: 0;
  }
  .msg-foot-actions .btn {
    flex: 1;
    justify-content: center;
  }
}
@media (prefers-reduced-motion: reduce) {
  .msg-overlay,
  .msg-sheet {
    animation: none;
  }
}
