body {
  background: #f4f5f7;
  color: #242121;
  font-family: Arial, Helvetica, sans-serif;
}

.portal-nav {
  align-items: center;
  background: #ffffff;
  border-bottom: 4px solid #fdc50d;
  box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .06);
  display: flex;
  justify-content: space-between;
  padding: .85rem 1.5rem;
}

.portal-nav a {
  color: #3a3a3a;
  font-weight: 700;
  margin-left: 1rem;
  text-decoration: none;
}

.portal-nav a.active {
  background: #fdc50d;
  border: 1px solid #fdc50d;
  border-radius: .3rem;
  color: #242121;
  padding: .35rem .6rem;
}

.portal-nav-links {
  align-items: center;
  display: flex;
}

.portal-session {
  color: #666;
  display: inline-flex;
  gap: .35rem;
  align-items: center;
  font-size: .9rem;
  font-weight: 700;
  margin-left: 1rem;
}

.portal-brand {
  color: #242121 !important;
  margin-left: 0 !important;
}

.portal-brand img {
  display: block;
  height: 42px;
  width: auto;
}

.portal-shell {
  margin: 0 auto;
  max-width: 1240px;
  padding: 2rem 1rem;
}

.portal-login-screen {
  display: flex;
  justify-content: center;
  min-height: calc(100vh - 150px);
  padding-top: 3rem;
}

.portal-login-screen .portal-panel {
  width: 100%;
}

.portal-public-area .admin-login {
  background: linear-gradient(135deg, #242121 0%, #3a3528 100%);
  border-radius: .3rem;
  padding: 3rem 1rem;
}

.portal-public-area .admin-login .portal-panel {
  border-top: 5px solid #fdc50d;
}

.portal-public-area .client-login {
  background: #ffffff;
  border: 1px solid #e5e5e5;
  border-radius: .3rem;
  padding: 3rem 1rem;
}

.portal-public-area .client-login .portal-panel {
  border-left: 5px solid #fdc50d;
}

.portal-page-head {
  align-items: flex-end;
  background: #242121;
  border-left: 6px solid #fdc50d;
  border-radius: .3rem;
  color: #ffffff;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding: 1.35rem 1.5rem;
}

.portal-page-head h1 {
  font-size: 1.9rem;
  font-weight: 800;
  margin-bottom: .25rem;
}

.portal-page-head p {
  color: #e5e5e5;
  margin-bottom: 0;
}

.portal-eyebrow {
  color: #fdc50d;
  display: inline-block;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .03rem;
  margin-bottom: .25rem;
  text-transform: uppercase;
}

.portal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  justify-content: flex-end;
}

.portal-metrics {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 1rem;
}

.portal-metric {
  background: #ffffff;
  border: 1px solid #e5e5e5;
  border-top: 4px solid #fdc50d;
  border-radius: .3rem;
  color: #242121;
  padding: 1rem;
  text-decoration: none;
}

.portal-metric:hover {
  border-color: #fdc50d;
  color: #242121;
}

.portal-metric span {
  color: #666;
  display: block;
  font-size: .9rem;
  font-weight: 700;
}

.portal-metric strong {
  display: block;
  font-size: 2rem;
  line-height: 1.1;
  margin-top: .35rem;
}

.portal-subnav {
  background: #ffffff;
  border: 1px solid #e5e5e5;
  border-radius: .3rem;
  display: flex;
  flex-wrap: wrap;
  gap: .25rem;
  margin-bottom: 1.5rem;
  padding: .35rem;
  position: sticky;
  top: 0;
  z-index: 2;
}

.portal-subnav a {
  border-radius: .3rem;
  color: #555;
  font-weight: 800;
  padding: .6rem .9rem;
  text-decoration: none;
}

.portal-subnav a:hover {
  background: #fff4cc;
  color: #242121;
}

.portal-panel {
  background: #ffffff;
  border: 1px solid #e5e5e5;
  border-radius: .3rem;
  box-shadow: 0 .2rem .7rem rgba(0, 0, 0, .04);
  padding: 1.5rem;
}

.portal-panel h1,
.portal-panel h2 {
  font-weight: 700;
}

.portal-card {
  background: #ffffff;
  border: 1px solid #e5e5e5;
  border-left: 5px solid #fdc50d;
  border-radius: .3rem;
  margin-bottom: 1rem;
  padding: 1rem;
}

.portal-muted {
  color: #666;
}

.portal-stat {
  background: #ffffff;
  border: 1px solid #e5e5e5;
  border-radius: .3rem;
  padding: 1rem;
}

