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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #0f1117;
  color: #e2e8f0;
  min-height: 100vh;
}

.app {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 16px;
}

header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 32px;
}

header h1 {
  font-size: 1.6rem;
  font-weight: 700;
  color: #f8fafc;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: #1e2130;
  border: 1px solid #2d3148;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
}

.stat-number {
  font-size: 2rem;
  font-weight: 700;
  color: #818cf8;
}

.stat-label {
  font-size: 0.8rem;
  color: #94a3b8;
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  border-bottom: 1px solid #2d3148;
  padding-bottom: 0;
}

.tab {
  background: none;
  border: none;
  color: #94a3b8;
  padding: 10px 20px;
  cursor: pointer;
  font-size: 0.95rem;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all 0.2s;
}

.tab:hover { color: #e2e8f0; }
.tab.active { color: #818cf8; border-bottom-color: #818cf8; }

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

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

.table-header h2 { font-size: 1.1rem; color: #f8fafc; }

.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

thead th {
  background: #1e2130;
  color: #94a3b8;
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

tbody tr {
  border-bottom: 1px solid #1e2130;
  transition: background 0.15s;
}

tbody tr:hover { background: #1e2130; }

tbody td {
  padding: 12px 16px;
  color: #cbd5e1;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty { text-align: center; color: #475569; padding: 40px !important; }

/* Badges */
.badge {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-success { background: #064e3b; color: #34d399; }
.badge-danger { background: #450a0a; color: #f87171; }

.status-badge {
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.status-pending    { background: #1e3a5f; color: #60a5fa; }
.status-processing { background: #1c1f4a; color: #818cf8; }
.status-completed  { background: #064e3b; color: #34d399; }
.status-failed     { background: #450a0a; color: #f87171; }
.status-cancelled  { background: #1e1e2e; color: #94a3b8; }

.priority-1 { color: #f87171; font-weight: 700; }
.priority-2 { color: #fbbf24; font-weight: 700; }
.priority-3 { color: #34d399; font-weight: 700; }

/* Form */
.form-card {
  background: #1e2130;
  border: 1px solid #2d3148;
  border-radius: 12px;
  padding: 28px;
  max-width: 600px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  color: #94a3b8;
  margin-bottom: 8px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  background: #0f1117;
  border: 1px solid #2d3148;
  border-radius: 8px;
  color: #e2e8f0;
  padding: 10px 14px;
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: #818cf8;
}

.form-group textarea { resize: vertical; font-family: monospace; }

.btn-primary {
  background: #4f46e5;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 12px 28px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-primary:hover { background: #4338ca; }

.btn-danger {
  background: #7f1d1d;
  color: #fca5a5;
  border: none;
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-danger:hover { background: #991b1b; }

.btn-cancel {
  background: #1e2130;
  color: #94a3b8;
  border: 1px solid #2d3148;
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 0.8rem;
  cursor: pointer;
}

.btn-cancel:hover { background: #2d3148; }

select#status-filter {
  background: #1e2130;
  border: 1px solid #2d3148;
  border-radius: 8px;
  color: #e2e8f0;
  padding: 8px 12px;
  font-size: 0.875rem;
}

.error-msg {
  background: #450a0a;
  color: #f87171;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 0.875rem;
}

.success-msg {
  background: #064e3b;
  color: #34d399;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 0.875rem;
}