:root {
  color-scheme: light;
}

body {
  margin: 0;
  font-family: "Noto Sans TC", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.85), transparent 32%),
    radial-gradient(circle at right 15%, rgba(142, 199, 255, 0.3), transparent 28%),
    linear-gradient(180deg, #f3efe4 0%, #eef5fb 48%, #f5f7fb 100%);
  color: #17324d;
}

#admin-page {
  --s-color-primary: #0f5f83;
  --s-color-primary-container: #d6ecfb;
  --s-color-on-primary-container: #11334d;
  --s-color-secondary-container: #efe4d0;
  --s-color-on-secondary-container: #4e3621;
  --s-color-surface: rgba(255, 255, 255, 0.78);
  min-height: 100vh;
}

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

.login-shell {
  min-height: 100vh;
  padding: 24px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
}

.app-rail {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 12px;
  box-sizing: border-box;
  border-right: 1px solid rgba(15, 95, 131, 0.12);
  background: rgba(255, 255, 255, 0.52);
  backdrop-filter: blur(16px);
}

.app-main {
  min-width: 0;
  padding: 20px 24px 104px;
}

.topbar {
  margin-bottom: 24px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 18px 60px rgba(14, 59, 97, 0.08);
}

.topbar-headline,
.brand-title,
.summary-number {
  font-family: "Space Grotesk", "Noto Sans TC", sans-serif;
}

.topbar-subtitle,
.brand-subtitle,
.muted,
.inline-status {
  color: #55718d;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #0f5f83, #1c8cb8);
  color: #fff;
  font-family: "Space Grotesk", sans-serif;
  font-size: 20px;
  font-weight: 700;
  box-shadow: 0 16px 32px rgba(15, 95, 131, 0.24);
}

.brand-mark-rail {
  margin: 0 auto 20px;
}

.brand-title {
  font-size: 1rem;
  font-weight: 700;
}

.brand-subtitle {
  font-size: 0.78rem;
}

.login-grid,
.summary-grid,
.section-grid {
  display: grid;
  gap: 20px;
}

.login-grid,
.summary-grid {
  margin-top: 20px;
}

.login-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.login-grid-single {
  grid-template-columns: minmax(720px, 980px);
}

.summary-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.section-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.panel-card,
.summary-card {
  display: block;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 18px 60px rgba(14, 59, 97, 0.08);
  width: 100%;
  max-width: none;
  min-width: 0;
  box-sizing: border-box;
}

.panel-card [slot="text"],
.summary-card [slot="text"] {
  display: block;
  min-width: 0;
}

.summary-card {
  min-height: 120px;
}

.accent-a {
  background: linear-gradient(135deg, rgba(255, 244, 224, 0.94), rgba(255, 255, 255, 0.85));
}

.accent-b {
  background: linear-gradient(135deg, rgba(220, 242, 255, 0.94), rgba(255, 255, 255, 0.85));
}

.summary-number {
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  font-weight: 700;
  word-break: break-word;
}

.summary-code {
  font-size: clamp(1rem, 1.8vw, 1.35rem);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.filter-grid-wide {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.action-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.list-region,
.detail-region {
  min-height: 220px;
}

.item-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.item-card {
  border: 1px solid rgba(15, 95, 131, 0.1);
  border-radius: 22px;
  padding: 16px;
  background: rgba(246, 250, 253, 0.88);
}

.item-card.is-selected {
  border-color: rgba(15, 95, 131, 0.4);
  box-shadow: inset 0 0 0 1px rgba(15, 95, 131, 0.18);
}

.item-card-header,
.detail-header,
.timeline-item-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.item-title,
.detail-title {
  font-size: 1rem;
  font-weight: 700;
}

.item-meta,
.detail-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.meta-chip {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(15, 95, 131, 0.1);
  color: #0f5f83;
  font-size: 0.82rem;
}

.detail-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.detail-block {
  padding: 16px;
  border-radius: 20px;
  background: rgba(246, 250, 253, 0.88);
  border: 1px solid rgba(15, 95, 131, 0.1);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.kv {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.kv-label {
  font-size: 0.8rem;
  color: #68819a;
}

.kv-value,
.mono {
  word-break: break-word;
}

.mono {
  font-family: "Space Grotesk", monospace;
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.timeline-item {
  border-left: 3px solid rgba(15, 95, 131, 0.18);
  padding: 4px 0 4px 14px;
}

.timeline-item pre,
.audit-json {
  margin: 10px 0 0;
  padding: 12px;
  border-radius: 16px;
  background: rgba(18, 39, 59, 0.92);
  color: #eff7ff;
  font-size: 0.82rem;
  overflow: auto;
  white-space: pre-wrap;
}

.empty-state {
  min-height: 180px;
  display: grid;
  place-items: center;
  color: #68819a;
}

.mobile-nav-wrap {
  display: none;
  margin: 20px 0;
}

.google-signin {
  min-height: 44px;
}

.inline-status {
  min-height: 24px;
}

.content-section {
  margin-top: 20px;
}

.text-block {
  white-space: pre-wrap;
  line-height: 1.6;
}

@media (max-width: 1180px) {
  .filter-grid-wide,
  .section-grid,
  .login-grid,
  .summary-grid {
    grid-template-columns: 1fr;
  }
}

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

  .app-rail {
    display: none;
  }

  .app-main {
    padding: 16px 14px 112px;
  }

  .mobile-nav-wrap {
    display: block;
  }

  .login-shell {
    align-items: stretch;
    justify-content: flex-start;
  }
}

@media (max-width: 720px) {
  .filter-grid,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .panel-card,
  .summary-card,
  .topbar {
    border-radius: 22px;
  }
}