.portal-stat strong {
  display: block;
  font-size: 2rem;
}

.portal-status {
  background: #f8f9fa;
  border: 1px solid #e5e5e5;
  border-radius: .3rem;
  display: inline-block;
  font-size: .85rem;
  font-weight: 700;
  padding: .3rem .6rem;
}

.portal-status.open {
  background: #fff4cc;
  border-color: #fdc50d;
}

.btn-warning {
  background-color: #fdc50d;
  border-color: #e6b000;
  color: #242121;
}

.btn-warning:hover {
  background-color: #e6b000;
  border-color: #d19e00;
  color: #242121;
}

.form-control:focus,
.form-select:focus {
  border-color: #fdc50d;
  box-shadow: 0 0 0 .2rem rgba(253, 197, 13, .2);
}

.portal-section {
  margin-bottom: 2rem;
  scroll-margin-top: 5rem;
}

.portal-section.compact {
  margin-bottom: 0;
}

.portal-section-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: .75rem;
}

.portal-section-head h1,
.portal-section-head h2 {
  font-weight: 700;
  margin-bottom: 0;
}

.portal-table-wrap {
  background: #ffffff;
  border: 1px solid #e5e5e5;
  border-radius: .3rem;
  box-shadow: 0 .2rem .7rem rgba(0, 0, 0, .04);
  overflow-x: auto;
}

.portal-table {
  border-collapse: collapse;
  margin-bottom: 0;
  min-width: 760px;
  width: 100%;
}

.portal-table-compact {
  min-width: 0;
}

.portal-table th {
  background: #242121;
  border-bottom: 1px solid #e5e5e5;
  color: #ffffff;
  font-size: .78rem;
  letter-spacing: .02rem;
  padding: .85rem 1rem;
  text-transform: uppercase;
  white-space: nowrap;
}

.portal-table td {
  border-bottom: 1px solid #eeeeee;
  padding: .9rem 1rem;
  vertical-align: top;
}

.portal-table tbody tr:hover {
  background: #fffdf2;
}

.portal-table tr:last-child td {
  border-bottom: 0;
}

.portal-table strong {
  display: block;
  font-weight: 700;
}

.portal-table small {
  color: #666;
  display: block;
  margin-top: .2rem;
}

.portal-main-cell {
  min-width: 220px;
}

.portal-message-cell {
  color: #555;
  max-width: 320px;
}

.portal-form-grid,
.portal-split-tables {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.portal-single-column {
  display: grid;
  gap: 1rem;
}

.portal-empty {
  color: #666;
  padding: 1.5rem !important;
  text-align: center;
}

.portal-detail-list {
  display: grid;
  gap: .75rem 1rem;
  grid-template-columns: 120px 1fr;
  margin-bottom: 0;
}

.portal-detail-list dt {
  color: #666;
  font-weight: 800;
}

.portal-detail-list dd {
  margin-bottom: 0;
}

.portal-case-description {
  color: #444;
  margin-bottom: 0;
}

.portal-comment {
  border: 1px solid #e5e5e5;
  border-left: 4px solid #fdc50d;
  border-radius: .3rem;
  margin-bottom: .75rem;
  padding: .85rem 1rem;
}

.portal-comment-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: .5rem;
}

.portal-comment-head span {
  color: #666;
  font-size: .85rem;
}

.portal-comment p {
  margin-bottom: 0;
}

.portal-attachment {
  align-items: center;
  border: 1px solid #e5e5e5;
  border-radius: .3rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .75rem;
  padding: .75rem;
}

.portal-attachment a {
  font-weight: 800;
  text-decoration: none;
}

.portal-attachment small {
  color: #666;
  display: block;
  margin-top: .15rem;
}

.portal-log-block {
  background: #1f2328;
  border-radius: .3rem;
  color: #f6f8fa;
  font-size: .85rem;
  max-height: 280px;
  overflow: auto;
  padding: 1rem;
  white-space: pre-wrap;
}

@media (max-width: 767.98px) {
  .portal-nav {
    align-items: flex-start;
    flex-direction: column;
  }

  .portal-nav-links {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .portal-nav a {
    display: inline-block;
    margin: .75rem 1rem 0 0;
  }

  .portal-section-head {
    align-items: flex-start;
    flex-direction: column;
    gap: .25rem;
  }

  .portal-page-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .portal-actions {
    justify-content: flex-start;
  }

  .portal-metrics,
  .portal-form-grid,
  .portal-split-tables {
    grid-template-columns: 1fr;
  }
}

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