/* 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;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

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

.kds-clock {
  margin-left: auto;
  padding-left: 12px;
  color: #ffffff;
  font-size: 16px;
  font-weight: bold;
  line-height: 1.2;
  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 {
  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;
}

/* Modo lista: scroll vertical; nuevas arriba */
.kds-board.kds-layout-list {
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.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-list {
  display: block;
  width: 100%;
}

.kds-list .ticket.ticket-row {
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-orient: horizontal;
  -webkit-box-direction: normal;
  -webkit-flex-direction: row;
  flex-direction: row;
  -webkit-box-align: stretch;
  -webkit-align-items: stretch;
  align-items: stretch;
  width: 100%;
  max-width: none;
  margin: 0 0 10px 0;
}

.kds-list .ticket-side {
  width: 168px;
  -webkit-flex-shrink: 0;
  flex-shrink: 0;
  padding: 10px 12px;
  background: #0b1220;
  background: var(--tv-skin-dark, #0b1220);
  border-right: 2px solid #0072ee;
  border-right-color: var(--tv-skin, #0072ee);
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
}

.kds-list .ticket-side .timer {
  display: block;
  float: none;
  margin: 0 0 8px;
  font-size: 22px;
}

.kds-list .ticket-side .table {
  margin: 0;
  font-size: 16px;
  font-weight: bold;
}

.kds-list .ticket-side .meta {
  margin: 2px 0 0;
  font-size: 12px;
  color: #9ca3af;
}

.kds-list .ticket-body {
  -webkit-box-flex: 1;
  -webkit-flex: 1 1 auto;
  flex: 1 1 auto;
  min-width: 0;
  display: block;
}

.kds-list .ticket-notes,
.kds-list .ticket-allergies {
  border-bottom: 1px solid #374151;
}

.kds-list .ticket-items {
  border-bottom: 0;
}

.kds-list .ticket-actions {
  width: 140px;
  -webkit-flex-shrink: 0;
  flex-shrink: 0;
  border-top: 0;
  border-left: 2px solid #0072ee;
  border-left-color: var(--tv-skin, #0072ee);
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  align-items: center;
  -webkit-box-pack: center;
  -webkit-justify-content: center;
  justify-content: center;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
}

.kds-list .ticket-actions .btn {
  width: 100%;
}

@media (max-width: 700px) {
  .kds-list .ticket.ticket-row {
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -webkit-flex-direction: column;
    flex-direction: column;
  }
  .kds-list .ticket-side,
  .kds-list .ticket-actions {
    width: 100%;
    border-right: 0;
    border-left: 0;
  }
  .kds-list .ticket-side {
    border-bottom: 2px solid #0072ee;
    border-bottom-color: var(--tv-skin, #0072ee);
  }
  .kds-list .ticket-actions {
    border-top: 2px solid #0072ee;
    border-top-color: var(--tv-skin, #0072ee);
  }
}

.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 {
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-align: start;
  -webkit-align-items: flex-start;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid #374151;
}

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

.item-main {
  -webkit-box-flex: 1;
  -webkit-flex: 1 1 auto;
  flex: 1 1 auto;
  min-width: 0;
}

.item-course {
  display: inline;
  margin-left: 6px;
  padding: 0;
  border-radius: 0;
  background: none;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
}

.item.held .item-course,
.item.held-third .item-course {
  background: none;
  color: #ffffff;
}

.item-check {
  -webkit-flex: 0 0 auto;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  margin: 0;
  padding: 0;
  border: 1px solid #4b5563;
  border-radius: 8px;
  background: #1f2937;
  color: #e5e7eb;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.item-check:hover {
  border-color: #10b981;
  color: #34d399;
}

.item-check-undo {
  border-color: rgba(16, 185, 129, 0.45);
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
}

.item-check-disabled,
.item-check:disabled {
  opacity: 0.45;
  cursor: default;
}

.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;
}

@-webkit-keyframes tv-kds-blink {
  0%,
  100% {
    -webkit-box-shadow: inset 0 0 0 3px rgba(251, 191, 36, 0.95);
    background-color: rgba(251, 191, 36, 0.22);
  }
  50% {
    -webkit-box-shadow: inset 0 0 0 3px rgba(251, 191, 36, 0.25);
    background-color: transparent;
  }
}
@keyframes tv-kds-blink {
  0%,
  100% {
    box-shadow: inset 0 0 0 3px rgba(251, 191, 36, 0.95);
    background-color: rgba(251, 191, 36, 0.22);
  }
  50% {
    box-shadow: inset 0 0 0 3px rgba(251, 191, 36, 0.25);
    background-color: transparent;
  }
}
.kds-blink-card,
.item.kds-blink-row {
  -webkit-animation: tv-kds-blink 0.7s ease-in-out infinite;
  animation: tv-kds-blink 0.7s ease-in-out infinite;
}

.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;
  width: 100%;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

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

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