/* ============================================
   Clovar Dashboard — Dark Observatory Theme
   Custom overrides on compiled Tailwind output
   ============================================ */

/* -- Font imports handled in _Layout.cshtml -- */

:root {
  --glow-emerald: rgba(52, 211, 153, 0.10);
  --glow-emerald-strong: rgba(52, 211, 153, 0.18);
  --glass-border: rgba(255, 255, 255, 0.10);
  --glass-highlight: rgba(255, 255, 255, 0.05);
  --color-body: #0e1512;
  --color-surface: #1a2420;
  --color-sidebar: #131b18;
  --accent-gradient: linear-gradient(135deg, #34d399, #06b6d4);
  --subtle-noise: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.02'/%3E%3C/svg%3E");
}

/* -- Global typography -- */
body {
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  letter-spacing: -0.01em;
  background-color: var(--color-body);
  background-image: var(--subtle-noise);
  background-repeat: repeat;
}

h1, h2, h3, h4 {
  font-family: 'Outfit', system-ui, sans-serif;
  letter-spacing: -0.025em;
}

/* -- Page title enhancement -- */
h1.text-2xl {
  font-size: 1.75rem;
  font-weight: 700;
  background: linear-gradient(135deg, #fff 30%, rgba(255,255,255,0.7));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* -- Enhanced cards with glass morphism -- */
.card {
  background: linear-gradient(145deg, rgba(26, 36, 32, 0.92), rgba(22, 30, 27, 0.96));
  border: 1px solid var(--glass-border);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.03) inset,
    0 1px 0 0 var(--glass-highlight) inset,
    0 4px 24px -4px rgba(0,0,0,0.35);
  backdrop-filter: blur(12px);
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.card:hover {
  border-color: rgba(255,255,255,0.15);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.04) inset,
    0 1px 0 0 var(--glass-highlight) inset,
    0 8px 32px -4px rgba(0,0,0,0.45);
}

/* -- Metric cards with ambient glow -- */
.metric-card {
  background: linear-gradient(145deg, rgba(26, 36, 32, 0.92), rgba(22, 30, 27, 0.96));
  border: 1px solid var(--glass-border);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.03) inset,
    0 1px 0 0 var(--glass-highlight) inset,
    0 4px 24px -4px rgba(0,0,0,0.35);
  position: relative;
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.metric-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent-gradient);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.metric-card:hover {
  transform: translateY(-2px);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.04) inset,
    0 1px 0 0 var(--glass-highlight) inset,
    0 8px 40px -4px rgba(52, 211, 153, 0.12);
}

.metric-card:hover::before {
  opacity: 1;
}

.metric-value {
  font-family: 'Outfit', system-ui, sans-serif;
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.metric-label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.7rem;
  font-weight: 600;
  opacity: 0.7;
}

/* -- Sidebar refinement -- */
#sidebar {
  background: linear-gradient(180deg, var(--color-sidebar) 0%, #0c1310 100%);
  border-right: 1px solid rgba(255,255,255,0.08);
}

#sidebar .nav-link {
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  border-radius: 8px;
  margin: 0 4px;
  transition: all 0.2s ease;
  position: relative;
}

#sidebar .nav-link.active {
  background: linear-gradient(135deg, rgba(52, 211, 153, 0.14), rgba(6, 182, 212, 0.08));
  border-left: 2px solid transparent;
  border-image: var(--accent-gradient) 1;
  box-shadow: 0 0 20px -4px rgba(52, 211, 153, 0.12);
}

#sidebar .nav-link:hover:not(.active) {
  background: rgba(255,255,255,0.07);
}

/* Sidebar section labels */
#sidebar nav > .pt-4 > span {
  font-family: 'Outfit', system-ui, sans-serif;
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  opacity: 0.55;
}

/* Sidebar logo area */
#sidebar > div:first-child {
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

#sidebar > div:first-child span {
  font-family: 'Outfit', system-ui, sans-serif;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* -- Navbar refinement -- */
