/* ============================================
   SquareLine Atlas - Wireframe CSS
   Light tema, fekete-feher, letisztult design
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* --- Scrollbar (fele szélesség) --- */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #c0c0c0;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a0a0a0;
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: #c0c0c0 transparent;
}

html, body {
  width: 100%;
  height: 100%;
  background: #f0f0f0;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: #222;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ============================================
   APP SHELL
   ============================================ */
.app-shell {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  visibility: hidden; /* Rejtett amig auth nem keszul el */
}

/* --- App Header --- */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 48px;
  min-height: 48px;
  padding: 0 20px;
  background: #fff;
  border-bottom: 1px solid #ddd;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  z-index: 10;
}

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

.app-title {
  font-size: 15px;
  font-weight: 700;
  color: #222;
  letter-spacing: -0.3px;
  white-space: nowrap;
}

.app-version {
  font-size: 11px;
  font-weight: 500;
  color: #999;
  white-space: nowrap;
}

.app-title-separator {
  width: 1px;
  height: 20px;
  background: #ddd;
}

/* --- Project/Version Selector --- */
.app-project-selector {
  display: flex;
  align-items: center;
  gap: 6px;
}

.app-project-selector select {
  padding: 4px 8px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #f8f8f8;
  color: #222;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s ease;
}

.app-project-selector select:hover {
  border-color: #aaa;
}

.app-project-selector select:focus {
  border-color: #888;
  box-shadow: 0 0 0 2px rgba(0,0,0,0.05);
}

#project-select {
  max-width: 280px;
  font-weight: 700;
}

#version-select {
  min-width: 60px;
}

.app-mode-switch {
  display: flex;
  gap: 2px;
  background: #eee;
  border-radius: 6px;
  padding: 2px;
}

.mode-btn {
  padding: 5px 16px;
  font-size: 12px;
  font-weight: 600;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: #666;
  cursor: pointer;
  transition: all 0.15s ease;
}

.mode-btn:hover {
  color: #333;
}

.mode-btn.active {
  background: #fff;
  color: #111;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* --- Play / Stop Button (jobb panel teteje) --- */
.proto-play-btn {
  padding: 4px 16px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid #27ae60;
  border-radius: 4px;
  background: #27ae60;
  color: #fff;
  cursor: pointer;
  transition: all 0.15s ease;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.proto-play-btn:hover {
  background: #219a52;
  border-color: #219a52;
}

.proto-play-btn.playing {
  background: #e74c3c;
  border-color: #e74c3c;
}

.proto-play-btn.playing:hover {
  background: #c0392b;
  border-color: #c0392b;
}

.proto-play-btn.hidden {
  display: none;
}

/* --- App Body --- */
.app-body {
  flex: 1;
  display: flex;
  overflow: hidden;
}

/* --- Sidebar --- */
.app-sidebar {
  width: 200px;
  min-width: 120px;
  background: #fff;
  border-right: 1px solid #ddd;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-title {
  padding: 12px 16px 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #999;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 0 8px 8px;
}

.sidebar-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 500;
  color: #555;
  text-align: left;
  border: none;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  transition: all 0.1s ease;
  margin-bottom: 1px;
}

.sidebar-item-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-item:hover {
  background: #f0f0f0;
  color: #222;
}

.sidebar-item.active {
  background: #e8e8e8;
  color: #111;
  font-weight: 600;
}

.sidebar-item.disabled {
  opacity: 0.4;
  pointer-events: none;
  cursor: default;
}

.sidebar-group-title {
  padding: 8px 10px 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #aaa;
  border-top: 1px solid #e0e0e0;
  margin-top: 6px;
  padding-top: 10px;
}

.sidebar-group-title:first-child {
  border-top: none;
  margin-top: 0;
  padding-top: 8px;
}

/* --- Resize Handles --- */
.resize-handle {
  width: 5px;
  flex-shrink: 0;
  cursor: col-resize;
  background: transparent;
  position: relative;
  z-index: 10;
  transition: background 0.15s ease;
}

.resize-handle:hover,
.resize-handle.active {
  background: #b0b0b0;
}

.resize-handle.hidden {
  display: none;
}

body.resizing {
  cursor: col-resize !important;
  user-select: none !important;
  -webkit-user-select: none !important;
}

body.resizing * {
  cursor: col-resize !important;
}

/* --- Main Area --- */
.app-main {
  flex: 1;
  display: flex;
  padding: 20px;
  background: #e8e8e8;
  min-width: 0;
  overflow: auto;
}

.app-main-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin: auto;
}

