/* NorIA TV / KDS legacy — CSS sin color-mix, @layer ni selectores modernos.
   Pensado para Chromium ~70–110 y navegadores de Smart TV. */
html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: #0a1b3d;
  color: #ffffff;
  font-family: Arial, Helvetica, "Segoe UI", sans-serif;
  font-size: 18px;
  line-height: 1.35;
  -webkit-text-size-adjust: 100%;
}

* {
  box-sizing: border-box;
}

a {
  color: #7ec8ff;
}

.wrap {
  max-width: 480px;
  margin: 0 auto;
  padding: 24px 16px 40px;
}

.brand {
  text-align: center;
  margin-bottom: 20px;
}

.brand img {
  display: block;
  margin: 0 auto 8px;
  width: 96px;
  height: auto;
  max-width: 40%;
}

.brand h1 {
  margin: 0;
  font-size: 28px;
  font-weight: bold;
  letter-spacing: 0.02em;
}

.badge {
  display: inline-block;
  margin-top: 8px;
  padding: 4px 10px;
  background: #0072ee;
  color: #fff;
  font-size: 12px;
  font-weight: bold;
  text-transform: uppercase;
  border-radius: 4px;
}

.card {
  background: #132a52;
  border: 1px solid #2a4570;
  border-radius: 8px;
  padding: 20px 16px;
}

.card h2 {
  margin: 0 0 6px;
  font-size: 22px;
}

.hint {
  margin: 0 0 16px;
  color: #b8c7e0;
  font-size: 14px;
}

label {
  display: block;
  margin: 12px 0 4px;
  font-size: 14px;
  color: #d5e0f2;
}

input[type="text"],
input[type="password"] {
  width: 100%;
  padding: 14px 12px;
  font-size: 18px;
  border: 2px solid #3a5a8a;
  border-radius: 6px;
  background: #0a1b3d;
  color: #fff;
}

input:focus {
  outline: none;
  border-color: #0072ee;
}

