/* ============================================================
   REPARTOS.ONLINE — Design System v1
   Marca corporativa neutral B2B (azul + blanco)
   ============================================================ */

:root {
  /* Colores marca */
  --brand-50:  #EFF6FF;
  --brand-100: #DBEAFE;
  --brand-500: #3B82F6;
  --brand-600: #2563EB;
  --brand-700: #1D4ED8;
  --brand-900: #1E3A8A;
  
  /* Neutrales */
  --gray-50:  #F8FAFC;
  --gray-100: #F1F5F9;
  --gray-200: #E2E8F0;
  --gray-300: #CBD5E1;
  --gray-400: #94A3B8;
  --gray-500: #64748B;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1E293B;
  --gray-900: #0F172A;
  
  /* Estados */
  --success: #16A34A;
  --success-bg: #DCFCE7;
  --warning: #F59E0B;
  --warning-bg: #FEF3C7;
  --danger: #DC2626;
  --danger-bg: #FEE2E2;
  --info: #0EA5E9;
  --info-bg: #E0F2FE;
  
  /* Sombras */
  --shadow-sm: 0 1px 2px rgba(15,23,42,0.05);
  --shadow:    0 4px 6px -1px rgba(15,23,42,0.08), 0 2px 4px -2px rgba(15,23,42,0.05);
  --shadow-md: 0 10px 15px -3px rgba(15,23,42,0.08), 0 4px 6px -4px rgba(15,23,42,0.05);
  --shadow-lg: 0 20px 25px -5px rgba(15,23,42,0.10), 0 8px 10px -6px rgba(15,23,42,0.05);
  --shadow-xl: 0 25px 50px -12px rgba(15,23,42,0.18);
  
  /* Tipografía */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  
  /* Layout */
  --radius-sm: 6px;
  --radius:    8px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  
  --sidebar-w: 260px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
}

html, body {
  font-family: var(--font-sans);
  color: var(--gray-800);
  background: var(--gray-50);
  line-height: 1.5;
  font-size: 14px;
}

a {
  color: var(--brand-600);
  text-decoration: none;
}
a:hover { color: var(--brand-700); }

/* ============ Buttons ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.1rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  text-decoration: none;
  font-family: inherit;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--brand-600);
  color: white;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover:not(:disabled) {
  background: var(--brand-700);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.btn-secondary {
  background: white;
  color: var(--gray-700);
  border-color: var(--gray-200);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--gray-50);
  border-color: var(--gray-300);
}

.btn-danger {
  background: white;
  color: var(--danger);
  border-color: var(--danger-bg);
}
.btn-danger:hover:not(:disabled) {
  background: var(--danger-bg);
}

.btn-ghost {
  background: transparent;
  color: var(--gray-600);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--gray-100);
  color: var(--gray-900);
}

.btn-lg { padding: 0.85rem 1.5rem; font-size: 0.95rem; }
.btn-sm { padding: 0.4rem 0.85rem; font-size: 0.8rem; }
.btn-block { width: 100%; }

/* ============ Inputs ============ */
.input, .select, .textarea {
  width: 100%;
  padding: 0.625rem 0.85rem;
  font-size: 0.9rem;
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  color: var(--gray-900);
  transition: all 0.15s;
  outline: none;
  font-family: inherit;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
}
.input::placeholder { color: var(--gray-400); }
.input:disabled { background: var(--gray-100); color: var(--gray-500); }

.label {
  display: block;
  font-size: 0.8rem;
  color: var(--gray-700);
  margin-bottom: 0.35rem;
  font-weight: 500;
}
.help-text {
  font-size: 0.75rem;
  color: var(--gray-500);
  margin-top: 0.35rem;
}

/* ============ Cards ============ */
.card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.card-body { padding: 1.25rem; }
.card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.card-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--gray-900);
}
.card-sub {
  font-size: 0.8rem;
  color: var(--gray-500);
  margin-top: 0.15rem;
}

/* ============ Badges ============ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger  { background: var(--danger-bg);  color: var(--danger); }
.badge-info    { background: var(--info-bg);    color: var(--info); }
.badge-gray    { background: var(--gray-100);   color: var(--gray-600); }

/* ============ Tables ============ */
.table {
  width: 100%;
  border-collapse: collapse;
}
.table th {
  text-align: left;
  padding: 0.65rem 1rem;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border-bottom: 1px solid var(--gray-200);
  background: var(--gray-50);
}
.table td {
  padding: 0.85rem 1rem;
  font-size: 0.875rem;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-700);
}
.table tr:hover td { background: var(--gray-50); }
.table tr:last-child td { border-bottom: none; }

/* ============ Alerts ============ */
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
}
.alert-error { background: var(--danger-bg); color: var(--danger); border: 1px solid #FECACA; }
.alert-success { background: var(--success-bg); color: var(--success); border: 1px solid #BBF7D0; }
.alert-info { background: var(--info-bg); color: var(--info); border: 1px solid #BAE6FD; }
.alert-warning { background: var(--warning-bg); color: #92400E; border: 1px solid #FDE68A; }
.alert.hidden { display: none; }

/* ============ Empty State ============ */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--gray-500);
}
.empty-state-icon {
  font-size: 2.5rem;
  opacity: 0.4;
  margin-bottom: 0.75rem;
}
.empty-state-title {
  font-size: 0.95rem;
  color: var(--gray-700);
  font-weight: 500;
  margin-bottom: 0.35rem;
}
.empty-state-text {
  font-size: 0.85rem;
}

/* ============ Spinner ============ */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ Utility ============ */
.text-xs { font-size: 0.7rem; }
.text-sm { font-size: 0.8rem; }
.text-muted { color: var(--gray-500); }
.text-mono { font-family: var(--font-mono); }
.font-semibold { font-weight: 600; }

.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }

.hidden { display: none !important; }
