html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

:root {
  --ems-primary: #d62828;
  --ems-primary-dark: #b91c1c;
  --ems-blue: #2563eb;
  --ems-slate: #0f172a;
  --ems-text: #334155;
  --ems-muted: #64748b;
  --ems-bg: #f8fafc;
  --ems-card: #ffffff;
  --ems-border: #e2e8f0;
  --ems-shadow: 0 14px 40px rgba(15, 23, 42, 0.08);
  --ems-radius-lg: 22px;
  --ems-radius-md: 16px;
  --ems-radius-sm: 12px;
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
  box-shadow: 0 0 0 0.15rem rgba(214, 40, 40, 0.18);
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin: 0;
  margin-bottom: 60px;
  color: #1e293b;
  background:
    radial-gradient(circle at top left, rgba(214, 40, 40, 0.06), transparent 28%),
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.05), transparent 22%),
    linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
}

.navbar {
  backdrop-filter: blur(10px);
}

.navbar-brand {
  letter-spacing: 0.3px;
}

.nav-link {
  font-weight: 600;
}

.nav-link:hover {
  color: var(--ems-primary) !important;
}

.ems-page {
  padding: 16px 0 40px;
}

.ems-banner {
  margin-bottom: 28px;
  overflow: hidden;
  border-radius: 24px;
  box-shadow: var(--ems-shadow);
}

.ems-banner img {
  display: block;
  width: 100%;
  max-height: 380px;
  object-fit: cover;
}

.content-card,
.form-card,
.filter-panel,
.table-panel,
.stat-card {
  border: 1px solid rgba(226, 232, 240, 0.9);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--ems-shadow);
}

.content-card,
.form-card {
  height: 100%;
  padding: 32px;
  border-radius: var(--ems-radius-lg);
}

.content-title,
.form-title,
.export-title {
  margin-bottom: 22px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--ems-slate);
}

.content-title {
  font-size: 1.8rem;
}

.form-title {
  font-size: 1.45rem;
  text-align: center;
}

.commitment-item + .commitment-item {
  margin-top: 22px;
}

.commitment-item h2 {
  margin-bottom: 10px;
  font-size: 1.08rem;
  font-weight: 800;
  color: var(--ems-primary);
}

.commitment-item ul {
  margin: 0;
  padding-left: 1.2rem;
}

.commitment-item li {
  margin-bottom: 8px;
  line-height: 1.7;
  color: var(--ems-text);
}

.form-label {
  margin-bottom: 8px;
  font-weight: 700;
  color: var(--ems-slate);
}

.form-control,
.modern-input {
  min-height: 50px;
  border: 1px solid var(--ems-border);
  border-radius: 14px;
  background: #fff;
  transition: all 0.2s ease;
}

.form-control:hover,
.modern-input:hover {
  border-color: #cbd5e1;
}

.form-control:focus,
.modern-input:focus {
  border-color: rgba(214, 40, 40, 0.45);
  background: #fff;
}

.form-check {
  margin-bottom: 10px;
}

.form-check-label {
  color: var(--ems-text);
}

.submit-btn,
.modern-btn-primary,
.export-download-btn {
  min-height: 50px;
  border: none;
  border-radius: 14px;
  font-weight: 800;
  transition: all 0.2s ease;
}

