/* shell.css — Station shell layout (3-panel glassmorphism) */

/* ── Variables & Reset ── */
:root {
  --portal-bg: #0F0F12;
  --panel-bg: rgba(22, 22, 26, 0.65);
  --glass-border: rgba(255, 255, 255, 0.08);
  --text-main: #FFFFFF;
  --text-muted: #8E8D96;
  --accent-cyan: #3DB5FF;
  --accent-glow: rgba(61, 181, 255, 0.15);
  --accent-blue: #4F46E5;
  --accent-green: #22c55e;
  --accent-red: #ef4444;
  --font-inter: 'Inter', sans-serif;
  --font-ubuntu: 'Ubuntu', sans-serif;
  --border-radius-lg: 16px;
  --border-radius-md: 12px;
  --border-radius-sm: 8px;
  --transition-speed: 0.2s;
}

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

body {
  margin: 0;
  background-color: var(--portal-bg);
  background-image: radial-gradient(circle at 15% 50%, rgba(61, 181, 255, 0.03), transparent 25%),
                    radial-gradient(circle at 85% 30%, rgba(79, 70, 229, 0.03), transparent 25%);
  color: var(--text-main);
  font-family: var(--font-inter);
  height: 100vh;
  overflow: hidden;
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 10px; }

.hidden { display: none !important; }

/* ── Layout ── */
.portal-layout {
  display: flex;
  height: 100vh;
}

/* ── LEFT SIDEBAR ── */
.sidebar-left {
  width: 260px;
  min-width: 260px;
  display: flex;
  flex-direction: column;
  background-color: rgba(15, 15, 18, 0.8);
  border-right: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
  z-index: 10;
}

.sidebar-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 22px 18px;
  gap: 16px;
}

.logo-image {
  width: 140px;
  height: auto;
  margin-top: 8px;
}

.queue-widget {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-md);
  padding: 14px;
  text-align: center;
}

.queue-widget-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.queue-widget-value {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text-main);
  font-family: var(--font-ubuntu);
  line-height: 1;
}

.grow { flex: 1; }

.sidebar-bottom {
  padding: 20px 16px;
  border-top: 1px solid var(--glass-border);
}

.station-card {
  background: linear-gradient(135deg, rgba(61,181,255,0.1) 0%, rgba(79,70,229,0.1) 100%);
  border: 1px solid rgba(61,181,255,0.2);
  border-radius: var(--border-radius-lg);
  padding: 16px;
  margin-bottom: 16px;
  text-align: center;
  box-shadow: 0 4px 20px var(--accent-glow);
}

.station-card .line-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 2px;
}

.station-card .line-name {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent-cyan);
  font-family: var(--font-ubuntu);
}

.station-card .station-name {
  font-size: 0.85rem;
  color: var(--text-main);
  font-weight: 500;
  margin-top: 4px;
}

.btn-orders {
  width: 100%;
  padding: 14px 18px;
  border-radius: 30px;
  border: none;
  background: var(--accent-cyan);
  color: var(--portal-bg);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all var(--transition-speed);
  box-shadow: 0 4px 20px rgba(61,181,255,0.3);
  font-family: var(--font-inter);
}

.btn-orders:hover {
  background: #fff;
  box-shadow: 0 4px 30px rgba(61,181,255,0.5);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--border-radius-md);
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition-speed) ease;
  border: none;
  background: none;
  width: 100%;
  font-family: var(--font-inter);
}

.nav-item:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
}

.nav-icon { width: 18px; height: 18px; opacity: 0.8; }

/* ── MAIN CONTENT ── */
.main-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  background-color: var(--portal-bg);
}

.main-header {
  height: 70px;
  padding: 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--glass-border);
}

