/* ──────────────────────────────────────────────
   Design Tokens — Vibrant Campus
   ────────────────────────────────────────────── */
:root {
  /* Canvas / Background */
  --bg: #F8FAFC;
  --panel: #ffffff;
  --bg-subtle: #EEF2FF;

  /* Text */
  --text: #1E293B;
  --text-muted: #475569;
  --text-subtle: #64748B;

  /* Borders */
  --border: #E2E8F0;
  --border-muted: #CBD5E1;

  /* Accent — indigo-purple */
  --accent: #4F46E5;
  --accent-hover: #4338CA;
  --accent-subtle: #EEF2FF;

  /* CTA — warm orange */
  --cta: #F97316;
  --cta-hover: #EA580C;

  /* Semantic */
  --success: #059669;
  --success-subtle: #ECFDF5;
  --danger: #DC2626;
  --danger-subtle: #FEF2F2;
  --warning: #D97706;
  --warning-subtle: #FFFBEB;

  /* Radius (softer) */
  --radius-sm: 4px;
  --radius: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 20px;

  /* Shadows */
  --shadow-resting: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-floating: 0 0 0 1px rgba(0,0,0,0.03), 0 4px 16px rgba(0,0,0,0.06);
  --shadow-overlay: 0 0 0 1px rgba(0,0,0,0.04), 0 8px 24px rgba(0,0,0,0.10);
  --shadow-card-hover: 0 4px 20px rgba(0,0,0,0.08);

  /* Typography */
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  /* Transitions */
  --transition: 0.2s ease;
}

/* ──────────────────────────────────────────────
   Reset
   ────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Ensure hidden attribute always wins over display utilities */
[hidden] {
  display: none !important;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: linear-gradient(135deg, #F5F3FF 0%, #F8FAFC 30%, #EEF2FF 60%, #F5F7FF 100%);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
}

/* Subtle decorative glow — adds life without distraction */
body::before {
  content: '';
  position: fixed;
  top: -30%;
  right: -20%;
  width: 60%;
  height: 60%;
  background: radial-gradient(ellipse, rgba(79,70,229,0.03) 0%, rgba(124,58,237,0.02) 40%, transparent 70%);
  pointer-events: none;
  z-index: -1;
}

/* ──────────────────────────────────────────────
   Container
   ────────────────────────────────────────────── */
.shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ──────────────────────────────────────────────
   Unified Navbar
   ────────────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-resting);
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  gap: 16px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  text-decoration: none;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent) 0%, #7C3AED 100%);
  flex-shrink: 0;
}

.brand-kicker {
  margin: 0 0 2px;
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-subtle);
  line-height: 1;
}

.brand-name {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
  line-height: 1.2;
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* All navbar buttons get indigo border */
.navbar-actions .btn {
  border-color: var(--accent);
}

.navbar-nav {
  display: flex;
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 0;
}

.navbar-nav a {
  display: inline-block;
  padding: 6px 12px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  border-radius: var(--radius);
  transition: background var(--transition);
}

.navbar-nav a:hover {
  background: var(--accent-subtle);
}

.navbar-nav a.active {
  color: var(--accent);
  font-weight: 600;
}

.user-chip {
  max-width: 200px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  background: var(--accent-subtle);
  font-size: 0.8125rem;
  color: var(--accent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ──────────────────────────────────────────────
   Main content
   ────────────────────────────────────────────── */
main.shell {
  padding: 36px 24px 60px;
}

/* ──────────────────────────────────────────────
   Cards
   ────────────────────────────────────────────── */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-resting);
  transition: box-shadow var(--transition), transform var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-1px);
}

/* ──────────────────────────────────────────────
   Typography
   ────────────────────────────────────────────── */
h2 {
  margin: 0 0 10px;
  font-size: 1.25rem;
  font-weight: 700;
}

h3 {
  margin: 0 0 8px;
  font-size: 1rem;
  font-weight: 600;
}

.eyebrow {
  margin: 0 0 4px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--accent);
}

