/* Rocheston ZelExploits - Gruvbox Dark Theme */
@import url('https://fonts.googleapis.com/css2?family=Fira+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&family=Fira+Mono:wght@400;500&display=swap');

:root {
  --bg:      #282828;
  --bg1:     #3c3836;
  --bg2:     #504945;
  --bg3:     #665c54;
  --bg4:     #7c6f64;
  --fg:      #ebdbb2;
  --fg1:     #d5c4a1;
  --fg2:     #bdae93;
  --fg3:     #a89984;
  --yellow:  #d79921;
  --orange:  #d65d0e;
  --red:     #cc241d;
  --magenta: #b16286;
  --blue:    #458588;
  --cyan:    #689d6a;
  --green:   #98971a;
  --by:      #fabd2f;  /* bright yellow */
  --bo:      #fe8019;  /* bright orange */
  --br:      #fb4934;  /* bright red */
  --bb:      #83a598;  /* bright blue */
  --bc:      #8ec07c;  /* bright cyan */
  --bg-grn:  #b8bb26;  /* bright green */
  --bm:      #d3869b;  /* bright magenta */

  --sidebar-width: 260px;
  --topbar-height: 60px;
  --card-radius: 10px;
  --transition: all 0.2s ease;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Fira Sans', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--fg);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: var(--bb); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--by); }

code, pre, .mono { font-family: 'Fira Mono', 'Consolas', monospace; }

/* ========== SCROLLBAR ========== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg1); }
::-webkit-scrollbar-thumb { background: var(--bg3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--bg4); }

/* ========== LAYOUT ========== */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ========== SIDEBAR ========== */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg1);
  border-right: 1px solid var(--bg2);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
  transition: width 0.25s ease;
  overflow: hidden;
}
.sidebar.collapsed { width: 60px; }
.sidebar.collapsed .sidebar-label,
.sidebar.collapsed .sidebar-group-label,
.sidebar.collapsed .sidebar-brand-sub,
.sidebar.collapsed .sidebar-badge,
.sidebar.collapsed .sidebar-brand-name,
.sidebar.collapsed .sidebar-footer-text { display: none; }
.sidebar.collapsed .nav-item span.icon { margin: 0; }
.sidebar.collapsed .sidebar-brand { padding: 0 10px; justify-content: center; }

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--bg2);
  min-height: 70px;
}
.sidebar-brand-logo {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--by), var(--bo));
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(250,189,47,0.3);
}
.sidebar-brand-name {
  font-size: 20px;
  font-weight: 700;
  color: var(--fg);
  letter-spacing: 0.5px;
}
.sidebar-brand-sub {
  font-size: 10px;
  color: var(--fg3);
  margin-top: 1px;
}
.sidebar-badge {
  margin-left: auto;
  background: var(--bg2);
  color: var(--by);
  font-size: 9px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 10px;
  border: 1px solid var(--yellow);
  white-space: nowrap;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.sidebar-group { margin-bottom: 4px; }

.sidebar-group-label {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  padding: 12px 18px 5px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.sidebar-group-label::after {
  content: '';
  flex: 1;
  height: 1px;
  opacity: 0.3;
  background: currentColor;
  margin-left: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px;
  color: var(--fg2);
  cursor: pointer;
  border-radius: 0;
  transition: var(--transition);
  font-size: 13.5px;
  white-space: nowrap;
  position: relative;
  text-decoration: none;
}
.nav-item:hover { background: var(--bg2); color: var(--fg); }
.nav-item.active {
  background: rgba(250,189,47,0.15);
  color: #fabd2f;
  font-weight: 600;
  box-shadow: inset 4px 0 0 #fabd2f;
}
.nav-item.active .icon svg {
  stroke: #fabd2f !important;
  stroke-width: 2.5 !important;
}
.nav-item.active:hover {
  background: rgba(250,189,47,0.22);
  color: #fabd2f;
}
.nav-item .icon { font-size: 15px; min-width: 20px; text-align: center; }
.nav-item .sidebar-label { flex: 1; }

.sidebar-footer {
  border-top: 1px solid var(--bg2);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.sidebar-status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--bg-grn);
  box-shadow: 0 0 6px var(--bg-grn);
  flex-shrink: 0;
  animation: pulse-green 2s infinite;
}
@keyframes pulse-green {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
.sidebar-footer-text {
  font-size: 11px;
  color: var(--fg3);
  flex: 1;
  overflow: hidden;
}
.collapse-btn {
  background: none; border: none; cursor: pointer;
  color: var(--fg3); padding: 4px; border-radius: 4px;
  transition: var(--transition); margin-left: auto;
}
.collapse-btn:hover { color: var(--fg); background: var(--bg2); }

/* ========== TOPBAR ========== */
.topbar {
  position: fixed;
  top: 0;
  left: var(--sidebar-width);
  right: 0;
  height: var(--topbar-height);
  background: var(--bg1);
  border-bottom: 1px solid var(--bg2);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
  z-index: 99;
  transition: left 0.25s ease;
}
.topbar.sidebar-collapsed { left: 60px; }

.topbar-search {
  flex: 1;
  max-width: 400px;
  position: relative;
}
.topbar-search input {
  width: 100%;
  background: var(--bg2);
  border: 1px solid var(--bg3);
  border-radius: 8px;
  color: var(--fg);
  font-family: inherit;
  font-size: 13px;
  padding: 8px 12px 8px 36px;
  outline: none;
  transition: var(--transition);
}
.topbar-search input:focus { border-color: var(--by); box-shadow: 0 0 0 2px rgba(250,189,47,0.2); }
.topbar-search input::placeholder { color: var(--fg3); }
.topbar-search-icon {
  position: absolute;
  left: 10px; top: 50%;
  transform: translateY(-50%);
  color: var(--fg3);
  font-size: 14px;
}
.search-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg1);
  border: 1px solid var(--bg3);
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  z-index: 200;
  max-height: 400px;
  overflow-y: auto;
  display: none;
}
.search-dropdown.visible { display: block; }
.search-group-header {
  padding: 8px 14px 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--fg3);
}
.search-result-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  color: var(--fg);
}
.search-result-item:hover { background: var(--bg2); }
.search-result-icon { font-size: 14px; min-width: 20px; }
.search-result-title { font-size: 13px; font-weight: 500; }
.search-result-sub { font-size: 11px; color: var(--fg3); }