/* --- Simulation Controls Panel (Prototype mod, docs panel bal oldalan) --- */
.app-sim-panel {
  width: 280px;
  min-width: 200px;
  background: #f8f8f8;
  border-left: 1px solid #ddd;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px;
}

.app-sim-panel.hidden {
  display: none;
}

/* --- Documentation Panel --- */
.app-docs {
  width: 320px;
  min-width: 200px;
  background: #fff;
  border-left: 1px solid #ddd;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.docs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  border-bottom: 1px solid #eee;
  min-height: 40px;
  gap: 8px;
}

.docs-title {
  font-size: 14px;
  font-weight: 700;
  color: #222;
}

.docs-content {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  font-size: 12px;
  line-height: 1.6;
  color: #444;
}

.docs-content h4 {
  font-size: 12px;
  font-weight: 700;
  color: #222;
  margin: 12px 0 4px;
}

.docs-content h4:first-child {
  margin-top: 0;
}

.docs-content p {
  margin: 4px 0;
}

.docs-content ul {
  margin: 4px 0 4px 16px;
}

.docs-content li {
  margin: 2px 0;
}

/* ============================================
   COLLAPSIBLE SECTIONS
   ============================================ */
.collapsible-section {
  border-bottom: 2px solid #d0d0d0;
}

.collapsible-section:last-child {
  border-bottom: none;
}

.collapsible-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  cursor: pointer;
  user-select: none;
  background: #eee;
  border-top: 1px solid #d8d8d8;
  transition: background 0.15s ease;
}

.collapsible-section:first-child .collapsible-header {
  border-top: none;
}

.collapsible-header:hover {
  background: #e2e2e2;
}

.collapsible-chevron {
  font-size: 10px;
  color: #888;
  transition: transform 0.2s ease;
  display: inline-block;
}

.collapsible-section.open .collapsible-chevron {
  transform: rotate(90deg);
}

.collapsible-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #555;
}

.collapsible-body {
  display: none;
  padding: 12px;
}

#approval-content.collapsible-body {
  padding: 0;
}

.collapsible-section.open .collapsible-body {
  display: block;
}

/* ============================================
   DOCS PANEL - Subject Variables & Backend API
   ============================================ */
.docs-section {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px dashed #ddd;
}

.docs-section:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.docs-section-title {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #999;
  margin-bottom: 8px;
}

/* --- Subject Variables --- */
.subject-table {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.subject-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 6px;
  background: #f8f9fa;
  border-radius: 3px;
  font-size: 11px;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
}

.subject-key {
  flex: 1;
  color: #555;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.subject-value {
  min-width: 52px;
  text-align: right;
  font-weight: 700;
  color: #222;
  transition: color 0.3s ease, background 0.3s ease;
  padding: 0 4px;
  border-radius: 2px;
}

.subject-value-changed {
  color: #2563eb;
  background: #eff6ff;
}

.subject-badge {
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 1px 5px;
  border-radius: 2px;
  white-space: nowrap;
  font-family: 'Segoe UI', system-ui, sans-serif;
}

.badge-read {
  background: #e0f2fe;
  color: #0369a1;
}

.badge-write {
  background: #fef3c7;
  color: #92400e;
}

.badge-readwrite {
  background: #dcfce7;
  color: #166534;
}

/* --- Backend API --- */
.api-table {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.api-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 6px 0;
  font-size: 11px;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
}

.api-method {
  font-size: 9px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 2px;
  white-space: nowrap;
  min-width: 28px;
  text-align: center;
  font-family: 'Segoe UI', system-ui, sans-serif;
}

