/* ============================================================
   BARKHOUSE — Sistema de diseño
   Paleta: café oscuro + dorado (marca ya establecida)
   Tipografía: Fraunces (display, cálida/con carácter) +
               Work Sans (texto, limpia y legible en pantallas chicas)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600;9..144,700&family=Work+Sans:wght@400;500;600;700&display=swap');

:root {
  /* Color — paleta ajustada a la Opción B aprobada (boutique simplificado) */
  --bg: #17110B;
  --bg-elevated: #1D1710;
  --surface: #241C13;
  --surface-hover: #2A2116;
  --border: #3A2F20;
  --border-soft: #2E2517;

  --gold: #C9A24B;
  --gold-bright: #DCB863;
  --gold-dim: #8A7038;

  --text: #F2ECE0;
  --text-muted: #B3A488;
  --text-faint: #7A6C54;

  --success: #7BA876;
  --success-bg: rgba(123,168,118,0.12);
  --warning: #D6A24B;
  --warning-bg: rgba(214,162,75,0.1);
  --danger: #C17164;
  --danger-bg: rgba(193,113,100,0.12);
  --info: #6C93AD;
  --info-bg: rgba(108,147,173,0.12);

  /* Servicios — un color de identificación por línea de negocio */
  --svc-hotel: #C9A24B;    /* hospedaje */
  --svc-daycare: #7BA876;  /* guardería */
  --svc-grooming: #B57BA6; /* grooming */
  --svc-escuela: #6C93AD;  /* entrenamiento */

  /* Tipografía */
  --font-display: 'Fraunces', serif;
  --font-body: 'Work Sans', sans-serif;

  /* Layout — radios y sombra más discretos que la primera versión */
  --radius: 6px;
  --radius-sm: 4px;
  --shadow: 0 1px 2px rgba(0,0,0,0.2), 0 4px 12px rgba(0,0,0,0.18);
  --sidebar-w: 240px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body {
  background-image:
    radial-gradient(ellipse 900px 500px at 15% -10%, rgba(201,162,75,0.08), transparent),
    radial-gradient(ellipse 700px 500px at 100% 100%, rgba(201,162,75,0.05), transparent);
  background-attachment: fixed;
  min-height: 100vh;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--text);
  margin: 0 0 0.4em 0;
  letter-spacing: -0.01em;
}

h1 { font-size: 2rem; font-weight: 700; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.1rem; }

p { margin: 0 0 0.75em 0; color: var(--text-muted); }

a { color: var(--gold-bright); text-decoration: none; }
a:hover { text-decoration: underline; }

button, input, select, textarea {
  font-family: var(--font-body);
  font-size: 0.95rem;
}

::placeholder { color: var(--text-faint); }

/* Focus visibility */
:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 2px;
}

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  padding: 0.65em 1.3em;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  transition: transform 0.08s ease, background 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}
.btn:active { transform: scale(0.98); }

.btn-primary {
  background: linear-gradient(135deg, var(--gold-bright), var(--gold));
  color: #211505;
}
.btn-primary:hover { filter: brightness(1.08); }

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover { background: var(--surface-hover); }

.btn-danger {
  background: var(--danger-bg);
  color: #F2B5AC;
  border-color: var(--danger);
}
.btn-danger:hover { background: var(--danger); color: #fff; }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: transparent;
}
.btn-ghost:hover { background: var(--surface); color: var(--text); }

.btn-sm { padding: 0.4em 0.9em; font-size: 0.82rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- Formularios ---------- */
.field { margin-bottom: 1rem; }
.field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.4em;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.65em 0.8em;
  border-radius: var(--radius-sm);
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--gold-dim);
}
.field textarea { resize: vertical; min-height: 80px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 640px) { .field-row { grid-template-columns: 1fr; } }

/* ---------- Tarjetas ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 1.25rem;
}

/* ---------- Badges de estado / servicio ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.25em 0.7em;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.badge-hotel { background: rgba(201,162,75,0.15); color: var(--gold-bright); }
.badge-daycare { background: rgba(110,155,94,0.18); color: #A8D19A; }
.badge-grooming { background: rgba(181,123,166,0.18); color: #DBAECF; }
.badge-escuela { background: rgba(108,147,173,0.18); color: #A9C9DD; }
.badge-success { background: var(--success-bg); color: #A8D19A; }
.badge-warning { background: var(--warning-bg); color: #EAC27E; }
.badge-danger { background: var(--danger-bg); color: #F2B5AC; }
.badge-muted { background: var(--bg-elevated); color: var(--text-faint); }

/* ---------- Utilidades ---------- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-sm { gap: 0.5rem; } .gap-md { gap: 1rem; } .gap-lg { gap: 1.5rem; }
.muted { color: var(--text-muted); }
.faint { color: var(--text-faint); font-size: 0.85rem; }
.text-center { text-align: center; }
.mt-lg { margin-top: 1.5rem; } .mb-lg { margin-bottom: 1.5rem; }
.hidden { display: none !important; }

.divider { height: 1px; background: var(--border-soft); margin: 1.25rem 0; }

.avatar {
  width: 44px; height: 44px; border-radius: 50%;
  object-fit: cover; background: var(--bg-elevated);
  border: 2px solid var(--gold-dim);
}
.avatar-lg { width: 96px; height: 96px; border: 3px solid var(--gold); }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold-dim); }

/* Toast */
#toast-container {
  position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 999;
  display: flex; flex-direction: column; gap: 0.6rem;
}
.toast {
  background: var(--surface); border: 1px solid var(--border);
  border-left: 4px solid var(--gold);
  padding: 0.8em 1.2em; border-radius: var(--radius-sm);
  box-shadow: var(--shadow); font-size: 0.88rem; min-width: 220px;
  animation: slideIn 0.25s ease;
}
.toast.error { border-left-color: var(--danger); }
.toast.success { border-left-color: var(--success); }
@keyframes slideIn { from { transform: translateX(30px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* Spinner */
.spinner {
  width: 22px; height: 22px; border-radius: 50%;
  border: 3px solid var(--border); border-top-color: var(--gold);
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(15,10,6,0.7);
  display: flex; align-items: center; justify-content: center;
  z-index: 500; padding: 1rem; backdrop-filter: blur(2px);
}
.modal {
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto;
  padding: 1.5rem;
}
.modal-wide { max-width: 780px; }