.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.btn-new-scan {
  background: linear-gradient(135deg, var(--yellow), var(--orange));
  color: var(--bg);
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(215,153,33,0.3);
}
.btn-new-scan:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(215,153,33,0.4);
  color: var(--bg);
}

.notif-btn {
  position: relative;
  background: none; border: none;
  color: var(--fg2); cursor: pointer;
  font-size: 18px;
  width: 38px; height: 38px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
  text-decoration: none;
}
.notif-btn:hover { background: var(--bg2); color: var(--fg); }
.notif-count {
  position: absolute;
  top: 4px; right: 4px;
  background: var(--br);
  color: white;
  font-size: 9px;
  font-weight: 700;
  min-width: 16px; height: 16px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px;
}

.user-menu-btn {
  background: var(--bg2);
  border: 1px solid var(--bg3);
  border-radius: 8px;
  cursor: pointer;
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px;
  transition: var(--transition);
  position: relative;
  color: var(--fg);
}
.user-menu-btn:hover { border-color: var(--by); }
.user-avatar { font-size: 20px; }
.user-name { font-size: 13px; font-weight: 500; }

.user-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--bg1);
  border: 1px solid var(--bg3);
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  min-width: 200px;
  z-index: 200;
  display: none;
}
.user-dropdown.open { display: block; }
.user-dropdown-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px;
  color: var(--fg2);
  text-decoration: none;
  font-size: 13px;
  transition: var(--transition);
  cursor: pointer;
  border: none; background: none; width: 100%; text-align: left;
  font-family: inherit;
}
.user-dropdown-item:hover { background: var(--bg2); color: var(--fg); }
.user-dropdown-item.danger:hover { color: var(--br); }
.user-dropdown-divider { height: 1px; background: var(--bg2); margin: 4px 0; }

