@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=JetBrains+Mono:wght@400;500&display=swap');

/* ==========================================================================
   Vahan Automation — Theme (Intangles design system)
   Tokens copied verbatim from intangles-cx/frontend/src/themes/intangles.css
   ========================================================================== */
:root {
  /* Primary */
  --color-primary: #0063E2;
  --color-primary-foreground: #FFFFFF;
  --color-primary-hover: #0050B8;
  --color-primary-light: #E8F0FE;

  /* Secondary */
  --color-secondary: #F1F5F9;
  --color-secondary-foreground: #334155;

  /* Accent */
  --color-accent: #06B6D4;
  --color-accent-foreground: #FFFFFF;

  /* Base */
  --color-background: #FDFCF8;
  --color-foreground: #002B31;
  --color-card: #FFFFFF;
  --color-card-foreground: #002B31;
  --color-muted: #F5F3EF;
  --color-muted-foreground: #64748B;

  /* Form */
  --color-border: #E2E0DC;
  --color-input: #E2E0DC;
  --color-ring: #0063E2;

  /* Status */
  --color-destructive: #EF4444;
  --color-destructive-foreground: #FFFFFF;
  --color-success: #22C55E;
  --color-success-foreground: #166534;
  --color-success-subtle: #F0FDF4;
  --color-success-border: #BBF7D0;
  --color-warning: #F59E0B;
  --color-warning-foreground: #92400E;
  --color-warning-subtle: #FFFBEB;
  --color-warning-border: #FDE68A;

  /* Sidebar */
  --color-sidebar: #002B31;
  --color-sidebar-foreground: #E2E8F0;
  --color-sidebar-active: #0063E2;
  --color-sidebar-hover: rgba(255, 255, 255, 0.08);

  /* Radii */
  --radius-lg: 0.75rem;
  --radius-md: 0.5rem;
  --radius-sm: 0.25rem;

  /* Shadows */
  --shadow-card: 0 1px 3px 0 rgba(0,0,0,0.06), 0 1px 2px -1px rgba(0,0,0,0.06);
  --shadow-dropdown: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
}

/* ==========================================================================
   Reset + Base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  background: var(--color-background);
  color: var(--color-foreground);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'kern' 1, 'liga' 1;
}

a { color: inherit; text-decoration: none; }

/* ==========================================================================
   App Shell — sidebar + header + main (CSS grid)
   ========================================================================== */

/* Grid container */
.app-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  grid-template-rows: 60px 1fr;
  grid-template-areas:
    'sidebar header'
    'sidebar main';
  min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
  grid-area: sidebar;
  grid-row: 1 / 3;
  background: var(--color-sidebar);
  background-image:
    radial-gradient(ellipse at 0% 0%, rgba(0,99,226,0.18) 0%, transparent 60%),
    radial-gradient(ellipse at 100% 100%, rgba(6,182,212,0.08) 0%, transparent 50%);
  color: var(--color-sidebar-foreground);
  display: flex;
  flex-direction: column;
  padding: 0 12px 24px;
  overflow-y: auto;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 16px;
  color: #fff;
  padding: 20px 12px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 12px;
  flex-shrink: 0;
}

.sidebar-logo-mark {
  width: 32px;
  height: 32px;
  background: var(--color-primary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}

/* legacy alias */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 16px;
  color: #fff;
  padding: 20px 12px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 12px;
  flex-shrink: 0;
}

.sidebar-brand span {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: rgba(255,255,255,0.45);
  margin-top: 2px;
}

.sidebar-nav {
  flex: 1;
  list-style: none;
  padding: 0;
}

/* Nav items — both .nav-item (injected by layout.js) and sidebar-nav li a */
.nav-item,
.sidebar-nav li a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  color: rgba(226, 232, 240, 0.75);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  margin-bottom: 1px;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
  border-left: 2px solid transparent;
  letter-spacing: 0.01em;
}

.nav-item:hover,
.sidebar-nav li a:hover {
  background: var(--color-sidebar-hover);
  color: #fff;
}

.nav-item.active,
.sidebar-nav li a.active {
  background: rgba(0, 99, 226, 0.25);
  color: #fff;
  border-left-color: var(--color-primary);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(0,99,226,0.15);
}

.nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-icon {
  font-size: 15px;
  width: 18px;
  text-align: center;
  opacity: 0.8;
  flex-shrink: 0;
}

/* ── Header ── */
.header,
.top-header {
  grid-area: header;
  position: sticky;
  top: 0;
  z-index: 20;
  height: 60px;
  min-height: 60px;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 12px;
}

.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--color-muted-foreground);
  margin-right: 4px;
  align-items: center;
  justify-content: center;
}

.sidebar-toggle svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
}

.header-title,
.page-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-foreground);
  flex: 1;
}

.header-actions { display: flex; align-items: center; gap: 12px; }