.api-method-get {
  background: #e0f2fe;
  color: #0369a1;
}

.api-method-set {
  background: #fef3c7;
  color: #92400e;
}

.api-endpoint {
  color: #555;
  font-weight: 500;
}

.api-description {
  font-size: 10px;
  color: #999;
  padding: 0 6px 4px 39px;
  font-family: 'Segoe UI', system-ui, sans-serif;
}

/* --- Device Frame (touchscreen kontener) --- */
.device-frame {
  width: 480px;
  height: 320px;
  min-width: 480px;
  min-height: 320px;
  background: #f5f5f5;
  border: 2px solid #bbb;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.15);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Zöld pulzáló keret prototípus lejátszás közben */
.device-frame.proto-playing {
  border-color: #27ae60;
  animation: proto-pulse 2s ease-in-out infinite;
}

@keyframes proto-pulse {
  0%   { box-shadow: 0 0 4px rgba(39, 174, 96, 0.3),  0 2px 20px rgba(0, 0, 0, 0.15); }
  50%  { box-shadow: 0 0 16px rgba(39, 174, 96, 0.6), 0 2px 20px rgba(0, 0, 0, 0.15); }
  100% { box-shadow: 0 0 4px rgba(39, 174, 96, 0.3),  0 2px 20px rgba(0, 0, 0, 0.15); }
}

/* --- Screen Container (a betoltott screen) --- */
.screen {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

/* ============================================
   HEADER - Felso Statuszsav
   ============================================ */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 36px;
  min-height: 36px;
  padding: 0 10px;
  background: #fff;
  border-bottom: 1px solid #ccc;
  gap: 8px;
}

.header-status {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  color: #111;
}

/* --- Progress Bar (homerseklet jelzo) --- */
.header-progress {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 200px;
}

.progress-bar {
  flex: 1;
  height: 10px;
  background: #e0e0e0;
  border: 1px solid #bbb;
  border-radius: 5px;
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #999, #666, #333);
  border-radius: 4px;
  transition: width 0.5s ease;
}

.progress-text {
  font-size: 11px;
  font-weight: 700;
  color: #444;
  white-space: nowrap;
  min-width: 32px;
  text-align: right;
}

/* --- DMX Info --- */
.header-dmx {
  font-size: 11px;
  font-weight: 600;
  color: #555;
  white-space: nowrap;
}

/* ============================================
   MAIN CONTENT AREA
   ============================================ */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 10px;
  gap: 10px;
  overflow: hidden;
}

/* --- 2x2 Button Grid (Home Screen) --- */
.btn-grid-2x2 {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 10px;
}

/* --- 2x3 Button Grid (Settings Menu) --- */
.btn-grid-2x3 {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr 1fr;
  gap: 8px;
}

/* --- 3x2 Button Grid --- */
.btn-grid-3x2 {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 8px;
}

