/* ===========================================================
   AGENDA DEMO · Proxera Labs
   Estilos para landing + panel admin
   =========================================================== */

:root {
  --primary: #4f46e5;
  --primary-dark: #3730a3;
  --primary-light: #6366f1;
  --secondary: #7c3aed;
  --accent: #0ea5e9;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --text: #0f172a;
  --text-muted: #475569;
  --text-dim: #94a3b8;
  --bg: #f8fafc;
  --bg-card: #ffffff;
  --bg-sidebar: #ffffff;
  --border: #e2e8f0;
  --border-active: #c7d2fe;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 8px 24px rgba(15, 23, 42, 0.12);
  --gradient: linear-gradient(135deg, var(--primary), var(--secondary));
  --sidebar-w: 260px;
  --header-h: 64px;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
button { font-family: inherit; cursor: pointer; }

.hidden { display: none !important; }
.muted { color: var(--text-muted); font-size: 0.875rem; }

/* ============================= BUTTONS ============================= */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: var(--radius-sm);
  border: 1px solid transparent; font-weight: 600; font-size: 0.925rem;
  transition: var(--transition); text-decoration: none;
}
.btn-primary { background: var(--gradient); color: white; box-shadow: var(--shadow-sm); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); color: white; }
.btn-secondary { background: white; color: var(--primary); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--primary); color: var(--primary-dark); }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--bg); color: var(--text); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #dc2626; color: white; }
.btn-large { padding: 14px 28px; font-size: 1rem; }
.btn-small { padding: 7px 14px; font-size: 0.8125rem; }
.btn-full { width: 100%; justify-content: center; }

/* ============================= LANDING ============================= */
.landing-body {
  min-height: 100vh;
  background: radial-gradient(circle at 20% 10%, rgba(79,70,229,0.08), transparent 50%),
              radial-gradient(circle at 80% 90%, rgba(124,58,237,0.08), transparent 50%),
              var(--bg);
}
.landing-wrapper {
  max-width: 1100px; margin: 0 auto; padding: 0 24px;
  min-height: 100vh; display: flex; flex-direction: column;
}
.landing-header {
  height: var(--header-h); display: flex; align-items: center;
  justify-content: space-between; padding: 0 8px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo {
  width: 40px; height: 40px; border-radius: var(--radius-sm);
  background: var(--gradient); display: inline-flex; align-items: center;
  justify-content: center; font-size: 1.25rem;
}
.brand-name { font-weight: 700; font-size: 1.0625rem; }
.brand-sub { font-size: 0.75rem; color: var(--text-muted); }
.landing-back { font-size: 0.875rem; color: var(--text-muted); }

.landing-main { flex: 1; padding: 40px 0; }
.landing-hero { text-align: center; max-width: 760px; margin: 0 auto 64px; }
.eyebrow {
  display: inline-block; padding: 6px 14px;
  background: rgba(79,70,229,0.08); color: var(--primary);
  border-radius: 999px; font-size: 0.8125rem; font-weight: 600;
  margin-bottom: 20px;
}
.landing-hero h1 {
  font-size: clamp(2rem, 5vw, 3rem); font-weight: 800; line-height: 1.15;
  letter-spacing: -0.02em; margin-bottom: 20px;
}
.landing-lead { font-size: 1.125rem; color: var(--text-muted); margin-bottom: 32px; }
.landing-ctas {
  display: flex; gap: 16px; justify-content: center; flex-wrap: wrap;
  margin-bottom: 20px;
}
.landing-microcopy { font-size: 0.875rem; color: var(--text-muted); }

.landing-features {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px; max-width: 1000px; margin: 0 auto;
}
.feature {
  background: var(--bg-card); padding: 28px 24px;
  border-radius: var(--radius-md); border: 1px solid var(--border);
  transition: var(--transition);
}
.feature:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.feature-icon { font-size: 2rem; margin-bottom: 12px; }
.feature h3 { font-size: 1.0625rem; margin-bottom: 8px; }
.feature p { color: var(--text-muted); font-size: 0.925rem; }

.landing-footer {
  padding: 32px 0; text-align: center; color: var(--text-dim);
  font-size: 0.8125rem; border-top: 1px solid var(--border);
}

/* ============================= MODAL ============================= */
.modal {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
}
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(15, 23, 42, 0.5); backdrop-filter: blur(6px);
}
.modal-panel {
  position: relative; background: var(--bg-card);
  border-radius: var(--radius-lg); padding: 40px 32px 32px;
  width: 420px; max-width: calc(100vw - 32px);
  box-shadow: var(--shadow-lg);
}
.modal-close {
  position: absolute; top: 16px; right: 16px;
  background: transparent; border: none; font-size: 1.25rem;
  color: var(--text-muted); padding: 4px 8px; border-radius: 6px;
}
.modal-close:hover { background: var(--bg); }
.modal-panel h2 { margin-bottom: 8px; }
.modal-sub { color: var(--text-muted); margin-bottom: 24px; font-size: 0.925rem; }
.modal-panel form label {
  display: block; margin-bottom: 16px;
}
.modal-panel form label span { display: block; font-size: 0.8125rem; font-weight: 600; margin-bottom: 6px; }
.modal-panel form input[type="email"],
.modal-panel form input[type="password"] {
  width: 100%; padding: 10px 14px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 0.925rem;
  font-family: inherit; transition: var(--transition);
}
.modal-panel form input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,0.1); }
.form-error { color: var(--danger); font-size: 0.875rem; min-height: 1.5em; margin-bottom: 12px; }

