body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f3f4f6;
  color: #111827;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.5rem;
  background: #111827;
  color: #f9fafb;
}

.topbar .brand {
  font-weight: 600;
  letter-spacing: 0.04em;
}

.topbar a {
  color: #e5e7eb;
  text-decoration: none;
  margin-left: 1rem;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-chip {
  opacity: 0.95;
}

.notif {
  position: relative;
}

.notif-btn {
  position: relative;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0.25rem;
  color: #f9fafb;
}

.notif-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 0.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.notif-dd {
  position: absolute;
  right: 0;
  top: 34px;
  width: 360px;
  max-width: 85vw;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.18);
  z-index: 999;
  overflow: hidden;
}

.notif-dd-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid #e5e7eb;
}

.notif-dd-body {
  max-height: 320px;
  overflow: auto;
}

.notif-item {
  display: block;
  padding: 10px 12px;
  border-bottom: 1px solid #f3f4f6;
  color: #111827;
  text-decoration: none;
}

.notif-item:hover {
  background: #f9fafb;
}

.notif-msg {
  font-size: 0.95rem;
}

.notif-time {
  margin-top: 2px;
  font-size: 0.75rem;
  color: #6b7280;
}

.small { font-size: 0.85rem; }

.layout {
  display: flex;
  min-height: calc(100vh - 48px);
}

.sidebar {
  width: 220px;
  background: #1f2933;
  color: #e5e7eb;
  padding: 1rem 0.5rem;
}

.sidebar ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar li {
  margin-bottom: 0.25rem;
}

.sidebar a {
  display: block;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  color: #e5e7eb;
  text-decoration: none;
  font-size: 0.95rem;
}

.sidebar li.active a,
.sidebar a:hover {
  background: #4b5563;
}

.content {
  flex: 1;
  padding: 1.5rem;
}

h1, h2, h3, h4 {
  margin-top: 0;
}

.card {
  background: #ffffff;
  border-radius: 0.75rem;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.card.subtle {
  background: #f9fafb;
  box-shadow: none;
}

.grid-2 {
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(0,1fr);
  gap: 1rem;
}

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

.kpi {
  text-align: center;
}

.kpi-value {
  font-size: 2rem;
  font-weight: 700;
}

form label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

form input[type="text"],
form input[type="password"],
form input[type="number"],
form input[type="date"],
form input[type="time"],
form select,
form textarea {
  width: 100%;
  padding: 0.4rem 0.5rem;
  margin-top: 0.2rem;
  border-radius: 0.5rem;
  border: 1px solid #d1d5db;
  font-size: 0.9rem;
  box-sizing: border-box;
}

form textarea {
  min-height: 60px;
}

button {
  margin-top: 0.5rem;
  padding: 0.4rem 0.75rem;
  border-radius: 9999px;
  border: none;
  background: #2563eb;
  color: #f9fafb;
  font-size: 0.9rem;
  cursor: pointer;
}

button.small {
  padding: 0.2rem 0.5rem;
  font-size: 0.75rem;
}

button.danger {
  background: #dc2626;
}

button:disabled {
  opacity: 0.5;
  cursor: default;
}

.flash-container {
  margin-bottom: 0.5rem;
}

.flash {
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
}

.flash.success {
  background: #ecfdf5;
  color: #166534;
}

.flash.error {
  background: #fef2f2;
  color: #b91c1c;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

table th, table td {
  border-bottom: 1px solid #e5e7eb;
  padding: 0.35rem 0.5rem;
  text-align: left;
}

table thead {
  background: #f9fafb;
}

.inline-form {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.inline-form input[type="text"] {
  width: auto;
}

.tag-list {
  list-style: none;
  padding: 0;
  margin: 0 0 0.25rem 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.tag-list li {
  background: #e5e7eb;
  border-radius: 9999px;
  padding: 0.1rem 0.5rem;
}

.package-block {
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  padding: 0.75rem;
  margin-bottom: 0.75rem;
}

.package-header {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.package-header-right {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.hint {
  font-size: 0.8rem;
  color: #6b7280;
}

.schedule-grid {
  overflow-x: auto;
}

.cell-bookings {
  vertical-align: top;
  min-width: 200px;
}

.cell-existing {
  margin-bottom: 0.25rem;
}

.pill {
  background: #eff6ff;
  border-radius: 9999px;
  padding: 0.2rem 0.4rem;
  margin-bottom: 0.1rem;
  font-size: 0.75rem;
}

.pill.bonus {
  background: #fef3c7;
}

.mini-form label {
  display: block;
  margin-bottom: 0.25rem;
}

.kpi-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.kpi-mini {
  background: #f9fafb;
  border-radius: 0.75rem;
  padding: 0.5rem 0.75rem;
  min-width: 140px;
}

.bar-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.3rem 0;
}

.bar-label {
  width: 70px;
  font-size: 0.85rem;
}

.bar-bg {
  flex: 1;
  background: #e5e7eb;
  border-radius: 9999px;
  overflow: hidden;
  height: 10px;
}

.bar-fill {
  height: 100%;
}

.bar-fill.booked {
  background: #3b82f6;
}

.bar-fill.aired {
  background: #10b981;
}


.sidebar-toggle {
  background: transparent;
  border: none;
  color: #e5e7eb;
  font-size: 1.3rem;
  cursor: pointer;
  margin-right: 1rem;
}

body.sidebar-collapsed .sidebar {
  width: 0;
  padding: 0;
  margin: 0;
  overflow: hidden;
}

body.sidebar-collapsed .content {
  padding-left: 1.5rem;
}

@media (max-width: 900px) {
  body.sidebar-collapsed .sidebar {
    position: absolute;
    left: 0;
    top: 48px;
    width: 220px;
    padding: 1rem 0.5rem;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    background: #1f2933;
  }
}

/* Toast */
.toast{position:fixed;bottom:18px;right:18px;padding:10px 14px;border-radius:10px;background:#222;color:#fff;box-shadow:0 6px 18px rgba(0,0,0,.25);max-width:420px;z-index:9999;font-size:14px}
.toast.ok{background:#1f7a3b}
.toast.err{background:#b3261e}



label.inline{display:flex; gap:8px; align-items:center; font-weight:500;}


.badge{
  display:inline-block;
  min-width:18px;
  padding:2px 6px;
  border-radius:999px;
  background:#ef4444;
  color:white;
  font-size:12px;
  line-height:1;
  margin-left:6px;
  text-align:center;
}

/* v35: SweetAlert2 modals no centrados (mejor apariencia) */
.swal2-container {
  align-items: flex-start !important;
  padding-top: 1rem !important;
}
.swal2-popup {
  margin-top: 1rem !important;
}
