* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.9), transparent 42%),
    linear-gradient(180deg, #f4f7fb 0%, #eef2f8 100%);
  color: #111827;
}
.is-hidden {
  display: none !important;
}
.auth-gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.9), transparent 40%),
    linear-gradient(180deg, #f8fafc 0%, #e2e8f0 100%);
}
.auth-card {
  width: min(100%, 480px);
  padding: 30px;
  border-radius: 30px;
  background: rgba(10, 18, 32, 0.96);
  color: #fff;
  box-shadow: 0 30px 90px rgba(15, 23, 42, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.auth-brand-logo {
  display: block;
  width: 150px;
  height: 84px;
  margin: 0 auto 18px;
  object-fit: contain;
  filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.18));
}
.auth-card h1 {
  margin: 0;
  font-size: clamp(32px, 5vw, 44px);
  line-height: 1;
}
.auth-copy {
  margin: 14px 0 24px;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.6;
}
.auth-grid {
  display: grid;
  gap: 12px;
}
.auth-grid label {
  color: rgba(255, 255, 255, 0.82);
}
.auth-grid input {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
  color: #fff;
}
.auth-grid input::placeholder {
  color: rgba(255, 255, 255, 0.45);
}
.auth-actions {
  margin-top: 8px;
}
.auth-status {
  margin: 14px 0 0;
  color: rgba(255, 255, 255, 0.65);
  font-size: 13px;
}
.shell {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  padding: 28px 20px;
  background: rgba(10, 18, 32, 0.96);
  color: white;
}
.brand {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 24px;
}
.brand img,
.admin-brand-logo {
  width: 94px;
  height: 58px;
  object-fit: contain;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  padding: 5px 8px;
}
.brand-mark {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: linear-gradient(135deg, #fff, #dbe7ff);
  color: #0f172a;
  font-weight: 800;
  letter-spacing: 0.08em;
}
.brand h1 {
  margin: 0;
  font-size: 18px;
}
.brand p,
.muted {
  margin: 4px 0 0;
  color: rgba(255, 255, 255, 0.65);
  font-size: 13px;
}
.sidebar nav {
  display: grid;
  gap: 10px;
}
.nav-item,
.ghost,
.primary,
.danger {
  border: 0;
  border-radius: 14px;
  padding: 12px 15px;
  font: inherit;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease, opacity 140ms ease;
}
.nav-item {
  background: rgba(255, 255, 255, 0.06);
  color: white;
  text-align: left;
}
.nav-item.active {
  background: linear-gradient(135deg, #fff, #dbe7ff);
  color: #0f172a;
}
.sidebar-card {
  margin-top: 24px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
}
.sidebar-card .actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.sidebar-card code {
  display: block;
  margin: 10px 0 14px;
  color: #dbeafe;
}
.ghost {
  background: rgba(255, 255, 255, 0.08);
  color: white;
}
.content {
  padding: 28px;
  min-width: 0;
}
.hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 24px;
  margin-bottom: 22px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.08);
}
.hero h2 {
  margin: 0;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.05;
  max-width: 13ch;
}
.eyebrow {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 11px;
  color: #6b7280;
}
.status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(92px, 1fr));
  gap: 14px;
  align-self: start;
}
.stat {
  min-width: 110px;
  padding: 16px 18px;
  border-radius: 20px;
  background: linear-gradient(180deg, #0f172a, #111827);
  color: white;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
}
.stat span {
  display: block;
  font-size: 28px;
  font-weight: 700;
}
.stat small {
  color: rgba(255, 255, 255, 0.7);
}
.panel {
  display: none;
  gap: 18px;
}
.panel.active {
  display: grid;
}
.panel-card {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 24px;
  padding: 20px;
  box-shadow: 0 18px 60px rgba(15, 23, 42, 0.08);
}
.panel-card h3 {
  margin: 0 0 16px;
  font-size: 20px;
}
.card-head,
.actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.table-wrap {
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
th, td {
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  padding: 12px 10px;
  text-align: left;
  vertical-align: top;
}
label {
  display: grid;
  gap: 7px;
  margin-bottom: 12px;
  font-size: 13px;
  color: #374151;
}
label.inline {
  display: flex;
  align-items: center;
  gap: 8px;
}
input, textarea {
  width: 100%;
  border: 1px solid rgba(15, 23, 42, 0.14);
  border-radius: 14px;
  padding: 11px 12px;
  font: inherit;
  background: white;
  color: #111827;
}
textarea {
  resize: vertical;
}
.primary {
  background: linear-gradient(135deg, #111827, #0f172a);
  color: white;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.14);
}
.danger {
  background: #fee2e2;
  color: #991b1b;
}
.list,
.stack {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 0;
  list-style: none;
}
.list li,
.stack .item {
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.04);
}
.muted {
  color: #6b7280;
}
@media (max-width: 1100px) {
  .shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px 14px;
    padding: 14px 18px;
    box-shadow: 0 8px 28px rgba(15, 23, 42, 0.18);
  }
  .sidebar .brand {
    grid-column: 1;
    margin: 0;
  }
  .sidebar nav {
    grid-column: 1 / -1;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }
  .sidebar nav::-webkit-scrollbar {
    display: none;
  }
  .sidebar .nav-item {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 10px 14px;
  }
  .sidebar-card {
    grid-column: 2;
    grid-row: 1;
    align-self: center;
    margin: 0;
    padding: 9px 10px;
  }
  .sidebar-card > strong,
  .sidebar-card > code,
  .sidebar-card > p {
    display: none;
  }
  .sidebar-card .actions {
    flex-wrap: nowrap;
  }
  .hero {
    flex-direction: column;
  }
}
@media (max-width: 720px) {
  html,
  body,
  .shell {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }
  .auth-gate {
    padding: 14px;
  }
  .auth-card {
    padding: 22px 18px;
    border-radius: 22px;
  }
  .auth-brand-logo {
    width: 118px;
    height: 66px;
    margin-bottom: 12px;
  }
  .auth-card h1 {
    font-size: 28px;
    line-height: 1.12;
  }
  .auth-copy {
    margin: 10px 0 18px;
  }
  .sidebar {
    padding: 10px 12px;
    gap: 8px 10px;
    grid-template-columns: minmax(0, 1fr);
  }
  .brand {
    gap: 9px;
    min-width: 0;
    padding-right: 76px;
  }
  .brand img,
  .admin-brand-logo {
    width: 72px;
    height: 44px;
    padding: 3px 6px;
    border-radius: 10px;
  }
  .brand h1 {
    font-size: 14px;
    white-space: nowrap;
  }
  .brand p {
    display: none;
  }
  .sidebar-card {
    position: absolute;
    top: 13px;
    right: 12px;
    padding: 6px;
  }
  .sidebar-card #refreshBtn {
    display: none;
  }
  .sidebar-card .ghost {
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 12px;
  }
  .sidebar nav {
    grid-column: 1;
    margin: 0 -2px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    overflow: visible;
  }
  .sidebar .nav-item {
    width: 100%;
    min-width: 0;
    padding: 9px 12px;
    border-radius: 11px;
    font-size: 13px;
    text-align: center;
  }
  .content {
    padding: 12px;
    width: 100%;
    max-width: 100vw;
    overflow: hidden;
  }
  .hero,
  .panel-card {
    border-radius: 18px;
  }
  .hero {
    gap: 16px;
    padding: 16px;
    margin-bottom: 14px;
  }
  .hero h2 {
    max-width: none;
    font-size: 24px;
    line-height: 1.12;
  }
  .hero .muted,
  .panel-card .muted,
  code {
    overflow-wrap: anywhere;
    word-break: break-all;
  }
  .status-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }
  .stat {
    min-width: 0;
    padding: 10px 8px;
    border-radius: 14px;
    text-align: center;
  }
  .stat span {
    font-size: 22px;
  }
  .panel-card {
    padding: 14px;
  }
  .panel-card h3 {
    font-size: 18px;
  }
  .table-wrap {
    margin: 0 -14px;
    padding: 0 14px 6px;
    overscroll-behavior-x: contain;
  }
  .table-wrap table {
    min-width: 720px;
  }
  input,
  textarea {
    font-size: 16px;
  }
  .primary,
  .danger,
  .ghost {
    min-height: 42px;
  }
  .actions > .primary,
  .actions > .danger {
    flex: 1 1 140px;
  }
}
