html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  min-height: 100vh;
}

.app-shell {
  background: #f6f7fb;
  color: #172033;
  display: flex;
  flex-direction: column;
  margin-bottom: 0;
}

.app-shell > main {
  flex: 1 0 auto;
}

.system-header {
  background: linear-gradient(135deg, #071733 0%, #10264f 58%, #16396c 100%);
  border-bottom: 1px solid rgba(213, 166, 66, .45);
  box-shadow: 0 12px 28px rgba(7, 23, 51, .18);
}

.system-brand {
  align-items: center;
  color: #fff;
  display: inline-flex;
  font-weight: 800;
  gap: .65rem;
  letter-spacing: 0;
}

.system-brand:hover,
.system-brand:focus {
  color: #fff;
}

.system-brand-mark {
  align-items: center;
  background: #d5a642;
  border-radius: 8px;
  color: #071733;
  display: inline-flex;
  font-size: .85rem;
  height: 34px;
  justify-content: center;
  width: 46px;
}

.system-nav-link {
  border-bottom: 2px solid transparent;
  color: rgba(255, 255, 255, .84) !important;
  font-weight: 600;
  margin: 0 .15rem;
  padding-left: .7rem !important;
  padding-right: .7rem !important;
}

.system-nav-link:hover,
.system-nav-link:focus,
.system-nav-link.active {
  border-bottom-color: #f2c76b;
  color: #f4d078 !important;
}

.navbar-toggler {
  border-color: rgba(213, 166, 66, .65);
}

.navbar-toggler:focus {
  box-shadow: 0 0 0 .2rem rgba(213, 166, 66, .35);
}

.navbar-toggler-icon {
  filter: invert(1) grayscale(1) brightness(2);
}

.system-footer {
  background: #071733;
  color: rgba(255, 255, 255, .75);
  margin-top: auto;
}

.system-footer a {
  color: #f4d078;
  text-decoration: none;
}

.system-footer a:hover {
  color: #fff;
}

.btn {
  border-radius: 14px;
  font-weight: 700;
}

.btn-primary,
.btn-gold {
  background: linear-gradient(135deg, #f2c76b, #d9a84e);
  border: 0;
  box-shadow: 0 10px 20px rgba(217, 168, 78, .24);
  color: #07152f;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-gold:hover,
.btn-gold:focus {
  background: linear-gradient(135deg, #ffd980, #d9a84e);
  color: #07152f;
  transform: translateY(-1px);
}

.btn-darkblue {
  background: #07152f;
  border: 1px solid #d9a84e;
  color: #fff;
}

.btn-darkblue:hover,
.btn-darkblue:focus {
  background: #142b57;
  color: #f2c76b;
}

.btn-outline-primary,
.btn-outline-secondary,
.btn-outline-gold {
  background: rgba(255, 255, 255, .88);
  border: 1px solid rgba(217, 168, 78, .88);
  color: #142b57;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-secondary:hover,
.btn-outline-secondary:focus,
.btn-outline-gold:hover,
.btn-outline-gold:focus {
  background: #fff8e8;
  border-color: #d9a84e;
  color: #07152f;
}

.btn-secondary,
.btn-soft {
  background: #eef2f7;
  border: 1px solid #d8deea;
  color: #142b57;
}

.btn-secondary:hover,
.btn-secondary:focus,
.btn-soft:hover,
.btn-soft:focus {
  background: #e5eaf3;
  color: #07152f;
}

.user-pill {
  align-items: center;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(242, 199, 107, .36);
  border-radius: 999px;
  display: flex;
  gap: .5rem;
  padding: .25rem .35rem .25rem .25rem;
}

.user-profile-link {
  align-items: center;
  color: #fff;
  display: inline-flex;
  gap: .5rem;
  min-width: 0;
  text-decoration: none;
}

.user-profile-link:hover {
  color: #f2c76b;
}

.user-avatar {
  align-items: center;
  background: linear-gradient(135deg, #f2c76b, #d9a84e);
  border-radius: 50%;
  color: #07152f;
  display: inline-flex;
  flex: 0 0 34px;
  font-size: .78rem;
  font-weight: 900;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.user-name {
  display: inline-block;
  font-weight: 700;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logout-button {
  background: transparent;
  border: 0;
  border-left: 1px solid rgba(255, 255, 255, .18);
  color: rgba(255, 255, 255, .8);
  font-weight: 700;
  padding: .35rem .6rem;
}

.logout-button:hover,
.logout-button:focus {
  color: #f2c76b;
}

.page-title {
  margin-bottom: 1.5rem;
}

.page-title h1 {
  color: #10264f;
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.12;
  margin-bottom: .25rem;
  overflow-wrap: anywhere;
}

.metric-card,
.work-card {
  background: #fff;
  border: 1px solid #e4e8f2;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(16, 38, 79, .06);
  padding: 1rem;
}

.work-card {
  position: relative;
}

.work-card::before,
.metric-card::before {
  background: linear-gradient(90deg, #f2c76b, #d9a84e);
  border-radius: 8px 8px 0 0;
  content: "";
  display: block;
  height: 4px;
  left: -1px;
  position: absolute;
  right: -1px;
  top: -1px;
}

.metric-card {
  min-height: 120px;
  position: relative;
}

.metric-value {
  color: #10264f;
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
}

.filter-title {
  color: #10264f;
  font-size: 1rem;
  font-weight: 800;
  margin-bottom: 1rem;
}

.data-card {
  background: #fff;
  border: 1px solid #e4e8f2;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(16, 38, 79, .06);
  overflow: hidden;
}

.data-card .table {
  --bs-table-hover-bg: #fff8e8;
}

.data-card thead th {
  background: #f2f5fa;
  color: #142b57;
  font-size: .82rem;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.empty-state {
  align-items: flex-start;
  background: #fff;
  border: 1px solid #e4e8f2;
  border-left: 5px solid #d9a84e;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(16, 38, 79, .06);
  display: flex;
  gap: 1rem;
  padding: 1.25rem;
}

.empty-state-icon {
  align-items: center;
  background: #fff4d9;
  border-radius: 12px;
  color: #9a6b07;
  display: inline-flex;
  flex: 0 0 48px;
  font-size: 1.5rem;
  height: 48px;
  justify-content: center;
  width: 48px;
}

.quick-actions {
  display: grid;
  gap: .75rem;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.quick-action {
  background: #fff;
  border: 1px solid #e4e8f2;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(16, 38, 79, .05);
  color: #142b57;
  display: flex;
  flex-direction: column;
  gap: .35rem;
  min-height: 92px;
  padding: 1rem;
  position: relative;
  text-decoration: none;
}

.quick-action::before {
  background: #d9a84e;
  border-radius: 8px 8px 0 0;
  content: "";
  height: 4px;
  left: -1px;
  position: absolute;
  right: -1px;
  top: -1px;
}

.quick-action span {
  color: #6b7280;
  font-size: .9rem;
}

.quick-action strong {
  color: #07152f;
  font-size: 1.35rem;
}

.quick-action:hover {
  border-color: #d9a84e;
  color: #07152f;
  transform: translateY(-1px);
}

.quick-action-active {
  border-color: #d5a642;
  box-shadow: 0 10px 24px rgba(213, 166, 66, .16);
}

.quick-action-muted {
  background: #f7f8fb;
  opacity: .82;
}

.status-badge {
  border-radius: 999px;
  display: inline-flex;
  font-size: .82rem;
  font-weight: 700;
  line-height: 1;
  padding: .4rem .65rem;
  white-space: nowrap;
}

.status-new {
  background: #e8efff;
  color: #204a9c;
}

.status-review {
  background: #e5f4f6;
  color: #0b6873;
}

.status-warning {
  background: #fff1d6;
  color: #895000;
}

.status-success {
  background: #e4f7e9;
  color: #166534;
}

.status-danger {
  background: #fde8e8;
  color: #b42318;
}

.status-cancelled {
  background: #eceff3;
  color: #4b5563;
}

.cancelled-row {
  background: #fafafa;
  color: #5d687b;
}

.cancelled-row strong {
  color: #364152;
}

.table-actions {
  min-width: 180px;
}

.file-list,
.timeline-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.file-list li,
.timeline-list li {
  border-bottom: 1px solid #eef1f6;
  padding: .75rem 0;
}

.file-list li:last-child,
.timeline-list li:last-child {
  border-bottom: 0;
}

.application-file-groups {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1fr);
}

.application-file-group {
  background: #fbfcfe;
  border: 1px solid #e1e6ee;
  border-left: 4px solid #d5a642;
  border-radius: 8px;
  min-width: 0;
  padding: 1rem;
}

.application-file-group h3 {
  color: #0c234a;
  font-size: 1rem;
  font-weight: 800;
  margin: 0 0 .5rem;
}

.application-file-group .file-list,
.application-file-group .file-list li,
.application-file-group .file-list li > div,
.application-file-group .file-list li > div > div {
  min-width: 0;
}

.application-file-group .text-muted {
  overflow-wrap: anywhere;
}

.multiline-value {
  white-space: pre-line;
}

.work-card .text-muted {
  overflow-wrap: anywhere;
}

.submission-confirmation {
  background: #fff;
  border: 1px solid rgba(213, 166, 66, .42);
  border-radius: 8px;
  box-shadow: 0 18px 46px rgba(12, 35, 74, .12);
  margin: 1.5rem auto;
  max-width: 1040px;
  padding: clamp(1.5rem, 4vw, 3rem);
  text-align: center;
}

.submission-confirmation-mark {
  align-items: center;
  background: #d5a642;
  border-radius: 50%;
  color: #07152f;
  display: inline-flex;
  font-size: 1.75rem;
  font-weight: 900;
  height: 56px;
  justify-content: center;
  width: 56px;
}

.submission-confirmation-kicker {
  color: #9c6c1d;
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: 0;
  margin: 1rem 0 .35rem;
  text-transform: uppercase;
}

.submission-confirmation h1 {
  color: #07152f;
  font-weight: 900;
  margin-bottom: .75rem;
}

.submission-confirmation-lead {
  color: #5f6f89;
  margin: 0 auto 2rem;
  max-width: 720px;
}

.submission-confirmation-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  text-align: left;
}

.submission-confirmation-data,
.submission-confirmation-files {
  background: #f8fafc;
  border: 1px solid #e2e7ef;
  border-radius: 8px;
  padding: 1.25rem;
}

.submission-confirmation h2 {
  color: #0c234a;
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 1rem;
}

.submission-confirmation dl {
  display: grid;
  gap: .5rem 1rem;
  grid-template-columns: minmax(120px, .42fr) minmax(0, 1fr);
  margin: 0;
}

.submission-confirmation dt {
  color: #53647d;
}

.submission-confirmation dd {
  color: #17213f;
  margin: 0;
  overflow-wrap: anywhere;
}

.submission-confirmation-note {
  background: #fff8e7;
  border: 1px solid #ecd08f;
  border-radius: 8px;
  color: #634717;
  margin-top: 1.5rem;
  padding: 1rem;
}

.submission-confirmation-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  justify-content: center;
  margin-top: 1.5rem;
}

@media (max-width: 767.98px) {
  .submission-confirmation-grid {
    grid-template-columns: 1fr;
  }

  .submission-confirmation dl {
    grid-template-columns: 1fr;
  }

  .submission-confirmation dd {
    margin-bottom: .5rem;
  }
}

.comment-visible {
  border-left: 4px solid #d5a642;
}

.comment-internal {
  border-left: 4px solid #7b8798;
}

.comment-visible p,
.comment-internal p {
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.participant-alert {
  background: #fff8e7;
  border: 1px solid #f0c86a;
  border-radius: 8px;
  color: #4d3507;
  display: grid;
  gap: .25rem;
  padding: 1rem 1.15rem;
}

.review-empty {
  background: #f7f8fb;
  border: 1px dashed #cfd6e3;
  border-radius: 8px;
  color: #6b7280;
  padding: .9rem 1rem;
}

.review-result {
  background: #fbfcff;
  border: 1px solid #e4e8f2;
  border-radius: 8px;
  padding: 1rem;
}

.review-result-head {
  align-items: flex-start;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin-bottom: .75rem;
}

.review-kicker {
  color: #9a6b07;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.review-meta {
  color: #5d687b;
  display: flex;
  flex-wrap: wrap;
  font-size: .9rem;
  gap: .5rem 1rem;
  margin-bottom: .75rem;
}

.review-mini,
.review-successes,
.review-history-item,
.email-log-list li {
  background: #fbfcff;
  border: 1px solid #e4e8f2;
  border-radius: 8px;
  padding: .9rem;
}

.review-successes {
  border-left: 4px solid #2f855a;
}

.review-successes ul {
  margin: .5rem 0 0;
  padding-left: 1.1rem;
}

.review-history-item {
  margin-bottom: .75rem;
}

.review-history-item summary {
  align-items: center;
  cursor: pointer;
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  justify-content: space-between;
}

.email-log-list {
  display: grid;
  gap: .75rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.danger-zone {
  border-color: #f2c4c4;
}

.danger-zone::before {
  background: linear-gradient(90deg, #d92d20, #f0c86a);
}

.review-issues {
  display: grid;
  gap: .6rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.review-issues li {
  background: #fff;
  border: 1px solid #e4e8f2;
  border-left-width: 4px;
  border-radius: 8px;
  padding: .75rem .85rem;
}

.review-issues span {
  display: block;
  font-size: .78rem;
  font-weight: 800;
  margin-bottom: .25rem;
  text-transform: uppercase;
}

.review-issues p {
  margin: 0;
}

.review-issue-info {
  border-left-color: #2f6fed !important;
}

.review-issue-info span {
  color: #204a9c;
}

.review-issue-warning {
  border-left-color: #d5a642 !important;
}

.review-issue-warning span {
  color: #895000;
}

.review-issue-critical {
  border-left-color: #b42318 !important;
}

.review-issue-critical span {
  color: #b42318;
}

.review-textarea {
  background: #fff;
  border-color: #d8deea;
  resize: vertical;
}

.auth-page {
  background:
    radial-gradient(circle at 18% 10%, rgba(213, 166, 66, .22), transparent 28%),
    linear-gradient(135deg, #071733 0%, #10264f 48%, #0b1d3d 100%);
  min-height: 100vh;
}

.auth-page main.container {
  align-items: center;
  display: flex;
  justify-content: center;
  min-height: calc(100vh - 140px);
  padding-bottom: 2rem !important;
  padding-top: 2rem !important;
}

.auth-wrap {
  width: 100%;
}

.auth-card {
  background: rgba(255, 255, 255, .98);
  border: 1px solid rgba(213, 166, 66, .72);
  border-radius: 8px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, .26);
  margin: 0 auto;
  max-width: 620px;
  padding: 2rem;
}

.auth-card-compact {
  max-width: 520px;
}

.auth-card-header {
  border-bottom: 1px solid #edf0f5;
  margin-bottom: 1.5rem;
  padding-bottom: 1.2rem;
  text-align: center;
}

.auth-kicker {
  color: #b18422;
  font-size: .82rem;
  font-weight: 800;
  letter-spacing: .08em;
  margin-bottom: .45rem;
  text-transform: uppercase;
}

.auth-title {
  color: #10264f;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.15;
  margin: 0 0 .65rem;
}

.auth-subtitle {
  color: #5d687b;
  margin: 0 auto;
  max-width: 480px;
}

.auth-form .form-label,
.auth-form .form-check-label {
  color: #172033;
  font-weight: 700;
}

.auth-form .form-control {
  border-color: #cfd6e3;
  border-radius: 8px;
  min-height: 46px;
}

.auth-form .form-control:focus,
.auth-form .form-check-input:focus {
  border-color: #d5a642;
  box-shadow: 0 0 0 .2rem rgba(213, 166, 66, .2);
}

.auth-form .form-check-input:checked {
  background-color: #10264f;
  border-color: #10264f;
}

.auth-button {
  background: linear-gradient(135deg, #d5a642, #f0c86a);
  border: 0;
  border-radius: 8px;
  color: #071733;
  font-weight: 800;
  min-height: 48px;
}

.auth-button:hover,
.auth-button:focus {
  background: linear-gradient(135deg, #f0c86a, #d5a642);
  color: #071733;
}

.auth-links {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  justify-content: center;
  margin-top: 1.15rem;
}

.auth-links a,
.auth-inline-link {
  color: #9a6b07;
  font-weight: 700;
  text-decoration: none;
}

.auth-links a:hover,
.auth-inline-link:hover {
  color: #10264f;
  text-decoration: underline;
}

@media (max-width: 575.98px) {
  .page-title h1 {
    font-size: 1.45rem;
  }

  .auth-card {
    padding: 1.35rem;
  }

  .auth-title {
    font-size: 1.55rem;
  }

  .auth-page main.container {
    align-items: flex-start;
    min-height: auto;
  }
}

@media (max-width: 1199.98px) {
  .quick-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 991.98px) {
  .system-nav-link {
    border-bottom: 0;
    border-left: 3px solid transparent;
    margin: .1rem 0;
  }

  .system-nav-link.active,
  .system-nav-link:hover,
  .system-nav-link:focus {
    border-left-color: #f2c76b;
  }

  .user-pill {
    align-items: flex-start;
    border-radius: 14px;
    flex-direction: column;
    margin-top: .75rem;
    padding: .65rem;
    width: 100%;
  }

  .logout-button {
    border-left: 0;
    border-top: 1px solid rgba(255, 255, 255, .18);
    padding-left: 0;
    text-align: left;
    width: 100%;
  }
}

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

@media (max-width: 575.98px) {
  .quick-actions {
    grid-template-columns: 1fr;
  }

  .empty-state {
    flex-direction: column;
  }
}