.serial-display {
  font-family: var(--font-ubuntu);
  font-size: 1.2rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.serial-display .serial-label {
  color: var(--text-muted);
  font-weight: 400;
}

.serial-display .serial-value {
  color: var(--accent-cyan);
  font-weight: 700;
}

.order-meta-bar {
  display: flex;
  gap: 24px;
  align-items: center;
}

.meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.meta-chip .meta-value {
  color: var(--text-main);
  font-weight: 500;
}

/* Plugin content area */
.content-body {
  flex-grow: 1;
  display: flex;
  align-items: stretch;
  justify-content: center;
  overflow: hidden;
  padding: 24px 32px;
  position: relative;
}

#stepContent {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* Manual confirm overlay */
.confirm-overlay {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
}

.confirm-overlay .btn-confirm {
  background: var(--accent-green);
  color: var(--portal-bg);
  border: none;
  padding: 14px 48px;
  border-radius: 30px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.05em;
  box-shadow: 0 4px 20px rgba(34,197,94,0.3);
  font-family: var(--font-inter);
  transition: all var(--transition-speed);
}

.confirm-overlay .btn-confirm:hover {
  background: #4ade80;
  box-shadow: 0 4px 30px rgba(34,197,94,0.5);
}

/* ── RIGHT SIDEBAR — Process Steps ── */
.sidebar-right {
  width: 320px;
  min-width: 320px;
  display: flex;
  flex-direction: column;
  background-color: var(--panel-bg);
  border-left: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
  z-index: 10;
}

.steps-header {
  height: 70px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--glass-border);
}

.steps-header h2 {
  font-size: 1.15rem;
  font-weight: 700;
  font-family: var(--font-ubuntu);
  letter-spacing: 0.04em;
  margin: 0;
}

.steps-container {
  flex-grow: 1;
  overflow-y: auto;
  padding: 24px 16px;
}

.step-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 12px;
  border-radius: var(--border-radius-md);
  margin-bottom: 4px;
  cursor: default;
  transition: all var(--transition-speed);
  position: relative;
  border: 1px solid transparent;
}

.step-item.completed { opacity: 0.7; }

.step-item.active {
  background: rgba(61,181,255,0.08);
  border-color: rgba(61,181,255,0.2);
}

.step-item.locked { opacity: 0.35; }

.step-item:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 29px;
  top: 44px;
  width: 2px;
  height: calc(100% - 16px);
  background: rgba(255,255,255,0.08);
}

.step-item.completed:not(:last-child)::after {
  background: var(--accent-green);
}

.step-indicator {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.step-item.completed .step-indicator {
  background: rgba(34, 197, 94, 0.15);
  border: 2px solid var(--accent-green);
  color: var(--accent-green);
}

.step-item.active .step-indicator {
  background: rgba(61, 181, 255, 0.15);
  border: 2px solid var(--accent-cyan);
  color: var(--accent-cyan);
  box-shadow: 0 0 12px rgba(61,181,255,0.3);
}

.step-item.locked .step-indicator {
  background: rgba(255,255,255,0.05);
  border: 2px solid rgba(255,255,255,0.15);
  color: var(--text-muted);
}

.step-info { flex-grow: 1; padding-top: 3px; }

.step-label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-main);
  margin-bottom: 2px;
}

.step-item.locked .step-label { color: var(--text-muted); }

.step-sublabel { font-size: 0.72rem; color: var(--text-muted); }
.step-item.active .step-sublabel { color: var(--accent-cyan); }

.step-badge {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 4px;
  display: inline-block;
}

.step-badge.pass {
  background: rgba(34,197,94,0.1);
  color: var(--accent-green);
  border: 1px solid rgba(34,197,94,0.2);
}

.step-badge.in-progress {
  background: rgba(61,181,255,0.1);
  color: var(--accent-cyan);
  border: 1px solid rgba(61,181,255,0.2);
  animation: pulse 2s infinite;
}

.step-badge.locked {
  background: rgba(255,255,255,0.03);
  color: rgba(255,255,255,0.25);
  border: 1px solid rgba(255,255,255,0.06);
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(61,181,255, 0.3); }
  70% { box-shadow: 0 0 0 4px rgba(61,181,255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(61,181,255, 0); }
}

.steps-footer {
  padding: 16px;
  border-top: 1px solid var(--glass-border);
}

.steps-progress {
  display: flex;
  align-items: center;
  gap: 12px;
}

.progress-bar-container {
  flex-grow: 1;
  height: 6px;
  background: rgba(255,255,255,0.1);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--accent-green);
  box-shadow: 0 0 8px rgba(34,197,94,0.4);
  border-radius: 4px;
  transition: width 0.5s ease;
}