.header-user,
.user-chip {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar,
.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-primary);
  color: var(--color-primary-foreground);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
  user-select: none;
}

/* legacy smaller avatar */
.user-avatar {
  width: 30px;
  height: 30px;
  background: var(--color-primary-light);
  color: var(--color-primary);
  font-size: 12px;
}

.user-meta { display: flex; flex-direction: column; line-height: 1.3; }
.user-name { font-size: 13px; font-weight: 600; }
.user-role { font-size: 11px; color: var(--color-muted-foreground); text-transform: capitalize; }

.btn-logout {
  background: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
  color: var(--color-muted-foreground);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background 0.12s;
  font-family: inherit;
  font-weight: 500;
}

.btn-logout:hover { background: var(--color-muted); color: var(--color-foreground); }

.btn-logout svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ── Main content area ── */
.main,
.main-content {
  grid-area: main;
  padding: 24px;
  overflow: auto;
  min-height: 0;
}

.page-container { max-width: 1200px; margin: 0 auto; }

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
}

/* ── Backdrop (responsive) ── */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 25;
}

.sidebar-backdrop.open { display: block; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: 60px 1fr;
    grid-template-areas: 'header' 'main';
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 240px;
    transform: translateX(-100%);
    transition: transform 0.22s cubic-bezier(0.4,0,0.2,1);
    z-index: 30;
    grid-area: unset;
  }

  .sidebar.open { transform: translateX(0); }
  .sidebar-toggle { display: inline-flex; }
  .main,
  .main-content { padding: 16px; }
}

/* ── Loading / Forbidden screens ── */
.loading-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  color: var(--color-muted-foreground);
  font-size: 14px;
  gap: 10px;
}

.forbidden-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  gap: 12px;
  text-align: center;
  padding: 24px;
}

.forbidden-screen h1 {
  font-size: 64px;
  font-weight: 800;
  color: var(--color-muted-foreground);
  line-height: 1;
}

.forbidden-screen p {
  font-size: 15px;
  color: var(--color-muted-foreground);
  max-width: 320px;
}

/* ── Cards ─────────────────────────────────────────────────────────────────── */
.card {
  background: var(--color-card);
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 3px rgba(0,0,0,0.05), 0 1px 2px -1px rgba(0,0,0,0.05);
  border: 1px solid var(--color-border);
  padding: 20px 24px;
  transition: box-shadow 0.2s;
}

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

.card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-foreground);
}

/* ── Buttons ────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: none;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.14s, box-shadow 0.14s, transform 0.1s, opacity 0.12s;
  text-decoration: none;
  letter-spacing: 0.01em;
}

.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--color-primary);
  color: var(--color-primary-foreground);
  box-shadow: 0 1px 3px rgba(0,99,226,0.35), 0 0 0 0 rgba(0,99,226,0);
}
.btn-primary:hover:not(:disabled) {
  background: var(--color-primary-hover);
  box-shadow: 0 3px 8px rgba(0,99,226,0.4);
}

.btn-secondary {
  background: var(--color-secondary);
  color: var(--color-secondary-foreground);
  border: 1px solid var(--color-border);
}
.btn-secondary:hover:not(:disabled) { background: #e2e8f0; }

.btn-danger {
  background: var(--color-destructive);
  color: var(--color-destructive-foreground);
  box-shadow: 0 1px 3px rgba(239,68,68,0.3);
}
.btn-danger:hover:not(:disabled) {
  background: #dc2626;
  box-shadow: 0 3px 8px rgba(239,68,68,0.4);
}

.btn-ghost {
  background: transparent;
  color: var(--color-muted-foreground);
}
.btn-ghost:hover:not(:disabled) { background: var(--color-muted); color: var(--color-foreground); }

.btn-sm {
  padding: 4px 10px;
  font-size: 12px;
}

/* ── Tables ─────────────────────────────────────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 2px solid var(--color-border);
  color: var(--color-muted-foreground);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.data-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-foreground);
  vertical-align: middle;
}

.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: var(--color-muted); }

/* ── Status badges ──────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

/* dot inside badge */
.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Session status */
.badge-idle   { background: var(--color-success-subtle);  color: var(--color-success-foreground); }
.badge-idle   .badge-dot { background: var(--color-success); }

