/* OneSchool Private PyPI — self-contained, theme-aware styles (no external assets). */
:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --border: #e3e7ec;
  --text: #1a1f2b;
  --muted: #6b7385;
  --brand: #4f46e5;
  --brand-ink: #ffffff;
  --brand-soft: #eef0fe;
  --accent: #0ea5e9;
  --ok: #16a34a;
  --ok-soft: #dcfce7;
  --off: #b91c1c;
  --off-soft: #fee2e2;
  --danger: #dc2626;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 16px rgba(16, 24, 40, .06);
  --radius: 14px;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1017; --surface: #151a23; --surface-2: #1b212c; --border: #262d3a;
    --text: #e6e9ef; --muted: #9aa3b2; --brand: #7c7bff; --brand-soft: #1c2030;
    --brand-ink: #0d1017; --ok-soft: #0f2a1a; --off-soft: #2a1414; --shadow: none;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--sans); background: var(--bg); color: var(--text);
  line-height: 1.5; -webkit-font-smoothing: antialiased; min-height: 100vh;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.55rem; margin: 0 0 .25rem; letter-spacing: -.02em; }
h2 { font-size: 1.1rem; margin: 0 0 .5rem; letter-spacing: -.01em; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.mono { font-family: var(--mono); font-size: .85em; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.dot { color: var(--muted); margin: 0 .35rem; }

/* Top bar */
.topbar {
  background: var(--surface); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10; backdrop-filter: saturate(1.2);
}
.topbar-inner {
  max-width: 1080px; margin: 0 auto; padding: .7rem 1.25rem;
  display: flex; align-items: center; gap: 1.25rem;
}
.brand { display: flex; align-items: center; gap: .55rem; color: var(--text); font-weight: 600; }
.brand:hover { text-decoration: none; }
.brand-mark { font-size: 1.25rem; }
.brand-name b { color: var(--brand); font-weight: 700; }
.nav { display: flex; gap: .25rem; margin-left: .5rem; }
.nav a {
  color: var(--muted); padding: .4rem .7rem; border-radius: 8px; font-weight: 500; font-size: .92rem;
}
.nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav a.active { color: var(--brand); background: var(--brand-soft); }
.user { margin-left: auto; display: flex; align-items: center; gap: .75rem; }
.user-email {
  color: var(--muted); font-size: .85rem; max-width: 200px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}

/* Layout */
.container { max-width: 1080px; margin: 0 auto; padding: 1.75rem 1.25rem 3rem; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.breadcrumb { color: var(--muted); font-size: .9rem; margin-bottom: .5rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 760px) { .grid-2 { grid-template-columns: 1fr; } .nav { display: none; } }

/* Cards */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.15rem 1.25rem; box-shadow: var(--shadow); margin-bottom: 1rem;
}
.card-title { font-size: .95rem; text-transform: none; }
.reveal { border-color: var(--ok); }

/* Tables */
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th {
  text-align: left; font-weight: 600; color: var(--muted); font-size: .78rem;
  text-transform: uppercase; letter-spacing: .04em; padding: .5rem .6rem; border-bottom: 1px solid var(--border);
}
.table td { padding: .6rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.pkg-link { font-weight: 600; }
.row-muted { opacity: .55; }
.row-denied td { background: color-mix(in srgb, var(--off-soft) 45%, transparent); }

/* Badges & chips */
.badge {
  display: inline-block; padding: .12rem .5rem; border-radius: 999px; font-size: .78rem;
  font-weight: 600; background: var(--surface-2); color: var(--text); font-family: var(--mono);
}
.badge-on { background: var(--ok-soft); color: var(--ok); }
.badge-off { background: var(--off-soft); color: var(--off); }
.badge-read { background: var(--brand-soft); color: var(--brand); }
.badge-upload { background: #fef3c7; color: #b45309; }
.chip {
  display: inline-flex; align-items: center; gap: .35rem; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 999px; padding: .12rem .3rem .12rem .6rem;
  font-size: .82rem; margin: .15rem .15rem 0 0;
}
.chip-x { display: inline; margin: 0; }
.chip-x button {
  border: none; background: none; color: var(--muted); cursor: pointer; font-size: 1rem;
  line-height: 1; padding: 0 .2rem; border-radius: 999px;
}
.chip-x button:hover { color: var(--danger); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .5rem .9rem; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-weight: 600; font-size: .9rem;
  cursor: pointer; transition: .12s ease; font-family: inherit;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.btn-danger { background: var(--off-soft); color: var(--off); border-color: transparent; }
.btn-ghost { background: transparent; }
.btn-sm { padding: .3rem .6rem; font-size: .82rem; }
.btn-lg { padding: .7rem 1.4rem; font-size: 1rem; width: 100%; }

/* Forms */
.form { display: flex; flex-direction: column; gap: .8rem; }
.form label { display: flex; flex-direction: column; gap: .3rem; font-size: .85rem; font-weight: 600; color: var(--muted); }
.form input, .form select, .search input {
  font: inherit; padding: .55rem .7rem; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface-2); color: var(--text);
}
.form input:focus, .form select:focus, .search input:focus {
  outline: none; border-color: var(--brand); background: var(--surface);
}
.search input { min-width: 260px; }

/* Snippets */
.snippet, .readme {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px;
  padding: .8rem .9rem; overflow-x: auto; font-family: var(--mono); font-size: .82rem;
  line-height: 1.5; white-space: pre; margin: .5rem 0;
}
.readme { white-space: pre-wrap; max-height: 460px; overflow-y: auto; }
.token-reveal {
  display: flex; align-items: center; gap: .6rem; background: var(--surface-2);
  border: 1px dashed var(--brand); border-radius: 10px; padding: .7rem .9rem; margin: .5rem 0;
}
.token-reveal code { font-family: var(--mono); font-size: .82rem; word-break: break-all; flex: 1; }

/* Empty states */
.empty { text-align: center; padding: 4rem 1rem; }
.empty-mark { font-size: 2.6rem; margin-bottom: .5rem; }

/* Login */
.login-body { display: grid; place-items: center; min-height: 100vh;
  background: radial-gradient(1200px 600px at 50% -10%, var(--brand-soft), var(--bg)); }
.login-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 20px;
  padding: 2.5rem; width: min(400px, 90vw); text-align: center; box-shadow: var(--shadow);
}
.login-mark { font-size: 2.5rem; }
.login-card h1 { margin: .5rem 0 .25rem; }
.login-card .btn { margin-top: 1.25rem; }
.login-note { color: var(--muted); font-size: .82rem; margin-top: 1.25rem; }

/* Footer */
.footer {
  max-width: 1080px; margin: 0 auto; padding: 1.5rem 1.25rem 2.5rem;
  color: var(--muted); font-size: .82rem; text-align: center;
}