header.sticky {
  background: rgba(19, 27, 24, 0.85);
  backdrop-filter: blur(16px) saturate(1.5);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

header .text-lg {
  font-family: 'Outfit', system-ui, sans-serif;
  font-weight: 700;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* -- Data table refinement -- */
.data-table th {
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  opacity: 0.7;
  padding-block: 0.875rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.data-table td {
  border-bottom: 1px solid rgba(255,255,255,0.06);
  padding-block: 0.875rem;
}

.data-table tbody tr {
  transition: background-color 0.15s ease;
}

.data-table tbody tr:hover {
  background: rgba(52, 211, 153, 0.05);
}

/* -- Badge refinements -- */
.badge-success,
.badge-warning,
.badge-danger,
.badge-info,
.badge-neutral {
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid transparent;
}

.badge-success {
  border-color: rgba(52, 211, 153, 0.2);
}

.badge-warning {
  border-color: rgba(234, 179, 8, 0.2);
}

.badge-danger {
  border-color: rgba(239, 68, 68, 0.2);
}

.badge-info {
  border-color: rgba(99, 102, 241, 0.2);
}

.badge-neutral {
  border-color: rgba(156, 163, 175, 0.15);
}

/* -- Button refinements -- */
.btn-primary {
  background: linear-gradient(135deg, #059669, #0d9488);
  box-shadow: 0 1px 2px rgba(0,0,0,0.3), 0 0 12px -4px rgba(52, 211, 153, 0.2);
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: all 0.2s ease;
}

.btn-primary:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.3), 0 0 20px -4px rgba(52, 211, 153, 0.3);
  transform: translateY(-1px);
}

.btn-secondary {
  border: 1px solid rgba(255,255,255,0.12);
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
}

.btn-ghost {
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
}

.btn-danger {
  box-shadow: 0 1px 2px rgba(0,0,0,0.3), 0 0 12px -4px rgba(239, 68, 68, 0.2);
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
}

/* -- Form refinements -- */
.form-input,
.form-select {
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  background: rgba(12, 18, 15, 0.9);
  border: 1px solid rgba(255,255,255,0.15);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.25);
  transition: all 0.2s ease;
}

.form-input:hover,
.form-select:hover {
  border-color: rgba(255,255,255,0.25);
}

.form-input:focus,
.form-select:focus {
  border-color: rgba(52, 211, 153, 0.5);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.25), 0 0 0 3px rgba(52, 211, 153, 0.12);
}

.form-label {
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  text-transform: uppercase;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  opacity: 0.85;
}

/* -- Modal refinement -- */
.modal-backdrop {
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
}

.modal-content {
  background: linear-gradient(145deg, rgba(26, 36, 32, 0.98), rgba(22, 30, 27, 0.99));
  border: 1px solid rgba(255,255,255,0.10);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.03) inset,
    0 32px 64px -16px rgba(0,0,0,0.6);
}

/* -- Tab refinement -- */
.tab-list {
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.tab-item {
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.75rem 1.25rem;
  transition: all 0.2s ease;
}

.tab-item.active {
  border-bottom-color: transparent;
  background: linear-gradient(to bottom, rgba(52, 211, 153, 0.10), transparent);
  border-image: var(--accent-gradient) 1;
  border-image-slice: 0 0 1 0;
  border-image-width: 0 0 2px 0;
}

/* -- Timeline refinement -- */
.timeline-item::after {
  background: var(--accent-gradient);
  width: 8px;
  height: 8px;
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.3);
}

.timeline-item::before {
  background: rgba(255,255,255,0.08);
  width: 1px;
}

/* -- Agent avatar refinement -- */
.agent-avatar {
  background: linear-gradient(135deg, rgba(52, 211, 153, 0.18), rgba(6, 182, 212, 0.12));
  border: 1px solid rgba(52, 211, 153, 0.15);
  font-family: 'Outfit', system-ui, sans-serif;
  font-weight: 700;
  box-shadow: 0 0 16px -4px rgba(52, 211, 153, 0.12);
}

