/* Global Campus — navy / gold design system */

:root {
  --navy: #152238;
  --navy-soft: #1c2d4a;
  --gold: #b08d3e;
  --gold-soft: #f3e7c8;
  --gold-dark: #8a6a1f;
  --cream: #f6f5f0;
  --cream-card: #faf9f4;
  --border: #e7e4da;
  --border-soft: #efede4;
  --muted: #4f4e48;
  --muted-2: #5c5b54;
  --ink: #12110f;
  --white: #ffffff;
  --radius: 12px;
  --radius-sm: 8px;
}

html {
  scroll-behavior: smooth;
}

body {
  letter-spacing: 0.01em;
  background: var(--cream);
  color: var(--ink);
  font-family: "Plus Jakarta Sans", "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.45;
  font-weight: 500;
  -webkit-font-smoothing: antialiased;
}

input,
select,
textarea,
button {
  font: inherit;
}

/* ---- Shell ---- */

.app-shell {
  min-height: 100vh;
  display: flex;
}

.app-sidebar {
  width: 236px;
  flex-shrink: 0;
  background: var(--navy);
  color: #edeae0;
  display: flex;
  flex-direction: column;
  padding: 0;
}

.app-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 22px 16px 18px;
}

.app-logo {
  display: block;
  height: 48px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  object-position: left center;
}

.app-brand-title {
  font-family: Outfit, "Plus Jakarta Sans", sans-serif;
  font-weight: 700;
  font-size: 16.5px;
  line-height: 1.1;
  color: #fff;
}

.app-brand-sub {
  font-size: 12px;
  color: #c7cbd6;
  letter-spacing: 0.06em;
  font-weight: 600;
  text-transform: uppercase;
  margin-top: 0;
  padding-left: 2px;
}

.app-nav {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 12px;
  flex: 1;
}

.app-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-left: 3px solid transparent;
  border-radius: 6px;
  color: #e8ebf2;
  font-size: 14.5px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.app-nav a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.app-nav a.active {
  background: rgba(176, 141, 62, 0.16);
  border-left-color: var(--gold);
  color: #fff;
  font-weight: 700;
}

.app-nav .nav-badge {
  margin-left: auto;
  background: var(--gold);
  color: var(--navy);
  font-size: 11px;
  font-weight: 700;
  border-radius: 20px;
  padding: 1px 7px;
}

.app-sidebar-foot {
  padding: 16px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 11.5px;
  color: #8891a3;
  line-height: 1.5;
}

.app-sidebar-foot .btn-signout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 10px;
  padding: 7px 12px;
  background: rgba(255, 255, 255, 0.08);
  color: #f3e7c8;
  border: 1px solid rgba(176, 141, 62, 0.45);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}

.app-sidebar-foot .btn-signout:hover {
  background: rgba(176, 141, 62, 0.2);
  border-color: var(--gold);
  color: #fff;
}

.app-main {
  flex: 1;
  padding: 20px 20px 24px;
  min-width: 0;
  width: 100%;
}

.page-title {
  font-family: Outfit, "Plus Jakarta Sans", sans-serif;
  font-size: 30px;
  color: var(--navy);
  margin: 0 0 6px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.page-sub {
  color: var(--muted);
  font-size: 15px;
  font-weight: 500;
  margin: 0 0 22px;
  line-height: 1.45;
}

/* ---- Cards / stats ---- */

.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}

.stat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.stat-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stat-card-label {
  font-size: 12.5px;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 700;
}

.stat-card-value {
  font-family: Outfit, "Plus Jakarta Sans", sans-serif;
  font-size: 30px;
  color: var(--navy);
  font-weight: 700;
  line-height: 1.1;
}

.stat-card-sub {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}

.stat-icon {
  color: var(--gold);
  width: 16px;
  height: 16px;
}

/* ---- Forms ---- */

.field {
  width: 100%;
  background: #fff;
  border: 1px solid #dad7cb;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--ink);
  font-size: 14.5px;
  font-weight: 500;
  box-sizing: border-box;
}

.field:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(176, 141, 62, 0.15);
}

