:root {
  --sidebar: #2A2D3E;
  --sidebar-hover: #353849;
  --sidebar-text: #C9CCDA;
  --sidebar-muted: #8A8EA3;
  --bg: #EEF1F3;
  --card: #FFFFFF;
  --text: #1F2330;
  --muted: #6B7080;
  --border: #E3E6EB;
  --blue: #3B82F6;
  --blue-dark: #2563EB;
  --blue-soft: #EAF2FF;
  --red: #DC2626;
  --red-soft: #FEF2F2;
  --green: #16A34A;
  --radius: 20px;
  --sidebar-width: 276px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0 0 6px; font-weight: 600; }
h1 { font-size: 26px; }
h2 { font-size: 19px; }
h3 { font-size: 16px; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
[hidden] { display: none !important; }

/* Layout */
.app { min-height: 100%; }
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-width); flex: 0 0 var(--sidebar-width);
  background: var(--sidebar); color: var(--sidebar-text);
  display: flex; flex-direction: column; padding: 28px 20px 20px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.main { flex: 1; padding: 44px 48px 64px; min-width: 0; }
.main-inner { max-width: 800px; margin: 0 auto; }

/* Sidebar */
.profile { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; margin-bottom: 26px; }
.avatar {
  width: 72px; height: 72px; border-radius: 50%; background: var(--blue); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 30px; font-weight: 600; text-transform: uppercase;
}
.brand { color: #fff; font-weight: 600; font-size: 18px; margin-top: 4px; }
.email { color: var(--sidebar-muted); font-size: 13px; word-break: break-all; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px;
  color: var(--sidebar-text); font-size: 14.5px; text-decoration: none;
}
.nav a:hover { background: var(--sidebar-hover); color: #fff; }
.nav a.active { background: var(--sidebar-hover); color: #fff; font-weight: 600; }
.nav svg { width: 18px; height: 18px; flex: 0 0 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav .divider { height: 1px; background: rgba(255,255,255,0.08); margin: 12px 4px; }
.sidebar-bottom { margin-top: auto; padding-top: 24px; }
.trial-box { font-size: 13px; color: var(--sidebar-text); }
.trial-box .label { margin-bottom: 8px; }
.trial-box .label strong { color: #fff; }
.progress { height: 4px; background: rgba(255,255,255,0.12); border-radius: 4px; overflow: hidden; margin-bottom: 14px; }
.progress span { display: block; height: 100%; background: var(--blue); border-radius: 4px; }
.btn-block { width: 100%; }

/* Cards */
.card {
  background: var(--card); border-radius: var(--radius); padding: 28px; margin-bottom: 20px;
  box-shadow: 0 1px 2px rgba(20, 24, 40, 0.04);
}
.card .card-title { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.card.danger { border: 1px solid #F3C9C9; }
.page-title { margin-bottom: 22px; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 10px 16px; margin: 6px 0 4px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

/* Buttons and inputs */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 10px; border: 1px solid transparent; cursor: pointer;
  font: inherit; font-weight: 600; font-size: 14px; line-height: 1.2; transition: background .15s, border-color .15s;
  text-decoration: none !important;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--blue-dark); }
.btn-secondary { background: #F1F3F6; color: var(--text); border-color: #E3E6EB; }
.btn-secondary:hover:not(:disabled) { background: #E7EAEF; }
.btn-ghost { background: transparent; color: var(--blue); padding-left: 8px; padding-right: 8px; }
.btn-danger { background: var(--red-soft); color: var(--red); border-color: #F3C9C9; }
.btn-danger:hover:not(:disabled) { background: #FDE2E2; }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn-lg { padding: 13px 22px; font-size: 15px; }

.input, select.input {
  width: 100%; padding: 11px 14px; border: 1px solid var(--border); border-radius: 10px; font: inherit; font-size: 15px;
  background: #fff; color: var(--text); outline: none; transition: border-color .15s, box-shadow .15s;
}
.input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(59,130,246,0.18); }
select.input { width: auto; padding: 6px 30px 6px 10px; font-size: 13px; border-radius: 8px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.code-input { letter-spacing: 8px; font-size: 22px; text-align: center; font-variant-numeric: tabular-nums; }
.hint { font-size: 13px; color: var(--muted); margin-top: 8px; }
.error { color: var(--red); font-size: 13px; margin-top: 8px; }
.dev-code { margin-top: 10px; padding: 10px 12px; background: var(--blue-soft); border-radius: 10px; font-size: 13px; }
.dev-code code { font-size: 16px; font-weight: 700; letter-spacing: 3px; }

/* Tables */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: 12.5px; text-transform: uppercase; letter-spacing: .03em; }
tr:last-child td { border-bottom: none; }
td.actions { text-align: right; white-space: nowrap; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #F1F3F6; color: var(--muted); }
.pill.blue { background: var(--blue-soft); color: var(--blue-dark); }
.pill.green { background: #E8F7EC; color: var(--green); }
.pill.red { background: var(--red-soft); color: var(--red); }
.empty { padding: 20px 0 6px; color: var(--muted); text-align: center; }

/* Login */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-box { width: 100%; max-width: 420px; }
.login .card { width: 100%; padding: 36px; margin-bottom: 0; }
.login-foot { text-align: center; margin: 18px 0 0; font-size: 14px; }
.login-foot a { font-weight: 600; }
.sso { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.sso-btn {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 14px;
  border: 1px solid var(--border); border-radius: 10px; background: #fff; color: var(--text);
  font: inherit; font-weight: 600; font-size: 14.5px; cursor: pointer; transition: background .15s, border-color .15s;
}
.sso-btn:hover:not(:disabled) { background: #F6F7F9; border-color: #CDD2DA; }
.sso-btn:disabled { cursor: not-allowed; opacity: .55; }
.sso-btn .sso-icon { width: 20px; height: 20px; flex: 0 0 20px; display: inline-flex; }
.sso-btn .sso-icon svg { width: 20px; height: 20px; }
.sso-btn .sso-icon.stroke svg { stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sso-btn .label { flex: 1; text-align: center; padding-right: 32px; }
.sso-note { font-size: 12px; color: var(--muted); margin: -5px 0 0 2px; }
.sso-sep { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; margin: 2px 0; }
.sso-sep::before, .sso-sep::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.login .logo { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.login .logo img { width: 40px; height: 40px; }
.login .logo span { font-size: 20px; font-weight: 700; }

/* Plans */
.toggle-wrap { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 6px 0 26px; }
.toggle { display: inline-flex; background: #E3E6EB; border-radius: 999px; padding: 4px; }
.toggle button { border: 0; background: transparent; padding: 8px 22px; border-radius: 999px; font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; color: var(--muted); }
.toggle button.active { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.save { color: var(--blue); font-weight: 600; font-size: 14px; }
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.plan { background: #fff; border-radius: var(--radius); padding: 26px 24px; border: 2px solid transparent; display: flex; flex-direction: column; }
.plan.highlight { border-color: var(--blue); }
.plan .name { font-size: 18px; font-weight: 700; margin-bottom: 10px; }
.plan .price { font-size: 32px; font-weight: 700; letter-spacing: -0.5px; }
.plan .price small { font-size: 14px; font-weight: 500; color: var(--muted); margin-left: 4px; }
.plan .per { color: var(--muted); font-size: 13px; min-height: 20px; margin-bottom: 18px; }
.plan ul { list-style: none; padding: 0; margin: 18px 0 0; font-size: 14px; }
.plan li { padding: 6px 0 6px 24px; position: relative; }
.plan li::before { content: ""; position: absolute; left: 2px; top: 11px; width: 12px; height: 6px; border-left: 2px solid var(--blue); border-bottom: 2px solid var(--blue); transform: rotate(-45deg); }
.plan .cta { margin-top: auto; padding-top: 18px; }
.plan .quote { text-align: center; margin-top: 10px; font-size: 13px; }

/* Students */
.gh-card { text-align: center; padding: 40px 28px; }
.gh-card svg { width: 56px; height: 56px; margin-bottom: 12px; }

/* Toast */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: #1F2330; color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 14px; z-index: 50;
  box-shadow: 0 8px 24px rgba(0,0,0,.18); max-width: calc(100vw - 32px);
}
.toast.err { background: var(--red); }

/* Responsive */
@media (max-width: 960px) {
  .plans { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .kv dt { margin-top: 10px; }
}
@media (max-width: 820px) {
  .shell { flex-direction: column; }
  .sidebar { width: 100%; flex: none; height: auto; position: static; padding: 20px 16px; }
  .profile { flex-direction: row; text-align: left; margin-bottom: 14px; }
  .avatar { width: 48px; height: 48px; font-size: 20px; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .nav .divider { display: none; }
  .sidebar-bottom { padding-top: 14px; }
  .main { padding: 24px 16px 48px; }
  .card { padding: 20px; }
  table { font-size: 13px; }
  th, td { padding: 9px 6px; }
}

/* Environment badge (staging / development) next to the logo. */
.logo .env-badge, .env-badge { font-size: 11px !important; font-weight: 700; letter-spacing: .06em; padding: 2px 8px; border-radius: 999px; background: #F5A524; color: #0D0D0D; margin-left: 6px; }