.btn {
  display: inline-block;
  width: 100%;
  margin-top: 16px;
  padding: 16px 12px;
  font-size: 18px;
  font-weight: bold;
  text-align: center;
  color: #fff;
  background: #0072ee;
  background: var(--tv-skin, #0072ee);
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
}

.btn:disabled {
  opacity: 0.55;
  cursor: default;
}

.btn-secondary {
  background: #2a4570;
}

.btn-danger {
  background: #c0392b;
}

.btn-success {
  background: #1e8e4a;
}

.btn-sm {
  width: auto;
  margin: 0;
  padding: 10px 14px;
  font-size: 15px;
}

.error {
  margin-top: 12px;
  padding: 10px 12px;
  background: #5a1a1a;
  border: 1px solid #c0392b;
  border-radius: 6px;
  color: #ffd0d0;
  font-size: 15px;
}

.footer {
  margin-top: 18px;
  text-align: center;
  font-size: 13px;
  color: #8fa3c4;
}

.footer a {
  margin: 0 6px;
}

/* ——— KDS board ——— */
html.kds-html,
html.kds-html body {
  height: 100%;
  overflow: hidden;
}

.kds-page {
  height: 100%;
  background: #111827;
  color: #f3f4f6;
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -webkit-flex-direction: column;
  flex-direction: column;
  overflow: hidden;
}

.kds-top {
  -webkit-flex-shrink: 0;
  flex-shrink: 0;
  z-index: 20;
  background: #0b1220;
  border-bottom: 1px solid #374151;
  padding: 6px 10px;
}

/* Una sola línea: título + tabs + acciones (ahorra espacio en TV) */
.kds-toolbar {
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  align-items: center;
  -webkit-flex-wrap: nowrap;
  flex-wrap: nowrap;
  gap: 8px;
  min-width: 0;
}

.kds-title {
  margin: 0;
  font-size: 16px;
  font-weight: bold;
  white-space: nowrap;
  -webkit-flex-shrink: 0;
  flex-shrink: 0;
}

.kds-area-lock {
  font-size: 13px;
  font-weight: bold;
  color: #93c5fd;
  white-space: nowrap;
  -webkit-flex-shrink: 0;
  flex-shrink: 0;
}

.kds-toolbar-actions {
  margin-left: auto;
  white-space: nowrap;
  -webkit-flex-shrink: 0;
  flex-shrink: 0;
}

.kds-toolbar-actions .btn {
  margin-left: 6px;
}

.kds-tabs {
  margin-top: 0;
  overflow: hidden;
  white-space: nowrap;
  padding-bottom: 0;
  -webkit-flex-shrink: 1;
  flex-shrink: 1;
  min-width: 0;
}

.kds-tabs-inline {
  display: inline-block;
  vertical-align: middle;
}

.tab {
  display: inline-block;
  margin: 0 4px 0 0;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: bold;
  color: #e5e7eb;
  background: #1f2937;
  border: 2px solid #374151;
  border-radius: 6px;
  cursor: pointer;
}

.tab.active {
  background: #0072ee;
  background: var(--tv-skin, #0072ee);
  border-color: #0072ee;
  border-color: var(--tv-skin, #0072ee);
  color: #fff;
}

.banner-error {
  -webkit-flex-shrink: 0;
  flex-shrink: 0;
}

.kds-board {
  -webkit-box-flex: 1;
  -webkit-flex: 1 1 auto;
  flex: 1 1 auto;
  min-height: 0;
  padding: 12px;
  overflow: hidden;
  position: relative;
}

.kds-cols {
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-align: start;
  -webkit-align-items: flex-start;
  align-items: flex-start;
  -webkit-box-pack: start;
  -webkit-justify-content: flex-start;
  justify-content: flex-start;
}

.kds-col {
  -webkit-flex-shrink: 0;
  flex-shrink: 0;
  margin-right: 10px;
}

.kds-col:last-child {
  margin-right: 0;
}

.kds-empty {
  padding: 40px 16px;
  text-align: center;
  color: #9ca3af;
  font-size: 18px;
}

.ticket {
  display: block;
  width: 100%;
  max-width: none;
  margin: 0 0 10px 0;
  background: #1f2937;
  border: 3px solid #0072ee;
  border-color: var(--tv-skin, #0072ee);
  border-radius: 8px;
  overflow: hidden;
  -webkit-box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.ticket-head {
  padding: 10px 12px;
  background: #0b1220;
  background: var(--tv-skin-dark, #0b1220);
  border-bottom: 2px solid #0072ee;
  border-bottom-color: var(--tv-skin, #0072ee);
}

.ticket-head .table {
  margin: 0;
  font-size: 18px;
  font-weight: bold;
}

.ticket-head .meta {
  margin: 2px 0 0;
  font-size: 13px;
  color: #9ca3af;
}

.ticket-head .timer {
  float: right;
  font-family: Consolas, "Courier New", monospace;
  font-size: 20px;
  font-weight: bold;
}

.timer.green {
  color: #34d399;
}
.timer.amber {
  color: #fbbf24;
}
.timer.red {
  color: #f87171;
}

.ticket-notes {
  padding: 8px 12px;
  background: #422006;
  color: #fcd34d;
  font-style: italic;
  font-size: 15px;
  border-bottom: 1px solid #374151;
}

.ticket-allergies {
  padding: 8px 12px;
  background: #7f1d1d;
  color: #fecaca;
  font-weight: bold;
  font-size: 14px;
  text-transform: uppercase;
  border-bottom: 1px solid #374151;
}

.ticket-items {
  /* TV: sin scroll interno — se ve toda la comanda */
  max-height: none !important;
  overflow: visible !important;
}

/* Ocultar cualquier scrollbar residual en TVs */
.kds-page,
.kds-board,
.ticket,
.ticket-items {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.kds-page::-webkit-scrollbar,
.kds-board::-webkit-scrollbar,
.ticket::-webkit-scrollbar,
.ticket-items::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.item {
  padding: 10px 12px;
  border-bottom: 1px solid #374151;
  cursor: pointer;
}

.item:last-child {
  border-bottom: 0;
}

.item.ready {
  opacity: 0.55;
  text-decoration: line-through;
}

.item.held {
  background: #1d4ed8;
  color: #fff;
}

.item.held-third {
  background: #b45309;
  color: #fff;
}

/* 2º/3º mandados a preparar: parpadeo hasta Completar */
@-webkit-keyframes tv-course-fire {
  0%,
  100% {
    background: #2563eb;
  }
  50% {
    background: #1e3a5f;
  }
}
@keyframes tv-course-fire {
  0%,
  100% {
    background: #2563eb;
  }
  50% {
    background: #1e3a5f;
  }
}
@-webkit-keyframes tv-course-fire-third {
  0%,
  100% {
    background: #d97706;
  }
  50% {
    background: #78350f;
  }
}
@keyframes tv-course-fire-third {
  0%,
  100% {
    background: #d97706;
  }
  50% {
    background: #78350f;
  }
}
.item.course-fire {
  -webkit-animation: tv-course-fire 0.85s ease-in-out infinite;
  animation: tv-course-fire 0.85s ease-in-out infinite;
  color: #fff;
}
.item.course-fire-third {
  -webkit-animation: tv-course-fire-third 0.85s ease-in-out infinite;
  animation: tv-course-fire-third 0.85s ease-in-out infinite;
  color: #fff;
}

.item-name {
  margin: 0;
  font-size: 16px;
  font-weight: bold;
}

.item-extra {
  margin: 2px 0 0;
  font-size: 13px;
  color: #d1d5db;
}

.ticket-actions {
  padding: 10px 12px;
  border-top: 2px solid #0072ee;
  border-top-color: var(--tv-skin, #0072ee);
  background: #111827;
}

.ticket-actions .btn {
  margin-top: 0;
}

.banner-error {
  margin: 8px 12px 0;
  padding: 10px 12px;
  background: #7f1d1d;
  border-radius: 6px;
  color: #fecaca;
}

.clearfix {
  clear: both;
  height: 0;
  overflow: hidden;
}
