:root {
  --service-navy: #101d33;
  --service-navy-deep: #0b1527;
  --service-navy-muted: #273752;
  --service-blue: #2f6fed;
  --service-blue-dark: #2156c4;
  --service-ink: #172033;
  --service-muted: #68758a;
  --service-surface: #ffffff;
  --service-canvas: #f3f6fa;
  --service-border: #dce3ed;
  --service-success: #15803d;
  --service-warning: #b45309;
  --service-danger: #b42318;
  --service-info: #1d4ed8;
  --service-radius: 0.85rem;
  --service-shadow: 0 0.75rem 2rem rgba(16, 29, 51, 0.08);
}

html {
  min-width: 320px;
}

body {
  color: var(--service-ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--service-canvas);
}

a {
  color: var(--service-blue-dark);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid #8db4ff;
  outline-offset: 3px;
}

.app-shell {
  display: flex;
  min-height: 100vh;
}

.app-sidebar {
  --bs-offcanvas-width: 17rem;
  z-index: 1030;
  display: flex;
  flex-direction: column;
  width: 17rem;
  min-height: 100vh;
  color: #d8e2f1;
  background: var(--service-navy);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 4.5rem;
  padding: 1rem 1.25rem;
  color: #ffffff;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand:hover,
.sidebar-brand:focus-visible {
  color: #ffffff;
}

.brand-mark {
  flex: 0 0 auto;
  width: 2.5rem;
  height: 2.5rem;
  object-fit: contain;
}

.sidebar-brand-name {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.sidebar-content {
  flex: 1;
  padding: 1.5rem 0.85rem;
}

.sidebar-label {
  padding: 0 0.75rem;
  margin: 0 0 0.6rem;
  color: #8091ad;
  font-size: 0.69rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 2.75rem;
  padding: 0.65rem 0.75rem;
  margin-bottom: 0.25rem;
  color: #b9c7da;
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 0.6rem;
}

.sidebar-link:hover,
.sidebar-link:focus-visible {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.sidebar-link.is-active {
  color: #ffffff;
  background: var(--service-blue);
  box-shadow: 0 0.35rem 0.8rem rgba(47, 111, 237, 0.28);
}

.nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  color: currentColor;
  font-size: 1rem;
  line-height: 1;
}

.sidebar-footer {
  padding: 1rem 1.6rem 1.25rem;
  color: #8091ad;
  font-size: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.app-main {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.app-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 4.5rem;
  padding: 0.75rem clamp(1rem, 3vw, 2.5rem);
  background: var(--service-surface);
  border-bottom: 1px solid var(--service-border);
}

.menu-toggle {
  color: var(--service-ink);
  border-color: var(--service-border);
}

.topbar-title {
  margin: 0;
  color: var(--service-ink);
  font-size: 1.05rem;
  font-weight: 700;
}

.topbar-subtitle {
  margin: 0.15rem 0 0;
  color: var(--service-muted);
  font-size: 0.78rem;
}

.user-menu {
  color: var(--service-ink);
  text-decoration: none;
}

.user-menu:hover,
.user-menu:focus-visible {
  color: var(--service-blue-dark);
}

.user-avatar {
  width: 2rem;
  height: 2rem;
  object-fit: contain;
  border: 1px solid var(--service-border);
  border-radius: 50%;
}

.app-content {
  flex: 1;
  width: 100%;
  max-width: 90rem;
  padding: clamp(1.25rem, 3vw, 2.5rem);
  margin: 0 auto;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.page-kicker {
  margin: 0 0 0.4rem;
  color: var(--service-blue-dark);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.page-title {
  margin: 0;
  color: var(--service-ink);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 750;
  letter-spacing: -0.03em;
}

.page-description {
  max-width: 45rem;
  margin: 0.45rem 0 0;
  color: var(--service-muted);
}

.surface-card {
  background: var(--service-surface);
  border: 1px solid var(--service-border);
  border-radius: var(--service-radius);
  box-shadow: var(--service-shadow);
}

.table-card {
  overflow: hidden;
}

.table-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--service-border);
}

.table-card-header h2,
.table-card-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 750;
}

.table-responsive {
  margin-bottom: 0;
}

.service-table {
  min-width: 48rem;
  margin-bottom: 0;
  vertical-align: middle;
}

.service-table caption {
  caption-side: top;
}

.service-table thead th {
  color: var(--service-muted);
  background: #f8fafc;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  border-bottom-width: 1px;
}

.service-table td,
.service-table th {
  padding: 0.9rem 1rem;
  border-color: #edf1f6;
}

.service-table tbody tr:hover {
  background: #f8fbff;
}

.table-primary-link {
  font-weight: 700;
  text-decoration: none;
}

.table-primary-link:hover {
  text-decoration: underline;
}

.muted-value {
  color: var(--service-muted);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  max-width: 15rem;
  padding: 0.35rem 0.6rem;
  color: var(--service-ink);
  font-size: 0.76rem;
  font-weight: 750;
  line-height: 1.2;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 999px;
}

.status-d {
  color: #92400e;
  background: #fff7ed;
  border-color: #fed7aa;
}

.status-v,
.status-s {
  color: #1e40af;
  background: #eff6ff;
  border-color: #bfdbfe;
}

.status-a {
  color: #166534;
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.status-p {
  color: #6b21a8;
  background: #faf5ff;
  border-color: #e9d5ff;
}

.status-n,
.status-unknown {
  color: #475569;
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1rem;
  color: var(--service-muted);
  font-size: 0.85rem;
}

.pagination-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

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

.detail-section {
  padding: 1.25rem;
}

.detail-section h2 {
  margin: 0 0 1rem;
  color: var(--service-ink);
  font-size: 1rem;
  font-weight: 750;
}

.detail-list {
  display: grid;
  grid-template-columns: minmax(8rem, 0.8fr) minmax(0, 1.2fr);
  gap: 0.75rem 1rem;
  margin: 0;
}

.detail-list dt {
  color: var(--service-muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.detail-list dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.detail-copy {
  min-height: 5rem;
  padding: 0.85rem;
  margin: 0;
  color: #334155;
  white-space: pre-wrap;
  background: #f8fafc;
  border: 1px solid var(--service-border);
  border-radius: 0.6rem;
}

.action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.form-panel {
  max-width: 52rem;
  padding: clamp(1.25rem, 3vw, 2rem);
}

.form-panel form p {
  margin-bottom: 1rem;
}

.form-panel form label {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--service-ink);
  font-size: 0.84rem;
  font-weight: 700;
}

.form-panel input:not([type="submit"]),
.form-panel select,
.form-panel textarea {
  width: 100%;
  padding: 0.7rem 0.8rem;
  color: var(--service-ink);
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 0.5rem;
}

.form-panel textarea {
  min-height: 7rem;
}

.form-panel ul.errorlist,
.auth-card ul.errorlist {
  padding: 0;
  margin: 0 0 0.5rem;
  color: var(--service-danger);
  font-size: 0.82rem;
  list-style: none;
}

.form-panel .helptext {
  display: block;
  margin-top: 0.35rem;
  color: var(--service-muted);
  font-size: 0.78rem;
}

.empty-state {
  padding: 3rem 1.5rem;
  color: var(--service-muted);
  text-align: center;
}

.empty-state h2 {
  color: var(--service-ink);
  font-size: 1.15rem;
}

.public-shell,
.auth-shell,
.welcome-shell {
  min-height: 100vh;
  background: var(--service-navy-deep);
}

.public-header,
.auth-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 80rem;
  padding: 1.25rem clamp(1rem, 4vw, 3rem);
  margin: 0 auto;
}

.public-brand,
.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: #ffffff;
  font-weight: 750;
  text-decoration: none;
}

.public-brand:hover,
.public-brand:focus-visible,
.auth-brand:hover,
.auth-brand:focus-visible {
  color: #ffffff;
}

.public-main,
.auth-main {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 5.25rem);
  padding: 2rem 1rem 4rem;
}

.public-card,
.auth-card {
  width: min(100%, 34rem);
  padding: clamp(1.5rem, 5vw, 2.5rem);
  background: var(--service-surface);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1rem;
  box-shadow: 0 1.5rem 4rem rgba(0, 0, 0, 0.24);
}

.public-card {
  width: min(100%, 56rem);
}

.welcome-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(18rem, 0.85fr);
  gap: clamp(1.5rem, 5vw, 4rem);
  align-items: center;
}

