/* ──────────────────────────────────────────────────────────────
   CFM MDM — Custom CSS
   Apple-inspired, Bootstrap 5 based
────────────────────────────────────────────────────────────── */

:root {
  --cfm-sidebar-width: 230px;
  --cfm-sidebar-bg: #1d1d1f;
  --cfm-sidebar-text: #e5e5e7;
  --cfm-sidebar-muted: #6e6e73;
  --cfm-sidebar-active: #0071e3;
  --cfm-topbar-height: 56px;
  --cfm-bg: #f5f5f7;
  --cfm-card-radius: 12px;
  --cfm-primary: #0071e3;
  --cfm-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ── Base ────────────────────────────────────────────────── */
body {
  font-family: var(--cfm-font);
  background: var(--cfm-bg);
  color: #1d1d1f;
}

.fw-mono { font-family: "SF Mono", "Fira Code", "Menlo", monospace; }

/* ── Layout ──────────────────────────────────────────────── */
.app-wrapper {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar {
  width: var(--cfm-sidebar-width);
  background: var(--cfm-sidebar-bg);
  color: var(--cfm-sidebar-text);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 1000;
  overflow-y: auto;
  transition: transform 0.25s ease;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 16px 16px;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 8px;
}

.sidebar-brand i {
  font-size: 1.4rem;
  color: var(--cfm-primary);
}

.sidebar-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cfm-sidebar-muted);
  padding: 12px 16px 4px;
}

.sidebar-nav {
  list-style: none;
  margin: 0;
  padding: 0 8px;
}

.sidebar-nav li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--cfm-sidebar-text);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}

.sidebar-nav li a:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
}

.sidebar-nav li a.active {
  background: var(--cfm-primary);
  color: #fff;
}

.sidebar-nav li a i {
  font-size: 1rem;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-footer {
  margin-top: auto;
  padding: 12px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 4px 8px;
  color: var(--cfm-sidebar-text);
  font-size: 0.8125rem;
}

/* ── Main content ────────────────────────────────────────── */
.main-content {
  margin-left: var(--cfm-sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
}

/* ── Top bar ─────────────────────────────────────────────── */
.topbar {
  height: var(--cfm-topbar-height);
  background: rgba(245,245,247,0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #d2d2d7;
  display: flex;
  align-items: center;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.01em;
}

/* ── Flash zone ──────────────────────────────────────────── */
.flash-zone {
  padding: 12px 24px 0;
}

/* ── Page content ────────────────────────────────────────── */
.page-content {
  padding: 20px 24px 32px;
  flex: 1;
}

/* ── Cards ───────────────────────────────────────────────── */
.card {
  border: 1px solid #d2d2d7;
  border-radius: var(--cfm-card-radius);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.card-header {
  background: #fff;
  border-bottom: 1px solid #e5e5ea;
  border-radius: var(--cfm-card-radius) var(--cfm-card-radius) 0 0 !important;
  padding: 12px 16px;
  font-size: 0.875rem;
}

.card-footer {
  background: #fafafa;
  border-top: 1px solid #e5e5ea;
  padding: 8px 16px;
}

.card-hover {
  transition: box-shadow 0.15s, transform 0.15s;
  cursor: pointer;
}

.card-hover:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  transform: translateY(-1px);
}

/* ── Stat cards ──────────────────────────────────────────── */
.stat-card {
  background: #fff;
  border: 1px solid #d2d2d7;
  border-radius: var(--cfm-card-radius);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
}

.stat-label {
  font-size: 0.75rem;
  color: #6e6e73;
  margin-top: 2px;
}

/* ── Soft color helpers ──────────────────────────────────── */
.bg-primary-soft   { background: #e8f0fd; }
.bg-success-soft   { background: #e8f8ed; }
.bg-warning-soft   { background: #fff5e6; }
.bg-danger-soft    { background: #fde8e8; }
.bg-secondary-soft { background: #f0f0f5; }
.bg-info-soft      { background: #e6f5fb; }

/* Bootstrap subtle badge overrides */
.bg-secondary-subtle { background: #f0f0f5 !important; }
.text-secondary      { color: #6e6e73 !important; }

/* Purple — used for Transferred to Student status */
.bg-purple-soft      { background: #f0ebff; }
.text-purple         { color: #6e3bde; }
.bg-purple-subtle    { background: #f0ebff !important; }
.border-purple-subtle { border-color: #c8b5f5 !important; }

/* ── Pipeline ────────────────────────────────────────────── */
.pipeline-track {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 0;
}

.pipeline-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 80px;
}

.pipeline-bubble {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s;
}

.pipeline-bubble:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.pipeline-count {
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1;
}

.pipeline-label {
  font-size: 0.7rem;
  color: #6e6e73;
  text-align: center;
  font-weight: 500;
}

.pipeline-arrow {
  flex-shrink: 0;
  color: #d2d2d7;
}

/* ── Coverage ring ───────────────────────────────────────── */
.coverage-ring {
  position: relative;
  display: inline-block;
}

.coverage-pct {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* ── Avatar circles ──────────────────────────────────────── */
.avatar-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
}

.avatar-circle-lg {
  width: 72px;
  height: 72px;
  font-size: 1.4rem;
}

/* ── Tables ──────────────────────────────────────────────── */
.table { margin-bottom: 0; }
.table th { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: #6e6e73; }
.table td { font-size: 0.875rem; }
.table-hover tbody tr:hover { background: #f5f5f7; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn { border-radius: 8px; font-size: 0.875rem; font-weight: 500; }
.btn-primary { background: var(--cfm-primary); border-color: var(--cfm-primary); }
.btn-primary:hover { background: #0077ed; border-color: #0077ed; }

/* ── Forms ───────────────────────────────────────────────── */
.form-control, .form-select {
  border-radius: 8px;
  border-color: #d2d2d7;
  font-size: 0.875rem;
}

.form-control:focus, .form-select:focus {
  border-color: var(--cfm-primary);
  box-shadow: 0 0 0 3px rgba(0,113,227,0.15);
}

/* ── Login page ──────────────────────────────────────────── */
.login-body {
  background: var(--cfm-bg);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  background: #fff;
  border: 1px solid #d2d2d7;
  border-radius: 18px;
  padding: 40px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.1);
}

.login-logo {
  text-align: center;
  font-size: 2.5rem;
  color: var(--cfm-primary);
  margin-bottom: 12px;
}

.login-title {
  text-align: center;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.login-subtitle {
  text-align: center;
  color: #6e6e73;
  font-size: 0.875rem;
  margin-bottom: 24px;
}

.login-footer {
  text-align: center;
  color: #6e6e73;
  font-size: 0.75rem;
  margin-top: 20px;
  margin-bottom: 0;
}

/* ── Mobile sidebar ──────────────────────────────────────── */
.sidebar-toggle { background: transparent; border: 1px solid #d2d2d7; }

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 999;
}

@media (max-width: 991.98px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay.show {
    display: block;
  }

  .main-content {
    margin-left: 0;
  }
}
