:root {
  --ink: #0b0f14;
  --accent: #2f6fed;
  --line: #e5eaf2;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
}

.login-bg {
  background:
    radial-gradient(circle at 15% 20%, rgba(47, 111, 237, 0.12), transparent 35%),
    radial-gradient(circle at 85% 10%, rgba(15, 23, 42, 0.08), transparent 30%),
    linear-gradient(180deg, #f7f9fc 0%, #eef2f7 100%);
}

.nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.8rem;
  border-radius: 0.65rem;
  color: #cbd5e1;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-link:hover { background: #1a2332; color: #fff; }
.nav-link.active { background: #1a2332; color: #fff; }

.badge {
  background: #2f6fed;
  color: white;
  border-radius: 999px;
  font-size: 0.7rem;
  padding: 0.1rem 0.45rem;
  min-width: 1.25rem;
  text-align: center;
}

.page { padding: 1.5rem; max-width: 1200px; }
@media (min-width: 768px) { .page { padding: 2rem; } }

.page-header { margin-bottom: 1.5rem; }
.page-title { font-size: 1.75rem; font-weight: 600; letter-spacing: -0.02em; }
.page-subtitle { color: #64748b; margin-top: 0.25rem; }

.panel {
  background: white;
  border: 1px solid var(--line);
  border-radius: 1rem;
}

.panel-header {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--line);
  font-weight: 600;
}

.stat-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 1.1rem 1.2rem;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.stat-card:hover { border-color: #c7d2fe; transform: translateY(-1px); }
.stat-label { font-size: 0.85rem; color: #64748b; }
.stat-value { margin-top: 0.45rem; font-size: 1.5rem; font-weight: 600; }

.input {
  width: 100%;
  border: 1px solid #d7dee8;
  border-radius: 0.75rem;
  padding: 0.7rem 0.9rem;
  background: white;
  outline: none;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(47,111,237,0.12); }

.btn-primary, .btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.75rem;
  padding: 0.65rem 1rem;
  font-weight: 550;
  font-size: 0.925rem;
  transition: 0.15s ease;
}
.btn-primary { background: var(--accent); color: white; border: none; }
.btn-primary:hover { filter: brightness(1.05); }
.btn-secondary { background: white; color: #0f172a; border: 1px solid var(--line); }
.btn-secondary:hover { background: #f8fafc; }

.table { width: 100%; border-collapse: collapse; font-size: 0.925rem; }
.table th {
  text-align: left;
  padding: 0.85rem 1rem;
  color: #64748b;
  font-weight: 500;
  border-bottom: 1px solid var(--line);
  background: #fafbfc;
}
.table td { padding: 0.9rem 1rem; border-bottom: 1px solid var(--line); vertical-align: top; }

.tabs { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.tab {
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: white;
  font-size: 0.875rem;
  color: #475569;
}
.tab.active { background: #0f172a; color: white; border-color: #0f172a; }

.status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  font-size: 0.75rem;
  background: #f1f5f9;
  color: #334155;
  text-transform: lowercase;
}
.status-pending, .status-waiting_approval { background: #fff7ed; color: #c2410c; }
.status-completed, .status-executed, .status-approved { background: #ecfdf5; color: #047857; }
.status-rejected, .status-failed, .status-execution_failed { background: #fef2f2; color: #b91c1c; }
.status-running { background: #eff6ff; color: #1d4ed8; }

.chip {
  display: inline-flex;
  font-size: 0.75rem;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  padding: 0.2rem 0.5rem;
  color: #475569;
}

.msg {
  max-width: min(720px, 92%);
  border-radius: 1rem;
  padding: 0.85rem 1rem;
  font-size: 0.95rem;
  line-height: 1.5;
}
.msg-user { background: #0f172a; color: white; border-bottom-right-radius: 0.35rem; }
.msg-assistant { background: white; border: 1px solid var(--line); border-bottom-left-radius: 0.35rem; }
.msg-system {
  background: transparent;
  color: #64748b;
  font-size: 0.8rem;
  padding: 0.25rem 0.75rem;
  border: 1px dashed #cbd5e1;
  border-radius: 999px;
}

.mobile-nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 40;
}

.mobile-nav {
  position: fixed;
  inset: 0 auto 0 0;
  width: min(18rem, 86vw);
  background: #0b0f14;
  color: #e2e8f0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  transform: translateX(-105%);
  transition: transform 0.2s ease;
}

.msg-approval {
  background: #fff7ed;
  color: #9a3412;
  border: 1px solid #fed7aa;
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  font-size: 0.85rem;
}

.msg-md a { color: #2f6fed; }
.approval-kv {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 0.35rem 0.75rem;
  font-size: 0.9rem;
}
.approval-kv dt { color: #64748b; }
.approval-kv dd { color: #0f172a; word-break: break-word; }

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