/* ============================= ADMIN LAYOUT ============================= */
.admin-body {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--bg-sidebar); border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.sidebar-brand {
  padding: 20px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
}
.sidebar-nav { flex: 1; padding: 16px 12px; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-radius: var(--radius-sm);
  color: var(--text-muted); font-weight: 500; font-size: 0.9375rem;
  transition: var(--transition); margin-bottom: 4px;
}
.nav-item:hover { background: var(--bg); color: var(--text); }
.nav-item.active { background: rgba(79,70,229,0.08); color: var(--primary); font-weight: 600; }
.sidebar-footer {
  padding: 16px; border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 8px;
}

.admin-main { padding: 24px 32px 64px; overflow-x: hidden; min-width: 0; }
.admin-header {
  display: flex; justify-content: space-between; align-items: center;
  height: var(--header-h); margin-bottom: 24px;
}
.admin-header h1 { font-size: 1.5rem; font-weight: 700; }
.admin-header-right { display: flex; align-items: center; gap: 12px; }
.live-dot {
  width: 10px; height: 10px; border-radius: 50%; background: var(--success);
  box-shadow: 0 0 0 3px rgba(16,185,129,0.2);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: 0.4 } }

/* ============================= KPIs ============================= */
.kpis {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px; margin-bottom: 32px;
}
.kpi-card {
  background: var(--bg-card); padding: 20px 22px;
  border-radius: var(--radius-md); border: 1px solid var(--border);
}
.kpi-label { font-size: 0.8125rem; color: var(--text-muted); font-weight: 500; margin-bottom: 6px; }
.kpi-value { font-size: 2rem; font-weight: 700; letter-spacing: -0.02em; }
.kpi-sub { font-size: 0.75rem; color: var(--text-dim); margin-top: 4px; }

/* ============================= CARDS ============================= */
.two-col {
  display: grid; grid-template-columns: 1.25fr 1fr; gap: 20px;
}
@media (max-width: 1000px) { .two-col { grid-template-columns: 1fr; } }

.card {
  background: var(--bg-card); border-radius: var(--radius-md);
  border: 1px solid var(--border); padding: 20px 22px;
  margin-bottom: 20px;
}
.card-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px;
}
.card-header h2 { font-size: 1.0625rem; font-weight: 600; }
.card-link { font-size: 0.875rem; font-weight: 500; }

