/* shadcn/ui "zinc" light theme — CSS variables + the small set of
component classes these pages actually use (card, button, input,
badge, sidebar). No build step, no component library import — just
the same visual language applied directly, since these are plain
static HTML pages, not a React app. */

:root {
  --background: 0 0% 100%;
  --foreground: 240 10% 3.9%;
  --card: 0 0% 100%;
  --card-foreground: 240 10% 3.9%;
  --primary: 240 5.9% 10%;
  --primary-foreground: 0 0% 98%;
  --secondary: 240 4.8% 95.9%;
  --secondary-foreground: 240 5.9% 10%;
  --muted: 240 4.8% 95.9%;
  --muted-foreground: 240 3.8% 46.1%;
  --border: 240 5.9% 90%;
  --input: 240 5.9% 90%;
  --ring: 240 5.9% 10%;
  --radius: 0.5rem;
  --success: 142 71% 40%;
  --warning: 32 95% 44%;
  --destructive: 0 72% 51%;
  --info: 221 83% 53%;
}

* {
  border-color: hsl(var(--border));
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
    "Segoe UI", Helvetica, Arial, sans-serif;
  background-color: hsl(var(--secondary) / 40%);
  color: hsl(var(--foreground));
  -webkit-font-smoothing: antialiased;
}

/* Layout */

.sc-shell {
  display: flex;
  height: 100%;
}

.sc-sidebar {
  width: 15rem;
  flex-shrink: 0;
  background: hsl(var(--card));
  border-right: 1px solid hsl(var(--border));
  display: flex;
  flex-direction: column;
  padding: 1.25rem 0.75rem;
  gap: 0.25rem;
}

.sc-sidebar-brand {
  font-size: 0.8125rem;
  font-weight: 600;
  color: hsl(var(--foreground));
  padding: 0 0.5rem 1rem 0.5rem;
  letter-spacing: -0.01em;
}

.sc-sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.625rem;
  border-radius: calc(var(--radius) - 2px);
  font-size: 0.8125rem;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  text-decoration: none;
}

.sc-sidebar-link:hover {
  background: hsl(var(--secondary));
  color: hsl(var(--foreground));
}

.sc-sidebar-link.active {
  background: hsl(var(--secondary));
  color: hsl(var(--foreground));
}

.sc-sidebar-link .num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.125rem;
  height: 1.125rem;
  border-radius: 9999px;
  background: hsl(var(--foreground) / 8%);
  font-size: 0.6875rem;
  font-weight: 600;
  flex-shrink: 0;
}

.sc-sidebar-link.active .num {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}

.sc-main {
  flex: 1;
  min-width: 0;
  overflow: auto;
  padding: 1.5rem 2rem;
}

.sc-page-title {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: hsl(var(--foreground));
}

.sc-page-subtitle {
  font-size: 0.8125rem;
  color: hsl(var(--muted-foreground));
  margin-top: 0.125rem;
}

/* Card */

.sc-card {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.03);
}

/* Buttons */

.sc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  white-space: nowrap;
  border-radius: calc(var(--radius) - 2px);
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 0.4rem 0.85rem;
  transition: background-color 0.12s, opacity 0.12s;
  border: 1px solid transparent;
  cursor: pointer;
}

.sc-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.sc-btn-primary {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}
.sc-btn-primary:hover:not(:disabled) {
  opacity: 0.88;
}

.sc-btn-secondary {
  background: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
}
.sc-btn-secondary:hover:not(:disabled) {
  background: hsl(var(--border));
}

.sc-btn-outline {
  background: hsl(var(--card));
  border-color: hsl(var(--border));
  color: hsl(var(--foreground));
}
.sc-btn-outline:hover:not(:disabled) {
  background: hsl(var(--secondary));
}

.sc-btn-destructive {
  background: transparent;
  color: hsl(var(--destructive));
}
.sc-btn-destructive:hover:not(:disabled) {
  background: hsl(var(--destructive) / 10%);
}

.sc-btn-sm {
  padding: 0.3rem 0.65rem;
  font-size: 0.75rem;
}

/* Inputs */

.sc-input,
.sc-select {
  border: 1px solid hsl(var(--input));
  border-radius: calc(var(--radius) - 2px);
  padding: 0.4rem 0.65rem;
  font-size: 0.8125rem;
  background: hsl(var(--card));
  color: hsl(var(--foreground));
}

.sc-input:focus,
.sc-select:focus {
  outline: none;
  box-shadow: 0 0 0 2px hsl(var(--ring) / 25%);
  border-color: hsl(var(--ring) / 50%);
}

.sc-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  margin-bottom: 0.25rem;
}

/* Badges */

.sc-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 9999px;
  padding: 0.1rem 0.55rem;
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.25rem;
  white-space: nowrap;
}

.sc-badge-success {
  background: hsl(var(--success) / 12%);
  color: hsl(var(--success));
}
.sc-badge-warning {
  background: hsl(var(--warning) / 14%);
  color: hsl(var(--warning));
}
.sc-badge-destructive {
  background: hsl(var(--destructive) / 10%);
  color: hsl(var(--destructive));
}
.sc-badge-info {
  background: hsl(var(--info) / 10%);
  color: hsl(var(--info));
}
.sc-badge-muted {
  background: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
}

/* Table */

.sc-table-wrap {
  overflow: auto;
  max-height: 65vh;
  /* Confirmed required (2026-11-18): this sits inside a flex-column
  parent (.sc-main), and flex items default to min-height: auto —
  they refuse to shrink below their own content's natural height,
  which silently overrides max-height and makes the whole page scroll
  instead of this box getting its own internal scrollbar. */
  min-height: 0;
}

.sc-table-wrap table {
  width: 100%;
  font-size: 0.8125rem;
  border-collapse: collapse;
}

.sc-table-wrap thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  text-align: left;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground));
  background: hsl(var(--secondary) / 95%);
  padding: 0.55rem 1rem;
  border-bottom: 1px solid hsl(var(--border));
  white-space: nowrap;
}

.sc-table-wrap tbody td {
  padding: 0.55rem 1rem;
  border-bottom: 1px solid hsl(var(--border));
}

.sc-table-wrap tbody tr:last-child td {
  border-bottom: none;
}

.sc-table-wrap tbody tr.clickable:hover {
  background: hsl(var(--secondary) / 50%);
  cursor: pointer;
}

/* Loading state */

.sc-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 2.5rem 0;
  color: hsl(var(--muted-foreground));
}

.sc-spinner {
  width: 1.5rem;
  height: 1.5rem;
  border: 2px solid hsl(var(--border));
  border-top-color: hsl(var(--primary));
  border-radius: 9999px;
  animation: sc-spin 0.7s linear infinite;
}

@keyframes sc-spin {
  to {
    transform: rotate(360deg);
  }
}

.sc-loading-text {
  font-size: 0.8125rem;
}
