/* ==========================================================================
   AUDITSHIELD AI - ELITE LOVABLE DESIGN SYSTEM (2026 EDITION)
   ========================================================================== */

:root {
  /* Core Color Palette: Obsidian / Void Navy */
  --bg-app: #060911;
  --bg-surface: rgba(13, 19, 33, 0.85);
  --bg-surface-raised: rgba(22, 32, 54, 0.7);
  --bg-surface-hover: rgba(30, 44, 74, 0.8);
  --bg-input: rgba(8, 12, 22, 0.9);
  
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-glass-hover: rgba(255, 255, 255, 0.16);
  --border-subtle: #162036;
  --border-medium: #223254;
  --border-focus: #38bdf8;

  /* Typography Colors */
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-dim: #475569;

  /* Emerald / Security Tokens */
  --emerald-base: #10b981;
  --emerald-bright: #34d399;
  --emerald-bg: rgba(16, 185, 129, 0.12);
  --emerald-border: rgba(16, 185, 129, 0.3);
  --emerald-glow: 0 0 16px rgba(16, 185, 129, 0.25);

  /* Cyan / Tech Tokens */
  --cyan-base: #06b6d4;
  --cyan-bright: #38bdf8;
  --cyan-bg: rgba(6, 182, 212, 0.12);
  --cyan-border: rgba(6, 182, 212, 0.3);

  /* Amber / Quarantine Tokens */
  --amber-base: #f59e0b;
  --amber-bright: #fbbf24;
  --amber-bg: rgba(245, 158, 11, 0.12);
  --amber-border: rgba(245, 158, 11, 0.35);

  /* Crimson / Danger Tokens */
  --red-base: #f43f5e;
  --red-bg: rgba(244, 63, 94, 0.12);
  --red-border: rgba(244, 63, 94, 0.35);

  /* Fonts */
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Radii */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-pill: 9999px;

  /* Shadows */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 12px 36px rgba(0, 0, 0, 0.6);
  --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.37);

  /* Easing */
  --ease-smooth: cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: 0.15s var(--ease-smooth);
  --transition-normal: 0.25s var(--ease-smooth);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-primary);
  line-height: 1.5;
  font-size: 14px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
}

/* ==========================================================================
   AMBIENT GLOWS
   ========================================================================== */

.ambient-glow {
  position: fixed;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  filter: blur(140px);
  opacity: 0.12;
}

.glow-1 {
  top: -200px;
  left: 10%;
  background: radial-gradient(circle, #0284c7 0%, transparent 70%);
}

.glow-2 {
  top: -100px;
  right: 5%;
  background: radial-gradient(circle, #10b981 0%, transparent 70%);
}

/* ==========================================================================
   HEADER
   ========================================================================== */

.app-header {
  background: var(--bg-surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-glass);
  padding: 14px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.header-left {
  display: flex;
  align-items: center;
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 14px;
}

.shield-icon-wrapper {
  width: 42px;
  height: 42px;
  background: rgba(10, 15, 25, 0.8);
  border: 1px solid var(--emerald-border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--emerald-glow);
  overflow: hidden;
  padding: 2px;
}

.shield-icon {
  font-size: 20px;
}

.shield-img, .logo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: calc(var(--radius-sm) - 2px);
  display: block;
}

.brand-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-title {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #fff;
}

.version-tag {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-glass);
  font-size: 10px;
  font-weight: 700;
  color: var(--cyan-bright);
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  letter-spacing: 0.02em;
}

.brand-tagline {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 500;
}

.airgap-badge {
  background: var(--bg-surface-raised);
  border: 1px solid var(--emerald-border);
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.pulse-indicator {
  width: 8px;
  height: 8px;
  background-color: var(--emerald-bright);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--emerald-bright);
  animation: pulse-ring 2.5s infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(0.95); opacity: 1; }
  50% { transform: scale(1.15); opacity: 0.8; box-shadow: 0 0 12px var(--emerald-bright); }
  100% { transform: scale(0.95); opacity: 1; }
}

.airgap-label {
  font-weight: 800;
  color: var(--emerald-bright);
  letter-spacing: 0.04em;
  font-size: 11px;
}

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

.airgap-desc {
  color: var(--text-secondary);
  font-weight: 500;
}

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

/* ==========================================================================
   BUTTONS
   ========================================================================== */

