/* ============================================
   CSL Command Center — Global Stylesheet
   Design: Dark professional, Bloomberg meets Apple
   ============================================ */

:root {
  --bg-primary: #0A1628;
  --bg-secondary: #0F1E38;
  --bg-card: #132040;
  --bg-card-hover: #1A2850;
  --bg-elevated: #1C2D4E;
  --ahead-blue: #1C4CBF;
  --ahead-azure: #009FDC;
  --csl-red: #C8102E;
  --text-primary: #FFFFFF;
  --text-secondary: #9BAEC8;
  --text-muted: #6B7FA3;
  --border-color: #1E3060;
  --border-light: #243870;
  --success: #22C55E;
  --warning: #F59E0B;
  --danger: #EF4444;
  --gold: #F59E0B;
  --nav-height: 60px;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.6);
  --transition: all 0.2s ease;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

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

/* ============== NAVIGATION ============== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  z-index: 1000;
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 0;
  backdrop-filter: blur(12px);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.nav-logo {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--csl-red), #a00c24);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 14px;
  color: white;
  letter-spacing: -1px;
}

.nav-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.02em;
}

.nav-title span {
  color: var(--ahead-azure);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: 32px;
  flex: 1;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 6px;
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  transition: var(--transition);
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--text-primary);
  background: var(--bg-card);
}

.nav-link.active {
  color: var(--ahead-azure);
  background: rgba(0, 159, 220, 0.12);
}

.nav-link .icon {
  font-size: 14px;
  opacity: 0.8;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
  flex-shrink: 0;
}

.search-box {
  position: relative;
}

.search-box input {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 6px 12px 6px 32px;
  color: var(--text-primary);
  font-size: 13px;
  width: 200px;
  transition: var(--transition);
  outline: none;
}

.search-box input:focus {
  border-color: var(--ahead-azure);
  width: 260px;
}

.search-box input::placeholder {
  color: var(--text-muted);
}

.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 13px;
  pointer-events: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--ahead-blue);
  color: white;
}

.btn-primary:hover {
  background: #2558d8;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(28,76,191,0.4);
}

.btn-azure {
  background: var(--ahead-azure);
  color: white;
}

.btn-azure:hover {
  background: #00b8f0;
  transform: translateY(-1px);
}

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

.btn-outline:hover {
  color: var(--text-primary);
  border-color: var(--text-secondary);
  background: var(--bg-card);
}

.btn-danger {
  background: var(--danger);
  color: white;
}

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

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid transparent;
}

.btn-ghost:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

/* Edit mode toggle */
.edit-toggle {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
}

.edit-toggle.active {
  background: rgba(245, 158, 11, 0.15);
  border-color: var(--warning);
  color: var(--warning);
}

/* ============== LAYOUT ============== */
.page-wrapper {
  margin-top: var(--nav-height);
  min-height: calc(100vh - var(--nav-height));
  padding: 28px 28px 60px;
  max-width: 1600px;
  margin-left: auto;
  margin-right: auto;
}

.page-wrapper {
  margin-top: var(--nav-height);
}

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

.page-title {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.page-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.page-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

/* ============== CARDS ============== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: var(--transition);
}

.card:hover {
  border-color: var(--border-light);
}

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

.card-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.card-title.blue { color: var(--ahead-azure); }
.card-title.red { color: var(--csl-red); }
.card-title.gold { color: var(--gold); }

/* ============== GRID ============== */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 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(300px, 1fr)); gap: 20px; }

/* ============== ALERT BAR ============== */
.alert-bar {
  border-radius: var(--radius);
  margin-bottom: 20px;
  overflow: hidden;
}

.alert-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-left: 3px solid transparent;
  font-size: 13px;
}

.alert-item.high {
  background: rgba(239,68,68,0.1);
  border-left-color: var(--danger);
}

.alert-item.medium {
  background: rgba(245,158,11,0.1);
  border-left-color: var(--warning);
}

.alert-item.low {
  background: rgba(34,197,94,0.1);
  border-left-color: var(--success);
}

.alert-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.alert-item.high .alert-dot { background: var(--danger); }
.alert-item.medium .alert-dot { background: var(--warning); }
.alert-item.low .alert-dot { background: var(--success); }

.alert-text { flex: 1; color: var(--text-primary); }
.alert-date { color: var(--text-muted); font-size: 11px; }

/* ============== STATS BAR ============== */
.stats-bar {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.stat-chip {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px 20px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 140px;
}

.stat-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--ahead-azure);
  line-height: 1;
}

.stat-value.red { color: var(--csl-red); }
.stat-value.gold { color: var(--gold); }
.stat-value.green { color: var(--success); }

.stat-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

/* ============== BULLETS / BRIEF ============== */
.brief-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.brief-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.brief-list li::before {
  content: '▸';
  color: var(--ahead-azure);
  font-size: 12px;
  margin-top: 2px;
  flex-shrink: 0;
}

