body {
  background: #eef2f6;
  color: #1f2933;
  font-size: 0.84rem;
}

.app-shell {
  min-height: 100vh;
  max-width: 1440px;
  margin: 0 auto;
  padding: clamp(8px, 1.2vw, 14px);
  display: grid;
  grid-template-columns: clamp(172px, 15vw, 220px) minmax(0, 1fr);
  gap: clamp(8px, 1.1vw, 14px);
  align-items: start;
}

.app-shell > *:not(.sidebar) {
  grid-column: 2;
}

.sidebar {
  grid-column: 1;
  grid-row: 1 / span 20;
  height: calc(100vh - (clamp(8px, 1.2vw, 14px) * 2));
  background: #10233f;
  color: #dbeafe;
  border-radius: 8px;
  padding: clamp(9px, 1vw, 14px);
  position: sticky;
  top: clamp(8px, 1.2vw, 14px);
  z-index: 10;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.brand-block {
  padding: 6px 6px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  margin-bottom: 10px;
  display: block;
  min-width: 0;
  flex: 0 0 auto;
}

.brand-mark {
  width: clamp(28px, 2.4vw, 34px);
  height: clamp(28px, 2.4vw, 34px);
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #16a34a;
  color: #fff;
  font-weight: 900;
  margin-bottom: 8px;
  flex: 0 0 auto;
}

.brand-title {
  font-size: clamp(0.78rem, 0.9vw, 0.88rem);
  font-weight: 900;
  line-height: 1.2;
}

.brand-subtitle {
  color: #9fb4d0;
  font-size: clamp(0.66rem, 0.75vw, 0.72rem);
  margin-top: 2px;
}

.nav-stack {
  display: grid;
  gap: 4px;
  overflow-y: auto;
  padding-right: 2px;
}

.nav-stack a {
  color: #cbd5e1;
  text-decoration: none;
  padding: clamp(6px, 0.7vw, 8px) clamp(7px, 0.8vw, 9px);
  border-radius: 7px;
  font-weight: 700;
  font-size: clamp(0.72rem, 0.82vw, 0.8rem);
}

.topbar,
.app-shell > .row,
.app-shell > .panel,
.app-shell > .status-box {
  min-width: 0;
}

.nav-stack a:hover,
.nav-stack a.active {
  background: rgba(255, 255, 255, 0.11);
  color: #fff;
}

.sidebar-foot {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  min-width: 0;
}

.sidebar-auth-link {
  display: inline-flex;
  margin-top: 6px;
  color: #f8d047;
  font-weight: 800;
  text-decoration: none;
}

.sidebar-auth-muted {
  display: inline-flex;
  margin-top: 6px;
  color: #f8d047;
  font-size: 0.72rem;
  font-weight: 800;
  opacity: 0.72;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid #dde3ea;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
}

.topbar h1 {
  margin: 0;
  color: #12355b;
  font-size: 1.15rem;
  font-weight: 800;
}

.topbar p {
  margin: 2px 0 0;
  color: #64748b;
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.eyebrow {
  color: #16833a;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.panel {
  background: #fff;
  border: 1px solid #dde3ea;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
  padding: 14px;
}

.auth-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-left: 4px solid #f8d047;
}

.auth-notice h2 {
  margin-bottom: 2px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 10px;
}

.section-head h2 {
  margin: 0;
  color: #12355b;
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.section-head p {
  margin: 3px 0 0;
  color: #64748b;
  font-size: 0.72rem;
}

.form-label {
  color: #475569;
  font-size: 0.7rem;
  font-weight: 800;
  margin-bottom: 0.16rem;
}

.form-control-sm,
.form-select-sm,
.btn-sm {
  font-size: 0.78rem;
}

.dashboard-card {
  background: #fff;
  border: 1px solid #dde3ea;
  border-radius: 8px;
  padding: 12px;
  min-height: 74px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
}

.dashboard-card .label {
  color: #64748b;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
}

.dashboard-card .value {
  color: #12355b;
  font-size: 1.28rem;
  font-weight: 900;
  line-height: 1.1;
  margin-top: 4px;
}

.dashboard-card .hint {
  color: #64748b;
  font-size: 0.7rem;
  margin-top: 3px;
}

.table-wrap,
.table-wrap-lg {
  overflow: auto;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.table-wrap {
  max-height: 390px;
}

.table-wrap-lg {
  max-height: 520px;
}

.table {
  font-size: 0.8rem;
}

.table > :not(caption) > * > * {
  padding: 0.42rem 0.5rem;
}

.pagination-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.terminal {
  background: #111827;
  color: #89f7a2;
  padding: 12px;
  border-radius: 8px;
  font-family: "Courier New", monospace;
  font-size: 0.72rem;
  max-height: 170px;
  overflow-y: auto;
  white-space: pre-wrap;
  border: 1px solid #1f2937;
}

.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: #f4f6f8;
}

.auth-card {
  max-width: 500px;
  width: 100%;
  background: #fff;
  border: 1px solid #dde3ea;
  border-radius: 8px;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
  padding: 34px;
  text-align: center;
}

.auth-card h2 {
  color: #b42318;
  font-size: 1.35rem;
  font-weight: 800;
}

.auth-shell-pro {
  background:
    linear-gradient(135deg, rgba(16, 35, 63, 0.96), rgba(18, 53, 91, 0.88)),
    linear-gradient(90deg, #eef2f6, #dce6ef);
  padding: clamp(16px, 4vw, 42px);
}

.auth-pro-card {
  width: min(920px, 100%);
  min-height: 460px;
  display: grid;
  grid-template-columns: minmax(280px, 0.95fr) minmax(320px, 1.05fr);
  background: #fff;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  box-shadow: 0 24px 60px rgba(2, 8, 23, 0.28);
  overflow: hidden;
}

.auth-pro-brand {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
  padding: clamp(24px, 4vw, 42px);
  background: #10233f;
  color: #e5eef9;
}

.auth-pro-brand::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 5px;
  background: linear-gradient(90deg, #16a34a, #f8d047, #38bdf8);
}

.auth-mark {
  width: 46px;
  height: 46px;
  margin-bottom: 18px;
}

.auth-eyebrow {
  color: #f8d047;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.auth-pro-brand h1 {
  margin: 4px 0 6px;
  color: #fff;
  font-size: clamp(1.55rem, 3vw, 2.15rem);
  font-weight: 900;
  letter-spacing: 0;
}

.auth-pro-brand p {
  max-width: 270px;
  margin: 0;
  color: #b8c8dc;
  font-size: 0.9rem;
  line-height: 1.55;
}

.auth-pro-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #dbeafe;
  font-size: 0.76rem;
  font-weight: 800;
}

.auth-pro-status span {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.16);
}

.auth-pro-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(26px, 5vw, 54px);
}

