@import url('tokens.css?v=1.0.1');

*, *::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(--f-body);
  background: var(--c-bg-warm);
  color: var(--c-text-primary);
  min-height: 100vh;
  display: flex;
  position: relative;
  width: 100%;
}

#app {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
}

/* ── Global Grain Overlay (Latinarq Texture) ── */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* ── Layout ── */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--c-bg-dark);
  display: flex;
  flex-direction: column;
  z-index: 100;
  border-right: 1px solid var(--c-line-dark);
  transition: width var(--dur) var(--ease);
}

.sidebar-logo {
  padding: 24px;
  border-bottom: 1px solid var(--c-line-dark);
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: padding var(--dur) var(--ease), align-items var(--dur) var(--ease);
}

.sidebar-logo h1 {
  font-family: var(--f-heading);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--c-white);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.sidebar-logo small {
  font-family: var(--f-body);
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--c-accent);
  text-transform: uppercase;
  letter-spacing: 0.15em;
}

.sidebar-nav {
  flex: 1;
  padding: 24px 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  color: var(--c-text-light-muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--dur) var(--ease);
  border-left: 3px solid transparent;
}

.sidebar-nav a:hover {
  color: var(--c-text-light);
  background: rgba(255,255,255,0.03);
  transform: translateX(4px);
}

.sidebar-nav a.active {
  color: var(--c-white);
  border-left-color: var(--c-accent);
  background: var(--c-accent-soft);
  font-weight: 600;
}

.sidebar-nav a .nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px; height: 18px;
  opacity: 0.8;
}

.sidebar-nav a .nav-icon svg {
  width: 100%;
  height: 100%;
  stroke-width: 2px;
}

.sidebar-nav .nav-section-label {
  padding: 12px 24px 6px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--c-text-light-muted);
  opacity: 0.4;
}

/* ── Sidebar Toggle (Premium Floating Button) ── */
.sidebar-toggle {
  position: absolute;
  top: 20px;
  right: -12px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--c-charcoal);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--c-white);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  transition: all var(--dur) var(--ease);
  z-index: 110;
  padding: 0;
}

.sidebar-toggle:hover {
  background: var(--c-accent);
  transform: scale(1.1);
  box-shadow: 0 2px 10px rgba(184, 131, 111, 0.3);
}

.sidebar-toggle svg {
  width: 14px;
  height: 14px;
  stroke-width: 3px;
  transition: transform var(--dur) var(--ease);
}

/* ── Collapsed State Transitions ── */
body.sidebar-collapsed {
  --sidebar-width: 72px;
}

body.sidebar-collapsed .sidebar-toggle svg {
  transform: rotate(180deg);
}

/* Hiding text elements elegantly without layout break */
.logo-text,
.logo-sub,
.nav-text,
.sidebar-nav .nav-section-label {
  transition: opacity 0.2s var(--ease), visibility 0.2s var(--ease), transform 0.2s var(--ease);
  opacity: 1;
  visibility: visible;
  display: inline-block;
  white-space: nowrap;
}

body.sidebar-collapsed .logo-text,
body.sidebar-collapsed .logo-sub,
body.sidebar-collapsed .nav-text,
body.sidebar-collapsed .sidebar-nav .nav-section-label {
  opacity: 0;
  visibility: hidden;
  transform: translateX(-12px);
  pointer-events: none;
  position: absolute;
}

/* Centering icons in mini sidebar state */
body.sidebar-collapsed .sidebar-nav a {
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
  gap: 0;
}

body.sidebar-collapsed .sidebar-nav a:hover {
  transform: none; /* Cancel the skew transform to avoid off-center */
  background: rgba(255,255,255,0.05);
}

body.sidebar-collapsed .sidebar-logo {
  align-items: center;
  padding: 24px 0;
}

body.sidebar-collapsed .sidebar-logo h1 {
  font-size: 1.6rem; /* Make single letter "E" slightly bigger */
}

/* ── Main Area ── */
.main {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--c-bg-white); /* Clean layout background */
  transition: margin-left var(--dur) var(--ease);
}

.topbar {
  height: var(--topbar-height);
  background: var(--c-bg-white);
  border-bottom: 1px solid var(--c-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title h2 {
  font-family: var(--f-heading);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--c-text-primary);
  letter-spacing: -0.01em;
}

.btn-mobile-menu {
  display: none;
  background: transparent;
  border: none;
  color: var(--c-text-primary);
  cursor: pointer;
  padding: 8px;
  margin-right: 12px;
}

@media (max-width: 768px) {
  .btn-mobile-menu { display: flex; align-items: center; justify-content: center; }
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--c-text-secondary);
}