.btn {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all var(--transition-fast);
  text-decoration: none;
  outline: none;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: linear-gradient(180deg, #0284c7 0%, #0369a1 100%);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(180deg, #0369a1 0%, #075985 100%);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.btn-emerald {
  background: linear-gradient(180deg, #10b981 0%, #059669 100%);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.35);
}

.btn-emerald:hover {
  background: linear-gradient(180deg, #059669 0%, #047857 100%);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-surface-raised);
  color: var(--text-primary);
  border: 1px solid var(--border-glass);
}

.btn-secondary:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-glass-hover);
}

.btn-danger {
  background: linear-gradient(180deg, #f43f5e 0%, #e11d48 100%);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.15);
}

.btn-danger:hover {
  background: linear-gradient(180deg, #e11d48 0%, #be123c 100%);
}

.btn-ai-sparkle {
  background: linear-gradient(135deg, #0284c7 0%, #06b6d4 100%) !important;
  color: #fff !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  box-shadow: 0 2px 10px rgba(6, 182, 212, 0.35);
}

.btn-ai-sparkle:hover {
  background: linear-gradient(135deg, #0369a1 0%, #0891b2 100%) !important;
  box-shadow: 0 4px 14px rgba(6, 182, 212, 0.5);
  transform: translateY(-1px);
}

.btn-glass {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  border: 1px solid var(--border-glass);
}

.btn-glass:hover, .btn-glass.active {
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
  border-color: var(--border-glass-hover);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
}

.btn-outline:hover {
  background: var(--bg-surface-raised);
  color: var(--text-primary);
  border-color: var(--border-glass-hover);
}

.btn-icon-only {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-sm);
  background: var(--bg-surface-raised);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-icon-only:hover {
  background: var(--bg-surface-hover);
  color: #fff;
  border-color: var(--border-glass-hover);
}

.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-xs { padding: 4px 10px; font-size: 11px; }

/* ==========================================================================
   METRIC RIBBON
   ========================================================================== */

.metric-ribbon {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  padding: 20px 32px 12px;
  position: relative;
  z-index: 1;
}

.metric-card {
  background: var(--bg-surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 1px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
}

.metric-card:hover {
  border-color: var(--border-glass-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.metric-card.alert-card {
  border-color: var(--amber-border);
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.06) 0%, rgba(13, 19, 33, 0.85) 100%);
}

.metric-card-inner {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.metric-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.metric-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

.badge-emerald {
  background: var(--emerald-bg);
  color: var(--emerald-bright);
  border: 1px solid var(--emerald-border);
}

.badge-cyan {
  background: var(--cyan-bg);
  color: var(--cyan-bright);
  border: 1px solid var(--cyan-border);
}

.badge-amber {
  background: var(--amber-bg);
  color: var(--amber-bright);
  border: 1px solid var(--amber-border);
}

.metric-value-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.metric-value {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #fff;
}

.metric-trend {
  font-size: 12px;
  font-weight: 600;
  color: var(--emerald-bright);
}

.metric-sub-highlight {
  font-size: 12px;
  font-weight: 600;
  color: var(--cyan-bright);
}

.metric-badge-sub {
  font-size: 11px;
  font-weight: 600;
  color: var(--amber-bright);
}

.metric-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.text-amber { color: var(--amber-bright) !important; }
.text-emerald { color: var(--emerald-bright) !important; }

/* ==========================================================================
   NAVIGATION BAR & TABS
   ========================================================================== */

.nav-container {
  padding: 6px 32px;
  background: var(--bg-surface);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-glass);
  position: relative;
  z-index: 10;
}

.main-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.main-tabs::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  transition: all var(--transition-fast);
  position: relative;
}

.tab-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
  color: #fff;
  background: var(--bg-surface-raised);
  border: 1px solid var(--border-glass);
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -7px;
  left: 20%;
  right: 20%;
  height: 2px;
  background: var(--cyan-bright);
  border-radius: var(--radius-pill);
}

.tab-btn.highlight-tab.active::after {
  background: var(--amber-bright);
}

.tab-counter {
  background: var(--amber-base);
  color: #000;
  font-size: 10px;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: var(--radius-pill);
}

/* ==========================================================================
   CONTENT AREA & PANELS
   ========================================================================== */

.content-area {
  padding: 24px 32px 40px;
  flex: 1;
  position: relative;
  z-index: 1;
}

.tab-pane {
  display: none;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.25s var(--ease-smooth), transform 0.25s var(--ease-smooth);
}

.tab-pane.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.grid-layout-2-1 {
  display: grid;
  grid-template-columns: 2fr 1.15fr;
  gap: 20px;
}

.grid-layout-1-1 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.glass-panel {
  background: var(--bg-surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-shadow: var(--shadow-sm);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border-glass);
  padding-bottom: 14px;
}

.panel-title {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
}

.panel-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.status-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.status-pill .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.status-pill.active-pill {
  background: var(--emerald-bg);
  color: var(--emerald-bright);
  border: 1px solid var(--emerald-border);
}

/* ==========================================================================
   AGENT CARDS
   ========================================================================== */

.agent-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.agent-card {
  background: var(--bg-surface-raised);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all var(--transition-fast);
}

.agent-card:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-glass-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.agent-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.agent-name {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

.agent-role {
  font-size: 11px;
  color: var(--cyan-bright);
  font-weight: 500;
  margin-top: 1px;
}

.agent-status-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.agent-status-badge.IDLE { background: rgba(255, 255, 255, 0.06); color: var(--text-secondary); border: 1px solid var(--border-glass); }
.agent-status-badge.EXECUTING { background: var(--amber-bg); color: var(--amber-bright); border: 1px solid var(--amber-border); }
.agent-status-badge.ACTIVE_SHIELD { background: var(--emerald-bg); color: var(--emerald-bright); border: 1px solid var(--emerald-border); }

.agent-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  border-top: 1px solid var(--border-glass);
  padding-top: 8px;
}

.agent-management-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.agent-full-card {
  background: var(--bg-surface-raised);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: all var(--transition-fast);
}

.agent-full-card:hover {
  border-color: var(--border-glass-hover);
  transform: translateY(-2px);
}

.agent-caps-list {
  list-style: none;
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.agent-caps-list li {
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.agent-caps-list li::before {
  content: "▹";
  color: var(--cyan-bright);
  font-weight: 700;
}

/* ==========================================================================
   QUARANTINE REVIEW CARDS
   ========================================================================== */

.quarantine-items-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.quarantine-card {
  background: var(--bg-surface-raised);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.quarantine-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 4px;
}

.quarantine-card.pending::before { background: var(--amber-bright); }
.quarantine-card.approved::before { background: var(--emerald-bright); }
.quarantine-card.rejected::before { background: var(--red-base); }

.quarantine-card:hover {
  border-color: var(--border-glass-hover);
  background: var(--bg-surface-hover);
}

.q-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.q-title {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
}

.q-meta-badges {
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge-risk {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  letter-spacing: 0.03em;
}

.badge-risk.ZERO_RISK,
.badge-risk.SAFE_ZERO_RISK,
.badge-risk.NO_RISK {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
  border: 1px solid #10b981;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
  font-weight: 800;
}

.badge-risk.LOW_RISK { background: var(--emerald-bg); color: var(--emerald-bright); border: 1px solid var(--emerald-border); }
.badge-risk.MEDIUM_RISK { background: var(--amber-bg); color: var(--amber-bright); border: 1px solid var(--amber-border); }
.badge-risk.CRITICAL_RISK { background: var(--red-bg); color: #fda4af; border: 1px solid var(--red-border); }

.q-details-row {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  font-size: 12px;
  color: var(--text-secondary);
}

.q-dest-label {
  color: var(--cyan-bright);
  font-weight: 600;
}

.q-preview-snippet {
  background: var(--bg-input);
  border: 1px solid var(--border-glass);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-primary);
  max-height: 80px;
  overflow-y: hidden;
  line-height: 1.6;
}

.q-action-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-glass);
}

/* ==========================================================================
   CRM KANBAN
   ========================================================================== */

.crm-kanban-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.kanban-column {
  background: var(--bg-surface-raised);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 480px;
}

.kanban-column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-glass);
  padding-bottom: 10px;
  letter-spacing: 0.04em;
}

.count-pill {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

.kanban-cards-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.crm-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all var(--transition-fast);
}

.crm-card:hover {
  border-color: var(--border-glass-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.crm-company {
  font-weight: 700;
  font-size: 14px;
  color: #fff;
}

.crm-contact {
  font-size: 12px;
  color: var(--text-secondary);
}

.crm-meta-badge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--border-glass);
}

.crm-score {
  font-weight: 700;
  color: var(--emerald-bright);
}

.crm-val {
  font-weight: 700;
  color: var(--cyan-bright);
}

/* ==========================================================================
   DATA TABLES
   ========================================================================== */

.orders-table-wrapper, .audit-ledger-table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-glass);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}

.data-table th {
  background: var(--bg-surface-raised);
  color: var(--text-secondary);
  font-weight: 700;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-medium);
  font-size: 12px;
  letter-spacing: 0.03em;
}

