:root {
  --ink: #17212f;
  --muted: #677287;
  --line: #dbe3ef;
  --surface: #ffffff;
  --page: #f4f7fb;
  --green: #12a150;
  --red: #dc3545;
  --blue: #0d6efd;
  --amber: #f2a900;
  --cyan: #0ea5e9;
  --violet: #7c3aed;
}

* {
  letter-spacing: 0;
}

body {
  background: linear-gradient(180deg, #f7fbff 0%, #eef4fb 42%, #f5f7fb 100%);
  color: var(--ink);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app-navbar {
  background: linear-gradient(90deg, #081526 0%, #10213b 58%, #132b4e 100%);
  box-shadow: 0 10px 30px rgba(16, 25, 40, .15);
}

.navbar-brand,
.app-navbar .nav-link,
.user-pill {
  color: #fff;
}

.app-navbar .nav-link {
  border-radius: 8px;
  color: rgba(255,255,255,.78);
  display: flex;
  gap: .45rem;
  align-items: center;
}

.app-navbar .nav-link.active,
.app-navbar .nav-link:hover {
  background: rgba(255,255,255,.12);
  color: #fff;
}

.monthly-alert-trigger {
  align-items: center;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 8px;
  color: #fff;
  display: inline-flex;
  font-weight: 700;
  gap: 7px;
  min-height: 38px;
  padding: 7px 11px;
  position: relative;
}

.monthly-alert-trigger:hover {
  background: rgba(255,255,255,.16);
}

.monthly-alert-count {
  align-items: center;
  background: var(--red);
  border: 2px solid #0b1729;
  border-radius: 999px;
  display: inline-flex;
  font-size: .72rem;
  font-weight: 800;
  justify-content: center;
  line-height: 1;
  min-width: 22px;
  padding: 3px 6px;
  position: absolute;
  right: -8px;
  top: -8px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: linear-gradient(135deg, #2f80ed, #0ea5e9);
  box-shadow: 0 10px 24px rgba(47, 128, 237, .28);
}

.app-toggler {
  border-color: rgba(255,255,255,.38);
}

.app-toggler:focus {
  box-shadow: 0 0 0 .2rem rgba(255,255,255,.18);
}

.app-toggler .navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.95%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2.5' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.app-main {
  min-height: calc(100vh - 62px);
}

.auth-main {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(rgba(8, 19, 36, .75), rgba(8, 19, 36, .75)),
    url("https://images.unsplash.com/photo-1558981285-6f0c94958bb6?auto=format&fit=crop&w=1800&q=80") center/cover;
}

.auth-card {
  width: min(100%, 430px);
  background: #fff;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.2);
  box-shadow: 0 28px 70px rgba(0,0,0,.28);
  padding: 28px;
}

.page-shell {
  padding: 24px;
}

.page-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.metric {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  height: 100%;
  box-shadow: 0 12px 30px rgba(15, 23, 42, .06);
}

.metric .icon {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #eef4ff;
  color: #175cd3;
}

.metric-value {
  font-size: 1.7rem;
  font-weight: 800;
}

.stats-metrics .stats-metric,
.stats-metrics .metric {
  align-items: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 210px;
  padding: 28px 18px;
  text-align: center;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .1);
}

.stats-metrics .metric .icon {
  width: 76px;
  height: 76px;
  border-radius: 12px;
  color: #fff;
  font-size: 2rem;
}

.stats-metrics .metric:nth-child(1) .icon,
.stats-metrics .icon-blue {
  background: #0d6efd;
}

.stats-metrics > div:nth-child(2) .icon,
.stats-metrics .icon-green {
  background: #1f8f3a;
}

.stats-metrics > div:nth-child(3) .icon,
.stats-metrics .icon-cyan {
  background: #169baa;
}

.stats-metrics > div:nth-child(4) .icon,
.stats-metrics .icon-amber {
  background: #f2b705;
}

.stats-metrics .metric-value {
  color: #1b2430;
  font-size: clamp(1.9rem, 4vw, 2.35rem);
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.stats-metrics .text-secondary {
  font-size: 1.02rem;
  font-weight: 600;
}

.floor-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.cubicle-grid {
  display: grid;
  grid-template-columns: repeat(10, minmax(46px, 1fr));
  gap: 8px;
}

.cubicle {
  min-height: 56px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  font-weight: 800;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  transition: transform .15s ease, box-shadow .15s ease;
}

.cubicle:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(15, 23, 42, .16);
}

.cubicle.disponible {
  background: var(--green);
}

.cubicle.ocupado {
  background: var(--red);
}

.cubicle.mensualidad {
  background: var(--blue);
}

.cubicle.semanal {
  background: #7c3aed;
}

.cubicle small {
  font-size: .68rem;
  font-weight: 700;
  opacity: .9;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.dot-free { background: var(--green); }
.dot-busy { background: var(--red); }
.dot-month { background: var(--blue); }
.dot-week { background: #7c3aed; }

.data-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(15, 23, 42, .05);
}

.modal-content {
  border: 0;
  border-radius: 10px;
  box-shadow: 0 28px 80px rgba(15, 23, 42, .26);
}

.modal-header {
  background: linear-gradient(90deg, #f8fbff, #eef6ff);
  border-bottom-color: #dbeafe;
}

.modal-footer {
  background: #f8fafc;
}

.operator-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.filter-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 18px;
  box-shadow: 0 10px 26px rgba(15, 23, 42, .05);
}

.monthly-alert-list {
  display: grid;
  gap: 10px;
  text-align: left;
}

.monthly-alert-item {
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  border-radius: 8px;
  padding: 12px;
  text-align: left;
  width: 100%;
}

.monthly-alert-item:hover {
  border-color: #93c5fd;
  box-shadow: 0 8px 18px rgba(15, 23, 42, .08);
}

.monthly-alert-item-expired {
  background: #fff1f2;
  border-color: #fecdd3;
}

.monthly-alert-item-today {
  background: #fff7ed;
  border-color: #fed7aa;
}

.monthly-alert-item span {
  color: var(--muted);
  display: block;
  font-size: .92rem;
  margin-top: 3px;
}

.ticket-preview {
  margin: 0 auto;
  max-width: 360px;
  text-align: left;
}

.ticket-preview-title {
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 800;
  text-align: center;
  text-transform: uppercase;
}

.ticket-preview-subtitle {
  border-bottom: 1px dashed #cbd5e1;
  color: var(--muted);
  font-size: .92rem;
  margin: 4px 0 12px;
  padding-bottom: 9px;
  text-align: center;
}

.ticket-preview-box {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.ticket-preview-row {
  align-items: flex-start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 6px 0;
}

.ticket-preview-row + .ticket-preview-row {
  border-top: 1px solid #e2e8f0;
}

.ticket-preview-row span {
  color: var(--muted);
  font-weight: 700;
  white-space: nowrap;
}

.ticket-preview-row strong {
  color: var(--ink);
  overflow-wrap: anywhere;
  text-align: right;
}

.table thead th {
  color: var(--muted);
  font-size: .78rem;
  text-transform: uppercase;
}

.badge-soft {
  background: #eef4ff;
  color: #175cd3;
}

.btn-icon {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 992px) {
  .cubicle-grid {
    grid-template-columns: repeat(6, minmax(44px, 1fr));
  }
}

@media (max-width: 576px) {
  .page-shell {
    padding: 16px;
  }

  .page-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .cubicle-grid {
    grid-template-columns: repeat(5, minmax(42px, 1fr));
  }

  .cubicle {
    min-height: 50px;
  }
}