.auth-chip {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  border-radius: 999px;
  background: #e8f4ec;
  color: #16833a;
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.auth-pro-panel h2 {
  margin: 16px 0 8px;
  color: #12355b;
  font-size: clamp(1.35rem, 3vw, 1.9rem);
  font-weight: 900;
  letter-spacing: 0;
}

.auth-copy {
  margin: 0 0 22px;
  color: #64748b;
  font-size: 0.9rem;
  line-height: 1.58;
}

.auth-main-btn {
  padding: 10px 14px;
  font-weight: 800;
}

.auth-footnote {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #e2e8f0;
  color: #64748b;
  font-size: 0.75rem;
}

.auth-error-card .auth-pro-brand::after {
  background: linear-gradient(90deg, #dc2626, #f8d047, #16a34a);
}

.auth-pro-status-danger span {
  background: #ef4444;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.18);
}

.auth-chip-danger {
  background: #fef2f2;
  color: #b42318;
}

.auth-error-detail {
  padding: 12px 14px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: #fff7f7;
  color: #7f1d1d;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.5;
}

.auth-error-actions {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

@media (max-width: 900px) {
  .app-shell {
    min-height: 100vh;
    display: block;
    padding: 10px;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 10px;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin-bottom: 10px;
  }

  .brand-block {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 4px 10px;
  }

  .brand-mark {
    margin-bottom: 0;
  }

  .nav-stack {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .nav-stack a {
    text-align: center;
  }

  .topbar {
    flex-direction: column;
    margin-bottom: 10px;
  }

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

@media (max-width: 760px) {
  .auth-pro-card {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .auth-pro-brand {
    padding: 24px;
    gap: 16px;
  }

  .auth-mark {
    margin-bottom: 12px;
  }

  .auth-pro-brand p {
    max-width: none;
  }

  .auth-pro-panel {
    padding: 24px;
  }
}

@media (max-width: 560px) {
  .nav-stack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .brand-subtitle {
    display: none;
  }
}
