
/* RESET */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Poppins", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

html, body {
  min-height: 100%;
}

/* BODY & LAYOUT */
body {
  background: radial-gradient(circle at top, #ff8a50 0, #1b1b1b 35%, #050505 100%);
  color: #fdfdfd;
  display: flex;
  flex-direction: column;
}

.page-container {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

/* HEADER */
header {
  margin-top: 10px;
  margin-bottom: 10px;
  padding: 18px 16px;
  text-align: center;
  border-radius: 24px;
  background: radial-gradient(circle at top left, rgba(255, 138, 101, 0.35), rgba(10, 10, 10, 0.9));
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(16px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.6);
  animation: headerIn 0.6s ease-out;
  position: relative;
}

header h1 {
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  letter-spacing: 0.04em;
}

header p {
  font-size: 0.95rem;
  opacity: 0.85;
  margin-top: 4px;
}

.user-info {
  margin-top: 8px;
  font-size: 0.8rem;
  opacity: 0.9;
  color: #ffe0b2;
}

/* BUTTONS */
.btn {
  display: block;
  width: 92%;
  max-width: 420px;
  margin: 14px auto;
  padding: 14px 20px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, #ff8a50, #ff5722);
  color: #fff;
  text-align: center;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.55);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    opacity 0.18s ease,
    background 0.18s ease;
}

.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top left, rgba(255, 255, 255, 0.35), transparent 55%);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.btn:hover {
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.7);
  opacity: 0.97;
}

.btn:hover::after {
  opacity: 0.35;
}

.btn:active {
  transform: translateY(1px) scale(0.99);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.7);
}

/* GRID */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
  padding: 18px 16px 26px;
}

/* CARDS */
.card {
  position: relative;
  background: radial-gradient(circle at top left, rgba(255, 255, 255, 0.06), rgba(10, 10, 10, 0.98));
  border-radius: 18px;
  padding: 16px 14px 18px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(18px);
  overflow: hidden;
  transform-origin: center bottom;
  animation: cardIn 0.4s ease-out;
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    border-color 0.16s ease;
}

.card:hover {
  transform: translateY(-3px) scale(1.01);
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.9);
  border-color: rgba(255, 204, 128, 0.4);
}

.card h3 {
  margin-bottom: 8px;
  font-size: 1.1rem;
}

.card p {
  color: #ffb39b;
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.card strong {
  color: #ffe082;
}

.card::before {
  content: "";
  position: absolute;
  width: 140%;
  height: 140%;
  background: radial-gradient(circle at 10% -10%, rgba(255, 255, 255, 0.12), transparent 60%);
  opacity: 0.5;
  pointer-events: none;
  top: -30%;
  left: -20%;
}

/* INPUTS & SELECTS */
.card input,
.card select {
  width: 92%;
  margin: 6px auto;
  padding: 9px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(10, 10, 10, 0.85);
  color: #f5f5f5;
  font-size: 0.9rem;
  outline: none;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.8);
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
}

.card input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.card input:focus,
.card select:focus {
  border-color: #ff8a50;
  box-shadow: 0 0 0 1px rgba(255, 138, 80, 0.7);
  background: rgba(0, 0, 0, 0.9);
}

/* BUTTONS inside card */
.card button {
  width: 92%;
  margin: 6px auto;
  padding: 9px 10px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, #ff8a50, #ff5722);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.75);
  transition:
    transform 0.14s ease,
    box-shadow 0.14s ease,
    background 0.14s ease;
}

.card button:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.9);
}

.card button:active {
  transform: translateY(1px);
  box-shadow: 0 7px 14px rgba(0, 0, 0, 0.85);
}

/* STATES */
.mesa-ocupada {
  border-color: #4caf50;
  box-shadow: 0 0 18px rgba(76, 175, 80, 0.4);
}

.low-stock {
  border-color: #ffeb3b;
  box-shadow: 0 0 18px rgba(255, 235, 59, 0.3);
}

/* TOTAL */
.total {
  text-align: center;
  font-size: 1.8rem;
  color: #ffe082;
  margin: 18px;
}

/* SECTION TITLES */
.section-title {
  text-align: center;
  margin-top: 18px;
  margin-bottom: 4px;
  font-size: 1.3rem;
  font-weight: 600;
}

/* TABLES */
.tabla-reportes {
  width: 100%;
  border-collapse: collapse;
  margin: 10px auto 26px;
  max-width: 1000px;
  background: rgba(9, 9, 9, 0.9);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.85);
}

