:root {
  --primary: #00c2cb;
  --primary-soft: rgba(0, 194, 203, 0.12);
  --growth: #22c55e;
  --growth-soft: rgba(34, 197, 94, 0.12);
  --warning: #f59e0b;
  --bg-main: #f8fafc;
  --surface: #ffffff;
  --sidebar-bg: #0f172a;
  --sidebar-text: #94a3b8;
  --sidebar-active: #f8fafc;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --border: rgba(0, 0, 0, 0.08);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.05);
  --radius: 10px;
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  font-size: 14px;
}

/* ─── LAYOUT ─────────────────────────────────────────── */

.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ─── SIDEBAR ─────────────────────────────────────────── */

.sidebar {
  width: 240px;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  z-index: 100;
  overflow: hidden;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.brand-icon {
  font-size: 20px;
  line-height: 1;
}

.brand-name {
  font-size: 16px;
  font-weight: 700;
  color: #f8fafc;
  letter-spacing: -0.3px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 16px 12px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
  position: relative;
}

.nav-item:hover:not(.disabled) {
  background: rgba(255,255,255,0.07);
  color: #f8fafc;
}

.nav-item.active {
  background: var(--primary-soft);
  color: var(--primary);
}

.nav-item.disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.nav-icon {
  font-size: 15px;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}

.badge-soon {
  margin-left: auto;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(255,255,255,0.08);
  color: var(--sidebar-text);
  padding: 2px 7px;
  border-radius: 20px;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.auth-link {
  font-size: 12px;
  color: var(--sidebar-text);
  text-decoration: none;
  display: block;
  text-align: center;
  padding: 8px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.1);
  transition: background 0.15s, color 0.15s;
}

.auth-link:hover {
  background: rgba(255,255,255,0.06);
  color: #f8fafc;
}

/* ─── MAIN CONTENT ──────────────────────────────────── */

.main-wrapper {
  margin-left: 240px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* ─── TOP BAR ───────────────────────────────────────── */

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 32px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.page-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.4px;
}

.page-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
  text-transform: capitalize;
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.last-updated {
  font-size: 12px;
  color: var(--text-muted);
}

/* ─── AUTH BANNER ──────────────────────────────────── */

.auth-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 32px 0;
  padding: 12px 16px;
  background: #fef3c7;
  border: 1px solid #fcd34d;
  border-radius: var(--radius);
  font-size: 13.5px;
  color: #92400e;
}

.auth-banner a {
  color: #92400e;
  font-weight: 600;
  text-decoration: underline;
}

.auth-banner.success {
  background: #dcfce7;
  border-color: #86efac;
  color: #166534;
}

.auth-banner.success a {
  color: #166534;
}

/* ─── SECTIONS ──────────────────────────────────────── */

.section {
  padding: 24px 32px;
}

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

.section-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
  letter-spacing: -0.2px;
}

.section-link {
  font-size: 13px;
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.section-link:hover { text-decoration: underline; }

/* ─── KPI GRID ──────────────────────────────────────── */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s;
}

.kpi-card:hover {
  box-shadow: var(--shadow-md);
}

.kpi-card.kpi-highlight {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.kpi-card.kpi-highlight .kpi-value {
  color: var(--primary);
}

.kpi-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.1;
  letter-spacing: -0.5px;
}

.kpi-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* Skeleton loading */
.kpi-card.skeleton {
  background: linear-gradient(90deg, #f0f4f8 25%, #e2e8f0 50%, #f0f4f8 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border: none;
  box-shadow: none;
}

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

/* ─── CHART CARD ────────────────────────────────────── */

.chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: var(--shadow);
}

.chart-legend {
  display: flex;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
}

.legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 5px;
}

/* ─── DATA TABLE ────────────────────────────────────── */

.table-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.data-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-main);
}

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

.data-table tbody tr:hover td {
  background: #f8fafc;
}

.table-loading {
  text-align: center;
  color: var(--text-muted);
  padding: 24px !important;
}

/* ─── COMING SOON GRID ──────────────────────────────── */

.coming-soon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.coming-card {
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  opacity: 0.7;
}

.coming-icon { font-size: 24px; margin-bottom: 8px; }
.coming-name { font-size: 14px; font-weight: 600; color: var(--text-main); margin-bottom: 6px; }
.coming-desc { font-size: 12px; color: var(--text-muted); line-height: 1.5; }

/* ─── PRODUCT HUNT HERO ─────────────────────────────── */

.ph-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, #ff4500 0%, #ff6d3a 100%);
  border-radius: var(--radius);
  padding: 18px 28px;
  color: white;
  box-shadow: 0 4px 20px rgba(255,69,0,0.25);
}

.ph-hero.ph-urgent {
  animation: pulse-ph 2s ease-in-out infinite;
}

@keyframes pulse-ph {
  0%, 100% { box-shadow: 0 4px 20px rgba(255,69,0,0.25); }
  50%       { box-shadow: 0 4px 30px rgba(255,69,0,0.5); }
}

.ph-label { font-size: 13px; font-weight: 600; opacity: 0.9; margin-bottom: 4px; }
.ph-date  { font-size: 18px; font-weight: 700; letter-spacing: -0.3px; }

.ph-countdown { display: flex; align-items: baseline; gap: 6px; }
.ph-days      { font-size: 48px; font-weight: 800; line-height: 1; letter-spacing: -2px; }
.ph-days-label{ font-size: 16px; font-weight: 600; opacity: 0.8; }

/* ─── STATUS BADGES ─────────────────────────────────── */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-approved { background: #dcfce7; color: #166534; }
.badge-pending  { background: #fef3c7; color: #92400e; }
.badge-rejected { background: #fee2e2; color: #991b1b; }

/* ─── DIRECTORIOS CHIPS ─────────────────────────────── */

.dir-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  background: var(--surface);
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--text-main);
  transition: box-shadow 0.15s;
}
.dir-chip:hover { box-shadow: var(--shadow-md); }
.dir-chip.skeleton { color: transparent; min-width: 100px; }
.dir-chip-ok       { border-color: #86efac; background: #dcfce7; color: #166534; }
.dir-chip-pending  { border-color: #fcd34d; background: #fef3c7; color: #92400e; }
.dir-chip-rejected { border-color: #fca5a5; background: #fee2e2; color: #991b1b; }

/* ─── DIRECTORIOS EDIT FORM ─────────────────────────── */

.edit-row td { background: #f8fafc; }

.edit-input {
  width: 100%;
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  background: white;
  color: var(--text-main);
  outline: none;
}
.edit-input:focus { border-color: var(--primary); }

.btn-edit {
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  color: var(--text-muted);
  transition: background 0.15s, color 0.15s;
}
.btn-edit:hover { background: var(--bg-main); color: var(--text-main); }

.btn-save {
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  background: var(--primary);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  color: #0f172a;
  margin-right: 4px;
}
.btn-save:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-cancel {
  padding: 5px 10px;
  font-size: 12px;
  font-family: inherit;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  color: var(--text-muted);
}
