:root {
  --sidebar-bg:    #1c3535;
  --accent:        #38b2a8;
  --accent-hover:  #2d9990;
  --accent-light:  #e6f7f6;
  --sidebar-width: 220px;
  --text-dark:     #1c3535;
  --text-muted:    #64748b;
  --border:        #e2ecec;
  --bg-page:       #f3f9f9;
  --topbar-h:      72px;
}

* { box-sizing: border-box; }
body { margin: 0; font-family: 'Segoe UI', sans-serif; background: var(--bg-page); }

/* ── Mobile topbar ── */
.topbar {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  background: var(--sidebar-bg);
  z-index: 200;
  align-items: center;
  padding: 0 1rem;
  gap: .75rem;
}
.topbar-logo-wrap {
  display: inline-flex;
  align-items: center;
  flex: 1;
}
.topbar-logo {
  display: block;
  width: 140px;
  height: 68px;
  object-fit: cover;
  object-position: center 50%;
  border-radius: 9px;
}
.topbar-brand {
  color: white;
  font-size: 1.1rem;
  font-weight: 700;
  flex: 1;
}
.btn-hamburger {
  background: none;
  border: none;
  color: white;
  font-size: 1.3rem;
  padding: .25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
}

/* ── Sidebar overlay (mobile backdrop) ── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 149;
  opacity: 0;
  transition: opacity .25s;
}
.sidebar-overlay.visible { opacity: 1; }

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 150;
  transition: transform .25s ease;
}
.sidebar-brand {
  padding: 1.5rem 1.25rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-logo-wrap {
  display: inline-flex;
  align-items: center;
  margin-bottom: .4rem;
}
.sidebar-logo {
  display: block;
  width: 174px;
  height: 96px;
  object-fit: cover;
  object-position: center 50%;
  border-radius: 11px;
}
.brand-sub {
  color: rgba(255,255,255,.4);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.sidebar-nav {
  list-style: none;
  padding: 1rem 0;
  margin: 0;
  flex: 1;
  overflow-y: auto;
}
.sidebar-nav li a {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .65rem 1.25rem;
  color: rgba(255,255,255,.55);
  text-decoration: none;
  font-size: .88rem;
  border-left: 3px solid transparent;
  transition: all .15s;
}
.sidebar-nav li a:hover,
.sidebar-nav li a.active {
  color: white;
  background: rgba(56,178,168,.15);
  border-left-color: var(--accent);
}
.nav-divider {
  padding: 1rem 1.25rem .25rem;
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255,255,255,.22);
}
.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255,255,255,.08);
}
.sidebar-footer .user-name {
  display: block;
  color: rgba(255,255,255,.45);
  font-size: .78rem;
  margin-bottom: .4rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.btn-logout {
  background: none;
  border: none;
  color: rgba(255,255,255,.35);
  font-size: .82rem;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: .35rem;
  transition: color .15s;
}
.btn-logout:hover { color: white; }

/* ── Main content ── */
.main-content {
  margin-left: var(--sidebar-width);
  padding: 2rem 2.5rem;
  min-height: 100vh;
  width: 100%;
}
.page-header { margin-bottom: 1.75rem; }
.page-header h1 {
  font-size: 1.45rem;
  font-weight: 600;
  color: var(--text-dark);
  margin: 0 0 .2rem;
}
.page-header p { color: var(--text-muted); margin: 0; font-size: .88rem; }

/* ── Cards ── */
.card {
  border: none;
  box-shadow: 0 1px 4px rgba(28,53,53,.07);
  border-radius: 12px;
}
.card-header {
  background: white;
  border-bottom: 1px solid var(--border);
  border-radius: 12px 12px 0 0 !important;
  font-weight: 600;
  font-size: .9rem;
  color: var(--text-dark);
  border-left: 4px solid var(--accent) !important;
  padding-left: 1.1rem !important;
}
.stat-card { padding: 1.25rem; }
.stat-card .label { font-size: .78rem; color: #94a3b8; text-transform: uppercase; letter-spacing: .5px; }
.stat-card .value { font-size: 2rem; font-weight: 700; color: var(--text-dark); line-height: 1.2; }

/* ── Tables ── */
.table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .4px; color: #94a3b8; font-weight: 600; border-top: none; }
.table td { font-size: .88rem; vertical-align: middle; }

/* ── Botones ── */
.btn-dark {
  background-color: var(--accent) !important;
  border-color: var(--accent) !important;
  color: white !important;
}
.btn-dark:hover, .btn-dark:focus {
  background-color: var(--accent-hover) !important;
  border-color: var(--accent-hover) !important;
  box-shadow: 0 0 0 .2rem rgba(56,178,168,.3) !important;
}
.btn-outline-secondary {
  color: var(--text-muted) !important;
  border-color: var(--border) !important;
}
.btn-outline-secondary:hover {
  background-color: var(--accent-light) !important;
  border-color: var(--accent) !important;
  color: var(--accent-hover) !important;
}

/* ── Formularios ── */
.form-control:focus, .form-select:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 .2rem rgba(56,178,168,.2) !important;
}

/* ── Login ── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--sidebar-bg);
  padding: 1rem;
}
.login-box {
  background: white;
  border-radius: 16px;
  padding: 2.5rem;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.login-logo {
  text-align: center;
  margin-bottom: .15rem;
}
.login-sub {
  text-align: center;
  color: #94a3b8;
  font-size: .85rem;
  margin-bottom: 2rem;
}

/* ── Badges de rol ── */
.role-superadmin { background: var(--accent-light); color: var(--accent-hover); }
.role-admin      { background: #dbeafe; color: #1e40af; }
.role-cliente    { background: #f1f5f9; color: #475569; }

/* ── Badges de turno ── */
.badge-disponible { background: var(--accent); color: white; }
.badge-reservado  { background: #1c3535; color: white; }

/* ── Tabla turnos ── */
.table-reservado td { background: #f3f9f9; }
.dia-semana { display:inline-block; min-width:2.5rem; color:var(--accent-hover); font-size:.8rem; }

/* ── Stats ── */
.stat-sub { font-size: .72rem; color: #94a3b8; margin-top: .1rem; }
.stat-card-link:hover { box-shadow: 0 4px 12px rgba(56,178,168,.2); transform: translateY(-1px); transition: all .15s; }

/* ── Cards de actividad (panel cliente) ── */
.actividad-card {
  border-radius: 14px;
  transition: box-shadow .15s, transform .15s;
  cursor: pointer;
}
.actividad-card:hover {
  box-shadow: 0 6px 18px rgba(28,53,53,.12);
  transform: translateY(-2px);
}
.actividad-icon {
  font-size: 2rem;
  line-height: 1;
}

/* ── Responsive: mobile sidebar como drawer ── */
@media (max-width: 767.98px) {
  .topbar        { display: flex; }
  .sidebar-overlay { display: block; }

  .sidebar {
    transform: translateX(-100%);
    top: 0;
  }
  .sidebar.open { transform: translateX(0); }

  .main-content {
    margin-left: 0;
    padding: calc(var(--topbar-h) + 1.25rem) 1rem 2rem;
  }

  .page-header h1 { font-size: 1.2rem; }

  /* stat cards en 2 columnas en mobile */
  .stat-card .value { font-size: 1.6rem; }
}
