:root {
  color-scheme: light;
  font-family: "Inter", system-ui, sans-serif;
  background: #f6f7fb;
  color: #1d2230;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 24px;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
}

.page-header {
  margin-bottom: 24px;
}

.page-header h1 {
  margin: 0 0 8px;
}

.card {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  margin-bottom: 20px;
}

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

label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
}

input[type="text"],
input[type="password"],
input[type="number"] {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #cbd5f5;
  margin-bottom: 12px;
}

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: 999px;
  border: none;
  background: #3b63f6;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

button:hover,
.button:hover {
  background: #2947c2;
}

.hint {
  color: #5c667e;
}

.menu-item {
  display: grid;
  grid-template-columns: 24px 1fr 80px;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
}

.total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 16px 0;
  font-size: 1.1rem;
}

.order-result {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px dashed #d1d5f0;
}

.orders {
  display: grid;
  gap: 16px;
}

.order-card {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
}

.order-card h3 {
  margin-top: 0;
}

.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  background: #edf2ff;
  color: #2b3a8f;
  font-size: 0.8rem;
  font-weight: 600;
}

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

.status-list li {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #eef1f8;
}

.status-list li:last-child {
  border-bottom: none;
}

.order-done {
  color: #1f8b4c;
  font-weight: 600;
}

.item-done {
  text-decoration: line-through;
  color: #94a3b8;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.qr {
  max-width: 240px; /* Increased from 160px */
  display: block;
  margin: 12px auto;
}

.header-actions {
  display: flex;
  gap: 12px;
  margin-top: 12px;
}

.button.secondary {
  background: #64748b;
}

.button.secondary:hover {
  background: #475569;
}

.button.danger {
  background: #ef4444;
}

.button.danger:hover {
  background: #dc2626;
}

.button.success {
  background: #10b981;
}

.button.success:hover {
  background: #059669;
}

/* Stylish Menu Item Boxes */
.menu-item {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px;
  transition: all 0.2s ease;
  cursor: pointer;
  position: relative;
}

.menu-item:hover {
  border-color: #3b63f6;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 99, 246, 0.1);
}

.menu-item input[type="checkbox"] {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 20px;
  height: 20px;
}

.menu-item label {
  font-size: 1rem;
  margin-bottom: 8px;
  padding-right: 24px;
}

.menu-item input[type="number"] {
  width: 100%;
  margin-bottom: 0;
}

#menu {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

/* TV View Styles */
.tv-header {
  text-align: center;
  background: #1e293b;
  color: #fff;
  padding: 20px;
  margin: -24px -24px 24px -24px;
}

.tv-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  height: calc(100vh - 150px);
}

.tv-column {
  background: #fff;
  border-radius: 20px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

.tv-column h2 {
  text-align: center;
  font-size: 2rem;
  margin-top: 0;
  padding-bottom: 16px;
  border-bottom: 2px solid #f1f5f9;
}

.tv-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: 16px;
}

.tv-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-radius: 12px;
  font-size: 1.8rem;
  font-weight: 700;
}

.tv-item.pending {
  background: #f8fafc;
  color: #334155;
  border-left: 10px solid #cbd5e1;
}

.tv-item.ready {
  background: #f0fdf4;
  color: #166534;
  border-left: 10px solid #22c55e;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

.tv-id {
  font-family: monospace;
}

/* Admin Item Styles */
.admin-item {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border: 1px solid #e2e8f0;
}

.admin-item.inactive {
  opacity: 0.6;
  background: #f1f5f9;
}

.admin-item-info {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 12px;
  width: 100%;
}

.admin-item-info div {
  display: flex;
  flex-direction: column;
}

.admin-item-info small {
  font-size: 0.7rem;
  color: #64748b;
  margin-bottom: 2px;
}

.admin-item-info input, .admin-item-info select {
  width: 100%;
  margin-bottom: 0;
  padding: 8px;
  font-size: 0.9rem;
}



.admin-item-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid #f1f5f9;
}


/* Staff QR Button */
.order-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.order-card-header h3 {
  margin: 0;
}

.qr-small-btn {
  background: #64748b;
  padding: 4px 8px;
  font-size: 0.7rem;
}

/* Stats Styles */
.stats-table {
  width: 100%;
  border-collapse: collapse;
}

.stats-table th, .stats-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #eef1f8;
}

.stats-table th {
  background: #f8fafc;
  font-weight: 600;
}

/* Limit Badge */
.limit-badge {
  color: #ef4444;
  font-weight: 600;
  font-size: 0.8rem;
}



.qr-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.qr-modal-content {
  background: white;
  border-radius: 20px;
  padding: 40px;
  max-width: 600px;
  width: 100%;
  text-align: center;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.qr-modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: #e2e8f0;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #334155;
}

.qr-modal-close:hover {
  background: #cbd5e1;
}

.qr-modal img {
  max-width: 90%;
  height: auto;
  margin: 20px 0;
}


.qr-modal h2 {
  margin-top: 0;
  color: #1d2230;
}

.show-qr-btn {
  margin-top: 12px;
  background: #10b981;
}

.show-qr-btn:hover {
  background: #059669;
}