/* --- Single Column List --- */
.btn-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* --- 3-Column Layout (Timer screen stb.) --- */
.columns-3 {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: #fff;
  border: 1px solid #bbb;
  border-radius: 6px;
  color: #222;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  user-select: none;
  padding: 8px 12px;
  line-height: 1.2;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.btn:hover {
  background: #eee;
  border-color: #999;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.btn:active {
  background: #ddd;
  border-color: #888;
  transform: scale(0.97);
  box-shadow: none;
}

.btn.active {
  background: #333;
  color: #fff;
  border-color: #222;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* --- Button Variants --- */
.btn-lg {
  font-size: 16px;
  font-weight: 700;
}

.btn-sm {
  font-size: 11px;
  padding: 4px 8px;
}

.btn-danger {
  border-color: #999;
  color: #444;
}

.btn-danger:hover {
  background: #faf0f0;
  border-color: #888;
}

.btn-success {
  border-color: #999;
  color: #444;
}

.btn-success:hover {
  background: #f0faf0;
  border-color: #888;
}

.btn-icon {
  font-size: 20px;
  padding: 4px;
}

/* --- Arrow Buttons (value adjustment) --- */
.btn-arrow {
  width: 40px;
  height: 40px;
  font-size: 18px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

/* --- Toggle Switch --- */
.toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.toggle-track {
  width: 40px;
  height: 20px;
  background: #ccc;
  border: 1px solid #aaa;
  border-radius: 10px;
  position: relative;
  transition: background 0.2s ease;
}

.toggle-track.active {
  background: #777;
}

.toggle-thumb {
  width: 16px;
  height: 16px;
  background: #fff;
  border: 1px solid #999;
  border-radius: 50%;
  position: absolute;
  top: 1px;
  left: 1px;
  transition: left 0.2s ease;
}

.toggle-track.active .toggle-thumb {
  left: 21px;
}

.toggle-label {
  font-size: 12px;
  color: #444;
}

/* ============================================
   VALUE DISPLAY (nagy szam kijelzo)
   ============================================ */
.value-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.value-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #777;
}

.value-number {
  font-size: 36px;
  font-weight: 700;
  color: #111;
  line-height: 1;
}

.value-unit {
  font-size: 11px;
  color: #777;
}

/* ============================================
   COLUMN CONTROL (3 oszlopos layout)
   ============================================ */
.control-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 4px;
}

/* ============================================
   FOOTER - Also Navigacios Sav
   ============================================ */
.footer {
  display: flex;
  align-items: stretch;
  height: 44px;
  min-height: 44px;
  background: #fff;
  border-top: 1px solid #ccc;
  gap: 10px;
  padding: 5px 10px;
}

.footer .btn {
  flex: 1;
  font-size: 13px;
  border-radius: 4px;
}

.footer-btn-left,
.footer-btn-right {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ============================================
   INFO PANEL (szoveges informaciok)
   ============================================ */
.info-panel {
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  padding: 4px 0;
  border-bottom: 1px solid #e0e0e0;
}

.info-row:last-child {
  border-bottom: none;
}

.info-label {
  color: #777;
  font-weight: 500;
}

.info-value {
  color: #111;
  font-weight: 600;
}

/* ============================================
   DIALOG / CONFIRMATION
   ============================================ */
.dialog-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  gap: 12px;
  text-align: center;
}

.dialog-title {
  font-size: 14px;
  font-weight: 700;
  color: #111;
}

.dialog-text {
  font-size: 12px;
  color: #555;
  line-height: 1.5;
  max-width: 380px;
}

.dialog-buttons {
  display: flex;
  gap: 20px;
  margin-top: 8px;
}

.dialog-buttons .btn {
  min-width: 120px;
  padding: 10px 20px;
}

/* ============================================
   NUMPAD (DMX Settings)
   ============================================ */
.numpad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}

.numpad .btn {
  font-size: 16px;
  font-weight: 700;
  padding: 8px;
  min-height: 36px;
}

/* ============================================
   QR CODE PLACEHOLDER
   ============================================ */
.qr-placeholder {
  width: 120px;
  height: 120px;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #333;
  font-size: 10px;
  font-weight: 600;
}

/* ============================================
   ERROR SCREEN
   ============================================ */
.error-icon {
  font-size: 40px;
  color: #666;
  margin-bottom: 8px;
}

.error-title {
  font-size: 16px;
  font-weight: 700;
  color: #111;
  text-transform: uppercase;
}

.error-message {
  font-size: 12px;
  color: #555;
  text-align: center;
  max-width: 300px;
  line-height: 1.4;
}

/* ============================================
   COUNTDOWN
   ============================================ */
.countdown-display {
  font-size: 48px;
  font-weight: 700;
  color: #111;
  font-variant-numeric: tabular-nums;
}

/* --- Boot Spinner --- */
.boot-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid #ddd;
  border-top-color: #4CAF50;
  border-radius: 50%;
  animation: boot-spin 0.8s linear infinite;
  margin: 0 auto;
}

@keyframes boot-spin {
  to { transform: rotate(360deg); }
}

/* --- Loading Screen (auth check alatt latszik) --- */
.loading-screen {
  position: fixed;
  inset: 0;
  background: #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.loading-screen.hidden {
  display: none;
}