.topbar-user .avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--c-accent-soft);
  color: var(--c-accent);
  border: 1px solid rgba(184, 131, 111, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.85rem;
}

.btn-logout {
  background: transparent;
  border: 1px solid var(--c-line);
  padding: 7px 16px;
  border-radius: var(--radius-sm);
  font-family: var(--f-body);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--c-text-secondary);
  cursor: pointer;
  transition: all var(--dur) var(--ease);
}

.btn-logout:hover {
  border-color: var(--c-accent);
  color: var(--c-accent);
  background: var(--c-bg-warm);
}

.content {
  padding: 40px;
  flex: 1;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

/* ── Loading / Error States ── */
.loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 0;
  color: var(--c-text-muted);
  gap: 12px;
  font-weight: 500;
}

.loading-spinner {
  width: 22px; height: 22px;
  border: 2px solid rgba(184, 131, 111, 0.15);
  border-top-color: var(--c-accent);
  border-radius: 50%;
  animation: spin 0.8s cubic-bezier(0.5, 0.1, 0.5, 0.9) infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Dashboard Stats ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.stat-card {
  background: var(--c-bg-white);
  border: 1px solid var(--c-line);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: all var(--dur) var(--ease);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--c-accent);
}

.stat-card .stat-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--c-text-secondary);
  margin-bottom: 8px;
  opacity: 0.8;
}

.stat-card .stat-value {
  font-family: var(--f-heading);
  font-size: 2.2rem;
  font-weight: 600;
  color: var(--c-text-primary);
  line-height: 1.1;
}

.stat-card .stat-sub {
  font-size: 0.8rem;
  color: var(--c-text-muted);
  margin-top: 8px;
  font-weight: 500;
}

.stat-card.stat-accent { border-top: 3px solid var(--c-accent); }
.stat-card.stat-success { border-top: 3px solid var(--c-success); }
.stat-card.stat-danger { border-top: 3px solid var(--c-danger); }
.stat-card.stat-info { border-top: 3px solid var(--c-info); }

/* ── Filter Bar ── */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
  align-items: center;
  background: var(--c-bg-white);
  padding: 16px;
  border: 1px solid var(--c-line);
  border-radius: var(--radius-md);
}

.filter-bar select,
.filter-bar input {
  padding: 10px 14px;
  border: 1px solid var(--c-line);
  border-radius: var(--radius-sm);
  font-family: var(--f-body);
  font-size: 0.85rem;
  font-weight: 500;
  background: var(--c-bg-card);
  color: var(--c-text-primary);
  min-width: 160px;
  transition: all var(--dur) var(--ease);
}

.filter-bar input { min-width: 280px; flex: 1; }

.filter-bar select:focus,
.filter-bar input:focus {
  outline: none;
  border-color: var(--c-accent);
  box-shadow: 0 0 0 3px var(--c-accent-soft);
}

.filter-count {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--c-text-muted);
  margin-left: auto;
}

/* ── Table ── */
.table-container {
  background: var(--c-bg-white);
  border-radius: var(--radius-md);
  border: 1px solid var(--c-line);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

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

table th {
  text-align: left;
  padding: 16px 20px;
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--c-text-secondary);
  border-bottom: 1px solid var(--c-line);
  white-space: nowrap;
  background: var(--c-bg-warm);
  cursor: pointer;
  user-select: none;
  transition: all var(--dur) var(--ease);
}

table th:hover { color: var(--c-accent); }

table td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--c-line);
  vertical-align: middle;
  transition: background var(--dur) var(--ease);
}

table tr:hover td { background: rgba(242, 236, 228, 0.3); }
table tr:last-child td { border-bottom: none; }

table td .nombre-cell {
  font-family: var(--f-body);
  font-weight: 600;
  color: var(--c-accent);
  cursor: pointer;
  text-decoration: none;
  transition: color var(--dur) var(--ease);
}

table td .nombre-cell:hover { color: var(--c-accent-hover); text-decoration: underline; }

table td .email-cell {
  font-size: 0.82rem;
  color: var(--c-text-secondary);
  font-weight: 500;
}

table td .sub-cell {
  font-size: 0.8rem;
  color: var(--c-text-muted);
  font-weight: 500;
}

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
  border: 1px solid transparent;
}

