/* ==========================================================================
   B.OCR Web - Professional Desktop Utility Design System
   Ref: redesain.md (Utility-first, Dense, Restrained, Operational)
   ========================================================================== */

/* Tokens are centrally defined in css/base.css with dual Light/Dark theme support */

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

html, body {
  width: 100%;
  height: 100%;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.45;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #242a32;
  border-radius: var(--radius-xs);
}
::-webkit-scrollbar-thumb:hover {
  background: #374151;
}

/* ==========================================================================
   APP SHELL LAYOUT
   ========================================================================== */

body {
  display: flex;
  flex-direction: column;
}

/* Header (52px height) */
.app-header {
  height: var(--header-height);
  min-height: var(--header-height);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 50;
  user-select: none;
}

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

.app-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: inherit;
}

.app-logo {
  width: 22px;
  height: 22px;
  object-fit: contain;
  border-radius: 4px;
}

.app-title {
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.app-version {
  font-size: 11px;
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--text-subtle);
  background: var(--surface-2);
  padding: 1px 6px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-subtle);
}

.credit-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}
.credit-badge:hover {
  color: var(--text);
  background: var(--surface-2);
  border-color: var(--border-subtle);
}

/* Header Navigation (Segmented utility control) */
.titlebar-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--surface-2);
  padding: 3px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  margin-left: 8px;
}

.nav-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.nav-tab:hover:not(.active) {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}
.nav-tab.active {
  background: var(--surface);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.nav-tab.active svg {
  color: var(--accent);
}

/* Header Right */
.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-titlebar-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-titlebar-action:hover {
  color: var(--text);
  background: var(--surface-hover);
  border-color: var(--border);
}

/* ==========================================================================
   MAIN WORKSPACE LAYOUT
   ========================================================================== */

.app-main {
  flex: 1;
  display: flex;
  overflow: hidden;
  position: relative;
}

.app-view {
  display: none;
  width: 100%;
  height: 100%;
  flex: 1;
}
.app-view.active {
  display: flex;
}

/* ==========================================================================
   SIDEBAR (Control Panel - 340px)
   ========================================================================== */

.panel-left {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  max-width: var(--sidebar-width);
  height: 100%;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  user-select: none;
}

/* Unified Control Panel Container */
.control-panel {
  display: flex;
  flex-direction: column;
  padding: 16px;
  gap: 18px;
}

/* Sidebar Section Headers */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 10px;
}

.section-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  gap: 6px;
}
.section-title svg {
  color: var(--text-muted);
}

.section-meta {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--accent);
  font-weight: 600;
}

/* Form Groups & Inputs */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.input-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.input-hint {
  font-size: 11px;
  color: var(--text-subtle);
  line-height: 1.35;
}

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

.input-text {
  flex: 1;
  height: 36px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 12px;
  padding: 0 10px;
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease;
  min-width: 0;
}
.input-text:focus {
  border-color: var(--accent);
  background: #191f27;
}
.input-text[readonly] {
  color: var(--text-muted);
  cursor: default;
}
.input-text.mono {
  font-family: var(--font-mono);
  font-size: 11.5px;
}

/* File Found Pill */
.file-count-badge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 11.5px;
  color: var(--text);
  margin-top: 4px;
}
.file-count-badge .badge-tag {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  background: var(--accent-dim);
  color: #60a5fa;
  border: 1px solid var(--accent-border);
  padding: 1px 6px;
  border-radius: 3px;
}

/* Format Penamaan (Segmented Grid) */
.format-segmented-control {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.format-segment-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  color: var(--text-muted);
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}
.format-segment-btn:hover:not(.active) {
  background: var(--surface-hover);
  border-color: var(--border-strong);
  color: var(--text);
}
.format-segment-btn.active {
  background: #141b24;
  border-color: var(--accent);
  color: #ffffff;
}

.format-icon-svg {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-subtle);
  flex-shrink: 0;
}
.format-segment-btn.active .format-icon-svg {
  background: var(--accent-dim);
  color: var(--accent);
}

.format-text-wrap {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.format-title {
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.2;
}
.format-preview {
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--text-subtle);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}
.format-segment-btn.active .format-preview {
  color: #93c5fd;
}

/* Presets & Input Pages for Split */
.split-presets-row {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}
.btn-preset {
  flex: 1;
  height: 28px;
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-preset:hover {
  color: var(--text);
  border-color: var(--border);
}
.btn-preset.active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: #60a5fa;
  font-weight: 600;
}

/* Info Notice Box */
.info-notice-box {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.35;
}
.info-notice-box svg {
  color: var(--accent);
  flex-shrink: 0;
  margin-top: 1px;
}

/* Destination Paths List */
.folder-dest-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 11px;
}
.folder-dest-item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.folder-dest-tag {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 3px;
  flex-shrink: 0;
}
.tag-split { background: #1f2937; color: #9ca3af; }
.tag-hasil { background: rgba(34, 197, 94, 0.15); color: #4ade80; }
.tag-gagal { background: rgba(239, 68, 68, 0.15); color: #f87171; }
.folder-dest-path {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-subtle);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Preview Switch Row */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0;
}
.toggle-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
}
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 34px;
  height: 18px;
  flex-shrink: 0;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #242a32;
  transition: .2s;
  border-radius: 18px;
}
.toggle-slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 2px;
  bottom: 2px;
  background-color: #ffffff;
  transition: .2s;
  border-radius: 50%;
}
input:checked + .toggle-slider {
  background-color: var(--accent);
}
input:checked + .toggle-slider:before {
  transform: translateX(16px);
}