.loading-screen-content {
  text-align: center;
}

.loading-screen-title {
  font-size: 22px;
  font-weight: 700;
  color: #333;
  letter-spacing: 0.5px;
  margin-bottom: 20px;
}

.loading-screen-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid #ddd;
  border-top-color: #4CAF50;
  border-radius: 50%;
  animation: boot-spin 0.8s linear infinite;
  margin: 0 auto;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.text-center {
  text-align: center;
}

.text-muted {
  color: #888;
}

.text-sm {
  font-size: 11px;
}

.text-xs {
  font-size: 10px;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.gap-sm {
  gap: 4px;
}

.gap-md {
  gap: 8px;
}

.gap-lg {
  gap: 12px;
}

.hidden {
  display: none !important;
}

/* --- Span 2 columns in grid --- */
.col-span-2 {
  grid-column: span 2;
}

/* --- Span 2 rows in grid --- */
.row-span-2 {
  grid-row: span 2;
}

/* ============================================
   SIMULATION CONTROLS (Prototype mod)
   ============================================ */
.sim-controls {
  margin-top: 6px;
  padding: 6px 10px;
  background: #f8f8f8;
  border: 1px dashed #ccc;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  max-width: 340px;
}

.sim-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sim-label {
  font-size: 10px;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  min-width: 44px;
}

.speed-btn {
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 600;
  border: 1px solid #ccc;
  border-radius: 3px;
  background: #fff;
  color: #666;
  cursor: pointer;
  transition: all 0.1s ease;
}

.speed-btn:hover {
  background: #eee;
  border-color: #aaa;
}

.speed-btn.active {
  background: #555;
  color: #fff;
  border-color: #555;
}

/* ============================================
   DEBUG PANEL (Prototype mod, device frame alatt)
   ============================================ */
.debug-panel {
  width: 100%;
  padding: 4px 0;
  background: transparent;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.debug-panel-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #999;
  margin-bottom: 2px;
}

.debug-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
  padding-left: calc(12ch + 8px);
}

.debug-label {
  font-size: 11px;
  font-weight: 600;
  color: #666;
  width: 12ch;
  min-width: 12ch;
  max-width: 12ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-shrink: 0;
  margin-left: calc(-12ch - 8px);
}

.debug-panel .speed-btn {
  padding: 3px 10px;
  font-size: 11px;
  white-space: nowrap;
  flex-shrink: 0;
}

.debug-panel .toggle-container {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.debug-panel .toggle-track {
  width: 28px;
  height: 14px;
  border-radius: 7px;
  background: #ccc;
  position: relative;
  transition: background 0.15s ease;
}

.debug-panel .toggle-track.active {
  background: #27ae60;
}

.debug-panel .toggle-thumb {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: left 0.15s ease;
}

.debug-panel .toggle-track.active .toggle-thumb {
  left: 16px;
}

.debug-toggle-label {
  font-size: 11px;
  font-weight: 600;
  color: #666;
}

.debug-input {
  width: 52px;
  padding: 3px 6px;
  font-size: 11px;
  border: 1px solid #ccc;
  border-radius: 4px;
  text-align: center;
  font-family: inherit;
}

.debug-unit {
  font-size: 11px;
  color: #666;
  margin-left: 2px;
}

.debug-value {
  font-size: 11px;
  font-weight: 600;
  color: #333;
}

.debug-separator {
  height: 1px;
  background: #ddd;
  margin: 4px 0 2px;
}

.debug-slider {
  flex: 1;
  min-width: 60px;
  height: 4px;
  appearance: none;
  -webkit-appearance: none;
  background: #ddd;
  border-radius: 2px;
  outline: none;
  cursor: pointer;
  max-width: 120px;
}

.debug-slider::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #555;
  border: 1px solid #444;
  cursor: pointer;
}

.debug-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #555;
  border: 1px solid #444;
  cursor: pointer;
}

/* ============================================
   APP HEADER - Center & Right sections
   ============================================ */
.app-header-center {
  display: flex;
  align-items: center;
}