.badge-nuevo { background: rgba(98, 139, 151, 0.1); color: var(--c-info); border-color: rgba(98, 139, 151, 0.2); }
.badge-en-revision { background: rgba(209, 155, 89, 0.1); color: var(--c-warning); border-color: rgba(209, 155, 89, 0.2); }
.badge-aprobado { background: rgba(138, 154, 123, 0.1); color: var(--c-success); border-color: rgba(138, 154, 123, 0.2); }
.badge-descartado { background: rgba(168, 78, 62, 0.1); color: var(--c-danger); border-color: rgba(168, 78, 62, 0.2); }
.badge-contactado { background: rgba(98, 139, 151, 0.1); color: var(--c-info); border-color: rgba(98, 139, 151, 0.2); }
.badge-enviado { background: rgba(184, 131, 111, 0.1); color: var(--c-accent); border-color: rgba(184, 131, 111, 0.2); }
.badge-convertido { background: rgba(138, 154, 123, 0.1); color: var(--c-success); border-color: rgba(138, 154, 123, 0.2); }
.badge-pendiente { background: var(--c-bg-warm); color: var(--c-text-secondary); border-color: var(--c-line); }

/* ── Prospect Detail ── */
.prospect-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 16px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--c-line);
}

.prospect-header h2 {
  font-family: var(--f-heading);
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--c-text-primary);
  letter-spacing: -0.01em;
}

.prospect-actions {
  display: flex;
  gap: 12px;
}

.btn {
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-family: var(--f-body);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--dur) var(--ease);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn svg {
  width: 16px;
  height: 16px;
  stroke-width: 2.5px;
}

.btn-primary { 
  background: var(--c-accent); 
  color: var(--c-white);
  box-shadow: 0 4px 14px rgba(184, 131, 111, 0.2);
}
.btn-primary:hover { 
  background: var(--c-accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(184, 131, 111, 0.3);
}

.btn-success { 
  background: var(--c-success); 
  color: var(--c-white);
  box-shadow: 0 4px 14px rgba(138, 154, 123, 0.2);
}
.btn-success:hover { 
  opacity: 0.95;
  transform: translateY(-1px);
}

.btn-danger { 
  background: var(--c-danger); 
  color: var(--c-white);
}
.btn-danger:hover { 
  opacity: 0.95;
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--c-line);
  color: var(--c-text-secondary);
}

.btn-outline:hover {
  border-color: var(--c-accent);
  color: var(--c-accent);
  background: var(--c-bg-warm);
}

.btn-sm { 
  padding: 6px 14px; 
  font-size: 0.72rem;
  letter-spacing: 0.08em;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 32px;
}

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

.detail-card {
  background: var(--c-bg-white);
  border-radius: var(--radius-md);
  border: 1px solid var(--c-line);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.detail-card h3 {
  font-family: var(--f-heading);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--c-text-primary);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--c-line);
}

.detail-card .field {
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.detail-card .field-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--c-text-muted);
}

.detail-card .field-value {
  font-size: 0.9rem;
  color: var(--c-text-primary);
  font-weight: 500;
  word-break: break-word;
  line-height: 1.5;
}

.detail-card .field-value strong {
  font-weight: 700;
}

.detail-card .field-value a {
  color: var(--c-accent);
  text-decoration: none;
  font-weight: 600;
  transition: color var(--dur) var(--ease);
}

.detail-card .field-value a:hover { color: var(--c-accent-hover); text-decoration: underline; }

/* ── Review Panel ── */
.review-panel {
  background: var(--c-bg-white);
  border-radius: var(--radius-md);
  border: 1px solid var(--c-line);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 32px;
}

.review-panel h3 {
  font-family: var(--f-heading);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--c-text-primary);
  margin-bottom: 18px;
}

.review-buttons {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.review-notes {
  width: 100%;
  min-height: 100px;
  padding: 14px;
  border: 1px solid var(--c-line);
  border-radius: var(--radius-sm);
  font-family: var(--f-body);
  font-size: 0.9rem;
  font-weight: 500;
  resize: vertical;
  color: var(--c-text-primary);
  background: var(--c-bg-warm);
  transition: all var(--dur) var(--ease);
}

.review-notes:focus {
  outline: none;
  border-color: var(--c-accent);
  background: var(--c-bg-white);
  box-shadow: 0 0 0 3px var(--c-accent-soft);
}

/* ── Timeline (seguimientos) ── */
.timeline {
  position: relative;
  padding-left: 32px;
  margin-top: 10px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 6px;
  bottom: 6px;
  width: 1px;
  background: var(--c-line);
}

.timeline-item {
  position: relative;
  padding-bottom: 24px;
}

.timeline-item:last-child { padding-bottom: 0; }

.timeline-item::before {
  content: '';
  position: absolute;
  left: -28px;
  top: 4px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--c-bg-white);
  border: 2px solid var(--c-line);
  transition: all var(--dur) var(--ease);
}