/* ==========================================================================
   BUTTONS (Utility Hierarchy)
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
  user-select: none;
  white-space: nowrap;
  outline: none;
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.1);
}
.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
}
.btn-primary:active:not(:disabled) {
  background: var(--accent-active);
}

.btn-success {
  background: var(--success);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.15);
}
.btn-success:hover:not(:disabled) {
  background: var(--success-hover);
}

.btn-outline {
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--text);
}
.btn-outline:hover:not(:disabled) {
  background: var(--surface-hover);
  border-color: var(--border-strong);
  color: #ffffff;
}

.btn-warning {
  background: var(--surface-2);
  border-color: rgba(245, 158, 11, 0.3);
  color: #fbbf24;
}
.btn-warning:hover:not(:disabled) {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.5);
}

.btn-danger {
  background: var(--surface-2);
  border-color: rgba(239, 68, 68, 0.3);
  color: #f87171;
}
.btn-danger:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.5);
}

.btn-lg {
  height: 42px;
  width: 100%;
  font-size: 13px;
  font-weight: 600;
}

.btn-sm {
  height: 28px;
  padding: 0 8px;
  font-size: 11px;
}

.btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-group-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

/* Action section */
.action-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ==========================================================================
   PROGRESS & METRICS (Compact Operational Display)
   ========================================================================== */

.progress-card {
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.progress-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
}
.progress-status-title {
  font-weight: 600;
  color: var(--text);
}
.progress-counts {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-muted);
}

.progress-track {
  width: 100%;
  height: 6px;
  background: #242a32;
  border-radius: 3px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.15s linear;
}

/* Compact Metrics (Single Line / Minimalist Data) */
.metrics-summary-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-subtle);
  border-top: 1px solid var(--border-subtle);
  padding-top: 8px;
}
.metric-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.metric-pill strong {
  color: var(--text);
  font-family: var(--font-mono);
}
.metric-pill.success strong { color: var(--success); }
.metric-pill.failed strong { color: var(--danger); }

.current-processing-file {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 4px 6px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}

/* Phase Badge */
.phase-badge {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: 3px;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-subtle);
}
.phase-badge.phase-split { color: #60a5fa; border-color: rgba(59,130,246,0.3); }
.phase-badge.phase-ocr { color: #fbbf24; border-color: rgba(245,158,11,0.3); }
.phase-badge.phase-done { color: #4ade80; border-color: rgba(34,197,94,0.3); }

/* ==========================================================================
   SELECTED RESULT DETAIL (Clean Definition List)
   ========================================================================== */

.detail-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}
.detail-item {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.detail-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-subtle);
  letter-spacing: 0.04em;
}
.detail-val {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  word-break: break-all;
}
.detail-val.mono {
  font-family: var(--font-mono);
  font-size: 11.5px;
}
.detail-val.highlight {
  color: #60a5fa;
}

/* ==========================================================================
   MAIN WORKSPACE (Right Panel)
   ========================================================================== */

.panel-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  background: var(--bg);
  padding: 16px;
  gap: 16px;
  min-width: 0;
}

/* Workspace Panels */
.workspace-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel-header {
  height: 42px;
  min-height: 42px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  user-select: none;
}

.panel-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.panel-title svg {
  color: var(--text-muted);
}

/* Preview Toolbar */
.preview-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
}
.preview-toolbar .btn-icon {
  width: 26px;
  height: 26px;
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.12s ease;
}
.preview-toolbar .btn-icon:hover {
  color: var(--text);
  border-color: var(--border);
}
.preview-page-text {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  padding: 0 4px;
}

/* Document Preview Container */
.preview-body {
  height: 280px;
  min-height: 280px;
  background: #080a0c;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  position: relative;
  padding: 12px;
}

.preview-canvas {
  max-width: 100%;
  max-height: 100%;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  border-radius: 2px;
  background: #ffffff;
}

.preview-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-subtle);
  text-align: center;
}
.preview-placeholder svg {
  color: var(--text-subtle);
  opacity: 0.6;
}
.placeholder-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}
.placeholder-desc {
  font-size: 11px;
  color: var(--text-subtle);
}

/* ==========================================================================
   DESKTOP DATA GRID (Results Table)
   ========================================================================== */

.table-section {
  flex: 1;
  min-height: 320px;
}

.table-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.table-container {
  flex: 1;
  overflow: auto;
  background: var(--surface);
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 12px;
}

.results-table th {
  background: var(--surface-2);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 11px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
  white-space: nowrap;
}