.app-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-header-right.hidden {
  display: none;
}

/* ============================================
   USER MENU (fejléc jobb oldalán)
   ============================================ */
.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-name {
  font-size: 13px;
  font-weight: 600;
  color: #333;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.role-badge {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 6px;
  border-radius: 3px;
  white-space: nowrap;
}

.role-badge.hidden {
  display: none;
}

.role-admin {
  background: #fef3c7;
  color: #92400e;
}

.role-customer {
  background: #e0f2fe;
  color: #0369a1;
}

.logout-btn {
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #f8f8f8;
  color: #555;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.logout-btn:hover {
  background: #eee;
  border-color: #bbb;
  color: #333;
}

.logout-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

/* ============================================
   AUTH MODAL (Bejelentkezés / Regisztráció)
   ============================================ */
.auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(2px);
}

.auth-overlay.hidden {
  display: none;
}

.auth-modal-box {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.2);
  width: 380px;
  max-width: 90vw;
  overflow: hidden;
}

.auth-modal-header {
  padding: 20px 24px 12px;
  text-align: center;
}

.auth-modal-title {
  font-size: 18px;
  font-weight: 700;
  color: #111;
  letter-spacing: -0.3px;
}

/* --- Auth Tabs --- */
.auth-tabs {
  display: flex;
  border-bottom: 1px solid #eee;
  padding: 0 24px;
}

.auth-tab {
  flex: 1;
  padding: 10px 0;
  font-size: 13px;
  font-weight: 600;
  color: #888;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.auth-tab:hover {
  color: #555;
}

.auth-tab.active {
  color: #111;
  border-bottom-color: #333;
}

/* --- Auth Form --- */
.auth-form-container {
  padding: 20px 24px 24px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-form.hidden {
  display: none;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.auth-label {
  font-size: 11px;
  font-weight: 600;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.auth-input {
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fafafa;
  color: #222;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-input:focus {
  border-color: #888;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
  background: #fff;
}

.auth-input::placeholder {
  color: #bbb;
}

/* --- Auth Password Toggle (szem ikon) --- */
.auth-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-input-wrapper .auth-input {
  flex: 1;
  padding-right: 40px;
}

.auth-password-toggle {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  color: #999;
  padding: 0;
  transition: color 0.15s ease, background 0.15s ease;
}

.auth-password-toggle:hover {
  color: #555;
  background: rgba(0, 0, 0, 0.05);
}

.auth-password-toggle .eye-icon {
  width: 18px;
  height: 18px;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.auth-password-toggle .eye-icon.hidden {
  display: none;
}

/* --- Auth Error & Success --- */
.auth-error {
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 500;
  color: #dc2626;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 6px;
  line-height: 1.4;
}

.auth-error.hidden {
  display: none;
}

.auth-success {
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 500;
  color: #16a34a;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 6px;
  line-height: 1.4;
}

.auth-success.hidden {
  display: none;
}

/* --- Auth Info Message (pl. session lejárt) --- */
.auth-info {
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 500;
  color: #2563eb;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  line-height: 1.4;
}

.auth-info.hidden {
  display: none;
}

/* --- Auth Remember Me Checkbox --- */
.auth-remember-field {
  margin-top: -4px;
}

.auth-remember-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #666;
  cursor: pointer;
  user-select: none;
}

.auth-remember-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #222;
  cursor: pointer;
  margin: 0;
}

.auth-remember-label span {
  line-height: 1;
}

/* --- Session Expiry Warning Toast --- */
.session-warning-toast {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 10001;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: #1e293b;
  color: #f1f5f9;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  animation: session-toast-in 0.3s ease;
  max-width: 420px;
}

.session-warning-toast.hiding {
  animation: session-toast-out 0.3s ease forwards;
}

.session-warning-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.session-warning-text {
  flex: 1;
}

.session-warning-btn {
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease;
  flex-shrink: 0;
}

.session-warning-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

@keyframes session-toast-in {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes session-toast-out {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-12px);
  }
}

/* --- Auth Submit Button --- */
.auth-submit-btn {
  padding: 11px 16px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  border: none;
  border-radius: 6px;
  background: #222;
  color: #fff;
  cursor: pointer;
  transition: background 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 4px;
}

.auth-submit-btn:hover {
  background: #444;
}

.auth-submit-btn:active {
  background: #111;
}

.auth-submit-btn:disabled {
  background: #999;
  cursor: default;
}

.auth-submit-text.hidden {
  display: none;
}

/* --- Auth Spinner --- */
.auth-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: auth-spin 0.6s linear infinite;
}

