:root {
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --primary-light: #eef2ff;
  --secondary: #0f172a;
  --bg: #f8fafc;
  --card: #ffffff;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --radius: 12px;
}

* { box-sizing: border-box; -webkit-font-smoothing: antialiased; }

body {
  margin: 0;
  font-family: 'Inter', -apple-system, system-ui, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

/* Layout Structure */
.shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 280px;
  background: var(--secondary);
  color: white;
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 10;
}

.main {
  flex: 1;
  padding: 2.5rem;
  max-width: 1400px;
  margin: 0 auto;
}

/* Branding */
.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 3rem;
  padding: 0 0.5rem;
}

.brand-mark {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--primary), #818cf8);
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1.25rem;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.brand strong { font-size: 1.2rem; letter-spacing: -0.02em; }
.brand .muted { color: #94a3b8; font-size: 0.8rem; margin-top: -2px; }

/* Navigation */
.nav { display: flex; flex-direction: column; gap: 0.5rem; }
.nav a {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.875rem 1rem;
  border-radius: var(--radius);
  color: #94a3b8;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav a svg { width: 20px; height: 20px; stroke-width: 2; }
.nav a:hover { color: white; background: rgba(255, 255, 255, 0.05); }
.nav a.is-active {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

.sidebar-foot {
  margin-top: auto;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Cards & Components */
.card {
  background: var(--card);
  border-radius: 16px;
  border: 1px solid var(--border);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.hero {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 2rem;
  margin-bottom: 3rem;
}

.hero-panel {
  background: linear-gradient(to right bottom, #ffffff, #f1f5f9);
  position: relative;
  overflow: hidden;
}

.hero-panel h1 {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin: 0.5rem 0 1rem;
  color: var(--secondary);
}

.hero-actions {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
}

/* Icons */
.icon-wrap {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.icon-wrap svg { width: 26px; height: 26px; }

.icon-blue { background: #e0e7ff; color: #4338ca; }
.icon-emerald { background: #dcfce7; color: #059669; }
.icon-amber { background: #fef3c7; color: #d97706; }
.icon-rose { background: #ffe4e6; color: #e11d48; }
.icon-cyan { background: #ecfeff; color: #0891b2; }
.icon-violet { background: #f3e8ff; color: #7c3aed; }

/* Buttons & Inputs */
button, .button-link {
  background: var(--primary);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

button:hover, .button-link:hover { background: var(--primary-dark); transform: translateY(-1px); }

.ghost {
  background: white;
  color: var(--text);
  border: 1px solid var(--border);
}

.ghost:hover { background: var(--bg); border-color: #cbd5e1; }

input, select, textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: white;
  font-size: 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1); }

/* Grid Layouts */
.panel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 2rem;
}

.stat-card { text-align: left; }
.eyebrow {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.pill-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1.25rem 0; }
.pill {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.375rem 0.875rem;
  background: var(--bg);
  color: var(--text-muted);
  border-radius: 99px;
  border: 1px solid var(--border);
}

/* Tables */
.table-card { padding: 0; overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
th {
  background: var(--bg);
  padding: 1rem 1.5rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
td { padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border); font-size: 0.95rem; }

.badge {
  padding: 0.375rem 0.75rem;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 700;
}
.status-completed { background: #d1fae5; color: #065f46; }
.status-queued { background: #fef3c7; color: #92400e; }
.status-failed { background: #fee2e2; color: #991b1b; }

/* Responsive */
@media (max-width: 1024px) {
  .shell { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; padding: 1.5rem; }
  .brand { margin-bottom: 1.5rem; }
  .nav { flex-direction: row; overflow-x: auto; padding-bottom: 0.5rem; }
  .nav a { white-space: nowrap; }
  .hero { grid-template-columns: 1fr; }
}
