/* styles.css - Houston D.O.G.E. Financial Audit Platform */

:root {
  --primary: #0f172a;
  --primary-light: #1e293b;
  --primary-mid: #334155;
  --accent: #ef4444;
  --accent-light: #fca5a5;
  --accent-bg: #fef2f2;
  --success: #10b981;
  --success-bg: #ecfdf5;
  --warning: #f59e0b;
  --warning-bg: #fffbeb;
  --info: #3b82f6;
  --info-bg: #eff6ff;
  --bg: #f8fafc;
  --card-bg: #ffffff;
  --text: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   HEADER
   ============================================================ */
header {
  background: var(--primary);
  color: #fff;
  padding: 0 24px;
  display: flex;
  align-items: center;
  height: 64px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-md);
}

header .logo img {
  height: 36px;
  margin-right: 12px;
  border-radius: 4px;
}

header h1 {
  font-size: 1.15em;
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.tagline {
  display: none; /* Clean up header - show in sidebar instead */
}

nav { margin-left: auto; }

nav ul {
  list-style: none;
  display: flex;
  gap: 2px;
}

nav ul li a {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: var(--radius-xs);
  font-size: 0.82em;
  font-weight: 500;
  transition: all var(--transition);
  white-space: nowrap;
  position: relative;
}

nav ul li a:hover {
  color: #fff;
  background: rgba(255,255,255,0.1);
}

nav ul li a.active {
  color: #fff;
  background: rgba(255,255,255,0.15);
}

nav ul li a.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 2px;
  background: var(--info);
  border-radius: 1px;
}

/* ============================================================
   GLOBAL SEARCH BAR
   ============================================================ */
#globalSearch {
  position: relative;
  margin: 0 20px;
  flex: 0 1 320px;
}

#globalSearchInput {
  width: 100%;
  padding: 8px 14px 8px 36px;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius-xs);
  background: rgba(255,255,255,0.08);
  color: #fff;
  font-size: 0.85em;
  outline: none;
  transition: all var(--transition);
}

#globalSearchInput::placeholder { color: rgba(255,255,255,0.4); }
#globalSearchInput:focus {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.3);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.3);
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255,255,255,0.4);
  font-size: 0.85em;
}

#searchResults {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  max-height: 400px;
  overflow-y: auto;
  display: none;
  z-index: 200;
  margin-top: 4px;
}

#searchResults.visible { display: block; }

.search-result-item {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: background var(--transition);
  color: var(--text);
  font-size: 0.85em;
}

.search-result-item:hover { background: var(--bg); }
.search-result-item:last-child { border-bottom: none; }

.search-result-type {
  font-size: 0.7em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.search-result-title {
  font-weight: 600;
  color: var(--text);
}

.search-result-detail {
  color: var(--text-secondary);
  font-size: 0.9em;
}

/* ============================================================
   LAYOUT
   ============================================================ */
.container {
  display: flex;
  min-height: calc(100vh - 64px);
}

/* ============================================================
   SIDEBAR
   ============================================================ */
#sidebar {
  width: 260px;
  min-width: 260px;
  background: var(--card-bg);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  height: calc(100vh - 64px);
  position: sticky;
  top: 64px;
  padding: 20px 0;
}

#sidebar h2 {
  font-size: 0.7em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 0 20px;
  margin-bottom: 8px;
}

#sidebar ul {
  list-style: none;
}

#sidebar ul li {
  padding: 8px 20px;
  cursor: pointer;
  font-size: 0.85em;
  color: var(--text-secondary);
  transition: all var(--transition);
  border-left: 3px solid transparent;
}

#sidebar ul li:hover {
  background: var(--bg);
  color: var(--text);
  border-left-color: var(--border);
}

#sidebar ul li.active {
  background: var(--info-bg);
  color: var(--info);
  font-weight: 600;
  border-left-color: var(--info);
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
#mainContent {
  flex-grow: 1;
  padding: 28px 32px;
  overflow-y: auto;
  max-width: 1200px;
}

h2 {
  font-size: 1.5em;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

h3 {
  font-size: 1.1em;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-bottom: 12px;
}

/* Tab System */
.tab-content { display: none; }
.tab-content.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   STATS GRID
   ============================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}

.stat-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--info);
  border-radius: var(--radius) var(--radius) 0 0;
}

