/* ============================================================
   NEXUS ADMIN — admin.css
   Global Leadership Foundation brand styles
   Colours: Yellow #FFF100 | Dark grey #4D4D4D | Mid grey #888888
   Typography: Helvetica Neue (Light, Regular, Medium)
   ============================================================ */

/* ------------------------------------------------------------
   RESET & BASE
   ------------------------------------------------------------ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; -webkit-font-smoothing: antialiased; }

body {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-weight: 400;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: #4D4D4D;
  background: #F5F5F3;
  min-height: 100vh;
}

a { color: #4D4D4D; text-decoration: none; }
a:hover { color: #000; }

img { max-width: 100%; display: block; }

/* ------------------------------------------------------------
   LAYOUT — SIDEBAR + MAIN
   ------------------------------------------------------------ */

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

/* Sidebar */
.nexus-sidebar {
  width: 240px;
  flex-shrink: 0;
  background: #4D4D4D;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  overflow-y: auto;
  z-index: 100;
}

.nexus-sidebar__logo {
  padding: 1.75rem 1.5rem 1.25rem;
  background: #FFF100;
  border-bottom: 3px solid #e6d800;
}

.nexus-sidebar__logo img {
  width: 140px;
  display: block;
}

.nexus-sidebar__program {
  padding: 0.875rem 1.5rem;
  background: #3d3d3d;
  border-bottom: 1px solid #5a5a5a;
}

.nexus-sidebar__program-label {
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #FFF100;
  margin-bottom: 0.2rem;
}

.nexus-sidebar__program-name {
  font-size: 0.875rem;
  color: #fff;
  font-weight: 400;
  line-height: 1.3;
}

/* Nav */
.nexus-nav {
  padding: 1rem 0;
  flex: 1;
}

.nexus-nav__section {
  margin-bottom: 0.25rem;
}

.nexus-nav__label {
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #888;
  padding: 0.875rem 1.5rem 0.375rem;
}

.nexus-nav__item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5625rem 1.5rem;
  font-size: 0.875rem;
  color: #ccc;
  transition: background 0.15s, color 0.15s;
  border-left: 3px solid transparent;
}

.nexus-nav__item:hover {
  background: rgba(255,255,255,0.06);
  color: #fff;
}

.nexus-nav__item.is-active {
  background: rgba(255,241,0,0.08);
  color: #FFF100;
  border-left-color: #FFF100;
}

.nexus-nav__item svg {
  width: 16px; height: 16px;
  flex-shrink: 0;
  opacity: 0.7;
}

/* Coloured emoji nav icons (twlsp-style) */
.nexus-nav__emoji {
  width: 18px;
  flex-shrink: 0;
  text-align: center;
  font-size: 0.9375rem;
  line-height: 1;
}

.nexus-nav__item.is-active svg,
.nexus-nav__item:hover svg { opacity: 1; }

/* Sidebar footer */
.nexus-sidebar__footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid #5a5a5a;
  font-size: 0.75rem;
  color: #777;
}