/* -- Chat bubble refinement -- */
.chat-bubble-user {
  background: linear-gradient(135deg, #059669, #0d9488);
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.2);
}

.chat-bubble-assistant {
  background: linear-gradient(145deg, rgba(22, 30, 27, 0.92), rgba(26, 36, 32, 0.92));
  border: 1px solid rgba(255,255,255,0.08);
}

/* -- Tool usage indicator (replaces raw JSON bubbles) -- */
.chat-tool-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  font-weight: 500;
  color: rgba(129, 140, 248, 0.7);
  letter-spacing: 0.02em;
  padding: 4px 0;
  align-self: flex-start;
}

/* -- Typing indicator -- */
.typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.typing-dots span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(52, 211, 153, 0.6);
  animation: typing-bounce 1.4s ease-in-out infinite;
}
.typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.typing-dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-4px); opacity: 1; }
}

/* -- Chat messages scroll container -- */
.chat-messages {
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.10) transparent;
}

/* -- Conversation list -- */
.section-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.45);
  font-family: 'Outfit', system-ui, sans-serif;
}

.conv-item {
  display: block;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s ease;
  text-decoration: none;
  color: inherit;
  border-left: 2px solid transparent;
}

.conv-item:hover {
  background: rgba(255,255,255,0.06);
}

.conv-item.active {
  background: linear-gradient(135deg, rgba(52, 211, 153, 0.12), rgba(6, 182, 212, 0.06));
  border-left-color: rgba(52, 211, 153, 0.5);
}

.conv-item.archived {
  opacity: 0.55;
}

.conv-item.archived:hover {
  opacity: 0.8;
}

.conv-title {
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: rgba(255,255,255,0.88);
}

.conv-item.active .conv-title {
  color: rgba(52, 211, 153, 0.9);
}

.conv-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 2px;
}

.conv-meta {
  font-size: 0.6rem;
  color: rgba(255,255,255,0.35);
  letter-spacing: 0.01em;
}

.conv-new-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: rgba(52, 211, 153, 0.12);
  color: rgba(52, 211, 153, 0.85);
  border: 1px solid rgba(52, 211, 153, 0.18);
  cursor: pointer;
  transition: all 0.15s ease;
}

.conv-new-btn:hover {
  background: rgba(52, 211, 153, 0.22);
  color: rgba(52, 211, 153, 1);
}

.conv-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background: transparent;
  color: rgba(255,255,255,0.3);
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.conv-action-btn:hover {
  background: rgba(255,255,255,0.10);
  color: rgba(255,255,255,0.7);
}

/* Editable conversation title (header) */
.conv-title-editable {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.55);
  cursor: pointer;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 2px 4px;
  border-radius: 4px;
  transition: background 0.15s ease, color 0.15s ease;
}

.conv-title-editable:hover {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.8);
}

/* Inline rename input */
.conv-rename-input {
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(52, 211, 153, 0.35);
  border-radius: 4px;
  color: rgba(255,255,255,0.92);
  font-size: inherit;
  font-family: inherit;
  padding: 1px 4px;
  width: 100%;
  outline: none;
}

.conv-rename-input:focus {
  border-color: rgba(52, 211, 153, 0.55);
  box-shadow: 0 0 0 2px rgba(52, 211, 153, 0.12);
}

/* Archived details chevron rotation */
details[open] .details-chevron {
  transform: rotate(90deg);
}

/* -- Email mailbox tabs -- */
.email-mailbox-tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}

.email-mailbox-tabs::-webkit-scrollbar {
  display: none;
}

.email-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  color: rgba(255,255,255,0.55);
  background: rgba(255,255,255,0.04);
  border: 1px solid transparent;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}

.email-tab:hover {
  color: rgba(255,255,255,0.8);
  background: rgba(255,255,255,0.08);
}

.email-tab.active {
  color: rgba(52, 211, 153, 0.92);
  background: rgba(52, 211, 153, 0.10);
  border-color: rgba(52, 211, 153, 0.22);
}