.timeline-item.active::before {
  background: var(--c-accent);
  border-color: var(--c-accent);
  box-shadow: 0 0 0 4px var(--c-accent-soft);
}

.timeline-item .tl-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  align-items: baseline;
}

.timeline-item .tl-tipo {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--c-text-primary);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.timeline-item .tl-fecha {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--c-text-muted);
}

.timeline-item .tl-dest {
  font-size: 0.85rem;
  color: var(--c-text-secondary);
  font-weight: 500;
}

.timeline-item .tl-notas {
  font-size: 0.82rem;
  color: var(--c-text-muted);
  margin-top: 6px;
  line-height: 1.5;
  background: rgba(0,0,0,0.02);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-style: italic;
}

/* ── Login Page ── */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: radial-gradient(circle at 50% 50%, #2f2825 0%, #1c1c1c 100%); /* Glow arquitectónico */
  margin: 0;
  position: relative;
  width: 100%;
  overflow: hidden;
}

/* Luz de fondo sutil */
.login-page::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 500px; height: 500px;
  background: var(--c-accent);
  opacity: 0.06;
  filter: blur(120px);
  pointer-events: none;
}

.login-box {
  background: rgba(37, 37, 37, 0.6);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 56px 48px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  z-index: 10;
  position: relative;
  transition: all var(--dur) var(--ease);
}

.login-box h1 {
  font-family: var(--f-heading);
  font-size: 2.2rem;
  font-weight: 600;
  color: var(--c-white);
  text-align: center;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}

.login-box .login-sub {
  text-align: center;
  color: var(--c-accent);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  margin-bottom: 36px;
}

.login-box .login-error {
  background: rgba(168, 78, 62, 0.15);
  color: #ff9e92;
  border: 1px solid rgba(168, 78, 62, 0.3);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 500;
  margin-bottom: 20px;
  display: none;
  animation: fadeIn 0.3s var(--ease);
}

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

.login-box .login-error.visible { display: block; }

.login-footer {
  position: absolute;
  bottom: 40px;
  left: 0;
  right: 0;
  text-align: center;
  color: rgba(255, 255, 255, 0.3);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  pointer-events: none;
}

.login-footer strong {
  color: rgba(255, 255, 255, 0.5);
  font-weight: 700;
  letter-spacing: 0.1em;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 8px;
}

.form-group input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  font-family: var(--f-body);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--c-white);
  transition: all var(--dur) var(--ease);
}

.form-group input::placeholder {
  color: rgba(255, 255, 255, 0.25);
}

.form-group input:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--c-accent);
  box-shadow: 0 0 0 4px rgba(184, 131, 111, 0.15);
}

.login-box .btn-primary {
  width: 100%;
  padding: 14px;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  margin-top: 12px;
  letter-spacing: 0.12em;
}

/* ── Form Controls ── */
.form-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--c-text-muted);
  margin-bottom: 6px;
  margin-top: 12px;
}

.form-control {
  display: block;
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--c-line);
  border-radius: var(--radius-sm);
  font-family: var(--f-body);
  font-size: 0.875rem;
  font-weight: 500;
  background: var(--c-bg-warm);
  color: var(--c-text-primary);
  transition: all var(--dur) var(--ease);
}

.form-control:focus {
  outline: none;
  border-color: var(--c-accent);
  background: var(--c-bg-white);
  box-shadow: 0 0 0 3px var(--c-accent-soft);
}

.form-control::placeholder {
  color: var(--c-text-muted);
  opacity: 0.6;
}


/* ── Utilities ── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--c-text-muted);
}

.empty-state .empty-icon { 
  font-size: 3rem; 
  margin-bottom: 16px; 
  opacity: 0.3; 
  display: flex;
  justify-content: center;
  align-items: center;
}
.empty-state .empty-icon svg {
  width: 48px;
  height: 48px;
  stroke-width: 1.5px;
}
.empty-state p { font-size: 0.9rem; font-weight: 500; color: var(--c-text-secondary); }

.flex { display: flex; }
.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .sidebar { 
    transform: translateX(-100%);
    width: 280px;
    box-shadow: 20px 0 50px rgba(0,0,0,0.3);
  }
  
  body.mobile-menu-open .sidebar {
    transform: translateX(0);
  }

  /* Overlay sutil para cuando el menú está abierto */
  body.mobile-menu-open::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(4px);
    z-index: 90;
  }

  .main { margin-left: 0; }
  .content { padding: 20px 16px; }
  .topbar { padding: 0 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  
  .sidebar-toggle { display: none; } /* Ocultar toggle de escritorio en movil */
}

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