:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-soft: #f8fbff;
  --border: #dbe4f0;
  --text: #10233f;
  --muted: #5d6f88;
  --primary: #0b4f9c;
  --primary-dark: #083b75;
  --accent: #0f9d8a;
  --warning: #b45309;
  --shadow: 0 10px 30px rgba(16, 35, 63, 0.08);
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(11, 79, 156, 0.12), transparent 28%),
    linear-gradient(180deg, #eef4fb 0%, var(--bg) 100%);
  min-height: 100vh;
}

.app {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 40px;
}

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

.header__brand {
  display: flex;
  gap: 16px;
  align-items: center;
}

.header__logo {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-weight: 700;
  color: white;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 4px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(24px, 4vw, 34px);
}

.subtitle {
  margin-top: 6px;
  color: var(--muted);
}

.header__actions {
  display: flex;
  gap: 12px;
}

.btn {
  border: 0;
  border-radius: 12px;
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s ease;
}

.btn--primary {
  color: white;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
}

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

.btn--primary:disabled {
  opacity: 0.7;
  cursor: wait;
  transform: none;
}

.btn--ghost {
  background: var(--surface-soft);
  color: var(--primary);
  border: 1px solid var(--border);
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
}

.stat-card--link {
  display: block;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: 0.2s ease;
}

.stat-card--link:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: 0 14px 34px rgba(11, 79, 156, 0.14);
}

.stat-card--active {
  border-color: var(--primary);
  background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
}

.stat-card__hint {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}

.stat-card__label {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.stat-card__value {
  font-size: 28px;
  line-height: 1.1;
}

.stat-card__value--small {
  font-size: 16px;
}

.toolbar,
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.toolbar {
  display: flex;
  gap: 16px;
  padding: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.search-box {
  flex: 1 1 320px;
}

.search-box input,
.toolbar select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
  background: var(--surface-soft);
  color: var(--text);
}

.toolbar__filters {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.toolbar__filters select {
  min-width: 180px;
}

.panel {
  overflow: hidden;
}

.panel__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 0;
}

.source-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.source-badge--saved {
  background: #eef4ff;
  color: var(--primary);
}

.source-badge--live {
  background: #ecfdf5;
  color: #047857;
}

.panel__head p {
  color: var(--muted);
  font-size: 14px;
}

.table-wrap {
  overflow-x: auto;
  padding: 16px 20px 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 960px;
}

th,
td {
  padding: 14px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: var(--surface-soft);
}

td.empty {
  text-align: center;
  color: var(--muted);
  padding: 40px 12px;
}

.tender-name {
  font-weight: 600;
  line-height: 1.45;
}

.tender-meta {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  background: #e8f2ff;
  color: var(--primary);
}

.badge--status {
  background: #ecfdf5;
  color: #047857;
}

.badge--warning {
  background: #fff7ed;
  color: var(--warning);
}

.status-select {
  min-width: 148px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 13px;
  background: var(--surface-soft);
  color: var(--text);
}

.status-select--theo_doi {
  border-color: #93c5fd;
  background: #eff6ff;
}

.status-select--luu {
  border-color: #fdba74;
  background: #fff7ed;
}

.status-select--khong_tham_gia {
  border-color: #d1d5db;
  background: #f9fafb;
}

.status-select--da_nop_thau {
  border-color: #6ee7b7;
  background: #ecfdf5;
}

.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px 20px 20px;
  flex-wrap: wrap;
}

.pagination__controls {
  display: flex;
  gap: 8px;
}

.dialog {
  border: 0;
  padding: 0;
  width: min(760px, calc(100% - 24px));
  border-radius: 18px;
  box-shadow: 0 24px 80px rgba(16, 35, 63, 0.24);
}

.dialog::backdrop {
  background: rgba(16, 35, 63, 0.45);
}

.dialog__content {
  position: relative;
  padding: 24px;
  background: var(--surface);
}

.dialog__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: var(--surface-soft);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 20px;
  margin-top: 18px;
}

.detail-item {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
}

.detail-item--full {
  grid-column: 1 / -1;
}

.detail-item span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}

.detail-item strong,
.detail-item p {
  font-size: 14px;
  line-height: 1.5;
}

.detail-actions {
  margin-top: 18px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  background: var(--text);
  color: white;
  padding: 14px 18px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  max-width: 360px;
}

@media (max-width: 960px) {
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .header {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  .stats,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .app {
    width: min(100%, calc(100% - 20px));
  }
}
