/* ===========================================================================
   Identidad visual — Agencia de automatización
   Paleta: negro / blanco / naranja Claude
   =========================================================================== */

:root {
  /* Colores Claude */
  --orange: #D97757;
  --orange-hover: #C96444;
  --orange-light: #F4E3DB;
  --orange-pale: #FAF1EC;

  --black: #141413;
  --gray-900: #262624;
  --gray-800: #3D3D3A;
  --gray-700: #57564F;
  --gray-600: #7D7B70;
  --gray-500: #A8A69A;
  --gray-400: #C9C7BC;
  --gray-300: #E5E4DF;
  --gray-200: #F0EFEA;
  --gray-100: #F7F6F2;
  --cream: #FAF9F5;
  --white: #FFFFFF;

  --success: #2D7A5F;
  --warning: #B77E2F;
  --danger: #A84234;

  /* Tipografía */
  --font-sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
  --font-serif: "Tiempos Headline", "Charter", Georgia, serif;
  --font-mono: "SF Mono", Menlo, Consolas, monospace;

  /* Espaciado */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  /* Sombras */
  --shadow-sm: 0 1px 2px rgba(20, 20, 19, 0.04);
  --shadow-md: 0 4px 12px rgba(20, 20, 19, 0.06);
  --shadow-lg: 0 12px 32px rgba(20, 20, 19, 0.08);
}

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

html, body {
  font-family: var(--font-sans);
  background: var(--cream);
  color: var(--black);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--orange);
  text-decoration: none;
  transition: color 0.15s;
}
a:hover { color: var(--orange-hover); }

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
}

code, pre {
  font-family: var(--font-mono);
  font-size: 0.875em;
}

/* ─── Botones ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: 14px;
  transition: all 0.15s;
  border: 1px solid transparent;
  white-space: nowrap;
}

.btn-primary {
  background: var(--black);
  color: var(--cream);
}
.btn-primary:hover { background: var(--gray-900); }

.btn-orange {
  background: var(--orange);
  color: var(--white);
}
.btn-orange:hover { background: var(--orange-hover); }

.btn-ghost {
  background: transparent;
  color: var(--black);
  border-color: var(--gray-300);
}
.btn-ghost:hover {
  background: var(--gray-100);
  border-color: var(--gray-400);
}

.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-lg { padding: 14px 24px; font-size: 15px; }

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ─── Inputs ──────────────────────────────────────────────────────────────── */
.input,
input[type=text],
input[type=email],
input[type=password],
input[type=tel],
input[type=number],
textarea,
select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  background: var(--white);
  color: var(--black);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.input:focus,
input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 3px var(--orange-light);
}

label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-800);
  margin-bottom: 6px;
}

/* ─── Tarjetas ────────────────────────────────────────────────────────────── */
.card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: border-color 0.2s;
}

.card-compact {
  padding: 16px;
}

/* ─── Pills / Badges ──────────────────────────────────────────────────────── */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 999px;
  background: var(--gray-200);
  color: var(--gray-800);
}

.pill-success { background: #E3F1E9; color: var(--success); }
.pill-warning { background: #FBEFDD; color: var(--warning); }
.pill-danger  { background: #F6E0DD; color: var(--danger); }
.pill-orange  { background: var(--orange-light); color: var(--orange-hover); }
.pill-black   { background: var(--black); color: var(--cream); }

/* ─── Tablas ──────────────────────────────────────────────────────────────── */
.table {
  width: 100%;
  border-collapse: collapse;
}
.table th,
.table td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--gray-200);
  font-size: 14px;
}
.table th {
  font-weight: 500;
  color: var(--gray-700);
  background: var(--gray-100);
  font-size: 13px;
  letter-spacing: 0.01em;
}
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--gray-100); }

/* ─── Utilidades ──────────────────────────────────────────────────────────── */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }

.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mt-8 { margin-top: 32px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mb-8 { margin-bottom: 32px; }

.text-sm { font-size: 13px; }
.text-xs { font-size: 12px; }
.text-lg { font-size: 17px; }
.text-xl { font-size: 20px; }
.text-2xl { font-size: 24px; }
.text-3xl { font-size: 32px; }
.text-4xl { font-size: 44px; }

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.text-gray   { color: var(--gray-700); }
.text-muted  { color: var(--gray-600); }
.text-orange { color: var(--orange); }
.text-black  { color: var(--black); }
.text-white  { color: var(--white); }

.serif { font-family: var(--font-serif); letter-spacing: -0.01em; }

.hidden { display: none !important; }

/* ─── Toast ──────────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 14px 20px;
  background: var(--black);
  color: var(--cream);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  animation: slideIn 0.3s ease;
  max-width: 360px;
  font-size: 14px;
}
.toast.error { background: var(--danger); }
.toast.success { background: var(--success); }

@keyframes slideIn {
  from { transform: translateX(120%); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

/* ─── Loading spinner ────────────────────────────────────────────────────── */
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--gray-300);
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Scrollbar fino ─────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background-color: var(--gray-500); }