.stat-card.alert-stat::before { background: var(--accent); }
.stat-card.success-stat::before { background: var(--success); }
.stat-card.warning-stat::before { background: var(--warning); }

.stat-value {
  font-size: 2em;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.alert-stat .stat-value { color: var(--accent); }
.success-stat .stat-value { color: var(--success); }

.stat-label {
  font-size: 0.78em;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 6px;
}

/* ============================================================
   SECTION DESCRIPTION
   ============================================================ */
.section-description {
  color: var(--text-secondary);
  margin-bottom: 24px;
  font-size: 0.9em;
  line-height: 1.6;
}

/* ============================================================
   CARDS & CONTAINERS
   ============================================================ */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
}

/* Graph Containers */
#overallGraphContainer, #graphSection {
  width: 100%;
  height: 420px;
  position: relative;
  overflow: hidden;
  margin-top: 20px;
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

#overallSpendingChart,
#departmentChart {
  width: 100% !important;
  height: 100% !important;
}

/* ============================================================
   BUTTONS
   ============================================================ */
button, .btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  font-size: 0.85em;
  font-weight: 600;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

button:hover { background: var(--primary-mid); transform: translateY(-1px); box-shadow: var(--shadow); }
button:active { transform: translateY(0); }
button:disabled { background: #cbd5e1; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-danger { background: var(--accent); }
.btn-danger:hover { background: #dc2626; }

.btn-success { background: var(--success); }
.btn-success:hover { background: #059669; }

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-outline:hover { background: var(--bg); box-shadow: none; }

.btn-sm { padding: 6px 12px; font-size: 0.78em; }
.btn-xs { padding: 4px 10px; font-size: 0.72em; }

/* ============================================================
   FORMS
   ============================================================ */
.audit-controls {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.audit-form {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.audit-form label {
  font-weight: 600;
  font-size: 0.82em;
  color: var(--text-secondary);
}

.audit-form select, .audit-form input,
select, input[type="text"] {
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  font-size: 0.85em;
  background: var(--card-bg);
  color: var(--text);
  transition: all var(--transition);
  outline: none;
}

select:focus, input[type="text"]:focus {
  border-color: var(--info);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}

/* ============================================================
   PROGRESS BAR
   ============================================================ */
.progress-bar {
  width: 100%;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 12px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--info), #818cf8);
  border-radius: 2px;
  animation: progress-anim 2s ease-in-out infinite;
}

@keyframes progress-anim {
  0% { width: 5%; }
  50% { width: 75%; }
  100% { width: 95%; }
}

/* ============================================================
   ALERT CARDS
   ============================================================ */
.alert-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 12px;
  border-left: 4px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
  cursor: default;
}

.alert-card:hover {
  box-shadow: var(--shadow);
  transform: translateX(2px);
}

.alert-card.severity-high { border-left-color: var(--accent); background: linear-gradient(90deg, var(--accent-bg) 0%, var(--card-bg) 15%); }
.alert-card.severity-medium { border-left-color: var(--warning); background: linear-gradient(90deg, var(--warning-bg) 0%, var(--card-bg) 15%); }
.alert-card.severity-low { border-left-color: var(--success); background: linear-gradient(90deg, var(--success-bg) 0%, var(--card-bg) 15%); }

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

.alert-type {
  font-weight: 700;
  font-size: 0.78em;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
}

.alert-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.7em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-high { background: #fecaca; color: #991b1b; }
.badge-medium { background: #fde68a; color: #92400e; }
.badge-low { background: #a7f3d0; color: #065f46; }
.badge-open { background: #fecaca; color: #991b1b; }
.badge-investigating { background: #fde68a; color: #92400e; }
.badge-resolved { background: #a7f3d0; color: #065f46; }
.badge-dismissed { background: #e2e8f0; color: #475569; }

.alert-reason {
  font-size: 0.88em;
  line-height: 1.6;
  margin-bottom: 10px;
  color: var(--text);
}

.alert-meta {
  font-size: 0.78em;
  color: var(--text-muted);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.alert-actions {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
  display: flex;
  gap: 8px;
}

.alert-actions button {
  font-size: 0.72em;
  padding: 5px 14px;
  border-radius: 20px;
}

/* ============================================================
   ALERT FILTERS
   ============================================================ */
.alert-filters {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.alert-summary-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.summary-chip {
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.78em;
  font-weight: 600;
}

/* ============================================================
   TABLES
   ============================================================ */
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.85em;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

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

.data-table td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-light);
}

.data-table tr:last-child td { border-bottom: none; }

.data-table tr:hover td {
  background: var(--bg);
}

.data-table tr.clickable {
  cursor: pointer;
}

/* ============================================================
   VENDOR CONTROLS
   ============================================================ */
.vendor-controls {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.vendor-controls input {
  min-width: 280px;
}

/* ============================================================
   SOURCE CARDS
   ============================================================ */
.source-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}

.source-card:hover { box-shadow: var(--shadow); }

.source-card h4 {
  margin: 0 0 10px 0;
  color: var(--text);
  font-weight: 700;
}

.source-meta {
  font-size: 0.82em;
  color: var(--text-secondary);
  line-height: 2;
}

.source-status {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.72em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.status-success { background: #a7f3d0; color: #065f46; }
.status-error { background: #fecaca; color: #991b1b; }
.status-pending { background: #fde68a; color: #92400e; }

/* ============================================================
   BENFORD'S LAW
   ============================================================ */
#benfordsContainer {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin: 24px 0;
  box-shadow: var(--shadow-sm);
}

#benfordsChart { max-height: 300px; }

#benfordsVerdict {
  text-align: center;
  font-weight: 600;
  font-size: 0.9em;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  margin-top: 16px;
}

/* ============================================================
   PAGINATION
   ============================================================ */
#alertsPagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
}

#alertsPagination button {
  padding: 8px 16px;
  font-size: 0.82em;
  border-radius: 20px;
}

#alertsPagination span {
  font-size: 0.85em;
  color: var(--text-secondary);
}

/* ============================================================
   AUDIT REPORTS
   ============================================================ */
.audit-report-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}

.audit-report-card:hover { box-shadow: var(--shadow); }
.audit-report-card h4 { margin: 0 0 10px 0; font-weight: 700; }

/* ============================================================
   VENDOR GRAPH CONTAINER (Dashboard)
   ============================================================ */
#vendorGraphContainer {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-top: 20px;
  box-shadow: var(--shadow-sm);
}

#vendorGraphContainer ol { padding-left: 20px; }
#vendorGraphContainer li { padding: 6px 0; font-size: 0.88em; }

/* ============================================================
   RELATED PARTIES
   ============================================================ */
.related-sections {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin-top: 28px;
}

.related-section {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.related-section h3 {
  margin-top: 0;
  color: var(--text);
}

/* ============================================================
   KICKBACK CATEGORIES
   ============================================================ */
.kickback-category {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.kickback-category h4 {
  margin: 0 0 4px 0;
  font-weight: 700;
  color: var(--text);
}

/* ============================================================
   INVESTIGATION PANEL (slide-out)
   ============================================================ */
#investigationPanel {
  position: fixed;
  top: 64px;
  right: -480px;
  width: 480px;
  height: calc(100vh - 64px);
  background: var(--card-bg);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  z-index: 150;
  transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  padding: 0;
}

#investigationPanel.open { right: 0; }

.panel-header {
  position: sticky;
  top: 0;
  background: var(--card-bg);
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 10;
}

.panel-header h3 { margin: 0; font-size: 1em; }

.panel-close {
  background: none;
  border: none;
  font-size: 1.3em;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

.panel-close:hover { color: var(--text); background: none; transform: none; box-shadow: none; }

.panel-body {
  padding: 24px;
}

.panel-section {
  margin-bottom: 24px;
}

.panel-section h4 {
  font-size: 0.75em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.panel-field {
  margin-bottom: 12px;
}

.panel-field-label {
  font-size: 0.78em;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.panel-field-value {
  font-size: 0.9em;
  font-weight: 600;
}

.panel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 140;
  display: none;
  backdrop-filter: blur(2px);
}

.panel-overlay.visible { display: block; }

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
#toastContainer {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: #fff;
  font-size: 0.85em;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.35s ease, toastOut 0.35s ease 3s forwards;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 400px;
}

.toast.success { background: #065f46; }
.toast.error { background: #991b1b; }
.toast.warning { background: #92400e; }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(16px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-8px); }
}

/* ============================================================
   LOADING SKELETON
   ============================================================ */
.skeleton {
  background: linear-gradient(90deg, var(--border-light) 25%, var(--border) 50%, var(--border-light) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: var(--radius-xs);
}

@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-text { height: 14px; margin-bottom: 8px; }
.skeleton-title { height: 24px; width: 60%; margin-bottom: 12px; }
.skeleton-card { height: 120px; margin-bottom: 12px; }

/* ============================================================
   FOOTER
   ============================================================ */
footer {
  background: var(--primary);
  color: rgba(255,255,255,0.7);
  padding: 20px 32px;
  font-size: 0.8em;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-sub {
  font-size: 0.9em;
  opacity: 0.6;
}

/* ============================================================
   UTILITY CLASSES
   ============================================================ */
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.85em; }
.text-xs { font-size: 0.78em; }
.font-mono { font-family: 'SF Mono', 'Fira Code', monospace; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.flex { display: flex; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.items-center { align-items: center; }

.money { font-family: 'SF Mono', 'Fira Code', monospace; font-weight: 600; }
.money-lg { font-size: 1.2em; }

/* ============================================================
   STAT CARD ICONS
   ============================================================ */
.stat-icon {
  margin-bottom: 10px;
}

.stat-card[style*="border-top-color"]::before {
  display: none; /* Use inline border-top-color instead */
}

.stat-card[style*="border-top-color"] {
  border-top: 3px solid var(--info);
}

/* ============================================================
   EXPORT BUTTON
   ============================================================ */
.btn-export {
  background: var(--card-bg);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: var(--radius-xs);
  font-size: 0.8em;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-export:hover {
  background: var(--bg);
  color: var(--text);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

/* ============================================================
   SEARCH SECTIONS
   ============================================================ */
.search-section {
  padding: 4px 0;
}

.search-section-title {
  font-size: 0.68em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 8px 14px 4px;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-loading, .search-no-results {
  padding: 16px 14px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85em;
}

/* ============================================================
   PANEL ACTIONS (investigation panel)
   ============================================================ */
.panel-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.panel-actions button {
  flex: 1;
  min-width: 0;
  font-size: 0.78em;
  justify-content: center;
}

.btn-investigate { background: var(--warning); color: #fff; }
.btn-investigate:hover { background: #d97706; }
.btn-resolve { background: var(--success); color: #fff; }
.btn-resolve:hover { background: #059669; }
.btn-dismiss { background: var(--text-muted); color: #fff; }
.btn-dismiss:hover { background: #64748b; }

.panel-badges {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.panel-alert-detail .data-table td:first-child {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.82em;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  width: 120px;
}

/* ============================================================
   TOAST ENHANCEMENTS
   ============================================================ */
.toast {
  animation: none; /* Controlled via JS classes */
  opacity: 0;
  transform: translateY(16px) scale(0.95);
  transition: all 0.3s ease;
}

.toast.toast-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.toast-success { background: #065f46; }
.toast-error { background: #991b1b; }
.toast-warning { background: #92400e; }
.toast-info { background: var(--primary); }

.toast-icon {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.toast-message { flex: 1; }

.toast-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  font-size: 1.1em;
  padding: 0 4px;
  line-height: 1;
}

.toast-close:hover {
  color: #fff;
  background: none;
  transform: none;
  box-shadow: none;
}

/* Panel overlay fix */
.panel-overlay.open { display: block; }

/* Clickable alerts */
.clickable-alert:hover {
  box-shadow: var(--shadow-md);
  cursor: pointer;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  nav ul { gap: 0; }
  nav ul li a { padding: 8px 10px; font-size: 0.78em; }
  #globalSearch { display: none; }
  #mainContent { padding: 20px; }
}

@media (max-width: 768px) {
  .container { flex-direction: column; }
  #sidebar { width: 100%; min-width: 100%; height: auto; max-height: 180px; position: relative; top: 0; }
  header { height: auto; padding: 12px; flex-wrap: wrap; }
  nav { margin-left: 0; width: 100%; overflow-x: auto; }
  nav ul { width: max-content; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .audit-form { flex-direction: column; align-items: stretch; }
  #investigationPanel { width: 100%; right: -100%; }
  footer { flex-direction: column; gap: 8px; text-align: center; }
}
