:root {
  --brand: #f58220;
  --brand-600: #e47110;
  --brand-700: #bf5f11;
  --portal-ink: #18202f;
  --portal-muted: #667085;
  --portal-line: #d9e0ea;
  --portal-soft-line: #e8edf3;
  --portal-surface: #f4f6f9;
  --portal-panel: #ffffff;
}

html,
body {
  background: var(--portal-surface) !important;
}

html {
  color-scheme: light;
}

body {
  color: var(--portal-ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  letter-spacing: 0;
}

body:not(.bg-light) {
  background: linear-gradient(180deg, #f8fafc 0, var(--portal-surface) 360px) !important;
}

.app-shell {
  display: grid !important;
  grid-template-columns: 284px minmax(0, 1fr) !important;
  min-height: 100vh;
}

main {
  min-width: 0;
}

.sidebar {
  position: sticky !important;
  top: 0;
  height: 100vh !important;
  overflow-y: auto;
  background: linear-gradient(180deg, #fff, #f8fafc) !important;
  border-right: 1px solid var(--portal-soft-line) !important;
  box-shadow: 8px 0 24px rgba(15, 23, 42, .06);
  padding: 0 14px 18px !important;
  scrollbar-width: thin;
}

.sidebar .brand {
  min-height: 84px;
  padding: 18px 6px 16px !important;
  border-bottom: 1px solid var(--portal-soft-line) !important;
}

.sidebar .brand a {
  width: 100%;
}

.sidebar .brand img {
  height: 46px !important;
  width: auto;
  max-width: 190px;
  object-fit: contain;
}

.sidebar nav {
  padding: 14px 0 !important;
}

.nav-vertical {
  gap: 3px;
}

.nav-vertical .nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 10px 12px !important;
  border-radius: 8px !important;
  color: #344054 !important;
  font-size: .94rem;
  font-weight: 650 !important;
  line-height: 1.2;
  border: 1px solid transparent;
}

.nav-vertical .nav-link i {
  width: 20px;
  margin-right: 0 !important;
  color: #667085;
  font-size: 1rem;
  text-align: center;
}

.nav-vertical .nav-link:hover {
  background: #fff1e6 !important;
  color: var(--portal-ink) !important;
}

.nav-vertical .nav-link:hover i,
.nav-vertical .nav-link.active i {
  color: var(--brand-700);
}

.nav-vertical .nav-link.active {
  background: #fff1e6 !important;
  color: var(--brand-700) !important;
  border-color: rgba(245, 130, 32, .28);
  box-shadow: inset 3px 0 0 var(--brand);
}

.topbar {
  background: rgba(255, 255, 255, .92) !important;
  border-bottom: 1px solid var(--portal-soft-line) !important;
  box-shadow: 0 12px 30px rgba(15, 23, 42, .06);
  backdrop-filter: blur(12px);
}

.container-fluid {
  max-width: 1680px;
}

main > .container-fluid,
main .container-fluid.py-3,
main .container-fluid.py-4 {
  padding: 28px 30px !important;
}

.card,
.login-card {
  border: 1px solid var(--portal-soft-line) !important;
  border-radius: 8px !important;
  background: var(--portal-panel) !important;
  box-shadow: 0 16px 38px rgba(15, 23, 42, .07) !important;
}

.login-card {
  backdrop-filter: none !important;
}

.card-header {
  background: #f8fafc !important;
  border-bottom: 1px solid var(--portal-soft-line) !important;
}

.card-title,
h1,
h2,
h3,
h4,
h5 {
  color: var(--portal-ink);
  letter-spacing: 0;
}

.lead,
.text-muted,
.subtle,
.form-text {
  color: var(--portal-muted) !important;
}

.btn {
  border-radius: 8px !important;
  font-weight: 650;
}

.btn-primary,
.btn-brand {
  background: var(--brand) !important;
  border-color: var(--brand) !important;
  color: #fff !important;
  box-shadow: 0 8px 18px rgba(245, 130, 32, .18);
}

.btn-primary:hover,
.btn-brand:hover {
  background: var(--brand-700) !important;
  border-color: var(--brand-700) !important;
  color: #fff !important;
  transform: none !important;
}

.btn-outline-secondary {
  border-color: #c9d2df;
  color: #344054;
}

.btn-outline-secondary:hover {
  background: #eef2f7;
  border-color: #b9c4d2;
  color: var(--portal-ink);
}

.form-control,
.form-select {
  border-radius: 8px !important;
  border-color: #cfd8e3;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 .2rem rgba(245, 130, 32, .14);
}

.table {
  --bs-table-striped-bg: #f7f9fc;
  --bs-table-hover-bg: #fff7ef;
}

.table thead th {
  background: #f8fafc;
  color: #5d6b82 !important;
  border-bottom: 1px solid var(--portal-line);
  font-size: .73rem !important;
  font-weight: 800;
  letter-spacing: .04em !important;
}

.table tbody td {
  border-color: #edf1f6;
}

.badge {
  border-radius: 6px;
  font-weight: 750;
}

.alert {
  border-radius: 8px;
  border-width: 1px;
}

.code-chip {
  background: #eef2f7 !important;
  color: var(--portal-ink);
}

footer {
  color: var(--portal-muted) !important;
}

@media (max-width: 991.98px) {
  .app-shell {
    grid-template-columns: 1fr !important;
  }

  main > .container-fluid,
  main .container-fluid.py-3,
  main .container-fluid.py-4 {
    padding: 18px 14px !important;
  }
}