.progress-text {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ── Modals ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: rgba(22, 22, 30, 0.95);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-lg);
  padding: 28px;
  width: min(640px, 90vw);
  max-height: 80vh;
  overflow-y: auto;
  backdrop-filter: blur(20px);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
  transform: translateY(12px) scale(0.98);
  transition: transform 0.2s ease;
}

.modal-overlay.open .modal-card {
  transform: translateY(0) scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.modal-header h2 {
  font-size: 1.1rem;
  font-weight: 600;
  font-family: var(--font-ubuntu);
  letter-spacing: 0.02em;
}

.modal-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: rgba(255,255,255,0.05);
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-speed);
}

.modal-close:hover {
  background: rgba(255,255,255,0.1);
  color: var(--text-main);
}

/* Orders list */
.orders-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.order-pill {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-md);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all var(--transition-speed);
}

.order-pill:hover { background: rgba(255,255,255,0.07); }

.order-pill.is-active {
  border-color: rgba(61,181,255,0.3);
  background: rgba(61,181,255,0.06);
}

.order-pill__main { display: flex; flex-direction: column; gap: 4px; }
.order-pill__serial { font-size: 0.95rem; font-weight: 600; }
.order-pill__meta { font-size: 0.75rem; color: var(--text-muted); }

.order-pill small {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
}

.order-pill.is-active small { color: var(--accent-cyan); }

/* Admin panel */
.admin-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.admin-form-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-form-row label {
  width: 100px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
}

.admin-input {
  flex: 1;
  height: 42px;
  border-radius: var(--border-radius-sm);
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.05);
  color: var(--text-main);
  padding: 0 14px;
  font-size: 0.9rem;
  font-family: var(--font-inter);
  outline: none;
  transition: all var(--transition-speed);
}

.admin-input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(61,181,255,0.15);
}

.admin-input::placeholder { color: rgba(255,255,255,0.2); }

.btn-modal {
  padding: 10px 24px;
  border-radius: var(--border-radius-sm);
  border: none;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition-speed);
  font-family: var(--font-inter);
}

.btn-modal-primary {
  background: var(--accent-cyan);
  color: var(--portal-bg);
}

.btn-modal-primary:hover {
  background: #5bc4ff;
  box-shadow: 0 4px 16px rgba(61,181,255,0.3);
}

.btn-modal-danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent-red);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-modal-danger:hover { background: rgba(239, 68, 68, 0.25); }

.btn-modal-warning {
  background: rgba(234, 179, 8, 0.15);
  color: #eab308;
  border: 1px solid rgba(234, 179, 8, 0.2);
}

.btn-modal-warning:hover { background: rgba(234, 179, 8, 0.25); }

.admin-actions-grid {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.admin-msg {
  font-size: 0.8rem;
  color: #eab308;
  min-height: 20px;
  margin-top: 4px;
}

.admin-logged-in { font-size: 0.8rem; color: var(--text-muted); }

.admin-logged-in .admin-link {
  background: none;
  border: none;
  color: var(--accent-cyan);
  cursor: pointer;
  text-decoration: underline;
  font-size: 0.8rem;
  padding: 0;
  font-family: var(--font-inter);
}

/* ── Toast ── */
.toast-container {
  position: fixed;
  top: 20px;
  right: 340px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: rgba(22, 22, 30, 0.95);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  padding: 14px 18px;
  border-radius: var(--border-radius-md);
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  min-width: 280px;
  max-width: 420px;
  pointer-events: auto;
  animation: toastSlideIn 0.3s ease-out;
  font-size: 0.85rem;
  position: relative;
}

.toast-success { border-color: rgba(34,197,94,0.4); }
.toast-error   { border-color: rgba(239,68,68,0.4); }
.toast-info    { border-color: rgba(61,181,255,0.4); }

.toast-header { font-weight: 600; margin-bottom: 4px; }
.toast-body { white-space: pre-wrap; word-break: break-word; }

.toast-close {
  position: absolute;
  top: 8px;
  right: 8px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  padding: 2px 6px;
}

@keyframes toastSlideIn {
  from { transform: translateX(100px); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}