.field-sm {
  padding: 6px 8px;
  font-size: 13.5px;
  font-weight: 500;
  border-radius: 6px;
  border: 1px solid #dad7cb;
  background: #fff;
  color: var(--ink);
}

.label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 5px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  background: var(--navy);
  color: var(--gold-soft);
  font-size: 14px;
  font-weight: 700;
  border: 1px solid var(--navy);
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
  line-height: 1.2;
  box-sizing: border-box;
}

.btn:hover {
  background: var(--navy-soft);
  border-color: var(--navy-soft);
  color: var(--gold-soft);
}

.btn-gold {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 13px;
  background: #fbf6ea;
  color: var(--gold-dark);
  border: 1px solid var(--gold);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.2;
  box-sizing: border-box;
  transition: background 0.15s, border-color 0.15s;
}

.btn-gold:hover {
  background: #f4ebd6;
  color: var(--gold-dark);
}

.btn-ghost,
.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 13px;
  background: #fff;
  color: var(--navy);
  border: 1px solid #dad7cb;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.2;
  box-sizing: border-box;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.btn-ghost:hover,
.btn-outline:hover {
  background: var(--cream-card);
  border-color: var(--gold);
  color: var(--navy);
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
}

.sort-link {
  color: inherit;
  text-decoration: none;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
}

.sort-link:hover {
  color: var(--navy);
}

.search-wrap {
  position: relative;
  max-width: 320px;
}

.search-wrap svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #9c9a8f;
  pointer-events: none;
}

.search-wrap .field {
  padding-left: 34px;
}

/* ---- Tables ---- */

.table-wrap {
  overflow-x: auto;
  width: 100%;
}

table.data {
  width: 100%;
  min-width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
  table-layout: auto;
  color: var(--ink);
}

table.data thead tr {
  background: var(--cream-card);
}

table.data th {
  text-align: left;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--navy);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

table.data td {
  padding: 14px 16px;
  vertical-align: middle;
  border-bottom: 1px solid #f3f1e9;
  font-weight: 500;
  color: var(--ink);
}

table.data td strong,
table.data td [style*="font-weight:600"],
table.data td div[style*="font-weight:600"] {
  font-weight: 700;
  color: var(--navy);
}

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

table.data td .btn,
table.data td .btn-ghost,
table.data td .btn-outline,
table.data td .btn-gold {
  margin-left: 6px;
}

table.data td .btn:first-child,
table.data td .btn-ghost:first-child,
table.data td .btn-outline:first-child,
table.data td .btn-gold:first-child {
  margin-left: 0;
}

/* ---- Pills ---- */

.pill {
  display: inline-flex;
  align-items: center;
  font-size: 12.5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: 700;
  white-space: nowrap;
}

.pill-enrolled,
.pill-active {
  background: #eaf1fb;
  color: #1d4e89;
}

.pill-completed,
.pill-graduated,
.pill-paid {
  background: #e8f3ea;
  color: #2a6b41;
}

.pill-withdrawn,
.pill-cancelled,
.pill-closed {
  background: #fbeaea;
  color: #a03a3a;
}

.pill-pending,
.pill-new,
.pill-contacted {
  background: #fdf1dc;
  color: #b4790f;
}

.pill-commission-paid {
  background: #f4ebd6;
  color: #8a6a1f;
}

.pill-commission-pending {
  background: #fdf1dc;
  color: #b4790f;
}

.pill-commission-approved {
  background: #eaf1fb;
  color: #1d4e89;
}

.pill-muted {
  background: #f1efe8;
  color: #6b6a63;
}

/* ---- Progress ---- */

.fee-bar {
  background: #efede4;
  border-radius: 20px;
  height: 5px;
  overflow: hidden;
  margin-top: 4px;
}

.fee-bar > span {
  display: block;
  height: 100%;
  background: var(--gold);
}

/* ---- Course cards ---- */

.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.course-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.course-level {
  font-size: 11px;
  color: var(--gold);
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.course-title {
  font-weight: 700;
  font-size: 15px;
  color: var(--navy);
}

.course-uni {
  font-size: 12.5px;
  color: var(--muted);
}

.course-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--muted-2);
  border-top: 1px solid #f0eee5;
  padding-top: 10px;
}

