:root {
  --bg-gradient: linear-gradient(135deg, #0b1220 0%, #121a2f 45%, #1f1f3a 100%);
  --surface: rgba(20, 29, 47, 0.78);
  --surface-border: rgba(255, 255, 255, 0.12);
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --text-main: #e5ecf8;
  --text-muted: #93a4c2;
  --danger: #ef4444;
  --success: #10b981;
  --warning: #f59e0b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg-gradient);
  color: var(--text-main);
  min-height: 100vh;
}

a {
  color: #93c5fd;
  text-decoration: none;
}

a:hover {
  color: #bfdbfe;
}

h1, h2, h3 {
  margin: 0 0 0.35rem;
  font-weight: 600;
}

code {
  font-family: Consolas, Monaco, monospace;
  font-size: 0.875rem;
  color: #c6d3ea;
}

.muted {
  color: var(--text-muted);
}

.glass {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 14px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.container {
  width: min(1220px, 96%);
  margin: 0 auto;
  padding: 1.4rem 0 2rem;
}

.navbar {
  width: min(1220px, 96%);
  margin: 1rem auto 0;
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.navbar-brand {
  font-weight: 700;
  font-size: 1.15rem;
  color: #eaf2ff;
}

.navbar-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn {
  appearance: none;
  border: 0;
  border-radius: 8px;
  padding: 0.62rem 1rem;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.92rem;
}

.btn:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: rgba(148, 163, 184, 0.2);
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: #d9e5f8;
}

.btn-secondary:hover {
  background: rgba(148, 163, 184, 0.32);
}

.btn-warning {
  background: rgba(245, 158, 11, 0.25);
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.btn-warning:hover {
  background: rgba(245, 158, 11, 0.38);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.25);
  border: 1px solid rgba(239, 68, 68, 0.45);
}

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

.btn-sm {
  padding: 0.38rem 0.6rem;
  font-size: 0.8rem;
}

.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  margin-bottom: 0.3rem;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.form-control {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.6);
  color: #e7eefc;
  padding: 0.6rem 0.75rem;
}

.form-control:focus {
  outline: none;
  border-color: rgba(59, 130, 246, 0.85);
}

.inline-form {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-bottom: 0.85rem;
}

.actions-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.panel {
  padding: 1rem;
  margin-bottom: 0.85rem;
}

.panel-inner {
  background: rgba(13, 19, 32, 0.45);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 10px;
  margin-top: 0.9rem;
}

.alert {
  border-radius: 9px;
  padding: 0.6rem 0.75rem;
  margin: 0.6rem 0;
  border: 1px solid transparent;
}

.alert.success {
  background: rgba(16, 185, 129, 0.18);
  border-color: rgba(16, 185, 129, 0.42);
}

.alert.danger {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.46);
}

.alert.warning {
  background: rgba(245, 158, 11, 0.18);
  border-color: rgba(245, 158, 11, 0.46);
}

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

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  padding: 0.58rem;
  text-align: left;
  vertical-align: top;
  font-size: 0.9rem;
}

.table th {
  color: #cad8f0;
  font-size: 0.8rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.status-badge {
  display: inline-block;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.55rem;
  text-transform: uppercase;
}

.status-active,
.status-done {
  background: rgba(16, 185, 129, 0.18);
  color: #6ee7b7;
}

.status-running {
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
}

.status-pending,
.status-queued {
  background: rgba(245, 158, 11, 0.2);
  color: #fcd34d;
}

.status-failed,
.status-cancelled {
  background: rgba(239, 68, 68, 0.22);
  color: #fca5a5;
}

.progress {
  width: 180px;
  max-width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.2);
  overflow: hidden;
  margin-top: 0.35rem;
}

.progress > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #10b981);
}

.progress-meta {
  font-size: 0.8rem;
  color: #c8d4eb;
}

.error-cell {
  max-width: 340px;
  white-space: normal;
  word-break: break-word;
  color: #fecaca;
  font-size: 0.84rem;
}

.actions-cell {
  white-space: nowrap;
}

.checkbox-inline,
.radio-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-right: 0.7rem;
  color: #d4dff2;
  font-size: 0.9rem;
}

.grid {
  display: grid;
  gap: 1rem;
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  border-radius: 7px;
  padding: 0 0.5rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.5);
  color: #d3def3;
}

.page.current {
  background: rgba(59, 130, 246, 0.28);
  border-color: rgba(59, 130, 246, 0.55);
  color: #bfdbfe;
}

.stat-card {
  padding: 1rem;
  text-align: center;
}

.stat-value {
  font-size: 2.1rem;
  font-weight: 700;
  margin-top: 0.35rem;
}

.stat-label {
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 0.82rem;
}

.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.auth-card {
  width: min(420px, 100%);
  padding: 1.3rem;
}

@media (max-width: 780px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }

  .navbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .progress {
    width: 130px;
  }
}

