html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
  background: #0f1728;
  color: #f8fafc;
  font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
}

.bg-nova {
  background: #0b1220;
  border-color: #1d2a3e !important;
}

.navbar-brand {
  letter-spacing: .08rem;
}

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

.page-heading h1 {
  margin: 0;
  font-size: 1.9rem;
  font-weight: 700;
}

.metric {
  min-height: 112px;
  padding: 1rem;
  border: 1px solid #4b5563;
  border-radius: 8px;
  background: #1f2427;
}

.metric span {
  display: block;
  min-height: 40px;
  color: #94a3b8;
  font-size: .9rem;
}

.metric strong {
  display: block;
  font-size: 2.1rem;
  line-height: 1;
}

.metric.danger {
  border-left: 5px solid #f97316;
}

.metric.warning {
  border-left: 5px solid #ffbf00;
}

section h2 {
  font-size: 1.2rem;
  margin-bottom: .85rem;
}

.form-panel {
  max-width: 1100px;
  padding: 1rem;
  border: 1px solid #4b5563;
  border-radius: 8px;
  background: #1f2427;
}

.info-panel {
  min-height: 100%;
  padding: 1rem;
  border: 1px solid #4b5563;
  border-radius: 8px;
  background: #1f2427;
}

.info-panel h2,
.info-panel h3 {
  margin-bottom: .85rem;
  font-size: 1.05rem;
  font-weight: 700;
}

.panel-subtitle {
  margin-bottom: .75rem;
  color: #94a3b8;
  font-size: .9rem;
}

.info-panel dd,
.info-panel p:last-child {
  margin-bottom: 0;
}

.table {
  --bs-table-bg: #1f2427;
  --bs-table-color: #f8fafc;
  --bs-table-border-color: #374151;
  --bs-table-striped-bg: #182033;
  --bs-table-hover-bg: #22314a;
  color: #f8fafc;
}

.list-group {
  --bs-list-group-bg: #1f2427;
  --bs-list-group-color: #f8fafc;
  --bs-list-group-border-color: #374151;
  --bs-list-group-action-hover-bg: #22314a;
  --bs-list-group-action-hover-color: #fff;
}

.text-muted {
  color: #94a3b8 !important;
}

.btn-primary {
  --bs-btn-bg: #1478ff;
  --bs-btn-border-color: #1478ff;
  --bs-btn-hover-bg: #0b66dd;
  --bs-btn-hover-border-color: #0b66dd;
}

.btn-outline-secondary {
  --bs-btn-color: #f8fafc;
  --bs-btn-border-color: #cbd5e1;
  --bs-btn-hover-bg: #334155;
  --bs-btn-hover-border-color: #cbd5e1;
}

.form-control,
.form-select {
  background-color: #111a2c;
  border-color: #465a7a;
  color: #f8fafc;
}

.site-selector {
  min-width: 190px;
}

.form-control:focus,
.form-select:focus {
  background-color: #111a2c;
  border-color: #1478ff;
  color: #fff;
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
  box-shadow: 0 0 0 .1rem #0f1728, 0 0 0 .25rem #1478ff;
}

.auth-page {
  display: grid;
  grid-template-columns: minmax(320px, 520px) minmax(320px, 1fr);
  gap: 1.5rem;
  align-items: stretch;
  min-height: calc(100vh - 180px);
  max-width: 1180px;
  margin: 1.5rem auto 0;
}

.auth-panel,
.auth-aside {
  border: 1px solid #263752;
  border-radius: 8px;
  background: #151f2f;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .22);
}

.auth-panel {
  padding: 2rem;
}

.auth-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2.25rem;
}

.auth-logo {
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 0 .85rem;
  border: 1px solid #365173;
  border-radius: 6px;
  background: #0b1220;
  color: #ffffff;
  font-weight: 800;
  letter-spacing: .08rem;
}

.auth-kicker,
.auth-aside-label {
  color: #8fb4e8;
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.auth-heading {
  margin-bottom: 1.5rem;
}

.auth-heading h1 {
  margin: 0 0 .5rem;
  font-size: 2rem;
  font-weight: 750;
}

.auth-heading p,
.auth-aside p,
.auth-highlights dd {
  color: #b7c5d8;
}

.auth-form {
  display: grid;
  gap: 1rem;
}

.auth-form .form-floating > label {
  color: #8ea0b8;
}

.auth-form .form-floating > .form-control {
  min-height: 58px;
}

.auth-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: #dbeafe;
}

