/* =========================================================
   FORNO & BRASA - HIGH-TECH KITCHEN DISPLAY SYSTEM (KDS)
   Aerospace / Culinary Mission Control Interface
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@500;600;700;800;900&family=Plus+Jakarta+Sans:wght@500;600;700;800&family=JetBrains+Mono:wght@600;700;800;900&display=swap');

:root {
  --bg-hud: #07090e;
  --bg-card: #0e131d;
  --bg-card-header: #131b29;
  --bg-surface-elevated: #182234;
  --border-hud: #1e293b;
  --border-focus: #ff5722;

  --color-green: #10b981;
  --color-green-glow: rgba(16, 185, 129, 0.45);
  --color-yellow: #f59e0b;
  --color-yellow-glow: rgba(245, 158, 11, 0.45);
  --color-red: #ef4444;
  --color-red-glow: rgba(239, 68, 68, 0.6);
  --color-brand: #ff5722;
  --color-cyan: #00d6ff;
  --color-cyan-glow: rgba(0, 214, 255, 0.4);

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --font-main: 'Outfit', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --transition-fast: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  user-select: none;
}

body.kds-body {
  background-color: var(--bg-hud);
  color: var(--text-main);
  font-family: var(--font-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 50% 0%, rgba(255, 87, 34, 0.08) 0%, transparent 60%),
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 100% 100%, 40px 40px, 40px 40px;
}

/* =========================================================
   KDS HUD HEADER
   ========================================================= */
.kds-header {
  background: rgba(14, 19, 29, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 2px solid var(--border-hud);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 25px rgba(0, 0, 0, 0.6);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 12px;
}

.fire-icon {
  font-size: 32px;
  filter: drop-shadow(0 0 14px rgba(255, 87, 34, 0.8));
  animation: flicker 2s infinite ease-in-out;
}
@keyframes flicker {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 14px rgba(255, 87, 34, 0.8)); }
  50% { transform: scale(1.08); filter: drop-shadow(0 0 22px rgba(255, 152, 0, 0.9)); }
}

.brand-titles h1 {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 1px;
  color: #fff;
  background: linear-gradient(135deg, #ff5722 0%, #ff9800 60%, #ffc107 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 20px rgba(255, 87, 34, 0.4);
}

.brand-titles .sub {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 2.5px;
  color: var(--text-muted);
  display: block;
}

.connection-status {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid var(--border-hud);
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--color-yellow);
}

.status-dot.online {
  background: #10b981;
  box-shadow: 0 0 12px #10b981;
}

.status-dot.offline {
  background: #ef4444;
  box-shadow: 0 0 12px #ef4444;
}

/* Station Nav Filter Tabs */
.station-nav {
  display: flex;
  background: #090d15;
  padding: 5px;
  border-radius: 12px;
  border: 1px solid var(--border-hud);
  gap: 6px;
}

.station-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 9px 18px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-main);
  font-size: 13px;
  font-weight: 800;
  transition: var(--transition-fast);
}

.station-tab:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.station-tab.active {
  background: linear-gradient(135deg, #ff5722, #ff9800);
  color: #fff;
  box-shadow: 0 2px 14px rgba(255, 87, 34, 0.5);
}

.tab-badge {
  background: rgba(0, 0, 0, 0.35);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-family: var(--font-mono);
  font-weight: 900;
}

/* Header Right Clock & Audio */
.header-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.kds-clock {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 900;
  color: #ffb74d;
  background: rgba(255, 183, 77, 0.1);
  padding: 6px 16px;
  border-radius: 10px;
  border: 1px solid rgba(255, 183, 77, 0.35);
  box-shadow: 0 0 16px rgba(255, 183, 77, 0.2);
}

.audio-toggle-btn, .refresh-btn {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-hud);
  color: var(--text-main);
  padding: 9px 16px;
  border-radius: 10px;
  cursor: pointer;
  font-family: var(--font-main);
  font-weight: 800;
  font-size: 13px;
  transition: var(--transition-fast);
}

.audio-toggle-btn:hover, .refresh-btn:hover {
  background: #25334c;
  border-color: rgba(255, 255, 255, 0.2);
}

/* =========================================================
   SLA METRICS BAR
   ========================================================= */
.sla-bar {
  background: #0b0f18;
  border-bottom: 1px solid var(--border-hud);
  padding: 10px 24px;
  display: flex;
  align-items: center;
  gap: 32px;
  font-size: 13px;
  font-weight: 700;
}

.sla-stat {
  display: flex;
  align-items: center;
  gap: 10px;
}

.stat-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.stat-indicator.green { background: var(--color-green); box-shadow: 0 0 10px var(--color-green); }
.stat-indicator.yellow { background: var(--color-yellow); box-shadow: 0 0 10px var(--color-yellow); }
.stat-indicator.red { background: var(--color-red); box-shadow: 0 0 12px var(--color-red); }

.sla-stat strong {
  font-family: var(--font-mono);
  font-size: 16px;
  color: #fff;
}

/* =========================================================
   TICKETS CONTAINER GRID
   ========================================================= */
.tickets-container {
  flex: 1;
  padding: 24px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 20px;
  align-items: start;
}

/* Ticket Card */
.ticket-card {
  background: var(--bg-card);
  border: 2px solid var(--border-hud);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  overflow: hidden;
  position: relative;
}

.ticket-card:hover {
  transform: translateY(-4px);
}