/* ============================= CITAS LIST ============================= */
.citas-list { display: flex; flex-direction: column; gap: 10px; }
.cita-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); transition: var(--transition);
}
.cita-item:hover { border-color: var(--border-active); }
.cita-icon { font-size: 1.25rem; }
.cita-info { flex: 1; min-width: 0; }
.cita-info strong { display: block; font-size: 0.9375rem; }
.cita-info span { font-size: 0.8125rem; color: var(--text-muted); }
.cita-estado { font-size: 0.75rem; font-weight: 600; padding: 4px 10px; border-radius: 999px; }
.estado-confirmada { background: rgba(16,185,129,0.1); color: #059669; }
.estado-completada { background: rgba(14,165,233,0.1); color: #0284c7; }
.estado-cancelada { background: rgba(239,68,68,0.1); color: #dc2626; }
.estado-no_show { background: rgba(245,158,11,0.1); color: #d97706; }

/* ============================= CITAS TABLE ============================= */
.table-wrap { overflow-x: auto; }
.citas-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.citas-table th {
  text-align: left; padding: 12px 10px; font-weight: 600;
  color: var(--text-muted); border-bottom: 1px solid var(--border);
  font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.03em;
}
.citas-table td {
  padding: 12px 10px; border-bottom: 1px solid var(--border);
}
.citas-table tr:last-child td { border-bottom: none; }
.citas-table .acciones { display: flex; gap: 6px; }

/* ============================= AGENDA 7D ============================= */
.agenda-week {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 12px;
}
@media (max-width: 1100px) { .agenda-week { grid-template-columns: 1fr; } }
.agenda-day {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px; min-height: 180px;
}
.agenda-day-header {
  font-weight: 600; font-size: 0.8125rem; margin-bottom: 8px;
  padding-bottom: 8px; border-bottom: 1px solid var(--border);
  text-transform: uppercase; letter-spacing: 0.03em;
}
.agenda-day-header.today { color: var(--primary); }
.agenda-cita {
  padding: 6px 8px; background: rgba(79,70,229,0.06);
  border-left: 3px solid var(--primary);
  border-radius: 4px; margin-bottom: 6px; font-size: 0.8125rem;
}
.agenda-cita .hora { font-weight: 600; }
.agenda-cita .nombre { color: var(--text-muted); font-size: 0.75rem; display: block; }

/* ============================= FEEDBACK ============================= */
.feedback-list { display: flex; flex-direction: column; gap: 14px; }
.feedback-item {
  padding: 14px 16px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--bg-card);
}
.feedback-stars { font-size: 1rem; margin-bottom: 6px; }
.feedback-comentario { font-size: 0.9375rem; margin-bottom: 6px; }
.feedback-meta { font-size: 0.75rem; color: var(--text-muted); }

/* ============================= ACTIVIDAD ============================= */
.actividad-feed { display: flex; flex-direction: column; gap: 8px; max-height: 600px; overflow-y: auto; }
.actividad-item {
  display: flex; gap: 12px; padding: 10px 12px;
  border-left: 3px solid var(--primary); background: var(--bg);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.875rem;
}
.actividad-item .ts { color: var(--text-dim); font-size: 0.75rem; min-width: 100px; }
.actividad-item.new { animation: flashIn 1s ease-out; }
@keyframes flashIn {
  0% { background: rgba(79,70,229,0.2); }
  100% { background: var(--bg); }
}

/* ============================= BLOQUEOS ============================= */
.bloqueo-form {
  display: flex; gap: 12px; align-items: end; flex-wrap: wrap;
  margin-bottom: 20px;
}
.bloqueo-form label { flex: 1; min-width: 160px; }
.bloqueo-form label span { display: block; font-size: 0.8125rem; font-weight: 600; margin-bottom: 6px; }
.bloqueo-form input {
  width: 100%; padding: 8px 12px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-family: inherit; font-size: 0.9375rem;
}
.bloqueos-list { display: flex; flex-direction: column; gap: 8px; }
.bloqueo-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px; border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

/* ============================= SELECT ============================= */
select#filtro-estado {
  padding: 7px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-family: inherit; font-size: 0.875rem; background: var(--bg-card);
}

/* ============================= TOAST ============================= */
.toast {
  position: fixed; bottom: 24px; right: 24px;
  background: var(--text); color: white;
  padding: 12px 18px; border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg); z-index: 2000;
  font-size: 0.9375rem; font-weight: 500;
  animation: slideUp 0.3s ease-out;
}
.toast.error { background: var(--danger); }
.toast.success { background: var(--success); }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
