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

:root {
  --bg-dark: #0f0f1a;
  --surface: #1a1a2e;
  --card: #16213e;
  --primary: #ff6b35;
  --primary-hover: #f7931e;
  --text-main: #f0f0f8;
  --text-muted: #8892b0;
  --border: rgba(255, 255, 255, 0.08);
  --radius: 12px;
  --success: #43d9a2;
  --warning: #f7931e;
  --danger: #ff4d6d;
}

body {
  background: var(--bg-dark);
  color: var(--text-main);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  min-height: 100vh;
}

.app-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 260px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
  padding: 0 8px;
}

.logo-icon {
  font-size: 28px;
}

.logo h2 {
  font-size: 18px;
  font-weight: 700;
}

.logo-tag {
  font-size: 11px;
  color: var(--primary);
  font-weight: 600;
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 8px;
  font-weight: 500;
  transition: all 0.2s;
}

.nav-item:hover, .nav-item.active {
  background: var(--card);
  color: var(--text-main);
}

.nav-item.active {
  color: var(--primary);
  font-weight: 600;
}

.api-status-box {
  background: var(--card);
  border: 1px solid var(--border);
  padding: 12px 14px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-muted);
}

.status-indicator.online {
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
}

.status-title {
  font-size: 12px;
  font-weight: 600;
}

.status-sub {
  font-size: 10px;
  color: var(--text-muted);
}

/* Main Content */
.main-content {
  flex: 1;
  padding: 32px;
  overflow-y: auto;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
}

.top-bar h1 {
  font-size: 24px;
  font-weight: 700;
}

.top-actions {
  display: flex;
  gap: 12px;
}

/* Buttons */
.btn {
  padding: 10px 18px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: #fff;
  box-shadow: 0 4px 14px rgba(255, 107, 53, 0.3);
}

.btn-primary:hover { opacity: 0.9; }

.btn-secondary {
  background: var(--card);
  color: var(--text-main);
  border: 1px solid var(--border);
}

.btn-secondary:hover { background: rgba(255,255,255,0.05); }

.btn-block { width: 100%; padding: 14px; font-size: 14px; }

/* Tabs */
.tab-content { display: none; }
.tab-content.active { display: block; }

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 20px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 16px;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.stat-icon.purple { background: rgba(255, 107, 53, 0.15); }
.stat-icon.green  { background: rgba(67, 217, 162, 0.15); }
.stat-icon.orange { background: rgba(247, 147, 30, 0.15); }
.stat-icon.red    { background: rgba(255, 77, 109, 0.15); }

.stat-value {
  font-size: 24px;
  font-weight: 700;
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
}

/* Card */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}

.card-header {
  margin-bottom: 20px;
}

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

/* Tables */
.table-responsive { overflow-x: auto; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th, .data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.data-table th {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

/* Badge */
.badge {
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  display: inline-block;
}

.badge-COMPLETED      { background: rgba(67, 217, 162, 0.2); color: var(--success); }
.badge-WAITING_FOR_QC { background: rgba(247, 147, 30, 0.2);  color: var(--warning); }
.badge-PROCESSING     { background: rgba(100, 149, 237, 0.2); color: #6495ed; }
.badge-PENDING        { background: rgba(255, 255, 255, 0.1); color: var(--text-muted); }
.badge-FAILED         { background: rgba(255, 77, 109, 0.2);  color: var(--danger); }

/* Drop Zone */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 40px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s;
  position: relative;
}

.drop-zone:hover { border-color: var(--primary); }

.drop-icon { font-size: 40px; margin-bottom: 12px; }
.drop-title { font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.drop-sub { font-size: 12px; color: var(--text-muted); }
.file-input { display: none; }

/* Forms */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; }
.form-control {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--text-main);
  outline: none;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--card);
  border: 1px solid var(--border);
  padding: 14px 20px;
  border-radius: 10px;
  font-weight: 500;
  display: none;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.toast.show { display: block; }