/* ========== MAIN CONTENT ========== */
.main-content {
  margin-left: var(--sidebar-width);
  margin-top: var(--topbar-height);
  min-height: calc(100vh - var(--topbar-height));
  padding: 28px;
  transition: margin-left 0.25s ease;
  flex: 1;
  width: calc(100vw - var(--sidebar-width));
  max-width: calc(100vw - var(--sidebar-width));
  overflow-x: hidden;
}
.main-content.sidebar-collapsed { margin-left: 60px; width: calc(100vw - 60px); max-width: calc(100vw - 60px); }

/* ========== PAGE HEADER ========== */
.page-header {
  margin-bottom: 24px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.page-header-left { flex: 1; }
.page-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--fg);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.page-subtitle {
  font-size: 13px;
  color: var(--fg3);
}
.page-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* ========== CARDS ========== */
.card {
  background: var(--bg1);
  border: 1px solid var(--bg2);
  border-radius: var(--card-radius);
  padding: 20px;
  margin-bottom: 20px;
  transition: var(--transition);
}
.card:hover { border-color: var(--bg3); }
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}
.card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--fg);
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-actions { display: flex; align-items: center; gap: 8px; }

/* ========== KPI CARDS ========== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.kpi-card {
  background: var(--bg1);
  border: 1px solid var(--bg2);
  border-radius: var(--card-radius);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,0.3); }
.kpi-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  border-radius: var(--card-radius) var(--card-radius) 0 0;
}
.kpi-card.yellow::after { background: var(--by); }
.kpi-card.orange::after { background: var(--bo); }
.kpi-card.red::after { background: var(--br); }
.kpi-card.green::after { background: var(--bg-grn); }
.kpi-card.blue::after { background: var(--bb); }
.kpi-card.magenta::after { background: var(--bm); }
.kpi-card.cyan::after { background: var(--bc); }

.kpi-icon {
  font-size: 24px;
  margin-bottom: 10px;
  opacity: 0.9;
}
.kpi-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--fg);
  line-height: 1;
  margin-bottom: 4px;
}
.kpi-label {
  font-size: 12px;
  color: var(--fg3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.kpi-change {
  font-size: 11px;
  margin-top: 6px;
  display: flex; align-items: center; gap: 4px;
}
.kpi-change.up { color: var(--bg-grn); }
.kpi-change.down { color: var(--br); }

/* ========== BUTTONS ========== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid transparent;
  border-radius: 7px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
  background: transparent;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--yellow);
  color: var(--bg);
  border-color: var(--yellow);
}
.btn-primary:hover { background: var(--by); border-color: var(--by); color: var(--bg); transform: translateY(-1px); }

.btn-secondary {
  background: var(--bg2);
  color: var(--fg);
  border-color: var(--bg3);
}
.btn-secondary:hover { background: var(--bg3); border-color: var(--bg4); }

.btn-danger {
  background: rgba(204,36,29,0.15);
  color: var(--br);
  border-color: rgba(204,36,29,0.3);
}
.btn-danger:hover { background: rgba(251,73,52,0.25); border-color: var(--br); }

.btn-success {
  background: rgba(152,151,26,0.15);
  color: var(--bg-grn);
  border-color: rgba(152,151,26,0.3);
}
.btn-success:hover { background: rgba(184,187,38,0.25); border-color: var(--bg-grn); }

.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }
.btn-icon { padding: 7px; }

.btn-ghost {
  background: transparent;
  color: var(--fg2);
  border-color: transparent;
}
.btn-ghost:hover { background: var(--bg2); color: var(--fg); }

/* ========== TABLES ========== */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--card-radius);
  border: 1px solid var(--bg2);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
