/* =====================
   Custom Properties
   ===================== */
:root {
  --brand-amber: #F0A500;
  --brand-amber-light: #FFF3CC;
  --brand-amber-hover: #FFF8E6;
  --brand-dark: #1C1C1C;
  --navbar-height: 64px;
}

/* =====================
   Base
   ===================== */
body {
  background-color: #f4f5f7;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

.card {
  border: none;
}

.card.shadow-sm {
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.04) !important;
  border-radius: 0.5rem !important;
}

input[type="text"],
input[type="password"] {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid #ced4da;
  border-radius: 0.375rem;
}

.table thead th {
  background-color: #f0f2f5;
  font-size: 0.775rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6c757d;
  font-weight: 600;
}

/* =====================
   Navbar
   ===================== */
.navbar-puente {
  background-color: var(--brand-dark) !important;
  min-height: var(--navbar-height);
}

.navbar-logo {
  height: 38px;
  width: auto;
}

.nav-link-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.75);
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-size: 1rem;
}

.nav-link-btn:hover,
.nav-link-btn:focus {
  color: #fff;
  text-decoration: underline;
}

/* =====================
   Layout principal
   ===================== */
.app-wrapper {
  display: flex;
  min-height: calc(100vh - var(--navbar-height));
}

.app-main {
  flex: 1;
  min-width: 0;
  padding: 1.5rem 1.75rem;
}

/* =====================
   Sidebar
   ===================== */
.sidebar {
  width: 220px;
  min-width: 220px;
  background: #ffffff;
  border-right: 1px solid #dee2e6;
  min-height: calc(100vh - var(--navbar-height));
  position: sticky;
  top: var(--navbar-height);
  height: calc(100vh - var(--navbar-height));
  overflow-y: auto;
  flex-shrink: 0;
}

.sidebar-nav {
  padding: 1rem 0;
}

.sidebar-heading {
  display: block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: #adb5bd;
  padding: 0.75rem 1.1rem 0.3rem;
  font-weight: 700;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 1.1rem;
  color: #495057;
  text-decoration: none;
  font-size: 0.875rem;
  border-left: 3px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.sidebar-link:hover {
  background: var(--brand-amber-hover);
  color: #7A5000;
}

.sidebar-link.active {
  background: var(--brand-amber-light);
  color: #7A5000;
  border-left-color: var(--brand-amber);
  font-weight: 600;
}

.sidebar-link i:first-child {
  font-size: 1rem;
  width: 1.2rem;
  text-align: center;
  flex-shrink: 0;
}

/* Ocultar sidebar en mobile */
@media (max-width: 767.98px) {
  .sidebar {
    display: none;
  }
  .app-main {
    padding: 1rem;
    padding-bottom: calc(5rem + env(safe-area-inset-bottom));
  }
}

/* =====================
   Bottom Navigation (mobile)
   ===================== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #ffffff;
  border-top: 1px solid #e9ecef;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
  display: flex;
  z-index: 1050;
  padding-bottom: env(safe-area-inset-bottom);
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.25rem 0.55rem;
  color: #adb5bd;
  text-decoration: none;
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  gap: 0.2rem;
  position: relative;
  transition: color 0.15s;
  min-height: 56px;
}

.bottom-nav-item i {
  font-size: 1.4rem;
  line-height: 1;
  transition: transform 0.15s;
}

.bottom-nav-item span {
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.bottom-nav-item:active i {
  transform: scale(0.88);
}

.bottom-nav-item.active {
  color: var(--brand-amber);
}

.bottom-nav-item.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 20%;
  right: 20%;
  height: 3px;
  background: var(--brand-amber);
  border-radius: 0 0 3px 3px;
}

.bottom-nav-badge {
  position: absolute;
  top: 0.3rem;
  left: calc(50% + 0.45rem);
  background: #dc3545;
  color: #fff;
  border-radius: 999px;
  font-size: 0.55rem;
  font-weight: 700;
  padding: 0.1rem 0.28rem;
  min-width: 1rem;
  text-align: center;
  line-height: 1.3;
  border: 2px solid #fff;
}

/* =====================
   Empty states
   ===================== */
.empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: #6c757d;
}

.empty-state .empty-icon {
  font-size: 2.75rem;
  opacity: 0.35;
  display: block;
  margin-bottom: 0.75rem;
}

.empty-state p {
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
}

/* Fila con pago pendiente en tabla */
.table-row-pending {
  background-color: rgba(220, 53, 69, 0.05) !important;
}

/* =====================
   Calendar Styles
   ===================== */
.calendar-container {
  background: white;
  border-radius: 8px;
  overflow: hidden;
}

.calendar-header {
  background: var(--brand-amber);
  color: var(--brand-dark);
  padding: 1rem;
  text-align: center;
  font-size: 1.25rem;
  font-weight: 600;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: #dee2e6;
  border: 1px solid #dee2e6;
}

.calendar-weekday {
  background: #f8f9fa;
  padding: 0.5rem;
  text-align: center;
  font-weight: 600;
  font-size: 0.875rem;
  color: #6c757d;
}

.calendar-day {
  background: white;
  min-height: 100px;
  padding: 0.5rem;
  position: relative;
}

.calendar-day.empty {
  background: #f8f9fa;
}

.calendar-day-number {
  font-weight: 600;
  color: #495057;
  margin-bottom: 0.25rem;
}

.calendar-day.today .calendar-day-number {
  background: var(--brand-amber);
  color: var(--brand-dark);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
}

.calendar-class {
  font-size: 0.75rem;
  padding: 0.125rem 0.25rem;
  margin-bottom: 0.125rem;
  background: #FFF8E6;
  border-left: 3px solid var(--brand-amber);
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.2s;
}

.calendar-class:hover {
  background: var(--brand-amber-light);
  transform: translateX(2px);
}

.calendar-class-time {
  font-weight: 600;
  color: #7A5000;
}

.calendar-class-space {
  color: #6c757d;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Clases canceladas en calendario */
.calendar-class.cancelled {
  background: #f8d7da;
  border-left-color: #dc3545;
  opacity: 0.8;
  text-decoration: line-through;
}

.calendar-class.cancelled:hover {
  background: #f5c2c7;
}

.calendar-class.cancelled .calendar-class-time {
  color: #dc3545;
}

.calendar-class.cancelled .calendar-class-space {
  color: #842029;
}