.auth-spinner.hidden {
  display: none;
}

@keyframes auth-spin {
  to { transform: rotate(360deg); }
}

/* ============================================
   DOCS PANEL - Tabs
   ============================================ */
.docs-tabs {
  display: flex;
  border-bottom: 1px solid #eee;
  padding: 0 16px;
  flex-shrink: 0;
}

.docs-tab {
  flex: 1;
  padding: 8px 0;
  font-size: 12px;
  font-weight: 600;
  color: #888;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.docs-tab:hover {
  color: #555;
}

.docs-tab.active {
  color: #111;
  border-bottom-color: #333;
}

.docs-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: #888;
  border-radius: 9px;
  line-height: 1;
}

.docs-tab.active .docs-tab-badge {
  background: #333;
}

.docs-tab-badge.hidden {
  display: none;
}

/* Tab content területek */
.docs-tab-content {
  display: none;
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  font-size: 12px;
  line-height: 1.6;
  color: #444;
}

.docs-tab-content.active {
  display: flex;
  flex-direction: column;
}

/* A docs-content megtartja az eredeti padding-ot */
.docs-content.docs-tab-content.active {
  display: block;
  padding: 0;
}

/* ============================================
   COMMENTS PANEL
   ============================================ */

/* --- Komment lista --- */
.comments-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.comments-empty {
  text-align: center;
  color: #999;
  padding: 32px 16px;
  font-size: 12px;
  line-height: 1.6;
}

.comments-empty-icon {
  font-size: 28px;
  margin-bottom: 8px;
  opacity: 0.4;
}

/* --- Korábbi verziók jelzés --- */
.comments-older-versions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  margin-bottom: 8px;
  background: #f0f4ff;
  border: 1px solid #d0daee;
  border-radius: 6px;
  font-size: 11px;
  color: #4a6fa5;
  flex-shrink: 0;
}

.comments-older-versions-text {
  flex: 1;
}

.comments-older-versions-btn {
  padding: 3px 10px;
  font-size: 10px;
  font-weight: 600;
  color: #4a6fa5;
  background: #fff;
  border: 1px solid #b8c9e2;
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.comments-older-versions-btn:hover {
  background: #e8eef7;
  border-color: #4a6fa5;
}

/* --- Komment kártya --- */
.comment-card {
  padding: 12px 0;
  border-bottom: 1px solid #f0f0f0;
}

.comment-card:last-child {
  border-bottom: none;
}

.comment-card-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 6px;
}

.comment-avatar {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 50%;
  background: #e0e0e0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #666;
  text-transform: uppercase;
  overflow: hidden;
}

.comment-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.comment-meta {
  flex: 1;
  min-width: 0;
}

.comment-meta-top {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
}

.comment-number {
  font-size: 11px;
  font-weight: 600;
  color: #888;
}

.comment-resolved-icon {
  color: #22c55e;
  font-size: 13px;
  line-height: 1;
}

.comment-meta-bottom {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: #999;
  margin-top: 2px;
}

.comment-author {
  font-weight: 500;
  color: #666;
}

.comment-time {
  color: #aaa;
}

.comment-actions {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}

.comment-action-btn {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  color: #bbb;
  font-size: 13px;
  transition: all 0.15s ease;
  padding: 0;
}

.comment-action-btn:hover {
  background: #f0f0f0;
  color: #666;
}

.comment-action-btn.resolved-active {
  color: #22c55e;
}

.comment-body {
  font-size: 12px;
  line-height: 1.5;
  color: #555;
  padding-left: 42px;
  word-wrap: break-word;
}