/* SLA Dynamic Glow Borders */
.ticket-card.sla-normal {
  border-color: var(--color-green);
  box-shadow: 0 0 18px var(--color-green-glow);
}
.ticket-card.sla-normal .ticket-header {
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.2) 0%, #131b29 100%);
}

.ticket-card.sla-warning {
  border-color: var(--color-yellow);
  box-shadow: 0 0 20px var(--color-yellow-glow);
}
.ticket-card.sla-warning .ticket-header {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.25) 0%, #131b29 100%);
}

.ticket-card.sla-alert {
  border-color: var(--color-red);
  box-shadow: 0 0 24px var(--color-red-glow);
  animation: pulse-kds-alert 1.5s infinite ease-in-out;
}
.ticket-card.sla-alert .ticket-header {
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.3) 0%, #131b29 100%);
}

@keyframes pulse-kds-alert {
  0% { box-shadow: 0 0 12px rgba(239, 68, 68, 0.4); }
  50% { box-shadow: 0 0 32px rgba(239, 68, 68, 0.9); }
  100% { box-shadow: 0 0 12px rgba(239, 68, 68, 0.4); }
}

/* Ticket Header */
.ticket-header {
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-hud);
}

.ticket-id-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ticket-number {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: -0.5px;
}

.ticket-type {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 6px;
  letter-spacing: 0.5px;
}

.type-delivery {
  background: rgba(0, 214, 255, 0.2);
  color: #00d6ff;
  border: 1px solid #00d6ff;
}

.type-balcao {
  background: rgba(255, 152, 0, 0.2);
  color: #ff9800;
  border: 1px solid #ff9800;
}

.type-mesa {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
  border: 1px solid #10b981;
}

.type-totem {
  background: rgba(236, 72, 153, 0.2);
  color: #f472b6;
  border: 1px solid #f472b6;
}

/* SLA Dynamic Timer */
.ticket-timer {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.timer-value {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 900;
}

.timer-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
}

.timer-green { color: #10b981; text-shadow: 0 0 8px rgba(16, 185, 129, 0.5); }
.timer-yellow { color: #f59e0b; text-shadow: 0 0 8px rgba(245, 158, 11, 0.5); }
.timer-red { color: #ef4444; font-weight: 900; text-shadow: 0 0 12px rgba(239, 68, 68, 0.8); animation: blink 1s infinite; }

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Customer Section */
.ticket-customer-info {
  background: rgba(0, 0, 0, 0.35);
  padding: 10px 18px;
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-hud);
}

.customer-name {
  font-weight: 800;
  color: #e2e8f0;
}

.order-timestamp {
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-weight: 700;
}

/* Ticket Items Body */
.ticket-items {
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.ticket-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 12px;
  transition: var(--transition-fast);
}

.ticket-item.done {
  opacity: 0.35;
  text-decoration: line-through;
  background: rgba(0, 0, 0, 0.5);
}

.item-main-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.item-qty-name {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.item-qty {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 900;
  color: #ff9800;
  background: rgba(255, 152, 0, 0.2);
  padding: 2px 8px;
  border-radius: 6px;
}

.item-name {
  font-size: 16px;
  font-weight: 800;
  color: #ffffff;
}

.item-station-tag {
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  letter-spacing: 0.5px;
}

.item-station-tag.forno {
  background: rgba(255, 87, 34, 0.25);
  color: #ff7043;
  border: 1px solid rgba(255, 87, 34, 0.5);
}

.item-station-tag.chapa {
  background: rgba(255, 152, 0, 0.25);
  color: #ffb74d;
  border: 1px solid rgba(255, 152, 0, 0.5);
}

/* Customizations */
.item-customizations {
  margin-top: 8px;
  padding-left: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.customization-badge {
  display: inline-block;
  background: rgba(251, 191, 36, 0.15);
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 700;
  color: #fde68a;
}

.item-observations {
  margin-top: 8px;
  background: rgba(239, 68, 68, 0.2);
  border-left: 4px solid #ef4444;
  padding: 6px 10px;
  border-radius: 0 6px 6px 0;
  font-size: 12px;
  font-weight: 800;
  color: #fca5a5;
}

/* Bump Action Footer */
.ticket-footer {
  padding: 14px 18px;
  background: #0a0e16;
  border-top: 1px solid var(--border-hud);
}

.bump-btn {
  width: 100%;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  border: none;
  padding: 14px;
  border-radius: 10px;
  font-family: var(--font-main);
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0.5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 4px 18px rgba(16, 185, 129, 0.4);
  transition: var(--transition-fast);
}

.bump-btn:hover {
  background: linear-gradient(135deg, #059669, #047857);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(16, 185, 129, 0.6);
}

.bump-btn:active {
  transform: translateY(1px);
}

.bump-btn.preparing {
  background: linear-gradient(135deg, #ff5722, #ea580c);
  box-shadow: 0 4px 18px rgba(255, 87, 34, 0.4);
}

.bump-btn.preparing:hover {
  background: linear-gradient(135deg, #ea580c, #c2410c);
  box-shadow: 0 6px 24px rgba(255, 87, 34, 0.6);
}

/* Empty State */
.tickets-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 100px 20px;
  color: var(--text-muted);
}

.empty-icon {
  font-size: 72px;
  margin-bottom: 20px;
  filter: drop-shadow(0 0 20px rgba(255, 87, 34, 0.4));
}

.tickets-empty h2 {
  font-size: 26px;
  font-weight: 900;
  color: #ffffff;
  margin-bottom: 8px;
}