/* ============== ACTION ITEMS ============== */
.action-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.action-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  background: var(--bg-secondary);
  border-radius: 6px;
  border-left: 3px solid transparent;
  transition: var(--transition);
}

.action-item.urgent { border-left-color: var(--danger); }
.action-item.high { border-left-color: var(--warning); }
.action-item.medium { border-left-color: var(--ahead-azure); }
.action-item.low { border-left-color: var(--text-muted); }

.action-text {
  flex: 1;
  font-size: 13px;
  color: var(--text-primary);
}

.action-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
}

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

.action-due {
  font-size: 11px;
  color: var(--warning);
  font-weight: 600;
}

/* ============== BADGES ============== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.badge-red { background: rgba(200,16,46,0.2); color: var(--csl-red); border: 1px solid rgba(200,16,46,0.3); }
.badge-blue { background: rgba(28,76,191,0.2); color: #5B8AFF; border: 1px solid rgba(28,76,191,0.3); }
.badge-azure { background: rgba(0,159,220,0.2); color: var(--ahead-azure); border: 1px solid rgba(0,159,220,0.3); }
.badge-gray { background: rgba(107,127,163,0.2); color: var(--text-muted); border: 1px solid rgba(107,127,163,0.2); }
.badge-green { background: rgba(34,197,94,0.2); color: var(--success); border: 1px solid rgba(34,197,94,0.3); }
.badge-warning { background: rgba(245,158,11,0.2); color: var(--warning); border: 1px solid rgba(245,158,11,0.3); }
.badge-danger { background: rgba(239,68,68,0.2); color: var(--danger); border: 1px solid rgba(239,68,68,0.3); }

/* ============== TABLE ============== */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

thead {
  background: var(--bg-secondary);
}

thead th {
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}

thead th:hover {
  color: var(--text-secondary);
}

tbody tr {
  border-bottom: 1px solid var(--border-color);
  transition: background 0.15s;
  cursor: pointer;
}

tbody tr:last-child {
  border-bottom: none;
}

tbody tr:hover {
  background: var(--bg-card-hover);
}

tbody td {
  padding: 10px 14px;
  color: var(--text-secondary);
  vertical-align: middle;
}

tbody td.primary {
  color: var(--text-primary);
  font-weight: 600;
}

/* ============== STATUS INDICATORS ============== */
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
}

.status-dot.green { background: var(--success); box-shadow: 0 0 6px rgba(34,197,94,0.5); }
.status-dot.yellow { background: var(--warning); box-shadow: 0 0 6px rgba(245,158,11,0.5); }
.status-dot.red { background: var(--danger); box-shadow: 0 0 6px rgba(239,68,68,0.5); }
.status-dot.blue { background: var(--ahead-azure); }

/* ============== DETAIL PANEL ============== */
.detail-panel {
  display: none;
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-top: 8px;
}

.detail-panel.open {
  display: block;
  animation: slideDown 0.2s ease;
}

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

/* ============== HEALTH INDICATORS ============== */
.health-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.health-item {
  background: var(--bg-secondary);
  border-radius: 8px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.health-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 600;
}

.health-value {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

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

.health-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.8s ease;
}

/* ============== FILTERS ============== */
.filter-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  align-items: center;
}

.filter-input {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 7px 12px;
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
  transition: var(--transition);
}

.filter-input:focus {
  border-color: var(--ahead-azure);
}

.filter-input::placeholder {
  color: var(--text-muted);
}

select.filter-input option {
  background: var(--bg-card);
  color: var(--text-primary);
}

/* ============== SEARCH RESULTS ============== */
.search-results {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  width: 400px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 2000;
  max-height: 400px;
  overflow-y: auto;
  display: none;
}

.search-results.open { display: block; }

.search-result-item {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: background 0.15s;
}

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

.search-result-type {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 2px;
}

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

.search-result-desc {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ============== EDIT MODE ============== */
.edit-mode-banner {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(245,158,11,0.15);
  border-top: 2px solid var(--warning);
  padding: 10px 24px;
  z-index: 999;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.edit-mode-banner.visible { display: flex; }

.edit-mode-banner-text {
  font-size: 13px;
  color: var(--warning);
  font-weight: 600;
}

body.edit-mode [data-editable] {
  border: 1px dashed rgba(245,158,11,0.4);
  border-radius: 4px;
  cursor: text;
  padding: 2px 4px;
}

body.edit-mode [data-editable]:focus {
  border-color: var(--warning);
  outline: none;
  background: rgba(245,158,11,0.05);
}

/* ============== FORM ELEMENTS ============== */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.form-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.form-input, .form-textarea, .form-select {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 8px 12px;
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: var(--transition);
  width: 100%;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--ahead-azure);
  box-shadow: 0 0 0 2px rgba(0,159,220,0.1);
}

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

.form-select option {
  background: var(--bg-card);
}

/* ============== MODAL ============== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 5000;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

.modal-overlay.open { display: flex; }

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 28px;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.25s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(-10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

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

.modal-title {
  font-size: 17px;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  padding: 4px;
  transition: color 0.15s;
}

.modal-close:hover { color: var(--text-primary); }

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

/* ============== DEADLINES ============== */
.deadline-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.deadline-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  background: var(--bg-secondary);
  border-radius: 6px;
}

