
:root {
  --bg: #0a0c10;
  --surface: #111318;
  --surface2: #181c23;
  --border: #232830;
  --border2: #2e3440;
  --accent: #00d4aa;
  --accent2: #0099ff;
  --accent3: #ff6b35;
  --text: #e8eaf0;
  --text2: #8892a4;
  --text3: #4a5568;
  --open: #00d4aa;
  --open-bg: rgba(0, 212, 170, 0.08);
  --eval: #f5a623;
  --eval-bg: rgba(245, 166, 35, 0.08);
  --upcoming: #0099ff;
  --upcoming-bg: rgba(0, 153, 255, 0.08);
  --closed: #4a5568;
  --closed-bg: rgba(74, 85, 104, 0.08);
  --draft: #a78bfa;
  --draft-bg: rgba(167, 139, 250, 0.08);
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ========== LOGIN SCREEN ========== */
#login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: 
    radial-gradient(ellipse 80% 50% at 20% 40%, rgba(0,212,170,0.06) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 70%, rgba(0,153,255,0.05) 0%, transparent 60%),
    var(--bg);
}

.grid-bg {
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: 0.4;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 40%, transparent 100%);
}

.login-card {
  position: relative;
  z-index: 10;
  width: 420px;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 16px;
  padding: 48px 40px;
  box-shadow: 0 32px 80px rgba(0,0,0,0.6), 0 0 0 1px rgba(0,212,170,0.08);
  animation: fadeUp 0.5s ease both;
}

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

.login-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 32px;
}

.login-logo-mark {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'DM Mono', monospace;
  font-size: 16px;
  font-weight: 500;
  color: #000;
}

.login-logo-text {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text);
}

.login-logo-sub {
  font-size: 11px;
  color: var(--text3);
  font-family: 'DM Mono', monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-heading {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}

.login-sub {
  font-size: 13px;
  color: var(--text2);
  margin-bottom: 32px;
  line-height: 1.5;
}

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.form-input {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--border2);
  border-radius: 8px;
  color: var(--text);
  font-family: 'DM Mono', monospace;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0,212,170,0.1);
}

.form-input::placeholder { color: var(--text3); }

.login-btn {
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, var(--accent), #00b894);
  border: none;
  border-radius: 8px;
  color: #000;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 24px;
  transition: opacity 0.2s, transform 0.1s;
}

.login-btn:hover { opacity: 0.9; transform: translateY(-1px); }
.login-btn:active { transform: translateY(0); }

.login-error {
  background: rgba(255, 107, 53, 0.1);
  border: 1px solid rgba(255, 107, 53, 0.3);
  color: var(--accent3);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin-top: 12px;
  display: none;
}

.login-footer {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text3);
  text-align: center;
  font-family: 'DM Mono', monospace;
  line-height: 1.6;
}

/* ========== DASHBOARD ========== */
#dashboard {
  display: none;
  min-height: 100vh;
  flex-direction: column;
}

