/* ── REBOOT DESIGN SYSTEM ─────────────────────────────── */
:root {
  --blue-dark: #1B4F8A;
  --blue-mid: #2E75B6;
  --blue-light: #D6E4F0;
  --blue-pale: #EEF5FB;
  --green: #27AE60;
  --green-light: #D5F5E3;
  --orange: #E67E22;
  --orange-light: #FDEBD0;
  --red: #E74C3C;
  --gray-dark: #2C3E50;
  --gray-mid: #7F8C8D;
  --gray-light: #ECF0F1;
  --white: #FFFFFF;
  --shadow: 0 2px 12px rgba(27,79,138,0.10);
  --radius: 10px;
  --font: 'Segoe UI', Arial, sans-serif;
}

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

body {
  font-family: var(--font);
  background: var(--gray-light);
  color: var(--gray-dark);
  min-height: 100vh;
}

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

.sidebar {
  width: 260px;
  background: var(--blue-dark);
  color: white;
  display: flex;
  flex-direction: column;
  padding: 0;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-logo {
  padding: 28px 24px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-logo h1 {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 2px;
  color: white;
}

.sidebar-logo p {
  font-size: 11px;
  color: rgba(255,255,255,0.55);
  margin-top: 3px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.sidebar-user {
  padding: 16px 24px;
  background: rgba(255,255,255,0.07);
  margin: 16px 12px;
  border-radius: var(--radius);
}

.sidebar-user .role-badge {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255,255,255,0.5);
}

.sidebar-user .user-name {
  font-size: 15px;
  font-weight: 600;
  color: white;
  margin-top: 2px;
}

.sidebar nav { flex: 1; padding: 8px 12px; }

.nav-section-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: rgba(255,255,255,0.35);
  padding: 16px 12px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  color: rgba(255,255,255,0.75);
  transition: all 0.15s;
  text-decoration: none;
  margin-bottom: 2px;
}

.nav-item:hover { background: rgba(255,255,255,0.1); color: white; }
.nav-item.active { background: var(--blue-mid); color: white; font-weight: 600; }

.nav-item .icon { font-size: 16px; width: 20px; text-align: center; }

.nav-item .progress-dot {
  margin-left: auto;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
}

.nav-item .progress-dot.done { background: var(--green); }
.nav-item .progress-dot.partial { background: var(--orange); }

.sidebar-footer {
  padding: 16px 24px;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.btn-logout {
  width: 100%;
  padding: 9px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px;
  color: rgba(255,255,255,0.6);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-logout:hover { background: rgba(255,255,255,0.1); color: white; }

.main-content {
  margin-left: 260px;
  flex: 1;
  padding: 32px 36px;
  max-width: calc(100vw - 260px);
}

/* ── TOP BAR ──────────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

.topbar h2 { font-size: 24px; font-weight: 700; color: var(--blue-dark); }
.topbar p { font-size: 14px; color: var(--gray-mid); margin-top: 3px; }

/* ── CARDS ────────────────────────────────────────────── */
.card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 20px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--blue-dark);
}

/* ── STAT GRID ────────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: white;
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  text-align: center;
}

.stat-card .stat-value {
  font-size: 36px;
  font-weight: 800;
  color: var(--blue-mid);
  line-height: 1;
}

.stat-card .stat-label {
  font-size: 12px;
  color: var(--gray-mid);
  margin-top: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ── PROGRESS BAR ─────────────────────────────────────── */
.progress-bar-wrap {
  background: var(--gray-light);
  border-radius: 20px;
  height: 10px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 20px;
  background: linear-gradient(90deg, var(--blue-mid), var(--blue-dark));
  transition: width 0.4s ease;
}

.progress-bar-fill.green { background: linear-gradient(90deg, #2ecc71, #27ae60); }

/* ── MODULES ──────────────────────────────────────────── */
.module-list { display: flex; flex-direction: column; gap: 12px; }

.module-card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 22px;
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  transition: all 0.15s;
  border-left: 4px solid var(--blue-light);
  text-decoration: none;
  color: inherit;
}

.module-card:hover { transform: translateY(-1px); box-shadow: 0 4px 20px rgba(27,79,138,0.15); border-left-color: var(--blue-mid); }
.module-card.locked { opacity: 0.5; cursor: not-allowed; }
.module-card.completed { border-left-color: var(--green); }
.module-card.in-progress { border-left-color: var(--orange); }

.module-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  background: var(--blue-pale);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.module-card.completed .module-icon { background: var(--green-light); }
.module-card.in-progress .module-icon { background: var(--orange-light); }

.module-info { flex: 1; }
.module-info h3 { font-size: 15px; font-weight: 600; color: var(--blue-dark); }
.module-info p { font-size: 13px; color: var(--gray-mid); margin-top: 3px; }

.module-meta {
  text-align: right;
  flex-shrink: 0;
}

.module-status {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--blue-pale);
  color: var(--blue-mid);
}

.module-status.done { background: var(--green-light); color: var(--green); }
.module-status.active { background: var(--orange-light); color: var(--orange); }
.module-status.locked { background: var(--gray-light); color: var(--gray-mid); }

/* ── MODULE CONTENT ───────────────────────────────────── */
.module-content-wrap { max-width: 820px; }

.module-section {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
  margin-bottom: 20px;
}

.module-section h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--blue-dark);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--blue-light);
}