.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-glass);
  color: var(--text-primary);
}

.data-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.audit-table td {
  font-family: var(--font-mono);
  font-size: 12px;
}

.hash-cell {
  color: var(--cyan-bright);
  word-break: break-all;
  cursor: pointer;
  transition: color var(--transition-fast);
}

.hash-cell:hover {
  color: #fff;
  text-decoration: underline;
}

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

.audit-action-tag {
  font-weight: 700;
  color: var(--cyan-bright);
  background: var(--cyan-bg);
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  font-size: 10px;
}

.chain-banner {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

.chain-banner.success {
  background: var(--emerald-bg);
  border: 1px solid var(--emerald-border);
  color: var(--emerald-bright);
}

/* ==========================================================================
   MODALS
   ========================================================================== */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
}

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

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

.modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-glass-hover);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 820px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-glass);
  overflow: hidden;
  position: relative;
  z-index: 1001;
  animation: modal-pop 0.25s var(--ease-smooth);
}

@keyframes modal-pop {
  0% { transform: scale(0.96); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.modal-card-sm { max-width: 520px; }

.modal-header {
  padding: 20px 28px;
  background: var(--bg-surface-raised);
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 17px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
}

.modal-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-xs);
  transition: all var(--transition-fast);
}

.modal-close-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.modal-body {
  padding: 24px 28px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.modal-footer {
  padding: 18px 28px;
  background: var(--bg-surface-raised);
  border-top: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.security-assessment-box {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid var(--amber-border);
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.6;
}

.remediation-banner {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid var(--emerald-border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  font-size: 13px;
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  gap: 6px;
  animation: fade-in 0.2s var(--ease-smooth);
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.remediation-banner.hidden { display: none; }

.section-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.modal-section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: block;
}

.code-preview {
  background: var(--bg-input);
  border: 1px solid var(--border-glass);
  padding: 16px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--cyan-bright);
  max-height: 200px;
  overflow-y: auto;
  white-space: pre-wrap;
  line-height: 1.6;
}

.modal-textarea, .modal-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-medium);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 13px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color var(--transition-fast);
}

