/* =========================================================
   PIPA STUDIO — Estilos compartidos (corporativo / profesional)
   ========================================================= */

:root {
  --navy: #1b2a4a;
  --navy-dark: #101a30;
  --blue: #3a5ba0;
  --blue-light: #6f8fc9;
  --gray-bg: #f4f6fa;
  --gray-border: #dfe4ee;
  --text: #232a3b;
  --text-muted: #6b7280;
  --white: #ffffff;
  --success: #1f8a5f;
  --danger: #c0392b;
  --warning: #b8860b;
  --radius: 10px;
  --shadow: 0 2px 10px rgba(27, 42, 74, 0.08);
  --shadow-lg: 0 8px 30px rgba(27, 42, 74, 0.14);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--gray-bg);
  line-height: 1.55;
}

h1, h2, h3, h4 { font-family: inherit; color: var(--navy); margin: 0 0 .5em; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }

/* ---------- NAV ---------- */
.navbar {
  background: var(--navy);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow);
}
.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.navbar .brand {
  color: var(--white);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: .5px;
}
.navbar .brand span { color: var(--blue-light); }
.navbar nav a {
  color: #e8ecf6;
  margin-left: 26px;
  font-weight: 500;
  font-size: .95rem;
}
.navbar nav a:hover { color: var(--white); text-decoration: none; }
.navbar .cta {
  background: var(--blue);
  padding: 9px 18px;
  border-radius: 6px;
  color: var(--white) !important;
}

/* ---------- HERO ---------- */
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-dark) 100%);
  color: var(--white);
  padding: 90px 0 70px;
  text-align: center;
}
.hero h1 { color: var(--white); font-size: 2.6rem; margin-bottom: .3em; }
.hero p { color: #c7d0e6; font-size: 1.15rem; max-width: 560px; margin: 0 auto 1.8em; }
.btn {
  display: inline-block;
  padding: 13px 28px;
  border-radius: 6px;
  font-weight: 600;
  font-size: .95rem;
  cursor: pointer;
  border: none;
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn-primary { background: var(--blue); color: var(--white); }
.btn-primary:hover { box-shadow: 0 6px 18px rgba(58,91,160,.4); }
.btn-outline { background: transparent; color: var(--white); border: 1.5px solid rgba(255,255,255,.5); }
.btn-secondary { background: var(--gray-border); color: var(--navy); }
.btn-danger { background: var(--danger); color: var(--white); }
.btn-sm { padding: 7px 14px; font-size: .82rem; border-radius: 5px; }

/* ---------- SECTIONS ---------- */
section { padding: 64px 0; }
.section-title { text-align: center; margin-bottom: 44px; }
.section-title h2 { font-size: 1.9rem; }
.section-title p { color: var(--text-muted); }
.section-alt { background: var(--white); }

.grid {
  display: grid;
  gap: 26px;
}
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

.card {
  background: var(--white);
  border: 1px solid var(--gray-border);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow);
}
.card h3 { font-size: 1.15rem; }
.card .price { color: var(--blue); font-weight: 700; font-size: 1.3rem; margin: 8px 0; }

/* ---------- FORMS ---------- */
label { display: block; font-weight: 600; font-size: .85rem; margin-bottom: 6px; color: var(--navy); }
input, select, textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--gray-border);
  border-radius: 6px;
  font-size: .95rem;
  margin-bottom: 16px;
  background: var(--white);
  font-family: inherit;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }

.form-card {
  max-width: 560px;
  margin: 0 auto;
  background: var(--white);
  border-radius: var(--radius);
  padding: 34px;
  box-shadow: var(--shadow);
}

/* ---------- FOOTER ---------- */
footer {
  background: var(--navy-dark);
  color: #aab4cc;
  padding: 40px 0;
  text-align: center;
  font-size: .9rem;
}
footer a { color: var(--blue-light); }

/* ---------- CONTACT INFO ---------- */
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap: 24px; margin-top: 30px; }
.contact-item { text-align: center; }
.contact-item .icon { font-size: 1.8rem; margin-bottom: 8px; }