thead { background: var(--bg2); }
th {
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
  color: var(--fg2);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  border-bottom: 1px solid var(--bg3);
}
td {
  padding: 11px 14px;
  color: var(--fg);
  border-bottom: 1px solid rgba(80,73,69,0.4);
  vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(80,73,69,0.3); }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--by); }

/* ========== BADGES & STATUSES ========== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
}
.badge-critical { background: rgba(251,73,52,0.15); color: var(--br); border: 1px solid rgba(251,73,52,0.3); }
.badge-high     { background: rgba(254,128,25,0.15); color: var(--bo); border: 1px solid rgba(254,128,25,0.3); }
.badge-medium   { background: rgba(250,189,47,0.15); color: var(--by); border: 1px solid rgba(250,189,47,0.3); }
.badge-low      { background: rgba(184,187,38,0.15); color: var(--bg-grn); border: 1px solid rgba(184,187,38,0.3); }
.badge-info     { background: rgba(131,165,152,0.15); color: var(--bb); border: 1px solid rgba(131,165,152,0.3); }

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  background: var(--bg2);
}
.status-badge::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
}
.status-running { color: var(--by); }
.status-completed { color: var(--bg-grn); }
.status-failed { color: var(--br); }
.status-queued { color: var(--bb); }
.status-paused { color: var(--bo); }
.status-stopped { color: var(--bm); }
.status-pending { color: var(--fg3); }
.status-open { color: var(--br); }
.status-confirmed { color: var(--bo); }
.status-in_review { color: var(--by); }
.status-remediated { color: var(--bg-grn); }
.status-accepted { color: var(--bb); }
.status-false_positive { color: var(--fg3); }
.status-active { color: var(--bg-grn); }
.status-draft { color: var(--fg3); }
.status-generated { color: var(--bb); }

/* ========== FORMS ========== */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--fg2);
  margin-bottom: 6px;
}
.form-label.required::after { content: ' *'; color: var(--br); }
.form-control {
  width: 100%;
  background: var(--bg2);
  border: 1px solid var(--bg3);
  border-radius: 7px;
  color: var(--fg);
  font-family: inherit;
  font-size: 13px;
  padding: 9px 12px;
  outline: none;
  transition: var(--transition);
}
.form-control:focus { border-color: var(--by); box-shadow: 0 0 0 2px rgba(250,189,47,0.15); }
.form-control::placeholder { color: var(--fg3); }
.form-control:disabled { opacity: 0.6; cursor: not-allowed; }
textarea.form-control { resize: vertical; min-height: 80px; }
select.form-control {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23a89984' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}
.form-hint { font-size: 11px; color: var(--fg3); margin-top: 4px; }
.form-error { font-size: 11px; color: var(--br); margin-top: 4px; }

.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.form-check input[type=checkbox] {
  width: 16px; height: 16px;
  accent-color: var(--by);
  cursor: pointer;
}
.form-check-label { font-size: 13px; color: var(--fg2); cursor: pointer; }

/* ========== PROGRESS ========== */
.progress {
  height: 6px;
  background: var(--bg2);
  border-radius: 3px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--yellow), var(--by));
  transition: width 0.5s ease;
}
.progress-bar.danger { background: linear-gradient(90deg, var(--red), var(--br)); }
.progress-bar.success { background: linear-gradient(90deg, var(--green), var(--bg-grn)); }
.progress-bar.info { background: linear-gradient(90deg, var(--blue), var(--bb)); }
.progress-bar.animated {
  background-size: 200% 100%;
  animation: progress-shimmer 1.5s infinite;
  background-image: linear-gradient(90deg, var(--yellow) 0%, var(--by) 50%, var(--yellow) 100%);
}
@keyframes progress-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ========== TABS ========== */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--bg2);
  gap: 0;
  margin-bottom: 20px;
  overflow-x: auto;
}
.tab-btn {
  padding: 10px 18px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--fg3);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  margin-bottom: -1px;
  display: flex; align-items: center; gap: 6px;
  text-decoration: none;
}
.tab-btn:hover { color: var(--fg); }
.tab-btn.active {
  color: var(--by);
  border-bottom-color: var(--by);
}
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ========== ALERTS ========== */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 13px;
}
.alert-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.alert-success { background: rgba(152,151,26,0.15); border: 1px solid rgba(184,187,38,0.3); color: var(--bg-grn); }
.alert-danger  { background: rgba(204,36,29,0.15);  border: 1px solid rgba(251,73,52,0.3);  color: var(--br); }
.alert-warning { background: rgba(215,153,33,0.15); border: 1px solid rgba(250,189,47,0.3); color: var(--by); }
.alert-info    { background: rgba(69,133,136,0.15); border: 1px solid rgba(131,165,152,0.3); color: var(--bb); }