/* -- Email stat cards -- */
.email-stat-card {
  padding: 12px 16px;
  border-radius: 8px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
}

.email-stat-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.25rem;
  font-weight: 600;
  color: rgba(255,255,255,0.9);
  line-height: 1.2;
}

.email-stat-label {
  font-size: 0.65rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.42);
  margin-top: 2px;
}

/* -- Email clickable rows -- */
.email-row-clickable {
  cursor: pointer;
  transition: background 0.15s ease;
}

.email-row-clickable:hover {
  background: rgba(52, 211, 153, 0.05);
}

/* -- Email table flagged rows -- */
.email-row-flagged {
  background: rgba(239, 68, 68, 0.05);
}

.email-row-flagged:hover {
  background: rgba(239, 68, 68, 0.08);
}

/* -- Email detail modal -- */
.email-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  animation: modal-fade-in 0.2s ease;
}

@keyframes modal-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.email-modal {
  width: 90%;
  max-width: 720px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(145deg, rgba(26, 36, 32, 0.98), rgba(22, 30, 27, 0.99));
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  box-shadow:
    0 24px 80px -12px rgba(0, 0, 0, 0.7),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  animation: modal-slide-up 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

@keyframes modal-slide-up {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.email-modal-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 20px 24px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.email-modal-close {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 255, 255, 0.45);
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.email-modal-close:hover {
  background: rgba(255, 255, 255, 0.10);
  color: rgba(255, 255, 255, 0.8);
}

.email-modal-meta {
  padding: 12px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.email-modal-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.email-modal-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.42);
  width: 36px;
  flex-shrink: 0;
}

.email-modal-body {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.email-body-iframe {
  width: 100%;
  height: 400px;
  border: none;
  display: block;
  background: #ffffff;
  border-radius: 0 0 12px 12px;
}

/* -- Badge variants for email statuses -- */
.badge-info {
  background: rgba(56, 189, 248, 0.12);
  color: rgba(56, 189, 248, 0.88);
  border: 1px solid rgba(56, 189, 248, 0.2);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-warning {
  background: rgba(251, 191, 36, 0.12);
  color: rgba(251, 191, 36, 0.88);
  border: 1px solid rgba(251, 191, 36, 0.2);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-danger {
  background: rgba(239, 68, 68, 0.12);
  color: rgba(239, 68, 68, 0.88);
  border: 1px solid rgba(239, 68, 68, 0.2);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* -- Approval item refinement -- */
.approval-item {
  border-left: 2px solid;
  border-image: var(--accent-gradient) 1;
  padding: 1rem 1.25rem;
  background: rgba(52, 211, 153, 0.03);
  border-radius: 0 8px 8px 0;
  transition: background 0.2s ease;
}

.approval-item:hover {
  background: rgba(52, 211, 153, 0.06);
}

/* -- Toast refinement -- */
.toast {
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 8px 32px -4px rgba(0,0,0,0.5);
  animation: toast-slide-in 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes toast-slide-in {
  from {
    transform: translateX(100%) scale(0.95);
    opacity: 0;
  }
  to {
    transform: translateX(0) scale(1);
    opacity: 1;
  }
}

/* -- Scrollbar styling -- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.12);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.20);
}

/* -- Page entrance animations -- */
@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

main > * {
  animation: fade-up 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

main > *:nth-child(1) { animation-delay: 0ms; }
main > *:nth-child(2) { animation-delay: 60ms; }
main > *:nth-child(3) { animation-delay: 120ms; }
main > *:nth-child(4) { animation-delay: 180ms; }
main > *:nth-child(5) { animation-delay: 240ms; }

/* -- Grid/table row stagger animation -- */
@keyframes row-fade {
  from {
    opacity: 0;
    transform: translateX(-8px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.data-table tbody tr {
  animation: row-fade 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.data-table tbody tr:nth-child(1) { animation-delay: 80ms; }
.data-table tbody tr:nth-child(2) { animation-delay: 120ms; }
.data-table tbody tr:nth-child(3) { animation-delay: 160ms; }
.data-table tbody tr:nth-child(4) { animation-delay: 200ms; }
.data-table tbody tr:nth-child(5) { animation-delay: 240ms; }
.data-table tbody tr:nth-child(6) { animation-delay: 280ms; }
.data-table tbody tr:nth-child(7) { animation-delay: 320ms; }
.data-table tbody tr:nth-child(8) { animation-delay: 360ms; }
.data-table tbody tr:nth-child(n+9) { animation-delay: 400ms; }

/* -- Metric card stagger -- */
.grid > .metric-card:nth-child(1) { animation-delay: 50ms; }
.grid > .metric-card:nth-child(2) { animation-delay: 120ms; }
.grid > .metric-card:nth-child(3) { animation-delay: 190ms; }
.grid > .metric-card:nth-child(4) { animation-delay: 260ms; }

/* -- Status pulse for active items -- */
@keyframes subtle-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.badge-success {
  position: relative;
}

/* -- Selection/focus ring -- */
*:focus-visible {
  outline: 2px solid rgba(52, 211, 153, 0.45);
  outline-offset: 2px;
}

/* -- Hover link accent underline -- */
a.font-medium:hover {
  text-decoration: none;
}

/* -- Login page specific -- */
body.bg-body.flex {
  background-image:
    radial-gradient(ellipse at 30% 50%, rgba(52, 211, 153, 0.05) 0%, transparent 60%),
    radial-gradient(ellipse at 70% 50%, rgba(6, 182, 212, 0.04) 0%, transparent 60%),
    var(--subtle-noise);
}

/* -- OrgChart tree lines -- */
.border-l.border-white\/10 {
  border-color: rgba(52, 211, 153, 0.12) !important;
}

/* -- Setup wizard progress -- */
.bg-emerald-600 {
  background: linear-gradient(135deg, #059669, #0d9488) !important;
}

/* -- Monospace font override -- */
.font-mono {
  font-family: 'JetBrains Mono', 'IBM Plex Mono', monospace;
  font-size: 0.85em;
}

/* -- Tool tag picker -- */
.tool-category-group {
  margin-bottom: 12px;
}

.tool-category-label {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.42);
  font-family: 'Outfit', system-ui, sans-serif;
  margin-bottom: 6px;
  padding-left: 2px;
}

.tool-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tool-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.tool-tag:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.14);
}

.tool-tag.active {
  background: rgba(52, 211, 153, 0.12);
  border-color: rgba(52, 211, 153, 0.28);
}

.tool-tag.active:hover {
  background: rgba(52, 211, 153, 0.18);
}

.tool-tag input[type="checkbox"] {
  display: none;
}

.tool-tag-name {
  font-size: 0.72rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.6);
  transition: color 0.15s ease;
}

.tool-tag.active .tool-tag-name {
  color: rgba(52, 211, 153, 0.92);
}

.tool-tag-action {
  font-size: 0.6rem;
  font-family: 'JetBrains Mono', monospace;
  color: rgba(255, 255, 255, 0.3);
  transition: color 0.15s ease;
}

.tool-tag.active .tool-tag-action {
  color: rgba(52, 211, 153, 0.55);
}

/* -- Case detail tabs -- */
.case-tab {
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.75rem 1rem;
  color: rgba(255, 255, 255, 0.45);
  border-bottom: 2px solid transparent;
  background: transparent;
  border-top: none;
  border-left: none;
  border-right: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.case-tab:hover {
  color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.03);
}

.case-tab.active {
  color: rgba(52, 211, 153, 0.92);
  border-bottom-color: transparent;
  background: linear-gradient(to bottom, rgba(52, 211, 153, 0.08), transparent);
  border-image: var(--accent-gradient) 1;
  border-image-slice: 0 0 1 0;
  border-image-width: 0 0 2px 0;
}

.case-tab-panel {
  display: none;
}

.case-tab-panel.active {
  display: block;
}