.results-table td {
  padding: 7px 12px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

.results-table tbody tr {
  transition: background-color 0.1s ease;
}
.results-table tbody tr:hover {
  background-color: var(--surface-hover);
}

.results-table td.mono {
  font-family: var(--font-mono);
  font-size: 11.5px;
}

/* Status cell (Indicator Dot + Text) */
.status-cell {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 500;
}
.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.status-cell.success { color: #4ade80; }
.status-cell.success .status-dot { background: var(--success); }
.status-cell.failed { color: #f87171; }
.status-cell.failed .status-dot { background: var(--danger); }
.status-cell.waiting { color: var(--text-subtle); }
.status-cell.waiting .status-dot { background: var(--text-subtle); }
.status-cell.processing { color: #60a5fa; }
.status-cell.processing .status-dot { background: var(--accent); }
.status-cell.tidak-ada { color: #94a3b8; }
.status-cell.tidak-ada .status-dot { background: #94a3b8; }
.status-cell.review { color: #fbbf24; }
.status-cell.review .status-dot { background: var(--warning); }

/* Review Card in Sidebar */
.review-card {
  margin-top: 10px;
  padding: 10px;
  background: rgba(245, 158, 11, 0.05);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: var(--radius-sm);
}
.review-title {
  font-size: 10px;
  font-weight: 700;
  color: var(--warning);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.review-candidates-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
  max-height: 180px;
  overflow-y: auto;
}
.review-candidate-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.15s ease;
}
.review-candidate-item:hover {
  border-color: var(--accent);
}
.review-candidate-item input[type="radio"] {
  margin-top: 2px;
  accent-color: var(--accent);
}
.review-candidate-info {
  flex: 1;
  min-width: 0;
}
.review-candidate-name {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text);
  word-break: break-all;
}
.review-candidate-score {
  font-size: 10px;
  color: var(--text-muted);
}
.review-actions-row {
  display: flex;
  gap: 8px;
}
.review-actions-row .btn {
  flex: 1;
}

/* Table Empty State */
.table-empty-wrap {
  padding: 48px 16px;
  text-align: center;
  color: var(--text-subtle);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.table-empty-wrap svg {
  color: var(--text-subtle);
  opacity: 0.5;
  margin-bottom: 4px;
}
.empty-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
}
.empty-desc {
  font-size: 11.5px;
  color: var(--text-subtle);
}

/* ==========================================================================
   STATUSBAR (Bottom 32px)
   ========================================================================== */

.app-statusbar {
  height: var(--statusbar-height);
  min-height: var(--statusbar-height);
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  font-size: 11.5px;
  user-select: none;
  z-index: 40;
}

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

.status-dot-indicator {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  flex-shrink: 0;
}
.status-dot-indicator.running { background: var(--accent); }
.status-dot-indicator.paused { background: var(--warning); }
.status-dot-indicator.error { background: var(--danger); }

.statusbar-text {
  font-family: var(--font-mono);
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.statusbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-statusbar-toggle {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.12s ease;
}
.btn-statusbar-toggle:hover {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border-subtle);
}
.badge-count {
  font-family: var(--font-mono);
  font-size: 10px;
  background: var(--surface-2);
  color: var(--text-subtle);
  padding: 0 5px;
  border-radius: 3px;
}

/* ==========================================================================
   CONSOLE DRAWER (Bottom Slide-Up Terminal)
   ========================================================================== */

.console-drawer {
  position: fixed;
  bottom: var(--statusbar-height);
  left: 0;
  right: 0;
  height: 220px;
  background: #0a0c0f;
  border-top: 1px solid var(--border);
  display: none;
  flex-direction: column;
  z-index: 35;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.4);
}
.console-drawer.expanded {
  display: flex;
}

.console-drawer-header {
  height: 32px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  user-select: none;
}
.console-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.console-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.6;
}
.log-item {
  display: flex;
  gap: 10px;
}
.log-time { color: var(--text-subtle); }
.log-type { font-weight: 600; width: 50px; }
.log-type.INFO { color: #60a5fa; }
.log-type.SUCCESS { color: #4ade80; }
.log-type.WARN { color: #fbbf24; }
.log-type.ERROR { color: #f87171; }
.log-msg { color: var(--text); word-break: break-all; }

/* ==========================================================================
   MODAL & POPUP (Professional Utility Dialog)
   ========================================================================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}

.modal-content {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  position: relative;
}

.dev-modal-content {
  width: 440px;
  max-width: 95%;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.dev-modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
}
.dev-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 3px;
}
.dev-title-block h2 {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
}
.dev-title-block span {
  font-size: 11px;
  color: var(--text-subtle);
}

.dev-author-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.dev-author-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-subtle);
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}
.dev-author-name {
  font-size: 16px;
  font-weight: 700;
  color: #60a5fa;
}
.dev-author-desc {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 2px;
  line-height: 1.4;
}

.dev-features-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.dev-feature-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--text-muted);
}
.dev-feature-line svg {
  color: var(--accent);
  flex-shrink: 0;
}

.btn-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 24px;
  height: 24px;
  background: transparent;
  border: none;
  color: var(--text-subtle);
  border-radius: var(--radius-xs);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-modal-close:hover {
  color: var(--text);
  background: var(--surface-2);
}

/* Spin animation for processing */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.spin-icon {
  animation: spin 1s linear infinite;
}
