/* css/app.css
   ─────────────────────────────────────────────
   BLM Turnos — Estilos globales
   ─────────────────────────────────────────────*/

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

/* ── Variables ──────────────────────────────── */
:root {
  --black:       #1a1a1a;
  --gold:        #c9a84c;
  --gold-light:  #f5e9c8;
  --white:       #ffffff;
  --bg:          #f4f3f0;
  --bg-panel:    #ffffff;
  --border:      #e5e3dc;
  --text-main:   #1a1a1a;
  --text-muted:  #6b6960;
  --text-hint:   #9d9b93;
  --green:       #3B6D11;
  --green-bg:    #EAF3DE;
  --amber:       #854F0B;
  --amber-bg:    #FAEEDA;
  --red:         #791F1F;
  --red-bg:      #FCEBEB;
  --radius-sm:   6px;
  --radius-md:   10px;
  --radius-lg:   14px;
  --shadow-sm:   0 1px 3px rgba(0,0,0,0.08);
}

/* ── Base ───────────────────────────────────── */
html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 14px;
  color: var(--text-main);
  background: var(--bg);
  line-height: 1.5;
}

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

/* ── LOGIN ──────────────────────────────────── */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: var(--bg);
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 36px 32px;
  box-shadow: var(--shadow-sm);
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.logo-text {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-main);
}

.login-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.login-divider {
  text-align: center;
  font-size: 12px;
  color: var(--text-hint);
  margin: 14px 0;
}

/* ── APP LAYOUT ─────────────────────────────── */
.app-layout {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* ── TOPBAR ─────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  height: 52px;
  background: var(--black);
  color: var(--white);
  flex-shrink: 0;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-badge {
  width: 30px;
  height: 30px;
  background: var(--gold);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--black);
  letter-spacing: 0.3px;
  flex-shrink: 0;
}

.topbar .logo-text {
  font-size: 15px;
  font-weight: 600;
  color: var(--white);
}

.negocio-nombre {
  font-size: 12px;
  color: rgba(255,255,255,0.45);
  padding-left: 8px;
  border-left: 1px solid rgba(255,255,255,0.15);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-email {
  font-size: 12px;
  color: rgba(255,255,255,0.55);
}

/* ── APP BODY ───────────────────────────────── */
.app-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* ── SIDEBAR ────────────────────────────────── */
.sidebar {
  width: 210px;
  flex-shrink: 0;
  background: var(--white);
  border-right: 1px solid var(--border);
  padding: 16px 0;
  overflow-y: auto;
}

.nav-section {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-hint);
  padding: 12px 18px 4px;
  font-weight: 500;
}

.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 18px;
  background: none;
  border: none;
  border-right: 2px solid transparent;
  text-align: left;
  font-size: 13px;
  font-weight: 400;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
}

.nav-item:hover {
  background: var(--bg);
  color: var(--text-main);
}

.nav-item.active {
  background: var(--bg);
  color: var(--text-main);
  font-weight: 500;
  border-right-color: var(--black);
}

.nav-icon {
  font-size: 15px;
}

/* ── MAIN CONTENT ───────────────────────────── */
.main-content {
  flex: 1;
  overflow-y: auto;
  background: var(--bg);
}

.section-wrapper {
  padding: 24px;
  max-width: 1100px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.section-header h2 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-main);
}

.fecha-hoy {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: capitalize;
}

/* ── MÉTRICAS ───────────────────────────────── */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.metric-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
}

.metric-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-hint);
  margin-bottom: 6px;
  font-weight: 500;
}

.metric-val {
  font-size: 28px;
  font-weight: 600;
  color: var(--text-main);
}

.metric-val.green { color: var(--green); }
.metric-val.amber { color: var(--amber); }
.metric-val.red   { color: var(--red); }

/* ── PANEL TITLE ────────────────────────────── */
.panel-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* ── TABLA ──────────────────────────────────── */
.table-wrapper {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 20px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-hint);
  font-weight: 500;
  padding: 10px 16px;
  text-align: left;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 11px 16px;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
  color: var(--text-main);
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #faf9f7; }

.hora-cell {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-main);
}

.loading-cell, .empty-cell, .error-cell {
  text-align: center;
  color: var(--text-hint);
  padding: 24px !important;
  font-size: 13px;
}

.error-cell { color: var(--red); }

/* ── BADGES ─────────────────────────────────── */
.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 20px;
  text-transform: capitalize;
}

.badge-confirmado { background: var(--green-bg); color: var(--green); }
.badge-pendiente  { background: var(--amber-bg); color: var(--amber); }
.badge-cancelado  { background: var(--red-bg);   color: var(--red); }

/* ── AGENDA ─────────────────────────────────── */
.date-picker {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  background: var(--white);
  color: var(--text-main);
  cursor: pointer;
}

.agenda-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.agenda-col {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.agenda-col-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.col-nombre { font-size: 13px; font-weight: 600; }
.col-sub    { font-size: 11px; color: var(--text-muted); }

.agenda-slots { overflow-y: auto; max-height: 460px; }

.slot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
  min-height: 48px;
}

.slot:last-child { border-bottom: none; }

.slot-libre { opacity: 0.5; }

.slot-hora {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  min-width: 40px;
  font-variant-numeric: tabular-nums;
}

.slot-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.slot-nombre   { font-size: 13px; font-weight: 500; }
.slot-servicio { font-size: 11px; color: var(--text-muted); }
.slot-empty    { font-size: 12px; color: var(--text-hint); font-style: italic; }

/* ── FORMULARIOS ────────────────────────────── */
.form-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 20px;
}

.form-card-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-main);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 12px;
}

.form-group label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

.form-group input,
.form-group select {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  background: var(--white);
  color: var(--text-main);
  transition: border-color 0.15s;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--black);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}

.error-msg {
  background: var(--red-bg);
  color: var(--red);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  margin-bottom: 10px;
}

/* ── BUSCADOR ───────────────────────────────── */
.search-bar {
  margin-bottom: 12px;
}

.search-bar input {
  width: 100%;
  max-width: 380px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  background: var(--white);
  color: var(--text-main);
}

.search-bar input:focus {
  outline: none;
  border-color: var(--black);
}

/* ── SERVICIOS ──────────────────────────────── */
.servicios-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.servicio-item {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.servicio-icon { font-size: 20px; }

.servicio-info { flex: 1; }

.servicio-nombre { font-size: 14px; font-weight: 500; }
.servicio-dur    { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.servicio-precio {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
  min-width: 90px;
  text-align: right;
}

/* ── AVATAR ─────────────────────────────────── */
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--black);
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.avatar.small {
  width: 26px;
  height: 26px;
  font-size: 10px;
  display: inline-flex;
  vertical-align: middle;
  margin-right: 6px;
}

.cliente-nombre-cell {
  display: flex;
  align-items: center;
}

/* ── BOTONES ────────────────────────────────── */
.btn-primary {
  background: var(--black);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-primary:hover    { background: #333; }
.btn-primary:disabled { opacity: 0.5; cursor: default; }

.btn-secondary {
  background: transparent;
  color: var(--text-main);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-secondary:hover { background: var(--bg); }

.btn-logout {
  background: transparent;
  color: rgba(255,255,255,0.6);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--radius-sm);
  padding: 5px 12px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-logout:hover {
  background: rgba(255,255,255,0.1);
  color: var(--white);
}

.btn-icon {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 5px 9px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-muted);
  transition: background 0.1s;
}
.btn-icon:hover { background: var(--bg); }

.btn-eliminar:hover { border-color: var(--red); color: var(--red); }

/* ── EMPTY STATE ────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.8;
}