.nexus-sidebar__footer a {
  color: #999;
  font-size: 0.75rem;
}
.nexus-sidebar__footer a:hover { color: #ccc; }

/* Main content area */
.nexus-main {
  margin-left: 240px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Top bar */
.nexus-topbar {
  background: #fff;
  border-bottom: 1px solid #E8E8E6;
  padding: 0 2rem;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.nexus-topbar__title {
  font-size: 0.9375rem;
  font-weight: 500;
  color: #4D4D4D;
}

.nexus-topbar__actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nexus-topbar__user {
  font-size: 0.8125rem;
  color: #888;
}

/* Page content */
.nexus-content {
  padding: 2rem;
  flex: 1;
}

.nexus-page-header {
  margin-bottom: 1.75rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.nexus-page-header__left h1 {
  font-size: 1.5rem;
  font-weight: 300;
  color: #4D4D4D;
  line-height: 1.2;
  margin-bottom: 0.25rem;
}

.nexus-page-header__left p {
  font-size: 0.875rem;
  color: #888;
}

/* Yellow accent bar under page title */
.nexus-page-header__left h1::after {
  content: '';
  display: block;
  width: 32px;
  height: 3px;
  background: #FFF100;
  margin-top: 0.5rem;
}

/* ------------------------------------------------------------
   CARDS
   ------------------------------------------------------------ */

.nexus-card {
  background: #fff;
  border: 1px solid #E8E8E6;
  border-radius: 6px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.nexus-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.875rem;
  border-bottom: 1px solid #F0F0EE;
}

.nexus-card__title {
  font-size: 0.9375rem;
  font-weight: 500;
  color: #4D4D4D;
}

/* ------------------------------------------------------------
   PROGRAM GRID — dashboard cards
   ------------------------------------------------------------ */

.nexus-program-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.nexus-program-card {
  background: #fff;
  border: 1px solid #E8E8E6;
  border-radius: 6px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s, box-shadow 0.15s;
  position: relative;
}

.nexus-program-card:hover {
  border-color: #D0D0CE;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.nexus-program-card__status {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
}

.nexus-program-card__name {
  font-size: 1.0625rem;
  font-weight: 500;
  color: #4D4D4D;
  margin-bottom: 0.25rem;
  padding-right: 3rem;
  line-height: 1.3;
}

.nexus-program-card__slug {
  font-size: 0.75rem;
  color: #aaa;
  font-family: 'Courier New', monospace;
  margin-bottom: 1rem;
}

.nexus-program-card__meta {
  font-size: 0.8125rem;
  color: #888;
  margin-bottom: 1rem;
  flex: 1;
}

.nexus-program-card__meta p { margin-bottom: 0.2rem; }

.nexus-program-card__footer {
  display: flex;
  gap: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid #F0F0EE;
}

/* Yellow accent on left edge of active program cards */
.nexus-program-card--active {
  border-left: 3px solid #FFF100;
}

/* ------------------------------------------------------------
   TABLES
   ------------------------------------------------------------ */

.nexus-table-wrap {
  overflow-x: auto;
}

.nexus-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.nexus-table th {
  text-align: left;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #888;
  padding: 0.625rem 1rem;
  background: #FAFAF8;
  border-bottom: 2px solid #E8E8E6;
  white-space: nowrap;
}

.nexus-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #F0F0EE;
  color: #4D4D4D;
  vertical-align: middle;
}

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

.nexus-table tr:hover td { background: #FAFAF8; }

.nexus-table__empty {
  text-align: center;
  color: #aaa;
  padding: 3rem 1rem;
  font-size: 0.875rem;
}

/* ------------------------------------------------------------
   FORMS
   ------------------------------------------------------------ */

.nexus-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem 1.5rem;
}

.nexus-form-grid--wide { grid-template-columns: 1fr; }
.nexus-form-grid--3 { grid-template-columns: 1fr 1fr 1fr; }

.nexus-field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.nexus-field--full { grid-column: 1 / -1; }

.nexus-field label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: #4D4D4D;
}

.nexus-field label .nexus-required {
  color: #c0392b;
  margin-left: 2px;
}

.nexus-field input[type="text"],
.nexus-field input[type="email"],
.nexus-field input[type="tel"],
.nexus-field input[type="url"],
.nexus-field input[type="date"],
.nexus-field input[type="number"],
.nexus-field input[type="password"],
.nexus-field select,
.nexus-field textarea {
  width: 100%;
  padding: 0.5625rem 0.75rem;
  border: 1px solid #D8D8D6;
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.9375rem;
  color: #4D4D4D;
  background: #fff;
  transition: border-color 0.15s;
  appearance: none;
  -webkit-appearance: none;
}

.nexus-field input:focus,
.nexus-field select:focus,
.nexus-field textarea:focus {
  outline: none;
  border-color: #4D4D4D;
  box-shadow: 0 0 0 2px rgba(77,77,77,0.08);
}

.nexus-field textarea {
  min-height: 100px;
  resize: vertical;
  line-height: 1.5;
}

.nexus-field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23888'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;
}

.nexus-field__hint {
  font-size: 0.75rem;
  color: #999;
}

.nexus-field__error {
  font-size: 0.75rem;
  color: #c0392b;
}

/* Module toggles */
.nexus-modules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
}

.nexus-module-toggle {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border: 1px solid #E8E8E6;
  border-radius: 4px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  background: #FAFAF8;
}

.nexus-module-toggle:hover { border-color: #D0D0CE; background: #fff; }

.nexus-module-toggle input[type="checkbox"] {
  margin-top: 2px;
  width: 15px;
  height: 15px;
  accent-color: #4D4D4D;
  flex-shrink: 0;
  cursor: pointer;
}

.nexus-module-toggle__label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: #4D4D4D;
  line-height: 1.3;
}

.nexus-module-toggle__desc {
  font-size: 0.75rem;
  color: #999;
  margin-top: 0.15rem;
}

/* Form section heading */
.nexus-form-section {
  margin: 1.75rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #F0F0EE;
  font-size: 0.875rem;
  font-weight: 500;
  color: #4D4D4D;
}

.nexus-form-section:first-child { margin-top: 0; }

/* ------------------------------------------------------------
   BUTTONS
   ------------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1.125rem;
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
  text-decoration: none;
  line-height: 1.4;
}

/* Primary — yellow */
.btn-primary {
  background: #FFF100;
  color: #4D4D4D;
  border-color: #FFF100;
}
.btn-primary:hover {
  background: #ffe800;
  border-color: #ffe800;
  color: #4D4D4D;
}

/* Secondary — dark grey outline */
.btn-secondary {
  background: transparent;
  color: #4D4D4D;
  border-color: #C8C8C6;
}
.btn-secondary:hover {
  background: #F5F5F3;
  border-color: #4D4D4D;
  color: #4D4D4D;
}

/* Dark — filled grey */
.btn-dark {
  background: #4D4D4D;
  color: #fff;
  border-color: #4D4D4D;
}
.btn-dark:hover {
  background: #3a3a3a;
  border-color: #3a3a3a;
  color: #fff;
}