.tabla-reportes th,
.tabla-reportes td {
  padding: 9px 10px;
  font-size: 0.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.tabla-reportes th {
  background: linear-gradient(135deg, #1f1f1f, #262626);
  font-weight: 600;
}

.tabla-reportes tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.02);
}

/* SPECIAL ELEMENTS */
.qr-image {
  width: 190px;
  height: 190px;
  object-fit: contain;
  margin: 8px auto 6px;
  display: block;
}

.mesa-label {
  text-align: center;
  margin-top: 10px;
  font-size: 1.3rem;
}

/* Pedido section */
.pedido-section {
  padding: 20px;
}

/* THEME TOGGLE */
.theme-toggle {
  position: absolute;
  right: 16px;
  top: 16px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(0, 0, 0, 0.45);
  color: #fff3e0;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition:
    background 0.18s ease,
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease;
}

.theme-toggle:hover {
  background: rgba(0, 0, 0, 0.75);
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.85);
}

.theme-toggle:active {
  transform: translateY(1px) scale(0.98);
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.8);
}

/* LIGHT THEME */
body[data-theme="light"] {
  background: radial-gradient(circle at top, #ffe0b2 0, #fafafa 45%, #e0e0e0 100%);
  color: #191919;
}

body[data-theme="light"] header {
  background: radial-gradient(circle at top left, rgba(255, 243, 224, 0.9), rgba(255, 224, 178, 0.9));
  color: #2b2b2b;
  border-color: rgba(0, 0, 0, 0.05);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.25);
}

body[data-theme="light"] .user-info {
  color: #c75b12;
}

body[data-theme="light"] .card {
  background: radial-gradient(circle at top left, rgba(255, 255, 255, 0.96), rgba(245, 245, 245, 0.96));
  color: #333;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
  border-color: rgba(0, 0, 0, 0.05);
}

body[data-theme="light"] .card p {
  color: #ff7043;
}

body[data-theme="light"] .card strong {
  color: #ff9800;
}

body[data-theme="light"] .card::before {
  background: radial-gradient(circle at 10% -10%, rgba(255, 255, 255, 0.8), transparent 55%);
  opacity: 0.7;
}

body[data-theme="light"] .card input,
body[data-theme="light"] .card select {
  background: #ffffff;
  color: #333;
  border-color: rgba(0, 0, 0, 0.12);
}

body[data-theme="light"] .card input::placeholder {
  color: rgba(0, 0, 0, 0.4);
}

body[data-theme="light"] .card input:focus,
body[data-theme="light"] .card select:focus {
  border-color: #ff9800;
  box-shadow: 0 0 0 1px rgba(255, 152, 0, 0.6);
}

body[data-theme="light"] .card button {
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.2);
}

body[data-theme="light"] .btn {
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
}

body[data-theme="light"] .tabla-reportes {
  background: #ffffff;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.18);
}

body[data-theme="light"] .tabla-reportes th {
  background: linear-gradient(135deg, #f5f5f5, #eeeeee);
}

body[data-theme="light"] .tabla-reportes tr:nth-child(even) td {
  background: #fafafa;
}

body[data-theme="light"] .mesa-ocupada {
  border-color: #2e7d32;
  box-shadow: 0 0 12px rgba(46, 125, 50, 0.35);
}

body[data-theme="light"] .low-stock {
  border-color: #fdd835;
  box-shadow: 0 0 12px rgba(253, 216, 53, 0.4);
}

body[data-theme="light"] .total {
  color: #e65100;
}

body[data-theme="light"] .theme-toggle {
  background: rgba(255, 255, 255, 0.8);
  color: #4e342e;
  border-color: rgba(0, 0, 0, 0.08);
}

/* ANIMATIONS */
@keyframes cardIn {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes headerIn {
  from { opacity: 0; transform: translateY(-10px) scale(0.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* RESPONSIVE */
@media (max-width: 768px) {
  header {
    margin-top: 8px;
    border-radius: 0 0 24px 24px;
  }
  .products-grid {
    grid-template-columns: 1fr;
    padding-inline: 12px;
  }
  .btn {
    width: 94%;
  }
}

@media (max-width: 480px) {
  header h1 {
    font-size: 1.5rem;
  }
  header p {
    font-size: 0.85rem;
  }
  .card {
    padding-inline: 12px;
  }
  .card h3 {
    font-size: 1rem;
  }
  .btn {
    font-size: 0.95rem;
    padding-block: 12px;
  }
}
