html {
  font-size: 14px;
  scroll-behavior: smooth;
  position: relative;
  min-height: 100%;
}

body {
  margin: 0;
  color: #e2e8f0;
  font-family: "Segoe UI", "Inter", system-ui, -apple-system, sans-serif;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.06), transparent 35%),
    radial-gradient(circle at 80% 0%, rgba(255, 255, 255, 0.08), transparent 30%),
    #0b1021;
}

a {
  text-decoration: none;
}

.container {
  max-width: 1120px;
}

main {
  padding-bottom: 2rem;
}

.app-shell,
.footer {
  background: rgba(255, 255, 255, 0.04) !important;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.2);
}

.app-nav {
  border-radius: 16px;
  margin-top: 0.75rem;
}

.navbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: #f8fafc !important;
  font-weight: 700;
}

.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(140deg, #2563eb, #7c3aed);
  box-shadow: 0 12px 30px rgba(124, 58, 237, 0.35);
}

.brand-name,
.brand-subtitle {
  display: block;
  line-height: 1.1;
}

.brand-name {
  font-size: 0.95rem;
  letter-spacing: 0.04em;
}

.brand-subtitle {
  color: #94a3b8;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.site-logo-link {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.site-logo {
    width: min(40px, 38vw);
    height: auto;
    display: block;
    filter: drop-shadow(0 16px 30px rgba(0, 0, 0, 0.18));
}

.app-nav-links {
  gap: 0.35rem;
}

.nav-link {
  color: #cbd5e1 !important;
  border-radius: 999px;
  padding: 0.48rem 0.82rem !important;
  font-weight: 600;
}

.nav-link:hover,
.nav-link:focus,
.nav-link.active {
  color: #fff !important;
  background: rgba(96, 165, 250, 0.14);
}

