:root {
  --app-bg: #eef1f4;
  --panel-bg: #ffffff;
  --sidebar-bg: #13202b;
  --sidebar-text: #dce5eb;
  --accent: #20384f;
  --accent-soft: #dbe7f1;
  --border: #d7dee4;
  --muted: #687684;
  --danger-soft: #fff3f2;
}

body {
  background: linear-gradient(180deg, #eef2f6 0%, #e7edf2 100%);
  color: #1c2732;
  min-height: 100vh;
}

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

.sidebar {
  width: 280px;
  background: linear-gradient(180deg, #13202b 0%, #0f1820 100%);
  color: var(--sidebar-text);
  padding: 28px 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.brand-eyebrow,
.eyebrow {
  text-transform: uppercase;
  letter-spacing: .16em;
  font-size: .72rem;
  color: #8ba5bb;
}

.brand-block h1 {
  font-size: 1.6rem;
  margin: .35rem 0;
  color: #fff;
}

.brand-block p {
  color: #93a8b7;
  margin-bottom: 0;
}

.app-nav {
  margin-top: 2rem;
  gap: .35rem;
}

.app-nav .nav-link {
  color: var(--sidebar-text);
  border-radius: 12px;
  padding: .75rem .9rem;
}

.app-nav .nav-link:hover,
.app-nav .nav-link:focus {
  background: rgba(255, 255, 255, .08);
  color: #fff;
}

.sidebar-footer {
  border-top: 1px solid rgba(255, 255, 255, .08);
  padding-top: 1rem;
}

.main-content {
  flex: 1;
  padding: 24px 28px 40px;
}

.topbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 1.25rem;
}

.global-search {
  width: min(760px, 100%);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .75rem;
}

.page-header {
  margin-bottom: 1.25rem;
}

.page-header h2 {
  margin-bottom: .2rem;
  font-size: 1.85rem;
}

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

.panel-card {
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 12px 30px rgba(18, 34, 48, .06);
  overflow: hidden;
}

.panel-card .card-header {
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}

.metric-card,
.directory-card {
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1rem 1.15rem;
  box-shadow: 0 10px 25px rgba(18, 34, 48, .05);
  height: 100%;
}

.metric-card span,
.directory-card span {
  display: block;
  color: var(--muted);
  font-size: .92rem;
}

.metric-card strong,
.directory-card strong {
  display: block;
  font-size: 1.7rem;
  margin-top: .45rem;
  color: var(--accent);
}

.metric-card.compact strong {
  font-size: 1.35rem;
}

.flash-stack {
  margin-bottom: 1rem;
}

.pagination-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
}

.table-actions {
  white-space: nowrap;
}

.detail-list dt {
  color: var(--muted);
  font-weight: 600;
}

.json-box {
  background: #0f1720;
  color: #dce8f2;
  padding: 1rem;
  border-radius: 14px;
  font-size: .83rem;
  max-height: 340px;
  overflow: auto;
  margin-bottom: 0;
}

.json-box.compact {
  max-height: 220px;
}

.login-page {
  background: radial-gradient(circle at top, #dbe6ef 0%, #eef2f5 45%, #dfe7ee 100%);
  display: grid;
  place-items: center;
  min-height: 100vh;
}

.login-card {
  width: min(460px, calc(100% - 2rem));
  background: rgba(255, 255, 255, .94);
  border: 1px solid rgba(255, 255, 255, .55);
  border-radius: 24px;
  padding: 2rem;
  backdrop-filter: blur(12px);
}

.danger-zone {
  min-width: 360px;
}

@media (max-width: 991px) {
  .app-shell {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
  }

  .page-header-actions,
  .pagination-bar,
  .topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .danger-zone {
    min-width: 100%;
  }
}