/* ========== TOAST NOTIFICATIONS ========== */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  background: var(--bg1);
  border: 1px solid var(--bg2);
  border-radius: 10px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 280px;
  max-width: 380px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  pointer-events: all;
  animation: toast-in 0.3s ease;
  font-size: 13px;
}
.toast.hiding { animation: toast-out 0.3s ease forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateX(100%); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(100%); } }
.toast-icon { font-size: 18px; flex-shrink: 0; }
.toast-body { flex: 1; }
.toast-title { font-weight: 600; margin-bottom: 2px; }
.toast-text { color: var(--fg3); font-size: 12px; }
.toast-close { background: none; border: none; color: var(--fg3); cursor: pointer; padding: 2px; font-size: 14px; }
.toast-close:hover { color: var(--fg); }
.toast.success { border-left: 3px solid var(--bg-grn); }
.toast.success .toast-icon { color: var(--bg-grn); }
.toast.error   { border-left: 3px solid var(--br); }
.toast.error .toast-icon { color: var(--br); }
.toast.warning { border-left: 3px solid var(--by); }
.toast.warning .toast-icon { color: var(--by); }
.toast.info    { border-left: 3px solid var(--bb); }
.toast.info .toast-icon { color: var(--bb); }

/* ========== EMPTY STATES ========== */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--fg3);
}
.empty-state-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.7; }
.empty-state-title { font-size: 18px; font-weight: 600; color: var(--fg2); margin-bottom: 8px; }
.empty-state-text { font-size: 13px; max-width: 360px; margin: 0 auto 20px; }

/* ========== GRID LAYOUTS ========== */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
@media (max-width: 1200px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 900px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .sidebar { width: 60px; }
  .sidebar.collapsed { width: 60px; }
  .topbar, .main-content { left: 60px; margin-left: 60px; }
}

/* ========== CHART CONTAINERS ========== */
.chart-container { position: relative; height: 240px; }
.chart-container.tall { height: 320px; }
.chart-container.small { height: 180px; }

/* ========== TERMINAL STYLES ========== */
.terminal-output {
  background: #1d2021;
  border: 1px solid var(--bg2);
  border-radius: 8px;
  padding: 16px;
  font-family: 'Fira Mono', monospace;
  font-size: 12px;
  color: var(--fg);
  height: 420px;
  overflow-y: auto;
  line-height: 1.7;
  position: relative;
}
.terminal-line { display: block; }
.terminal-prompt { color: var(--bg-grn); }
.terminal-cmd { color: var(--by); }
.terminal-output-text { color: var(--fg2); }
.terminal-error { color: var(--br); }
.terminal-input-row {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--bg3);
  border-radius: 0 0 8px 8px;
  border-top: none;
  background: #1d2021;
  overflow: hidden;
}
.terminal-input-prompt {
  padding: 10px 12px;
  color: var(--bg-grn);
  font-family: 'Fira Mono', monospace;
  font-size: 12px;
  background: #1d2021;
  white-space: nowrap;
}
.terminal-input {
  flex: 1;
  background: #1d2021;
  border: none;
  color: var(--by);
  font-family: 'Fira Mono', monospace;
  font-size: 12px;
  padding: 10px 0;
  outline: none;
}