/* ---------- MESSAGES ---------- */
.msg { padding: 12px 16px; border-radius: 6px; margin-bottom: 16px; font-size: .9rem; }
.msg-success { background: #e4f5ed; color: var(--success); border: 1px solid #b9e5cf; }
.msg-error { background: #fdeceb; color: var(--danger); border: 1px solid #f3c1ba; }

/* =========================================================
   ADMIN PANEL
   ========================================================= */
.admin-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 230px;
  background: var(--navy);
  color: var(--white);
  padding: 24px 0;
  flex-shrink: 0;
}
.sidebar .brand { padding: 0 24px 24px; font-weight: 700; font-size: 1.15rem; border-bottom: 1px solid rgba(255,255,255,.12); margin-bottom: 12px; }
.sidebar .brand span { color: var(--blue-light); }
.sidebar button.tab {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  color: #cdd6ea;
  padding: 12px 24px;
  font-size: .92rem;
  cursor: pointer;
  border-left: 3px solid transparent;
}
.sidebar button.tab:hover { background: rgba(255,255,255,.06); color: var(--white); }
.sidebar button.tab.active { background: rgba(255,255,255,.09); color: var(--white); border-left-color: var(--blue-light); font-weight: 600; }
.sidebar .logout { margin-top: 20px; padding: 12px 24px; }

.main-area { flex: 1; padding: 32px 36px; max-width: 100%; overflow-x: auto; }
.main-area h2 { margin-bottom: 4px; }
.subtitle { color: var(--text-muted); margin-bottom: 28px; }

.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: 18px; margin-bottom: 30px; }
.stat-card { background: var(--white); border: 1px solid var(--gray-border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.stat-card .label { color: var(--text-muted); font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; }
.stat-card .value { font-size: 1.6rem; font-weight: 700; color: var(--navy); margin-top: 6px; }

table { width: 100%; border-collapse: collapse; background: var(--white); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
thead th { background: var(--gray-bg); text-align: left; padding: 12px 14px; font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--text-muted); border-bottom: 1px solid var(--gray-border); }
tbody td { padding: 12px 14px; border-bottom: 1px solid var(--gray-border); font-size: .92rem; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #fafbfd; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: .75rem; font-weight: 600; }
.badge-pendiente { background: #fdf3d9; color: var(--warning); }
.badge-confirmado { background: #dbe7fb; color: var(--blue); }
.badge-completado { background: #e4f5ed; color: var(--success); }
.badge-cancelado { background: #fdeceb; color: var(--danger); }

.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; flex-wrap: wrap; gap: 12px; }
.toolbar .filters { display: flex; gap: 10px; flex-wrap: wrap; }
.toolbar select, .toolbar input { margin-bottom: 0; width: auto; }

.modal-overlay {
  position: fixed; inset: 0; background: rgba(16,26,48,.5);
  display: flex; align-items: center; justify-content: center; z-index: 100;
}
.modal { background: var(--white); border-radius: var(--radius); padding: 30px; width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto; }
.modal h3 { margin-bottom: 20px; }
.hidden { display: none !important; }

.login-shell {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-dark) 100%);
}
.login-card { background: var(--white); border-radius: var(--radius); padding: 40px; width: 100%; max-width: 380px; box-shadow: var(--shadow-lg); }
.login-card h1 { text-align: center; margin-bottom: 4px; }
.login-card .subtitle { text-align: center; margin-bottom: 26px; }

.low-stock { color: var(--danger); font-weight: 600; }

/* =========================================================
   TURNOS DISPONIBLES (sitio público)
   ========================================================= */

/* Tira de días tipo calendario */
.calendar-days {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 10px;
  margin-bottom: 18px;
  scrollbar-width: thin;
}
.cal-day {
  flex: 0 0 auto;
  width: 56px;
  padding: 10px 4px;
  border: 1.5px solid var(--gray-border);
  background: var(--white);
  border-radius: 8px;
  cursor: pointer;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cal-day-name { font-size: .72rem; color: var(--text-muted); text-transform: uppercase; }
.cal-day-num { font-size: 1.05rem; font-weight: 700; color: var(--navy); }
.cal-day:hover:not(.disabled) { border-color: var(--blue); }
.cal-day.selected { background: var(--navy); border-color: var(--navy); }
.cal-day.selected .cal-day-name, .cal-day.selected .cal-day-num { color: var(--white); }
.cal-day.disabled { opacity: .35; cursor: not-allowed; }

/* Horarios agrupados por franja del día */
.slots-group-label { font-weight: 600; font-size: .85rem; color: var(--navy); margin: 14px 0 8px; }
.slots-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.slot-btn {
  padding: 10px 16px;
  border: 1.5px solid var(--gray-border);
  background: var(--white);
  border-radius: 6px;
  font-size: .9rem;
  font-weight: 600;
  color: var(--navy);
  cursor: pointer;
  text-align: center;
}
.slot-btn:hover { border-color: var(--blue); color: var(--blue); }
.slot-btn.selected { background: var(--blue); border-color: var(--blue); color: var(--white); }
.slots-empty { color: var(--text-muted); font-size: .9rem; }