.module-section p {
  font-size: 15px;
  line-height: 1.75;
  color: var(--gray-dark);
  margin-bottom: 14px;
}

.module-section ul {
  padding-left: 20px;
  margin-bottom: 14px;
}

.module-section li {
  font-size: 15px;
  line-height: 1.7;
  color: var(--gray-dark);
  margin-bottom: 6px;
}

.callout {
  background: var(--blue-pale);
  border-left: 4px solid var(--blue-mid);
  border-radius: 0 8px 8px 0;
  padding: 14px 18px;
  margin: 16px 0;
  font-size: 14px;
  color: var(--blue-dark);
}

/* ── REFLECTION QUESTIONS ─────────────────────────────── */
.reflection-question {
  margin-bottom: 22px;
}

.reflection-question label {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: var(--gray-dark);
  margin-bottom: 8px;
}

.reflection-question textarea {
  width: 100%;
  min-height: 100px;
  padding: 12px 14px;
  border: 2px solid var(--blue-light);
  border-radius: 8px;
  font-family: var(--font);
  font-size: 14px;
  color: var(--gray-dark);
  resize: vertical;
  transition: border-color 0.15s;
}

.reflection-question textarea:focus {
  outline: none;
  border-color: var(--blue-mid);
}

/* ── BUTTONS ──────────────────────────────────────────── */
.btn {
  padding: 11px 22px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  border: none;
  font-family: var(--font);
}

.btn-primary {
  background: var(--blue-mid);
  color: white;
}

.btn-primary:hover { background: var(--blue-dark); }

.btn-success {
  background: var(--green);
  color: white;
}

.btn-success:hover { opacity: 0.88; }

.btn-outline {
  background: transparent;
  border: 2px solid var(--blue-mid);
  color: var(--blue-mid);
}

.btn-outline:hover { background: var(--blue-pale); }

.btn-row {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 20px;
}

/* ── TABLE ────────────────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--gray-mid);
  padding: 10px 14px;
  border-bottom: 2px solid var(--gray-light);
}

.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--gray-light);
  font-size: 14px;
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--blue-pale); }

/* ── BADGE ────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.badge-green { background: var(--green-light); color: var(--green); }
.badge-orange { background: var(--orange-light); color: var(--orange); }
.badge-blue { background: var(--blue-pale); color: var(--blue-mid); }
.badge-gray { background: var(--gray-light); color: var(--gray-mid); }

/* ── LOGIN PAGE ───────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--blue-dark) 0%, var(--blue-mid) 100%);
}

.login-box {
  background: white;
  border-radius: 16px;
  padding: 48px 42px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo h1 {
  font-size: 42px;
  font-weight: 800;
  letter-spacing: 4px;
  color: var(--blue-dark);
}

.login-logo p {
  font-size: 13px;
  color: var(--gray-mid);
  margin-top: 4px;
}

.login-role-select {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 24px;
}

.role-btn {
  padding: 12px 6px;
  border: 2px solid var(--gray-light);
  border-radius: 8px;
  background: white;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
  font-family: var(--font);
}

.role-btn:hover { border-color: var(--blue-mid); }
.role-btn.selected { border-color: var(--blue-mid); background: var(--blue-pale); }
.role-btn .role-icon { font-size: 22px; display: block; margin-bottom: 4px; }
.role-btn .role-label { font-size: 12px; font-weight: 600; color: var(--gray-dark); }

.form-group { margin-bottom: 18px; }

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-dark);
  margin-bottom: 6px;
}

.form-group input {
  width: 100%;
  padding: 11px 14px;
  border: 2px solid var(--gray-light);
  border-radius: 8px;
  font-size: 14px;
  font-family: var(--font);
  transition: border-color 0.15s;
}

.form-group input:focus { outline: none; border-color: var(--blue-mid); }

.login-error {
  color: var(--red);
  font-size: 13px;
  margin-bottom: 12px;
  display: none;
}

/* ── RESPONSIVE ───────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { width: 100%; position: relative; height: auto; }
  .main-content { margin-left: 0; padding: 20px 16px; max-width: 100%; }
  .app-shell { flex-direction: column; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}