.topbar {
  height: 60px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-mark {
  width: 30px; height: 30px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  font-weight: 500;
  color: #000;
  flex-shrink: 0;
}

.logo-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.logo-badge {
  font-size: 10px;
  font-family: 'DM Mono', monospace;
  color: var(--accent);
  background: rgba(0,212,170,0.1);
  border: 1px solid rgba(0,212,170,0.2);
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.06em;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.update-tag {
  font-size: 11px;
  font-family: 'DM Mono', monospace;
  color: var(--text3);
}

.user-info {
  font-size: 13px;
  color: var(--text2);
}

.logout-btn {
  font-size: 12px;
  font-family: 'DM Mono', monospace;
  color: var(--text3);
  background: none;
  border: 1px solid var(--border2);
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}
.logout-btn:hover { color: var(--text); border-color: var(--border2); background: var(--surface2); }

.main-content {
  flex: 1;
  padding: 28px;
  max-width: 1600px;
  margin: 0 auto;
  width: 100%;
}

/* Stats row */
.stats-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-label {
  font-size: 10px;
  font-family: 'DM Mono', monospace;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.stat-value {
  font-size: 26px;
  font-weight: 700;
  font-family: 'DM Mono', monospace;
  line-height: 1;
}

.stat-sub {
  font-size: 11px;
  color: var(--text3);
  margin-top: 2px;
}

.stat-open .stat-value { color: var(--open); }
.stat-eval .stat-value { color: var(--eval); }
.stat-upcoming .stat-value { color: var(--upcoming); }
.stat-closed .stat-value { color: var(--closed); }
.stat-total .stat-value { color: var(--text); }

/* Filter bar */
.filter-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 140px;
}

.filter-label {
  font-size: 10px;
  font-family: 'DM Mono', monospace;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.filter-select, .search-input {
  background: var(--bg);
  border: 1px solid var(--border2);
  color: var(--text);
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  padding: 7px 10px;
  border-radius: 6px;
  outline: none;
  transition: border-color 0.2s;
  cursor: pointer;
}

.filter-select:focus, .search-input:focus {
  border-color: var(--accent);
}

.search-input {
  width: 220px;
  cursor: text;
}

.search-input::placeholder { color: var(--text3); }

.filter-reset {
  background: none;
  border: 1px solid var(--border2);
  color: var(--text3);
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  padding: 7px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  align-self: flex-end;
}
.filter-reset:hover { color: var(--accent); border-color: rgba(0,212,170,0.3); }

.result-count {
  font-size: 11px;
  font-family: 'DM Mono', monospace;
  color: var(--text3);
  align-self: flex-end;
  margin-left: auto;
  padding-bottom: 8px;
}

/* Table */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.rfp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.rfp-table thead th {
  background: var(--surface2);
  padding: 10px 14px;
  text-align: left;
  font-size: 10px;
  font-family: 'DM Mono', monospace;
  font-weight: 500;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  position: relative;
}

.rfp-table thead th:hover { color: var(--text2); }

.rfp-table thead th.sorted::after {
  content: attr(data-dir);
  margin-left: 4px;
  color: var(--accent);
}

.rfp-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
  cursor: pointer;
}

.rfp-table tbody tr:last-child { border-bottom: none; }
.rfp-table tbody tr:hover { background: rgba(255,255,255,0.02); }

.rfp-table td {
  padding: 11px 14px;
  vertical-align: top;
  color: var(--text);
  line-height: 1.5;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 5px;
  font-size: 10px;
  font-family: 'DM Mono', monospace;
  font-weight: 500;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.status-badge::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.status-OPEN { color: var(--open); background: var(--open-bg); }
.status-EVALUATING { color: var(--eval); background: var(--eval-bg); }
.status-UPCOMING { color: var(--upcoming); background: var(--upcoming-bg); }
.status-CLOSED { color: var(--closed); background: var(--closed-bg); }
.status-DRAFT { color: var(--draft); background: var(--draft-bg); }

.conf-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  font-weight: 500;
}
.conf-H { color: var(--open); background: var(--open-bg); }
.conf-M { color: var(--eval); background: var(--eval-bg); }
.conf-L { color: var(--text3); background: rgba(74,85,104,0.15); }

.entity-name {
  font-weight: 600;
  color: var(--text);
  display: block;
  margin-bottom: 1px;
}

.sol-name {
  color: var(--text2);
  font-size: 11.5px;
}

.rfp-link {
  color: var(--accent2);
  text-decoration: none;
  font-size: 11px;
  font-family: 'DM Mono', monospace;
}
.rfp-link:hover { text-decoration: underline; }

td.mw { font-family: 'DM Mono', monospace; font-size: 11.5px; color: var(--text2); }
td.deadline { font-family: 'DM Mono', monospace; font-size: 11.5px; }
td.deadline.urgent { color: var(--accent3); font-weight: 500; }
td.deadline.soon { color: var(--eval); }
td.deadline.normal { color: var(--text2); }
td.deadline.passed { color: var(--text3); }

td.region { font-size: 11.5px; color: var(--text2); }
td.tech { font-size: 11.5px; color: var(--text2); max-width: 180px; }
td.notes { font-size: 11.5px; color: var(--text2); max-width: 240px; }

/* Modal */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 500;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-overlay.open { display: flex; }

.modal {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 16px;
  width: 100%;
  max-width: 700px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 32px;
  animation: fadeUp 0.25s ease both;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 20px; right: 20px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text2);
  width: 30px; height: 30px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.modal-close:hover { color: var(--text); border-color: var(--border2); }

.modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
  padding-right: 40px;
}
.modal-entity {
  font-size: 13px;
  color: var(--text2);
  margin-bottom: 20px;
}

.modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.modal-field {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
}

.modal-field-label {
  font-size: 10px;
  font-family: 'DM Mono', monospace;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}

.modal-field-value {
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
}

.modal-notes {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 16px;
}

.modal-notes .modal-field-label { margin-bottom: 8px; }
.modal-notes .modal-field-value { color: var(--text2); line-height: 1.7; }

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.modal-source {
  font-size: 11px;
  font-family: 'DM Mono', monospace;
  color: var(--text3);
  line-height: 1.5;
}

.modal-rfp-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, var(--accent), #00b894);
  color: #000;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: 8px;
  text-decoration: none;
  transition: opacity 0.2s;
}
.modal-rfp-btn:hover { opacity: 0.9; }

.no-results {
  text-align: center;
  padding: 60px 20px;
  color: var(--text3);
  font-family: 'DM Mono', monospace;
  font-size: 13px;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text3); }