.course-rate {
  font-size: 12.5px;
  color: var(--gold-dark);
  font-weight: 600;
}

/* ---- Funnel ---- */

.funnel-card {
  margin-top: 28px;
  padding: 20px 22px;
}

.funnel-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  font-weight: 700;
  font-size: 15px;
  color: var(--navy);
}

.funnel {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  min-height: 160px;
}

.funnel-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.funnel-value {
  font-size: 16px;
  font-weight: 800;
  color: var(--navy);
  line-height: 1;
}

.funnel-bar {
  width: min(72px, 70%);
  height: calc(var(--funnel-pct) * 1.2px);
  max-height: 120px;
  min-height: 8px;
  border-radius: 6px;
  background: #dce3ee;
}

.funnel-bar.last {
  background: var(--gold);
}

.funnel-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
  line-height: 1.25;
  max-width: 100%;
}

/* ---- Modal ---- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(21, 34, 56, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 40;
  padding: 20px;
}

.modal-backdrop[hidden] {
  display: none !important;
}

.modal {
  background: #fff;
  border-radius: 14px;
  width: 560px;
  max-width: 100%;
  max-height: 84vh;
  overflow-y: auto;
  padding: 24px;
}

.modal-lg {
  width: 640px;
}

.modal-title {
  font-family: Outfit, "Plus Jakarta Sans", sans-serif;
  font-weight: 700;
  font-size: 22px;
  color: var(--navy);
  margin: 0;
  letter-spacing: -0.01em;
}

.modal-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 8px;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-top: 1px solid var(--border-soft);
}

.pagination-meta {
  font-size: 13.5px;
  color: var(--muted);
  font-weight: 600;
}

.pagination-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.pagination-current {
  pointer-events: none;
}

.btn-outline.is-disabled,
.btn-sm.is-disabled {
  opacity: 0.45;
  pointer-events: none;
  cursor: default;
}

.flash {
  margin-bottom: 20px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
}

.flash-success {
  background: #e8f3ea;
  color: #2a6b41;
}

.flash-error {
  background: #fbeaea;
  color: #a03a3a;
}

.section-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 8px;
  letter-spacing: 0.02em;
}

.divider {
  border-top: 1px solid var(--border-soft);
  padding-top: 14px;
  margin-top: 2px;
}

.note-item {
  font-size: 12.5px;
  background: var(--cream-card);
  border-radius: 8px;
  padding: 8px 10px;
}

@media (max-width: 900px) {
  .app-shell {
    flex-direction: column;
  }

  .app-sidebar {
    width: 100%;
  }

  .app-main {
    padding: 16px 12px 20px;
  }

  .app-nav {
    flex-direction: row;
    flex-wrap: wrap;
    padding-bottom: 12px;
  }

  .app-nav a {
    border-left: none;
    border-bottom: 2px solid transparent;
  }

  .app-nav a.active {
    border-left: none;
    border-bottom-color: var(--gold);
  }

  .app-sidebar-foot {
    display: none;
  }

  .funnel-card {
    padding: 16px;
  }

  .funnel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
    gap: 14px;
    min-height: 0;
  }

  .funnel-col {
    background: var(--cream-card);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    padding: 14px 12px;
    justify-content: flex-start;
  }

  .funnel-bar {
    width: 100%;
    height: 10px;
    max-height: none;
    min-height: 10px;
    border-radius: 999px;
    background: #efede4;
    position: relative;
    overflow: hidden;
  }

  .funnel-bar::after {
    content: "";
    display: block;
    height: 100%;
    width: calc(var(--funnel-pct) * 1%);
    border-radius: inherit;
    background: #dce3ee;
  }

  .funnel-bar.last::after {
    background: var(--gold);
  }

  .funnel-bar.last {
    background: #efede4;
  }

  .funnel-label {
    order: -1;
    text-align: left;
    width: 100%;
  }

  .funnel-value {
    order: -1;
    align-self: flex-start;
    margin-bottom: 2px;
  }
}

@media (max-width: 520px) {
  .funnel {
    grid-template-columns: 1fr;
  }

  .stat-grid {
    grid-template-columns: 1fr;
  }
}