.welcome-eyebrow {
  margin: 0 0 0.75rem;
  color: var(--service-blue);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.welcome-title,
.public-card h1.display-4 {
  margin: 0;
  color: var(--service-ink);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.05em;
}

.welcome-copy {
  margin: 1rem 0 0;
  color: var(--service-muted);
  font-size: 1.05rem;
  line-height: 1.65;
}

.demo-note {
  padding-left: 0.85rem;
  margin: 1rem 0 0;
  color: #475569;
  font-size: 0.84rem;
  border-left: 3px solid var(--service-blue);
}

.demo-workspace-label {
  padding: 0.7rem 1.6rem;
  margin: 0;
  color: #bfdbfe;
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(47, 111, 237, 0.16);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.form-card {
  width: min(100%, 42rem);
  overflow: hidden;
}

.form-card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--service-border);
}

.form-card-header h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 750;
}

.service-form {
  padding: 1.25rem;
}

.service-form .field-group {
  margin-bottom: 1rem;
}

.service-form label {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--service-ink);
  font-size: 0.84rem;
  font-weight: 700;
}

.service-form input,
.service-form select,
.service-form textarea {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.5rem;
}

.field-help,
.field-error {
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
}

.field-help {
  color: var(--service-muted);
}

.field-error {
  color: var(--service-danger);
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.role-list {
  display: grid;
  gap: 0.85rem;
}

.role-list form {
  margin: 0;
}

.role-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 4.25rem;
  padding: 0.85rem 1rem;
  text-align: left;
  text-decoration: none;
  border-radius: 0.7rem;
}