.muted {
  margin: 0 0 18px;
  color: var(--text-muted);
  font-size: 1rem;
}

/* ──────────────────────────────────────────────
   Buttons — unified outline → fill on hover
   ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 20px;
  font-size: 0.9375rem;
  font-weight: 600;
  font-family: inherit;
  line-height: 20px;
  white-space: nowrap;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition);
  gap: 6px;
  background: var(--panel);
  color: var(--text);
}

.btn:active {
  transform: scale(0.97);
}

/* Primary — indigo border hint, fills on hover */
.btn-primary {
  color: var(--accent);
  border-color: var(--accent);
}
.btn-primary:hover {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

/* CTA — orange border hint, fills on hover */
.btn-cta {
  color: var(--cta);
  border-color: var(--cta);
}
.btn-cta:hover {
  background: var(--cta);
  color: #ffffff;
  border-color: var(--cta);
}

/* Default — standard gray border */
.btn-default {
  color: var(--text);
  border-color: var(--border);
}
.btn-default:hover {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

/* Ghost — no visible border until hover */
.btn-ghost {
  border-color: transparent;
  color: var(--text-muted);
}
.btn-ghost:hover {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

/* Danger — keeps red styling */
.btn-danger {
  background: var(--danger);
  color: #ffffff;
  border-color: var(--danger);
}
.btn-danger:hover {
  background: #B91C1C;
  border-color: #B91C1C;
}

.btn-small {
  padding: 5px 16px;
  font-size: 0.875rem;
  line-height: 18px;
}

.btn-row,
.footer-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
}

/* ──────────────────────────────────────────────
   Forms
   ────────────────────────────────────────────── */
.field {
  margin-bottom: 18px;
}

label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
}

input,
textarea,
select {
  font-family: var(--font-body);
  font-size: 1rem;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 9px 16px;
  background: var(--panel);
  color: var(--text);
  line-height: 22px;
  min-height: 42px;
  transition: border-color var(--transition), box-shadow var(--transition);
}

input::placeholder,
textarea::placeholder {
  color: #94A3B8;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

input[type="file"] {
  padding: 6px;
  color: var(--text-muted);
  cursor: pointer;
}

input[type="file"]::file-selector-button {
  margin-right: 12px;
  border: 0;
  border-radius: var(--radius);
  padding: 5px 14px;
  background: var(--accent-subtle);
  color: var(--accent);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

input[type="file"]::file-selector-button:hover {
  background: var(--accent);
  color: #ffffff;
}

/* ──────────────────────────────────────────────
   Status Messages
   ────────────────────────────────────────────── */
.status {
  min-height: 36px;
  padding: 8px 14px;
  margin-top: 10px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-size: 0.875rem;
  line-height: 1.5;
}

.status.success {
  background: var(--success-subtle);
  color: #065F46;
  border-color: #A7F3D0;
}

.status.error {
  background: var(--danger-subtle);
  color: #991B1B;
  border-color: #FECACA;
}

.status.info {
  background: var(--accent-subtle);
  color: #3730A3;
  border-color: #C7D2FE;
}

/* ──────────────────────────────────────────────
   Monospace Output
   ────────────────────────────────────────────── */
.output {
  min-height: 220px;
  max-height: 360px;
  overflow: auto;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--panel);
  padding: 14px;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ──────────────────────────────────────────────
   Grid
   ────────────────────────────────────────────── */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

/* ──────────────────────────────────────────────
   Responsive
   ────────────────────────────────────────────── */
@media (max-width: 1012px) {
  .navbar-inner {
    flex-wrap: wrap;
    min-height: auto;
    padding: 12px 0;
  }

  .navbar-actions {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 768px) {
  .shell {
    padding: 0 16px;
  }

  main.shell {
    padding: 28px 16px 44px;
  }

  .two-col {
    grid-template-columns: 1fr;
  }

  .card {
    padding: 20px;
  }

  .navbar-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .navbar-actions {
    width: 100%;
  }
}