.submit-btn {
  color: #fff;
  background: linear-gradient(135deg, var(--ems-primary), #ef4444);
}

.submit-btn:hover {
  color: #fff;
  transform: translateY(-1px);
  background: linear-gradient(135deg, var(--ems-primary-dark), #dc2626);
}

.modern-btn-primary {
  color: #fff;
  background: linear-gradient(135deg, #0f172a, #334155);
}

.modern-btn-primary:hover {
  color: #fff;
  transform: translateY(-1px);
  background: linear-gradient(135deg, #020617, #1e293b);
}

.modern-btn-light {
  min-height: 50px;
  border: 1px solid var(--ems-border);
  border-radius: 14px;
  font-weight: 700;
  color: var(--ems-slate);
  background: #fff;
}

.modern-btn-light:hover {
  color: var(--ems-slate);
  background: #f8fafc;
}

.validation-summary-errors ul {
  margin-bottom: 0;
  padding-left: 1.25rem;
}

.export-page {
  padding: 12px 0 28px;
}

.export-hero {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  margin-bottom: 24px;
  padding: 30px;
  color: #fff;
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(9, 14, 27, 0.98), rgba(30, 41, 59, 0.96)),
    linear-gradient(135deg, var(--ems-primary), #ef4444);
  box-shadow: var(--ems-shadow);
}

.page-badge {
  display: inline-flex;
  align-items: center;
  margin-bottom: 12px;
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
}

.export-title {
  margin: 0 0 8px;
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.2;
  color: #ffffff;
  letter-spacing: -0.02em;
}

.export-subtitle {
  max-width: 760px;
  margin: 0;
  color: rgba(255, 255, 255, 0.92);
  font-weight: 500;
}

.export-action {
  display: flex;
  align-items: center;
}

.export-download-btn {
  min-width: 170px;
  color: #fff;
  background: linear-gradient(135deg, #16a34a, #22c55e);
}

.export-download-btn:hover {
  color: #fff;
  transform: translateY(-1px);
  background: linear-gradient(135deg, #15803d, #16a34a);
}

.filter-panel {
  margin-bottom: 20px;
  padding: 24px;
  border-radius: 20px;
  background: #ffffff;
}

.filter-actions {
  display: flex;
  gap: 12px;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.stat-card {
  padding: 22px;
  border-radius: 20px;
}

.stat-label {
  margin-bottom: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ems-muted);
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  color: var(--ems-slate);
}

.stat-small {
  font-size: 1.2rem;
  line-height: 1.3;
}

.table-panel {
  overflow: hidden;
  border-radius: 22px;
  background: #ffffff;
}

.table-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 24px 0;
}

.table-panel-header h2 {
  margin: 0 0 6px;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--ems-slate);
}

.table-panel-header p {
  margin: 0;
  color: #475569;
}

.custom-table-wrap {
  padding: 20px 20px 22px;
}

.custom-table {
  overflow: hidden;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 18px;
}

.custom-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 16px 14px;
  font-size: 0.9rem;
  font-weight: 800;
  color: #0f172a;
  white-space: nowrap;
  background: #f1f5f9;
  border-top: none;
  border-bottom: 1px solid var(--ems-border);
}

.custom-table tbody td {
  padding: 16px 14px;
  font-size: 0.92rem;
  color: #1e293b;
  vertical-align: middle;
  background: #fff;
  border-color: #edf2f7;
}

.custom-table tbody tr {
  transition: transform 0.15s ease, background-color 0.15s ease;
}

.custom-table tbody tr:hover td {
  background: #f8fafc;
}

.id-badge {
  display: inline-block;
  padding: 6px 10px;
  font-size: 0.8rem;
  font-weight: 800;
  color: #0f172a;
  border-radius: 999px;
  background: #cbd5e1;
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 800;
  border-radius: 999px;
}

.tag-red {
  color: #991b1b;
  background: #fee2e2;
}

.tag-blue {
  color: #1d4ed8;
  background: #dbeafe;
}

.tag-gray {
  color: #1e293b;
  background: #cbd5e1;
}

.empty-state {
  padding: 36px 20px;
  text-align: center;
}

.empty-state-title {
  margin-bottom: 8px;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--ems-slate);
}

.empty-state-text {
  color: var(--ems-muted);
  font-weight: 500;
}

.footer {
  background: transparent;
}

@media (max-width: 991.98px) {
  .content-card,
  .form-card {
    padding: 24px;
  }

  .content-title {
    font-size: 1.45rem;
  }

  .export-hero {
    flex-direction: column;
    align-items: stretch;
  }

  .stats-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767.98px) {
  .ems-banner {
    border-radius: 18px;
  }

  .content-card,
  .form-card,
  .filter-panel,
  .stat-card {
    padding: 18px;
    border-radius: 18px;
  }

  .export-hero {
    padding: 22px;
    border-radius: 18px;
  }

  .export-title {
    font-size: 1.45rem;
  }

  .filter-actions {
    flex-direction: column;
  }

  .custom-table thead th,
  .custom-table tbody td {
    padding: 12px 10px;
  }
}

body,
button,
input,
select,
textarea,
.navbar-brand,
.nav-link,
.form-label,
.form-control,
.btn,
table {
  font-family: "Be Vietnam Pro", "Segoe UI", sans-serif;
}