/* ========== ACTIVITY FEED ========== */
.activity-feed { display: flex; flex-direction: column; gap: 0; }
.activity-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(80,73,69,0.4);
  position: relative;
}
.activity-item:last-child { border-bottom: none; }
.activity-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
  background: var(--bg2);
}
.activity-content { flex: 1; min-width: 0; }
.activity-title { font-size: 13px; color: var(--fg); font-weight: 500; }
.activity-desc { font-size: 11px; color: var(--fg3); margin-top: 2px; }
.activity-time { font-size: 11px; color: var(--fg3); white-space: nowrap; margin-top: 2px; }

/* ========== IMPERSONATION BANNER ========== */
.impersonation-banner {
  background: rgba(214,93,14,0.2);
  border: 1px solid var(--orange);
  border-radius: 8px;
  padding: 8px 16px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--bo);
}
.impersonation-banner strong { color: var(--by); }

/* ========== MODAL ========== */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 500;
  display: none;
  align-items: center;
  justify-content: center;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--bg1);
  border: 1px solid var(--bg3);
  border-radius: 12px;
  padding: 28px;
  max-width: 600px;
  width: calc(100% - 32px);
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 64px rgba(0,0,0,0.7);
  animation: modal-in 0.2s ease;
}
@keyframes modal-in { from { opacity: 0; transform: scale(0.95); } }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.modal-title { font-size: 18px; font-weight: 700; color: var(--fg); }
.modal-close { background: none; border: none; color: var(--fg3); cursor: pointer; font-size: 20px; }
.modal-close:hover { color: var(--fg); }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }

/* ========== WIZARD ========== */
.wizard-steps {
  display: flex;
  align-items: center;
  margin-bottom: 32px;
  gap: 0;
}
.wizard-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
  position: relative;
}
.wizard-step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 16px; left: calc(50% + 20px); right: calc(-50% + 20px);
  height: 2px;
  background: var(--bg3);
}
.wizard-step.done:not(:last-child)::after { background: var(--yellow); }
.wizard-step-circle {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--bg2);
  border: 2px solid var(--bg3);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--fg3);
  z-index: 1;
}
.wizard-step.active .wizard-step-circle { border-color: var(--by); color: var(--by); background: rgba(250,189,47,0.1); }
.wizard-step.done .wizard-step-circle { border-color: var(--yellow); background: var(--yellow); color: var(--bg); }
.wizard-step-label { font-size: 11px; color: var(--fg3); text-align: center; white-space: nowrap; }
.wizard-step.active .wizard-step-label { color: var(--by); }
.wizard-step.done .wizard-step-label { color: var(--fg2); }

/* ========== LOGIN PAGE ========== */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 24px;
  position: relative;
  overflow: hidden;
}
.auth-page::before {
  content: '';
  position: absolute;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: radial-gradient(ellipse at center, rgba(215,153,33,0.05) 0%, transparent 60%);
  pointer-events: none;
}
.auth-card {
  background: var(--bg1);
  border: 1px solid var(--bg2);
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 450px;
  box-shadow: 0 20px 64px rgba(0,0,0,0.5);
  position: relative;
}
.auth-logo {
  text-align: center;
  margin-bottom: 28px;
}
.auth-logo-icon {
  width: 56px; height: 56px;
  background: linear-gradient(135deg, var(--yellow), var(--orange));
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  margin: 0 auto 12px;
  box-shadow: 0 4px 16px rgba(215,153,33,0.4);
}
.auth-logo-name { font-size: 22px; font-weight: 700; color: var(--fg); }
.auth-logo-sub { font-size: 12px; color: var(--fg3); margin-top: 2px; }