.badge-busy   { background: #E0F7FA; color: #0E7490; }
.badge-busy   .badge-dot { background: var(--color-accent); }

.badge-locked { background: #FEF2F2; color: #991B1B; }
.badge-locked .badge-dot { background: var(--color-destructive); }

.badge-queued  { background: var(--color-warning-subtle);  color: var(--color-warning-foreground); }
.badge-queued  .badge-dot { background: var(--color-warning); }

.badge-running { background: #E0F7FA; color: #0E7490; }
.badge-running .badge-dot { background: var(--color-accent); }

.badge-done    { background: var(--color-success-subtle);  color: var(--color-success-foreground); }
.badge-done    .badge-dot { background: var(--color-success); }

.badge-failed  { background: #FEF2F2; color: #991B1B; }
.badge-failed  .badge-dot { background: var(--color-destructive); }

/* Role badges */
.badge-admin    { background: var(--color-primary-light);   color: var(--color-primary); }
.badge-operator { background: var(--color-warning-subtle);  color: var(--color-warning-foreground); }
.badge-viewer   { background: var(--color-secondary);       color: var(--color-secondary-foreground); }

/* Verified */
.badge-verified   { background: var(--color-success-subtle); color: var(--color-success-foreground); }
.badge-unverified { background: var(--color-warning-subtle); color: var(--color-warning-foreground); }

/* ── Forms ──────────────────────────────────────────────────────────────────── */
.form-group {
  margin-bottom: 14px;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-muted-foreground);
  margin-bottom: 5px;
}

.form-control {
  width: 100%;
  padding: 8px 11px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-family: inherit;
  color: var(--color-foreground);
  background: var(--color-card);
  transition: border-color 0.14s, box-shadow 0.14s;
}

.form-control:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(0,99,226,0.12);
}

.form-control::placeholder { color: var(--color-muted-foreground); opacity: 0.6; }

textarea.form-control {
  resize: vertical;
  min-height: 72px;
}

select.form-control {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2364748B' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
  cursor: pointer;
}

/* ── Modals ─────────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}

.modal-overlay.hidden { display: none; }

.modal {
  background: var(--color-card);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  width: 100%;
  max-width: 520px;
  max-height: 85vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--color-border);
}

.modal-title {
  font-size: 15px;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  color: var(--color-muted-foreground);
  line-height: 1;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}
.modal-close:hover { background: var(--color-muted); }

.modal-body {
  padding: 20px;
  flex: 1;
}

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--color-border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ── Slide-in panel ─────────────────────────────────────────────────────────── */
.panel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.25);
  z-index: 90;
  display: flex;
  justify-content: flex-end;
}
.panel-overlay.hidden { display: none; }

.slide-panel {
  background: var(--color-card);
  width: 400px;
  max-width: 95vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 32px rgba(0,0,0,0.12);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--color-border);
}

.panel-title {
  font-size: 15px;
  font-weight: 600;
}

.panel-body {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
}

.panel-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--color-border);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* ── Alert / Banner ─────────────────────────────────────────────────────────── */
.alert {
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  margin-bottom: 12px;
}
.alert-info { background: var(--color-primary-light); color: var(--color-primary); }
.alert-warning { background: var(--color-warning-subtle); color: var(--color-warning-foreground); }
.alert-danger { background: #FEF2F2; color: #991B1B; }
.alert-success { background: var(--color-success-subtle); color: var(--color-success-foreground); }
.alert.hidden { display: none; }

/* ── Utility ────────────────────────────────────────────────────────────────── */
.text-muted { color: var(--color-muted-foreground); font-size: 12px; }
.text-warning { color: var(--color-warning); }
.text-danger { color: var(--color-destructive); }
.text-success { color: var(--color-success-foreground); }
.fw-bold { font-weight: 700; }

.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--color-muted-foreground);
  font-size: 14px;
}

/* Failure count coloring */
.failure-ok { color: var(--color-success-foreground); font-weight: 600; }
.failure-warn { color: var(--color-warning); font-weight: 600; }
.failure-critical { color: var(--color-destructive); font-weight: 700; }

/* Checkbox group */
.checkbox-list { display: flex; flex-direction: column; gap: 8px; }
.checkbox-item { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.checkbox-item input[type=checkbox] { width: 15px; height: 15px; accent-color: var(--color-primary); cursor: pointer; }

/* ── Sessions dashboard ─────────────────────────────────────────────────────── */
.sessions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}
@media (max-width: 900px) {
  .sessions-grid { grid-template-columns: 1fr; }
}

.logins-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 20px;
  padding: 12px 16px;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  min-height: 48px;
  box-shadow: var(--shadow-card);
}

.logins-bar-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-right: 4px;
}

.refresh-note {
  font-size: 11px;
  color: var(--color-muted-foreground);
  margin-left: auto;
}

/* Session table — also used as .sessions-table for back-compat */
.sessions-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.sessions-table th {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 2px solid var(--color-border);
  color: var(--color-muted-foreground);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sessions-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}

.sessions-table tbody tr:hover td { background: var(--color-muted); cursor: pointer; }
.sessions-table tbody tr.selected td { background: var(--color-primary-light); }

/* Detail panel */
.detail-panel {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 20px;
}

.detail-section { margin-bottom: 16px; }

.detail-section h3 {
  font-size: 10px;
  font-weight: 700;
  color: var(--color-muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
}

.detail-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  font-size: 13px;
}

