.form-card {
  max-width: 600px;
  width: 100%;
  background-color: #f8f9fa;
  border-radius: 8px;
}
.form-card-bg {
  background-color: #f8f9fa;
}
/* === Layout general === */
.sidebar { 
  width: 260px; 
  min-height: 100vh; 
  transition: transform 0.3s ease; 
  background-color: #8a0000;
  color: #fff;
  padding-top: 1rem;
}
.logo-img { 
  height: 32px; 
  max-width: 120px; 
  object-fit: contain; 
}
@media (max-width: 576px) {
  .logo-img { height: 28px; max-width: 100px; }
}

/* === Links sidebar === */
.sidebar .nav-link { 
  padding: 0.5rem 1rem; 
  opacity: .95; 
  display: block; 
  width: 100%; 
  font-weight: 500;
  color: #fff;
  border-radius: 6px;
}
.sidebar .nav-link:hover { 
  opacity: 1; 
  background-color: rgba(255,255,255,0.1);
  text-decoration: none;
}

/* === Cards (dashboard) === */
.card-kpi {
  border: none;
  border-radius: 12px;
  padding: 1.2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  background-color: #ffffff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}
.card-kpi .icon { font-size: 2.2rem; color: #dc3545; }
.card-kpi .value { font-size: 1.8rem; font-weight: 600; color: #212529; }
.card-kpi .label { font-size: 0.95rem; color: #6c757d; }
.hover-card:hover { background-color: #f8f9fa; transform: scale(1.02); }
.hover-kpi:hover { transform: scale(1.04); box-shadow: 0 6px 16px rgba(0,0,0,0.12); background-color: #f8f9fa; }

/* === Secciones del dashboard === */
.card-header {
  background-color: #f1f3f5;
  border-bottom: 1px solid #dee2e6;
  font-weight: 600;
  font-size: 1.1rem;
  color: #343a40;
}
.card-body {
  background-color: #ffffff;
}

/* === Ganancia mensual === */
.ganancia-box {
  font-size: 2.5em;
  font-weight: bold;
  color: #212529;
  padding: 0.5rem 0;
}

/* === Barra de progreso === */
.progress {
  height: 20px;
  border-radius: 10px;
  background-color: #e9ecef;
}
.progress-bar {
  font-weight: 500;
  font-size: 0.9rem;
  line-height: 20px;
  border-radius: 10px;
}

/* === Dark mode === */
:root[data-theme="dark"] body { background: #1f1f1f; color: #eee; }
:root[data-theme="dark"] .navbar { background: #2a2a2a !important; }
:root[data-theme="dark"] .card-kpi { background: #2a2a2a; border-color: #3a3a3a; }
:root[data-theme="dark"] .sidebar { background: #8a0000 !important; }

/* === Sidebar responsive === */
@media (max-width: 991px) {
  #sidebar {
    position: fixed; top: 0; left: 0;
    height: 100vh; width: 260px;
    z-index: 1050; transform: translateX(-100%);
  }
  #sidebar.active { transform: translateX(0); }
}
@media (min-width: 992px) {
  #sidebar { transform: none !important; position: static; }
}

/* === Overlay para móviles === */
#sidebar-overlay {
  display: none; position: fixed; top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.4); z-index: 1040;
}
@media (max-width: 991px) {
  #sidebar.active + #sidebar-overlay { display: block; }
}

/* === Navbar ajustes móviles === */
@media (max-width: 576px) {
  .navbar .d-flex, .navbar form { margin-top: 0.5rem; }
}
@media (max-width: 991px) {
  #darkModeToggleMobile { display: block; width: 100%; }
}

/* === Animación logo === */
.logo-anim:hover { animation: bounce 0.6s; }
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  30% { transform: translateY(-5px); }
  60% { transform: translateY(3px); }
}

/* === Colapsables del sidebar === */
#sidebar .collapsing {
  height: 0;
  overflow: hidden;
  transition: height 0.3s ease;
  will-change: height;
}
#sidebar .collapse { overflow: hidden; }
#sidebar .collapse.show { height: auto; }
#sidebar .collapse > .nav {
  display: flex; flex-direction: column; margin: 0; padding: 0;
}
#sidebar .collapse > .nav .nav-item { width: 100%; }

/* Chevron rotatorio */
.sidebar-toggle-icon { transition: transform 0.2s ease; }
.sidebar-toggle[aria-expanded="true"] .sidebar-toggle-icon { transform: rotate(180deg); }

/* === Citas según estado === */
.cita-row { cursor: pointer; transition: background-color 0.2s ease; }
.cita-row:hover td { background-color: #f1f1f1 !important; }

/* Anular el box-shadow de Bootstrap para permitir colores personalizados */
.table-hover tbody tr.cita-pendiente > td,
.table-hover tbody tr.cita-completada > td,
.table-hover tbody tr.cita-hoy > td,
.table-hover tbody tr.cita-hoy.cita-pendiente > td {
  box-shadow: none !important;
}

/* Colores por estado base */
.table-hover tbody tr.cita-completada > td {
  background-color: #d4edda !important;
  color: #155724;
}
.table-hover tbody tr.cita-pendiente > td {
  background-color: #fff8e1 !important;
  color: #856404;
}
.table-hover tbody tr.cita-hoy.cita-pendiente > td {
  background-color: #e0f0ff !important;
  color: #004085;
}

/* Hovers más oscuros por estado */
.table-hover tbody tr.cita-completada:hover > td {
  background-color: #c3e6cb !important;
}
.table-hover tbody tr.cita-pendiente:hover > td {
  background-color: #ffe08a !important;
}
.table-hover tbody tr.cita-hoy.cita-pendiente:hover > td {
  background-color: #b8daff !important;
}

:root {
  --app-bg: #f5f7fb;
  --surface-1: #ffffff;
  --surface-2: #f8fafc;
  --border-soft: #e6eaf0;
  --text-strong: #0f172a;
  --text-muted: #5b667a;
  --brand: #dc3545;
  --brand-strong: #be2433;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-soft: 0 8px 24px rgba(15, 23, 42, 0.08);
}

html, body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--text-strong);
  background: var(--app-bg);
}

main {
  background: linear-gradient(180deg, #f9fbff 0%, var(--app-bg) 40%);
  min-height: 100vh;
}

.container,
.container-fluid {
  max-width: 1400px;
}

.navbar {
  background: rgba(255, 255, 255, 0.92) !important;
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-soft) !important;
}

.navbar .nav-link {
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  font-weight: 600;
}

.navbar .nav-link:hover {
  background: #eef2f8;
}

.sidebar {
  background: linear-gradient(180deg, #e63946 0%, #cf2d3c 38%, #bc2532 100%) !important;
  border-right: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 6px 0 20px rgba(0, 0, 0, 0.16);
}

.sidebar .sidebar-section a {
  font-weight: 700;
  letter-spacing: 0.02em;
}

.sidebar .nav-link {
  border-radius: 10px;
  margin: 2px 0;
  font-weight: 600;
}

.sidebar .nav-link:hover,
.sidebar .nav-link:focus {
  background: rgba(255, 255, 255, 0.16);
}

.sidebar .nav-link.active {
  background: rgba(255, 255, 255, 0.22);
}

.card,
.form-card,
.form-card-bg {
  background: var(--surface-1);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-soft);
}

.card-header,
.table thead th {
  background: var(--surface-2) !important;
  border-bottom-color: var(--border-soft) !important;
}

.card-title,
h1, h2, h3, h4, h5, h6 {
  letter-spacing: -0.01em;
  font-weight: 700;
  color: var(--text-strong);
}

.text-muted,
.small,
.form-text {
  color: var(--text-muted) !important;
}

.btn {
  border-radius: 10px;
  font-weight: 600;
  border-width: 1px;
}

.btn-primary,
.btn-danger {
  background: var(--brand);
  border-color: var(--brand);
}

.btn-primary:hover,
.btn-danger:hover {
  background: var(--brand-strong);
  border-color: var(--brand-strong);
}

.btn-outline-secondary,
.btn-outline-primary,
.btn-outline-danger {
  border-color: #d6dce6;
}

.form-control,
.form-select,
.input-group-text {
  border-radius: 10px;
  border-color: #d8dee8;
  background: #fff;
}

.form-control:focus,
.form-select:focus {
  border-color: #f0a0a8;
  box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.14);
}

.table {
  --bs-table-bg: transparent;
  --bs-table-striped-bg: #f9fbff;
}

.table > :not(caption) > * > * {
  border-bottom-color: var(--border-soft);
}

.table-hover tbody tr:hover > * {
  background-color: #f7faff !important;
}

.alert {
  border-radius: 12px;
  border: 1px solid transparent;
}

footer {
  background: transparent;
  border-top-color: var(--border-soft) !important;
}

:root[data-theme="dark"] body,
:root[data-theme="dark"] main {
  background: #111827;
  color: #e5e7eb;
}

:root[data-theme="dark"] .navbar,
:root[data-theme="dark"] .card,
:root[data-theme="dark"] .form-card,
:root[data-theme="dark"] .form-card-bg {
  background: #1f2937 !important;
  border-color: #374151 !important;
  color: #e5e7eb;
}

:root[data-theme="dark"] .table thead th,
:root[data-theme="dark"] .card-header {
  background: #111827 !important;
  border-bottom-color: #334155 !important;
}

:root[data-theme="dark"] .form-control,
:root[data-theme="dark"] .form-select,
:root[data-theme="dark"] .input-group-text {
  background: #111827;
  color: #e5e7eb;
  border-color: #334155;
}

.page-shell {
  animation: fadeUp 0.22s ease-out;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.page-shell > .d-flex:first-child h2,
.page-shell > .d-flex:first-child h1 {
  font-size: clamp(1.5rem, 2.2vw, 2rem);
  font-weight: 800;
}

.page-shell .btn-group .btn {
  border-radius: 999px !important;
  padding-inline: 0.8rem;
}

.page-shell .table thead th {
  font-size: 0.79rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.page-shell .badge {
  border-radius: 999px;
  font-weight: 600;
}

.media-thumb-card {
  width: 190px;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  padding: 0.5rem;
  background: var(--surface-1);
}

.media-thumb-image {
  width: 160px;
  height: auto;
}

.cliente-map-canvas {
  height: 420px;
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--border-soft);
}