.nav-status {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.nav-status-text {
  color: #cbd5e1;
  font-size: 0.84rem;
}

.navbar-toggler {
  border-color: rgba(255, 255, 255, 0.16);
  padding: 0.35rem 0.55rem;
}

.navbar-toggler:focus {
  box-shadow: 0 0 0 0.2rem rgba(96, 165, 250, 0.25);
}

.app-toggler-icon {
  filter: invert(1);
}

.footer {
  color: #cbd5e1;
  margin: 0 auto 0.75rem;
  border-radius: 16px;
  width: min(1120px, calc(100% - 1.5rem));
  line-height: 1.4;
  padding: 0.8rem 0;
}

.hero {
  padding: 1rem 0 0.4rem;
  color: #e2e8f0;
}

.hero h1,
.page-header h1,
.section-heading h2 {
  color: #f8fafc;
}

.hero h1 {
  font-size: clamp(1.9rem, 2.8vw, 2.45rem);
  line-height: 1.08;
  margin: 0.2rem 0 0.65rem;
  max-width: 13ch;
}

.lede {
  color: #cbd5e1;
  max-width: 700px;
  font-size: 0.94rem;
  margin-bottom: 0;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
  font-size: 0.7rem;
  color: #60a5fa;
}

.hero-actions,
.form-actions,
.table-actions {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.table-actions-inline {
  flex-wrap: nowrap;
  white-space: nowrap;
}

.inline-form {
  margin: 0;
}

.hero-actions {
  margin-top: 0.9rem;
}

.btn {
  border-radius: 999px;
  padding: 0.55rem 1rem;
  font-weight: 700;
  border: 1px solid transparent;
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
  font-size: 0.9rem;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(120deg, #2563eb, #7c3aed);
  color: #fff;
  box-shadow: 0 10px 40px rgba(124, 58, 237, 0.35);
}

.btn-primary:hover,
.btn-primary:focus {
  color: #fff;
  box-shadow: 0 12px 45px rgba(37, 99, 235, 0.35);
}

.btn-outline {
  background: transparent;
  color: #cbd5e1;
  border-color: rgba(148, 163, 184, 0.5);
}

.btn-outline:hover,
.btn-outline:focus {
  color: #fff;
  border-color: #60a5fa;
  background: rgba(96, 165, 250, 0.08);
}

.btn-danger {
  background: linear-gradient(120deg, #dc2626, #b91c1c);
  border: none;
  color: #fff;
  box-shadow: 0 10px 40px rgba(220, 38, 38, 0.22);
}

.btn-sm {
  padding: 0.38rem 0.76rem;
  font-size: 0.82rem;
}

.grid {
  margin: 0;
  padding: 1.25rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.35);
}

.grid.alt {
  background: rgba(255, 255, 255, 0.02);
}

.section-heading h2 {
  margin: 0.25rem 0 0.4rem;
  font-size: 1.45rem;
}

.card-list {
  display: grid;
  gap: 0.9rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-top: 0.95rem;
}

.card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 0.95rem;
  color: #e2e8f0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.card h3 {
  color: #f8fafc;
  margin-bottom: 0.45rem;
  font-size: 1.05rem;
}

.card p {
  margin-bottom: 0;
  font-size: 0.9rem;
}

.card .btn {
  margin-top: 0.7rem;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 0.9rem;
  margin-bottom: 0.95rem;
}

.page-header h1 {
  margin: 0.2rem 0 0.3rem;
  font-size: clamp(1.55rem, 2.1vw, 2rem);
}

.app-alert {
  border-radius: 12px;
  border: 1px solid rgba(74, 222, 128, 0.22);
  background: rgba(34, 197, 94, 0.12);
  color: #dcfce7;
  padding: 0.8rem 0.95rem;
}

.warning-alert {
  border-color: rgba(251, 191, 36, 0.25);
  background: rgba(234, 179, 8, 0.14);
  color: #fef3c7;
}

.table-shell {
  margin-top: 0.95rem;
  overflow-x: auto;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.app-table {
  --bs-table-bg: transparent;
  --bs-table-color: #e2e8f0;
  --bs-table-border-color: rgba(255, 255, 255, 0.08);
  --bs-table-striped-bg: rgba(255, 255, 255, 0.02);
  margin-bottom: 0;
}

.app-table thead th {
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.68rem;
  font-weight: 700;
  border-bottom-width: 1px;
  background: rgba(255, 255, 255, 0.03);
}

.app-table td,
.app-table th {
  padding: 0.72rem 0.82rem;
}

.table-primary {
  color: #f8fafc;
  font-weight: 700;
}

.table-link {
  display: inline-block;
}

.table-link:hover,
.table-link:focus {
  color: #93c5fd;
}

.order-code {
  display: inline-block;
  color: #bfdbfe;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

.table-secondary {
  color: #94a3b8;
  display: block;
  margin-top: 0.12rem;
  font-size: 0.82rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.24rem 0.62rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}

.status-pill.is-active {
  color: #dcfce7;
  background: rgba(34, 197, 94, 0.14);
  border: 1px solid rgba(74, 222, 128, 0.24);
}

.status-pill.is-inactive {
  color: #e2e8f0;
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.form-shell {
  padding: 0.45rem 0 0;
}

.form-label {
  color: #e2e8f0;
  font-weight: 600;
  margin-bottom: 0.32rem;
}

.form-control,
.form-select {
  color: #f8fafc;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 12px;
  padding: 0.68rem 0.88rem;
}

.form-control::placeholder {
  color: #64748b;
}

.form-control:focus,
.form-select:focus {
  color: #f8fafc;
  background: rgba(15, 23, 42, 0.88);
  border-color: #60a5fa;
  box-shadow: 0 0 0 0.2rem rgba(96, 165, 250, 0.2);
}

.form-select {
  background-image: linear-gradient(45deg, transparent 50%, #94a3b8 50%), linear-gradient(135deg, #94a3b8 50%, transparent 50%);
  background-position: calc(100% - 20px) calc(1.05em + 2px), calc(100% - 15px) calc(1.05em + 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.validation-summary ul {
  margin-bottom: 0;
}

.text-danger {
  color: #fda4af !important;
}

.app-check {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 0.85rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.form-check-input {
  margin-top: 0;
  background-color: rgba(15, 23, 42, 0.88);
  border-color: rgba(148, 163, 184, 0.35);
}

.form-check-input:checked {
  background-color: #2563eb;
  border-color: #2563eb;
}

.form-check-label {
  color: #e2e8f0;
}

.danger-panel {
  gap: 0.95rem;
}

.app-definition-list {
  display: grid;
  grid-template-columns: minmax(150px, 200px) 1fr;
  gap: 0.6rem 0.85rem;
  margin: 0;
}

.app-definition-list dt {
  color: #94a3b8;
  font-weight: 700;
}

.app-definition-list dd {
  margin: 0;
  color: #f8fafc;
}

.detail-list {
  display: grid;
  gap: 0.7rem;
}

.detail-item {
  padding: 0.78rem 0.92rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.detail-label {
  display: block;
  color: #94a3b8;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.25rem;
}

code {
  color: #bfdbfe;
  background: rgba(96, 165, 250, 0.1);
  border-radius: 8px;
  padding: 0.08rem 0.4rem;
}

@media (max-width: 991.98px) {
  .nav-status {
    align-items: flex-start;
    margin-top: 0.8rem;
  }
}

@media (max-width: 768px) {
  .grid,
  .footer {
    padding: 1rem;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero {
    padding-top: 0.75rem;
  }

  .app-definition-list {
    grid-template-columns: 1fr;
  }
}