.detail-meta > div { display: flex; flex-direction: column; gap: 2px; }
.detail-meta span {
  font-size: 10px;
  color: var(--color-muted-foreground);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.detail-empty { color: var(--color-muted-foreground); font-size: 14px; padding: 12px 0; }

pre, code {
  font-family: ui-monospace, 'Cascadia Code', 'Fira Code', 'Courier New', monospace;
}

pre {
  background: var(--color-muted);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 12px;
  font-size: 12px;
  overflow: auto;
  max-height: 200px;
  white-space: pre-wrap;
  word-break: break-word;
}

.logs-box {
  background: #002B31;
  color: #d1fae5;
  border-radius: var(--radius-md);
  padding: 12px;
  font-size: 12px;
  font-family: ui-monospace, monospace;
  max-height: 200px;
  overflow: auto;
  line-height: 1.5;
}

.log-ts { color: #64748B; }

.artifacts-grid { display: flex; flex-wrap: wrap; gap: 12px; }
.artifact-thumb { display: flex; flex-direction: column; gap: 4px; }
.artifact-thumb img {
  width: 120px;
  height: 80px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  display: block;
}
.artifact-thumb a { font-size: 11px; color: var(--color-primary); }
.artifact-thumb a:hover { text-decoration: underline; }

/* ── Workflow browser ─────────────────────────────────────────────────────── */
.workflow-list-panel {
  width: 340px;
  min-width: 280px;
  background: var(--color-card);
  border-right: 1px solid var(--color-border);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.workflow-card {
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border);
  cursor: pointer;
  transition: background 0.1s;
}
.workflow-card:hover { background: var(--color-muted); }
.workflow-card.selected { background: var(--color-primary-light); border-left: 3px solid var(--color-primary); }

.workflow-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-foreground);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.workflow-card-meta {
  font-size: 12px;
  color: var(--color-muted-foreground);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.success-bar { height: 4px; background: var(--color-border); border-radius: 2px; overflow: hidden; }
.success-bar-fill { height: 100%; background: var(--color-success); border-radius: 2px; }

/* Loading spinner */
.loading-spinner {
  display: inline-block;
  width: 16px; height: 16px;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Live pulse for running badge ────────────────────────────────────────────── */
.badge-running .badge-dot {
  animation: pulse-running 1.4s ease-in-out infinite;
}
@keyframes pulse-running {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(0.6); }
}

/* ── Page entry animation ────────────────────────────────────────────────────── */
.page-container {
  animation: page-in 0.22s ease both;
}
@keyframes page-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Modal enter ─────────────────────────────────────────────────────────────── */
.modal {
  animation: modal-in 0.18s cubic-bezier(0.34,1.3,0.64,1) both;
}
@keyframes modal-in {
  from { opacity: 0; transform: scale(0.94) translateY(-8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* ── Slide panel enter ───────────────────────────────────────────────────────── */
.slide-panel {
  animation: panel-in 0.22s cubic-bezier(0.4,0,0.2,1) both;
}
@keyframes panel-in {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}

/* ── monospace override for code/logs ────────────────────────────────────────── */
pre, code, .logs-box {
  font-family: 'JetBrains Mono', ui-monospace, 'Cascadia Code', 'Fira Code', monospace;
}

/* ── Filter bar ──────────────────────────────────────────────────────────────── */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 16px 12px;
  border-bottom: 1px solid var(--color-border);
}
.filter-select, .filter-input {
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-background);
  color: var(--color-foreground);
  font-size: 13px;
  min-width: 140px;
}
.filter-select:focus, .filter-input:focus {
  outline: none;
  border-color: var(--color-primary);
}
.btn-ghost {
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-muted-foreground);
}
.btn-ghost:hover {
  background: var(--color-muted);
  color: var(--color-foreground);
}
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }

/* ── Pagination ──────────────────────────────────────────────────────────────── */
.pagination-bar {
  padding: 12px 16px;
  border-top: 1px solid var(--color-border);
}
.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
}
.page-btn {
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-background);
  color: var(--color-foreground);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
.page-btn:hover:not(:disabled):not(.active) { background: var(--color-muted); }
.page-btn.active { background: var(--color-primary); color: var(--color-primary-foreground); border-color: var(--color-primary); font-weight: 600; }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.page-gap { padding: 0 4px; color: var(--color-muted-foreground); font-size: 13px; line-height: 32px; }
.page-info { margin-left: 12px; font-size: 12px; color: var(--color-muted-foreground); white-space: nowrap; }

/* ── Page toolbar ────────────────────────────────────────────────────────────── */
.page-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0 16px;
}

/* ── Detail grid (two-column) ────────────────────────────────────────────────── */
.detail-grid {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 16px;
  align-items: start;
}
@media (max-width: 900px) {
  .detail-grid { grid-template-columns: 1fr; }
}