/* ========== CHIPS/TAGS ========== */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  background: var(--bg2);
  border-radius: 20px;
  font-size: 11px;
  color: var(--fg2);
}

/* ========== SCAN PROGRESS CARD ========== */
.scan-live-card {
  background: var(--bg1);
  border: 1px solid var(--bg2);
  border-radius: var(--card-radius);
  padding: 16px;
  position: relative;
  overflow: hidden;
}
.scan-live-card.running {
  border-color: rgba(250,189,47,0.3);
  box-shadow: 0 0 12px rgba(250,189,47,0.08);
}

/* ========== MISC UTILITIES ========== */
.text-muted { color: var(--fg3) !important; }
.text-yellow { color: var(--by) !important; }
.text-orange { color: var(--bo) !important; }
.text-red    { color: var(--br) !important; }
.text-green  { color: var(--bg-grn) !important; }
.text-blue   { color: var(--bb) !important; }
.text-magenta { color: var(--bm) !important; }
.text-cyan   { color: var(--bc) !important; }
.text-center { text-align: center; }
.text-right  { text-align: right; }
.flex        { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-5 { margin-bottom: 20px; }
.w-full { width: 100%; }
.d-none { display: none !important; }
.d-flex { display: flex !important; }
.font-mono { font-family: 'Fira Mono', monospace; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.divider { height: 1px; background: var(--bg2); margin: 20px 0; }

/* ========== CONFIDENCE BAR ========== */
.confidence-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}
.confidence-track {
  flex: 1;
  height: 4px;
  background: var(--bg2);
  border-radius: 2px;
  overflow: hidden;
}
.confidence-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--by);
}
.confidence-fill.high { background: var(--bg-grn); }
.confidence-fill.low  { background: var(--br); }

/* ========== LOADING ========== */
.spinner {
  display: inline-block;
  width: 20px; height: 20px;
  border: 2px solid var(--bg3);
  border-top-color: var(--by);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.skeleton {
  background: linear-gradient(90deg, var(--bg2) 25%, var(--bg3) 50%, var(--bg2) 75%);
  background-size: 200% 100%;
  animation: skeleton-wave 1.5s infinite;
  border-radius: 4px;
  height: 16px;
}
@keyframes skeleton-wave { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ========== ACCORDION ========== */
.accordion-item { border: 1px solid var(--bg2); border-radius: 8px; margin-bottom: 8px; overflow: hidden; }
.accordion-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  cursor: pointer;
  background: var(--bg1);
  font-size: 13px;
  font-weight: 500;
  color: var(--fg);
  user-select: none;
  transition: var(--transition);
}
.accordion-header:hover { background: var(--bg2); }
.accordion-header .arrow { transition: transform 0.2s; color: var(--fg3); }
.accordion-header.open .arrow { transform: rotate(180deg); }
.accordion-body { padding: 16px; display: none; background: rgba(40,40,40,0.5); }
.accordion-body.open { display: block; }

/* ========== QUICK LAUNCH TILES ========== */
.quick-launch-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.quick-tile {
  background: var(--bg2);
  border: 1px solid var(--bg3);
  border-radius: 10px;
  padding: 20px 16px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  display: block;
}
.quick-tile:hover { border-color: var(--by); background: rgba(215,153,33,0.1); transform: translateY(-2px); }
.quick-tile-icon { font-size: 28px; margin-bottom: 8px; }
.quick-tile-label { font-size: 12px; font-weight: 600; color: var(--fg); }
.quick-tile-sub { font-size: 11px; color: var(--fg3); margin-top: 4px; }

/* ========== SYSTEM STATUS ========== */
.system-status-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.system-status-item {
  background: var(--bg2);
  border-radius: 8px;
  padding: 12px;
  text-align: center;
}
.system-status-value { font-size: 20px; font-weight: 700; color: var(--fg); }
.system-status-label { font-size: 11px; color: var(--fg3); margin-top: 4px; }
