* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  background: #f3f6fb;
  color: #1f2937;
}

.app {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 250px;
  background: #0f172a;
  color: white;
  padding: 28px 22px;
  position: fixed;
  height: 100vh;
}

.sidebar h2 {
  margin: 0;
  font-size: 28px;
}

.sidebar p {
  color: #94a3b8;
  margin-bottom: 35px;
}

.sidebar nav a {
  display: block;
  color: #cbd5e1;
  text-decoration: none;
  padding: 13px 15px;
  border-radius: 12px;
  margin-bottom: 8px;
}

.sidebar nav a:hover {
  background: #1e293b;
  color: white;
}

.content {
  margin-left: 250px;
  width: calc(100% - 250px);
  padding: 30px;
}

.topbar {
  background: linear-gradient(135deg, #1e40af, #2563eb);
  color: white;
  padding: 28px;
  border-radius: 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  box-shadow: 0 12px 30px rgba(37, 99, 235, .25);
}

.topbar h1 {
  margin: 0;
  font-size: 34px;
}

.topbar p {
  margin: 6px 0 0;
  color: #dbeafe;
}

.dashboard {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 18px;
  margin-bottom: 25px;
}

.stat {
  background: white;
  padding: 22px;
  border-radius: 20px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .07);
  border: 1px solid #e5e7eb;
}

.stat span {
  font-size: 26px;
}

.stat small {
  display: block;
  color: #64748b;
  margin-top: 10px;
}

.stat strong {
  display: block;
  font-size: 30px;
  margin-top: 8px;
}

.stat.success {
  border-left: 6px solid #16a34a;
}

.stat.danger {
  border-left: 6px solid #dc2626;
}

.stat.money {
  border-left: 6px solid #ca8a04;
}

.panel-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
  margin-bottom: 22px;
}

.card {
  background: white;
  padding: 24px;
  border-radius: 20px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .07);
  border: 1px solid #e5e7eb;
  margin-bottom: 22px;
}

.card h2 {
  margin-top: 0;
  font-size: 21px;
  color: #111827;
}

label {
  display: block;
  font-weight: 600;
  margin: 14px 0 6px;
  color: #374151;
}

input,
select {
  width: 100%;
  padding: 13px 14px;
  border-radius: 12px;
  border: 1px solid #d1d5db;
  outline: none;
  font-size: 15px;
  background: #f9fafb;
}

input:focus,
select:focus {
  border-color: #2563eb;
  background: white;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .12);
}

button {
  border: none;
  background: #2563eb;
  color: white;
  padding: 12px 18px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 700;
  margin-top: 15px;
  transition: .2s;
}

button:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
}

.inline {
  display: flex;
  gap: 10px;
}

.inline button {
  margin-top: 0;
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.actions button {
  margin-top: 0;
}

#espacios {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.espacio {
  padding: 20px 10px;
  border-radius: 16px;
  text-align: center;
  font-weight: 800;
  cursor: pointer;
  transition: .2s;
}

.espacio:hover {
  transform: scale(1.05);
}

.free,
.libre {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #86efac;
}

.occupied,
.ocupado {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 14px;
}

th {
  background: #f1f5f9;
  color: #475569;
  text-align: left;
  padding: 13px;
  font-size: 14px;
}

td {
  padding: 13px;
  border-bottom: 1px solid #e5e7eb;
}

tr:hover td {
  background: #f8fafc;
}

.ticket-container {
  margin-bottom: 20px;
}

.corte-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 15px;
}

.btn-danger {
  background: #dc2626;
  width: 100%;
}

.btn-danger:hover {
  background: #b91c1c;
}

.btn-dark-danger {
  background: #7f1d1d;
  width: 100%;
}

.btn-dark-danger:hover {
  background: #450a0a;
}

.danger-card {
  border-left: 6px solid #dc2626;
}

hr {
  border: none;
  border-top: 1px solid #e5e7eb;
  margin: 22px 0;
}

@media (max-width: 1000px) {
  .sidebar {
    position: relative;
    width: 100%;
    height: auto;
  }

  .app {
    display: block;
  }

  .content {
    margin-left: 0;
    width: 100%;
  }

  .dashboard,
  .panel-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    display: block;
  }
}
#resultadoSalida {
  display: none !important;
}
/* MAPA DE ESPACIOS PROFESIONAL */

#espacios {
  background: #0f172a;
  padding: 25px;
  border-radius: 22px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(115px, 1fr));
  gap: 18px;
  margin-top: 20px;
  border: 4px solid #1e293b;
}

.space {
  min-height: 105px;
  border-radius: 18px;
  padding: 14px 10px;
  text-align: center;
  font-weight: 800;
  cursor: pointer;
  position: relative;
  transition: .25s;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.45),
              0 10px 20px rgba(0,0,0,.25);
}

.space::before {
  content: "P";
  position: absolute;
  top: 8px;
  right: 10px;
  font-size: 13px;
  background: rgba(255,255,255,.75);
  padding: 3px 7px;
  border-radius: 999px;
}

.space:hover {
  transform: translateY(-5px) scale(1.04);
}

.space.free {
  background: linear-gradient(135deg, #dcfce7, #86efac);
  color: #14532d;
  border: 3px solid #22c55e;
}

.space.occupied {
  background: linear-gradient(135deg, #fee2e2, #fca5a5);
  color: #7f1d1d;
  border: 3px solid #ef4444;
}

.space.free::after {
  content: "DISPONIBLE";
  display: block;
  margin-top: 8px;
  font-size: 11px;
  color: #166534;
}

.space.occupied::after {
  content: "OCUPADO";
  display: block;
  margin-top: 8px;
  font-size: 11px;
  color: #991b1b;
}

.space strong {
  display: block;
  font-size: 23px;
  margin-bottom: 6px;
}

.space small {
  display: block;
  font-size: 12px;
  margin-top: 3px;
}

.space-highlight {
  border: 4px solid #facc15 !important;
  transform: scale(1.08);
  box-shadow: 0 0 25px #facc15;
}
.settings-panel {
  display: none;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.settings-panel.show {
  display: grid;
}

.settings-box {
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  padding: 20px;
  border-radius: 16px;
}

.settings-box h3 {
  margin-top: 0;
}

.danger-settings {
  border-left: 6px solid #dc2626;
}

.btn-dark-danger {
  background: #7f1d1d;
}

.btn-dark-danger:hover {
  background: #450a0a;
}
.login-screen {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #0f172a, #2563eb);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 99999;
}

.login-box {
  width: 360px;
  background: white;
  padding: 35px;
  border-radius: 22px;
  box-shadow: 0 20px 50px rgba(0,0,0,.35);
  text-align: center;
}

.login-box h1 {
  margin: 0;
}

.login-box p {
  color: #64748b;
  margin-bottom: 25px;
}

.login-box input {
  margin-bottom: 14px;
}

.login-box button {
  width: 100%;
}