/* Danger */
.btn-danger {
  background: transparent;
  color: #c0392b;
  border-color: #e8b4b0;
}
.btn-danger:hover {
  background: #fdf2f1;
  border-color: #c0392b;
}

/* Small */
.btn-sm {
  padding: 0.3125rem 0.75rem;
  font-size: 0.8125rem;
}

/* ------------------------------------------------------------
   STATUS BADGES
   ------------------------------------------------------------ */

.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 3px;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge-active    { background: #e8f5e9; color: #2e7d32; }
.badge-draft     { background: #FFF9CC; color: #7a6800; }
.badge-complete  { background: #e8eaf6; color: #3949ab; }
.badge-archived  { background: #F5F5F3; color: #999; }
.badge-invited   { background: #e3f2fd; color: #1565c0; }
.badge-accepted  { background: #e8f5e9; color: #2e7d32; }
.badge-withdrawn { background: #fce4ec; color: #c62828; }
.badge-pending   { background: #FFF9CC; color: #7a6800; }
.badge-sent      { background: #e3f2fd; color: #1565c0; }
.badge-applied   { background: #FFF9CC; color: #7a6800; }
.badge-declined  { background: #fce4ec; color: #c62828; }
.badge-paused    { background: #F5F5F3; color: #777; }
.badge-failed    { background: #fce4ec; color: #c62828; }
.badge-coach     { background: #FFF3E5; color: #B05C00; }
.badge-sponsor   { background: #E0F2F1; color: #00695C; }
.badge-disengaged{ background: #fce4ec; color: #c62828; }

/* ------------------------------------------------------------
   FLASH MESSAGES
   ------------------------------------------------------------ */

.nexus-flash {
  padding: 0.875rem 1.25rem;
  border-radius: 4px;
  margin-bottom: 1.25rem;
  font-size: 0.875rem;
  border-left: 3px solid transparent;
}

.nexus-flash--success {
  background: #e8f5e9;
  color: #2e7d32;
  border-left-color: #4caf50;
}

.nexus-flash--error {
  background: #fce4ec;
  color: #c62828;
  border-left-color: #e53935;
}

.nexus-flash--warning {
  background: #FFF9CC;
  color: #7a6800;
  border-left-color: #FFF100;
}

.nexus-flash--info {
  background: #e3f2fd;
  color: #1565c0;
  border-left-color: #1976d2;
}

/* ------------------------------------------------------------
   LOGIN PAGE
   ------------------------------------------------------------ */

.nexus-login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #717171;
  padding: 2rem;
}

.nexus-login-box {
  background: #fff;
  width: 100%;
  max-width: 400px;
  border-radius: 6px;
  overflow: visible;
}

.nexus-login-box__header {
  background: #717171;
  padding: 0 2rem 0.5rem 0.125rem;
  border-bottom: 4px solid #FFF100;
  border-radius: 6px 6px 0 0;
}

.nexus-login-box__header img {
  width: 240px;
  margin-bottom: 0.125rem;
  margin-left: -1.75rem;
  display: block;
}

.nexus-login-box__header p {
  font-size: 0.8125rem;
  color: #aaa;
  margin: 0;
}

.nexus-login-box__body {
  padding: 0.5rem 2rem;
}

.nexus-login-box__body .nexus-field { margin-bottom: 1rem; }

.nexus-login-box__body .btn {
  width: 100%;
  justify-content: center;
  padding: 0.6875rem 1rem;
  font-size: 0.9375rem;
  margin-top: 0.5rem;
}

/* ------------------------------------------------------------
   STAT TILES — dashboard summary row
   ------------------------------------------------------------ */

.nexus-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.nexus-stat {
  background: #fff;
  border: 1px solid #E8E8E6;
  border-radius: 6px;
  padding: 1.25rem 1.5rem;
}

.nexus-stat__value {
  font-size: 2rem;
  font-weight: 300;
  color: #4D4D4D;
  line-height: 1;
  margin-bottom: 0.25rem;
}

.nexus-stat__label {
  font-size: 0.75rem;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.nexus-stat--accent { border-top: 3px solid #FFF100; }

/* ------------------------------------------------------------
   UTILITIES
   ------------------------------------------------------------ */

.text-muted   { color: #888; }
.text-small   { font-size: 0.8125rem; }
.text-mono    { font-family: 'Courier New', monospace; font-size: 0.8125rem; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.justify-between { justify-content: space-between; }

/* ------------------------------------------------------------
   MODULE CHIPS — program card indicators
   ------------------------------------------------------------ */

.nexus-module-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-bottom: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid #F0F0EE;
}

.nexus-module-chip {
  display: inline-block;
  padding: 0.1875rem 0.5rem;
  background: #F5F5F3;
  border: 1px solid #E8E8E6;
  border-radius: 3px;
  font-size: 0.6875rem;
  color: #666;
  white-space: nowrap;
}

/* Accent chips for key modules */
.nexus-module-chip--portal {
  background: #FFF9CC;
  border-color: #FFF100;
  color: #7a6800;
}

.nexus-module-chip--eval {
  background: #e8eaf6;
  border-color: #c5cae9;
  color: #3949ab;
}