.comment-body p {
  margin: 0;
}

/* --- Komment form --- */
.comment-form {
  flex-shrink: 0;
  border-top: 1px solid #eee;
  padding: 12px 0 0;
  margin-top: auto;
}

.comment-form-body {
  width: 100%;
  min-height: 60px;
  max-height: 120px;
  padding: 8px 10px;
  font-size: 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  outline: none;
  font-family: inherit;
  color: #444;
  resize: vertical;
  line-height: 1.5;
  box-sizing: border-box;
}

.comment-form-body::placeholder {
  color: #aaa;
}

.comment-form-body:focus {
  border-color: #999;
}

.comment-form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
  padding-bottom: 4px;
}

.comment-form-submit {
  padding: 6px 16px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  background: #333;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
}

.comment-form-submit:hover {
  background: #111;
}

.comment-form-submit:disabled {
  background: #ccc;
  cursor: default;
}

/* --- Komment loading spinner --- */
.comments-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  color: #999;
  font-size: 12px;
  gap: 8px;
}

.comments-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #ddd;
  border-top-color: #666;
  border-radius: 50%;
  animation: auth-spin 0.6s linear infinite;
}

/* --- Verzió-szintű komment nézet (screen csoportok) --- */
.comment-screen-group {
  margin-bottom: 8px;
}

.comment-screen-group:last-child {
  margin-bottom: 0;
}

.comment-screen-label {
  font-size: 11px;
  font-weight: 700;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 8px 0 4px;
  border-bottom: 1px solid #eee;
  margin-bottom: 2px;
}

/* ============================================
   SIDEBAR APPROVAL ICONS
   ============================================ */

.sidebar-approval-icon {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: transparent;
  margin-left: 4px;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.sidebar-approval-icon.approved {
  color: #fff;
  background: #34a853;
  font-weight: 700;
  font-size: 9px;
}

/* ============================================
   APPROVAL PANEL
   ============================================ */

.approval-section {
  padding: 12px 16px;
  border-bottom: 1px solid #e0e0e0;
  background: #fafafa;
}

.approval-section.fully-approved {
  background: #f0faf0;
  border-bottom-color: #c8e6c8;
}

.approval-loading {
  font-size: 12px;
  color: #999;
  padding: 8px 0;
}

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

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

.approval-title {
  font-size: 11px;
  font-weight: 700;
  color: #222;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.approval-counter {
  font-size: 11px;
  font-weight: 600;
  color: #888;
}

.approval-badge-full {
  font-size: 10px;
  font-weight: 700;
  color: #34a853;
  background: #e6f4ea;
  padding: 2px 8px;
  border-radius: 10px;
  letter-spacing: 0.3px;
}

/* --- Approve / Revoke gombok --- */

.approval-btn {
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 600;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
}

.approval-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.approval-btn-approve {
  color: #fff;
  background: #34a853;
}

.approval-btn-approve:hover:not(:disabled) {
  background: #2d9249;
}

.approval-btn-revoke {
  color: #666;
  background: #eee;
}

.approval-btn-revoke:hover:not(:disabled) {
  background: #ddd;
  color: #444;
}

/* --- Tagok listája --- */

.approval-members-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.approval-member {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px;
  border-radius: 4px;
  transition: background 0.1s ease;
}

.approval-member.is-you {
  background: #fff;
}

.approval-member-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.approval-member-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  color: #999;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
}

.approval-member.approved .approval-member-avatar {
  background: #e6f4ea;
  color: #34a853;
}

.approval-member-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.approval-member-name {
  font-size: 12px;
  font-weight: 500;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.approval-you-badge {
  font-size: 10px;
  font-weight: 400;
  color: #999;
}

.approval-member-time {
  font-size: 10px;
  color: #999;
}

.approval-member-status {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
}

.approval-member-status.approved {
  color: #34a853;
  background: #e6f4ea;
}

.approval-member-status.pending {
  color: #ccc;
  background: #f5f5f5;
  font-size: 14px;
}