.deadline-date {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  min-width: 70px;
  flex-shrink: 0;
}

.deadline-date.urgent { color: var(--danger); }
.deadline-date.soon { color: var(--warning); }

.deadline-label {
  flex: 1;
  font-size: 13px;
  color: var(--text-primary);
}

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

/* ============== SECTION DIVIDER ============== */
.section-divider {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 24px 0;
}

/* ============== PROGRESS SCORE ============== */
.score-ring-wrapper {
  display: flex;
  align-items: center;
  gap: 16px;
}

.score-ring {
  position: relative;
  width: 70px;
  height: 70px;
  flex-shrink: 0;
}

.score-ring svg {
  transform: rotate(-90deg);
}

.score-number {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
}

/* ============== PIPELINE ============== */
.pipeline-stage {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
}

.pipeline-stage.active { background: rgba(34,197,94,0.15); color: var(--success); }
.pipeline-stage.proposal { background: rgba(0,159,220,0.15); color: var(--ahead-azure); }
.pipeline-stage.future { background: rgba(107,127,163,0.15); color: var(--text-muted); }
.pipeline-stage.risk { background: rgba(239,68,68,0.15); color: var(--danger); }

/* ============== SITE CARDS ============== */
.site-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition);
}

.site-card:hover {
  border-color: var(--border-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.site-card-header {
  padding: 16px 20px;
  background: linear-gradient(135deg, var(--bg-secondary), var(--bg-elevated));
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.site-card-body {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.site-name {
  font-size: 17px;
  font-weight: 800;
  color: var(--text-primary);
}

.site-location {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.site-section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.site-section-content {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ============== INTEL CARDS ============== */
.intel-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition);
}

.intel-card-header {
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border-color);
}

.intel-card-body {
  padding: 14px 20px;
}

.intel-expanded {
  display: none;
  padding: 14px 20px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-secondary);
}

.intel-expanded.open { display: block; }

.intel-category {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.intel-headline {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.intel-summary {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 10px;
}

.intel-implications {
  background: rgba(28,76,191,0.1);
  border-left: 3px solid var(--ahead-blue);
  border-radius: 0 6px 6px 0;
  padding: 10px 14px;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.intel-implications strong {
  color: var(--ahead-azure);
}

/* ============== PROPOSAL CARDS ============== */
.proposal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: var(--transition);
}

.proposal-card:hover {
  border-color: var(--border-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.proposal-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.proposal-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.proposal-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.proposal-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

/* ============== LOADING ============== */
.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-color);
  border-top-color: var(--ahead-azure);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============== HAMBURGER ============== */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  padding: 6px;
  background: none;
  border: none;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-secondary);
  border-radius: 1px;
  transition: var(--transition);
}

/* ============== LAST UPDATED ============== */
.last-updated {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
}

/* ============== TOOLTIP ============== */
[data-tooltip] {
  position: relative;
  cursor: help;
}

[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 4px;
  border: 1px solid var(--border-light);
  white-space: nowrap;
  z-index: 3000;
  pointer-events: none;
}

/* ============== PRINT STYLES ============== */
@media print {
  .nav, .edit-toggle, .btn-print, .edit-mode-banner { display: none !important; }
  body { background: white; color: black; }
  .card { background: #f8f9fa; border-color: #dee2e6; break-inside: avoid; }
  .page-wrapper { margin-top: 0 !important; padding: 0; }
  .badge { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}

/* ============== RESPONSIVE ============== */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .health-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-links.mobile-open {
    display: flex;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    flex-direction: column;
    padding: 8px;
    gap: 2px;
    z-index: 999;
  }
  .hamburger { display: flex; }
  .search-box input { width: 140px; }
  .search-box input:focus { width: 180px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .health-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-bar { gap: 8px; }
  .stat-chip { min-width: 100px; padding: 10px 14px; }
  .stat-value { font-size: 22px; }
  .page-wrapper { padding: 16px 16px 80px; }
  .page-title { font-size: 20px; }
  .modal { margin: 16px; }
}

@media (max-width: 480px) {
  .nav-right .search-box { display: none; }
  .health-grid { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; align-items: flex-start; }
}

/* ============== SCROLLBAR ============== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ============== UTILITIES ============== */
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-primary { color: var(--text-primary); }
.text-azure { color: var(--ahead-azure); }
.text-blue { color: var(--ahead-blue); }
.text-red { color: var(--csl-red); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.fw-bold { font-weight: 700; }
.fw-800 { font-weight: 800; }
.text-sm { font-size: 13px; }
.text-xs { font-size: 11px; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
.gap-8 { gap: 8px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-1 { flex: 1; }
.hidden { display: none !important; }
.w-full { width: 100%; }