.role-link small {
  display: block;
  margin-top: 0.15rem;
  font-weight: 400;
  opacity: 0.8;
}

.auth-card {
  text-align: left;
}

.auth-card .brand-mark {
  display: block;
  margin: 0 auto 1rem;
}

.auth-card h1 {
  margin-bottom: 1.5rem;
  color: var(--service-ink);
  font-size: 1.5rem;
  font-weight: 800;
  text-align: center;
}

.auth-card form label {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--service-ink);
  font-size: 0.84rem;
  font-weight: 700;
}

.auth-card form input:not([type="hidden"]):not([type="submit"]),
.auth-card form input[type="email"],
.auth-card form input[type="password"],
.auth-card form input[type="text"] {
  width: 100%;
  min-height: 3rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.5rem;
}

.auth-card .field-group {
  margin-bottom: 1rem;
}

.auth-card .auth-help {
  color: var(--service-muted);
  font-size: 0.82rem;
}

.auth-card .auth-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.25rem;
}

.auth-card .auth-footer {
  margin: 1.5rem 0 0;
  color: var(--service-muted);
  font-size: 0.8rem;
  text-align: center;
}

.public-search-card {
  width: min(100%, 42rem);
  text-align: center;
}

.public-search-card .search-form {
  display: flex;
  gap: 0.65rem;
  margin-top: 1.5rem;
}

.public-search-card .search-form input {
  min-height: 3.25rem;
}

.result-card {
  width: min(100%, 78rem);
  padding: clamp(1.25rem, 3vw, 2rem);
  background: var(--service-surface);
  border-radius: 1rem;
  box-shadow: 0 1.5rem 4rem rgba(0, 0, 0, 0.24);
}

@media (max-width: 991.98px) {
  .app-sidebar {
    min-height: 100%;
  }

  .app-content {
    padding: 1.25rem 1rem 2rem;
  }
}

@media (max-width: 767.98px) {
  .page-header,
  .table-card-header {
    align-items: stretch;
    flex-direction: column;
  }

  .page-header .btn,
  .table-card-header .btn {
    align-self: flex-start;
  }

  .detail-grid,
  .welcome-layout {
    grid-template-columns: 1fr;
  }

  .detail-list {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }

  .detail-list dd {
    margin-bottom: 0.5rem;
  }

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

@media (max-width: 575.98px) {
  .app-topbar {
    min-height: 4rem;
  }

  .topbar-subtitle,
  .user-role {
    display: none;
  }

  .public-header,
  .auth-header {
    padding: 1rem;
  }

  .public-main,
  .auth-main {
    align-items: flex-start;
    min-height: calc(100vh - 4.5rem);
    padding-top: 1rem;
  }

  .public-card,
  .auth-card,
  .result-card {
    padding: 1.25rem;
    border-radius: 0.75rem;
  }

  .public-search-card .search-form {
    align-items: stretch;
    flex-direction: column;
  }

  .auth-card .auth-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .auth-card .auth-actions .btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