.modal-textarea:focus, .modal-input:focus {
  border-color: var(--border-focus);
}

.lead-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

/* ==========================================================================
   CYCLE PROGRESS TRAY & AUDIT FEED
   ========================================================================== */

.cycle-tray {
  border-color: var(--cyan-border);
  margin-top: 18px;
  background: linear-gradient(180deg, rgba(6, 182, 212, 0.08) 0%, rgba(13, 19, 33, 0.9) 100%);
}

.cycle-tray.hidden { display: none; }

.cycle-steps-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cycle-step-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg-surface-raised);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  font-size: 13px;
  animation: fade-in 0.25s var(--ease-smooth);
}

.cycle-step-icon { font-size: 15px; }

.audit-feed-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 480px;
  overflow-y: auto;
}

.audit-feed-item {
  background: var(--bg-surface-raised);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  transition: all var(--transition-fast);
}

.audit-feed-item:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-glass-hover);
}

.audit-feed-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
}

.audit-time { color: var(--text-muted); }
.audit-details { font-size: 12px; color: var(--text-secondary); line-height: 1.4; }

/* ==========================================================================
   TOAST NOTIFICATION
   ========================================================================== */

.toast-container {
  position: fixed;
  bottom: 24px;
  right: 32px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 2000;
  pointer-events: none;
}

.toast {
  background: var(--bg-surface);
  border: 1px solid var(--border-glass-hover);
  backdrop-filter: blur(20px);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toast-in 0.25s var(--ease-smooth);
  pointer-events: auto;
}

@keyframes toast-in {
  from { transform: translateY(12px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */

@media (max-width: 1100px) {
  .metric-ribbon { grid-template-columns: repeat(2, 1fr); }
  .grid-layout-2-1, .grid-layout-1-1 { grid-template-columns: 1fr; }
  .agent-management-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .app-header { padding: 14px 20px; }
  .metric-ribbon { grid-template-columns: 1fr; padding: 16px 20px 8px; }
  .nav-container { padding: 4px 20px; }
  .content-area { padding: 20px; }
  .agent-cards-grid, .crm-kanban-board, .agent-management-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   APP HEADER DROPDOWN MENU
   ========================================================================== */
.app-dropdown {
  position: relative;
  display: inline-block;
}

.app-dropdown-menu {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  background: var(--bg-surface-raised);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  min-width: 220px;
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-sm);
  z-index: 1000;
  padding: 8px 0;
  margin-top: 8px;
}

.app-dropdown:hover .app-dropdown-menu,
.app-dropdown:focus-within .app-dropdown-menu {
  display: block;
}

.app-dropdown-item {
  color: var(--text-secondary);
  padding: 10px 16px;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 500;
  transition: all var(--transition-fast);
}

.app-dropdown-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.app-dropdown-trigger {
  cursor: pointer;
}