.auth-options a {
  color: #66a8ff;
  text-decoration: none;
}

.auth-options a:hover {
  text-decoration: underline;
}

.auth-submit {
  min-height: 48px;
  font-weight: 700;
}

.auth-validation:empty {
  display: none;
}

.auth-aside {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 2rem;
  background:
    linear-gradient(135deg, rgba(20, 120, 255, .16), rgba(22, 163, 74, .08)),
    #121c2c;
}

.auth-aside h2 {
  max-width: 620px;
  margin: .5rem 0 .75rem;
  font-size: 1.85rem;
  font-weight: 750;
}

.auth-highlights {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .75rem;
  margin: 2rem 0 0;
}

.auth-highlights div {
  min-height: 120px;
  padding: 1rem;
  border: 1px solid #314766;
  border-radius: 8px;
  background: rgba(11, 18, 32, .58);
}

.auth-highlights dt {
  margin-bottom: .35rem;
  color: #ffffff;
  font-weight: 800;
}

.auth-highlights dd {
  margin: 0;
  font-size: .92rem;
}

@media (max-width: 900px) {
  .auth-page {
    grid-template-columns: 1fr;
    margin-top: .5rem;
  }

  .auth-highlights {
    grid-template-columns: 1fr;
  }
}

.admin-heading {
  margin-bottom: 1.1rem;
}

.nova-alert {
  border-color: #2f6e8b;
  background: #c9f2ff;
  color: #08405a;
}

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

.admin-metric {
  min-height: 92px;
  padding: 1rem;
  border: 1px solid #30445f;
  border-radius: 8px;
  background: #162130;
}

.admin-metric span {
  display: block;
  color: #9fb4cf;
  font-size: .82rem;
  font-weight: 700;
  text-transform: uppercase;
}

.admin-metric strong {
  display: block;
  margin-top: .55rem;
  font-size: 2rem;
  line-height: 1;
}

.admin-section {
  margin-top: 1.25rem;
}

.admin-section-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .75rem;
}

.admin-section-title h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 750;
}

.admin-user-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .85rem;
}

.admin-user-card,
.admin-action-card,
.admin-table-panel {
  border: 1px solid #30445f;
  border-radius: 8px;
  background: #18212a;
}

.admin-user-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  min-height: 96px;
  padding: 1rem;
}

.admin-user-card h3,
.admin-action-card h3,
.admin-table-panel h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 750;
}

.admin-user-card p,
.admin-action-card p {
  margin: .3rem 0 0;
  color: #98abc4;
  font-size: .9rem;
}

.admin-badge-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .4rem;
  min-width: 120px;
}

.nova-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: .18rem .5rem;
  border-radius: 6px;
  background: #00c2e8;
  color: #06121f;
  font-size: .76rem;
  font-weight: 800;
}

.nova-badge.muted {
  background: #475569;
  color: #e2e8f0;
}

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

.admin-action-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 100%;
  padding: 1rem;
}

.admin-card-head {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
}

.admin-card-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid #355171;
  border-radius: 8px;
  background: #0d1726;
  color: #8fb4e8;
  font-weight: 800;
}

.admin-form-grid {
  display: grid;
  gap: .85rem;
}

.admin-action-card .btn {
  align-self: flex-start;
  margin-top: auto;
}

.admin-rights-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.admin-table-panel {
  padding: 1rem;
}

.admin-table-panel h3 {
  margin-bottom: .75rem;
}

.admin-table-panel .table {
  margin-bottom: 0;
}

.admin-table-panel td,
.admin-table-panel th {
  white-space: nowrap;
}

@media (max-width: 1400px) {
  .admin-user-grid,
  .admin-action-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

@media (max-width: 760px) {
  .admin-metrics,
  .admin-user-grid,
  .admin-action-grid {
    grid-template-columns: 1fr;
  }

  .admin-user-card {
    flex-direction: column;
  }

  .admin-badge-list {
    justify-content: flex-start;
  }
}
