@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400;1,700&display=swap");

:root {
  --font:
    "Plus Jakarta Sans", system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, sans-serif;
  --bg-shell: #0a1936;
  --sidebar-bg: linear-gradient(135deg, #091a3e 0%, #102a6b 50%, #1a42a8 100%);
  --workspace-bg: #f8fafc;
  --card-bg: #ffffff;
  --card-border: #e2e8f0;
  --card-border-hover: #cbd5e1;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-sub: #334155;
  --primary: #1d4ed8;
  --primary-hover: #1e40af;
  --primary-light: #eff6ff;
  --accent: #2563eb;
  --accent-glow: rgba(37, 99, 235, 0.35);
  --danger: #dc2626;
  --danger-light: #fee2e2;
  --success: #15803d;
  --success-light: #dcfce7;
  --warning: #b45309;
  --warning-light: #fef3c7;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-full: 9999px;
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 6px 20px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 14px 38px rgba(15, 23, 42, 0.1);
  --shadow-primary: 0 8px 24px rgba(37, 99, 235, 0.28);
  font-family: var(--font);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg-shell);
  color: var(--text-main);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button,
input,
textarea,
select {
  font-family: var(--font);
  font-size: inherit;
}

button,
a {
  touch-action: manipulation;
}

button {
  cursor: pointer;
  border: 0;
  background: none;
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: clamp(28px, 3.2vw, 42px);
  letter-spacing: -0.03em;
  line-height: 1.2;
  font-weight: 800;
  color: var(--text-main);
}

h2 {
  font-size: clamp(20px, 2.2vw, 26px);
  letter-spacing: -0.02em;
  font-weight: 700;
  color: var(--text-main);
}

h3 {
  font-size: clamp(17px, 1.8vw, 21px);
  letter-spacing: -0.01em;
  font-weight: 700;
  color: var(--text-main);
}

p {
  line-height: 1.65;
  color: var(--text-muted);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid #3b82f6;
  outline-offset: 2px;
}

.skip {
  position: fixed;
  left: 12px;
  top: -80px;
  background: #ffffff;
  color: var(--text-main);
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  transition: top 0.2s ease;
}

.skip:focus {
  top: 12px;
}

.eyebrow {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent);
  display: block;
  margin-bottom: 12px;
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  border: 1px solid var(--primary);
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: #ffffff;
  padding: 14px 24px;
  font-size: 16px;
  font-weight: 700;
  gap: 10px;
  line-height: 1.3;
  box-shadow: 0 4px 14px rgba(29, 78, 216, 0.25);
  transition: all 0.2s ease;
}

.btn:hover:not(:disabled) {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  box-shadow: 0 6px 18px rgba(29, 78, 216, 0.35);
  transform: translateY(-1px);
}

.btn:active:not(:disabled) {
  transform: translateY(0);
}

.btn.secondary {
  background: #ffffff;
  border-color: var(--card-border);
  color: var(--text-sub);
  box-shadow: var(--shadow-sm);
}

.btn.secondary:hover:not(:disabled) {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: var(--text-main);
  box-shadow: var(--shadow-md);
}

.btn.wide {
  width: 100%;
}

.text-button {
  background: transparent;
  border: 0;
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s ease;
}

.text-button:hover {
  background: var(--primary-light);
}

.back-link {
  color: #94a3b8;
  font-size: 14px;
  font-weight: 600;
  display: inline-block;
  margin-top: 36px;
  transition: color 0.15s;
}

.back-link:hover {
  color: #ffffff;
}

/* ==========================================================================
   NOTICES & CALLOUTS
   ========================================================================== */
.notice {
  background: #eff6ff;
  border: 1.5px solid #bfdbfe;
  color: #1e40af;
  font-size: 15px;
  font-weight: 500;
  padding: 18px 22px;
  border-radius: var(--radius-md);
  line-height: 1.6;
  margin: 20px 0;
  box-shadow: var(--shadow-sm);
}

.notice.error,
.error {
  background: #fef2f2 !important;
  border-color: #fecaca !important;
  color: #b91c1c !important;
}

/* ==========================================================================
   DEMO BANNER
   ========================================================================== */
.demo-banner {
  position: relative;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  padding: 12px 32px;
  background: linear-gradient(90deg, #1e3a8a 0%, #1e40af 100%);
  color: #ffffff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 14px;
  font-weight: 500;
}

.demo-banner b {
  color: #fde047;
}

.demo-banner > span {
  flex: 1;
}

.demo-banner button {
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  color: #ffffff;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 700;
  transition: background 0.15s;
}

.demo-banner button:hover {
  background: rgba(255, 255, 255, 0.28);
}

/* ==========================================================================
   PORTAL SHELL & SIDEBAR (REFERENCE IMAGE STYLE)
   ========================================================================== */
.portal-shell {
  display: flex;
  min-height: 100vh;
  background: var(--bg-shell);
}

.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--sidebar-bg);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
}

.portal-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  margin-bottom: 28px;
}

/* Graduation cap emblem for management/admin */
.portal-brand::before {
  content: "🎓";
  width: 58px;
  height: 58px;
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  border-radius: 16px;
  box-shadow: 0 8px 22px rgba(37, 99, 235, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  margin-bottom: 14px;
  transition: transform 0.2s ease;
}

.portal-brand:hover::before {
  transform: scale(1.05);
}

.portal-brand img {
  width: 110px;
  height: auto;
  opacity: 0.95;
}

/* ==========================================================================
   STUDENT GEAR AVATAR (CIRCULO TIPO ENGRENAGEM COM FOTO)
   ========================================================================== */
.student-gear-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 24px;
  padding: 8px 6px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
}

.gear-avatar-widget {
  position: relative;
  width: 90px;
  height: 90px;
  cursor: pointer;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  outline: none;
  user-select: none;
}

.gear-svg {
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.4));
  transition: transform 0.4s ease;
}

.gear-wheel {
  transform-origin: 60px 60px;
  transition: transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.gear-avatar-widget:hover .gear-wheel {
  transform: rotate(30deg);
}

.gear-badge-camera {
  position: absolute;
  right: 2px;
  bottom: 4px;
  width: 34px;
  height: 34px;
  background: #ffffff;
  border: 2px solid #2563eb;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  transition: all 0.2s ease;
  z-index: 2;
}

.gear-avatar-widget:hover .gear-badge-camera {
  transform: scale(1.15) rotate(-10deg);
  background: #eff6ff;
  border-color: #3b82f6;
}

.gear-hover-overlay {
  position: absolute;
  top: 17px;
  left: 17px;
  right: 17px;
  bottom: 17px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s ease;
  backdrop-filter: blur(2px);
  z-index: 1;
}

.gear-hover-overlay span {
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  text-align: center;
  padding: 0 6px;
}

.gear-avatar-widget:hover .gear-hover-overlay {
  opacity: 1;
}

.student-gear-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 12px;
}

.student-gear-meta strong {
  color: #ffffff;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.student-gear-meta small {
  color: #93c5fd;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
}

.gear-btn-group {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.gear-change-btn {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #ffffff;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.gear-change-btn:hover {
  background: #2563eb;
  border-color: #3b82f6;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.45);
  transform: translateY(-1px);
}

.gear-reset-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #94a3b8;
  padding: 6px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.gear-reset-btn:hover {
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.4);
}

.topbar-avatar-img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #3b82f6;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.nav-caption {
  font-size: 11px;
  font-weight: 800;
  color: #93c5fd;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  margin: 0 12px 14px;
}

.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.sidebar nav::-webkit-scrollbar {
  width: 4px;
}

.sidebar nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.sidebar nav button {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid transparent;
  border-radius: 10px;
  text-align: left;
  background: transparent;
  font-size: 14px;
  font-weight: 800;
  color: #f1f5f9;
  letter-spacing: -0.01em;
  transition: all 0.2s ease;
}

.sidebar nav button span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  color: #bfdbfe;
  transition:
    transform 0.2s ease,
    color 0.2s ease;
}

.sidebar nav button span svg {
  display: block;
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2.2;
}

.sidebar nav button:hover span {
  color: #ffffff;
  transform: translateX(3px);
}

.sidebar nav button.active span {
  color: #ffffff;
}

.empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 68px;
  height: 68px;
  background: #eff6ff;
  border-radius: 50%;
  color: #2563eb;
  margin-bottom: 16px;
}

.empty-icon svg {
  width: 36px;
  height: 36px;
  stroke: currentColor;
}

.course-cover span.course-cover-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: #ffffff;
  opacity: 0.85;
}

.course-cover span.course-cover-icon svg {
  width: 36px;
  height: 36px;
  stroke: currentColor;
}

.sidebar nav button:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.sidebar nav button.active {
  color: #ffffff;
  background: #2563eb;
  border-color: #3b82f6;
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.45);
  font-weight: 800;
}

.sidebar nav button.active span {
  color: #ffffff;
}

.sidebar-bottom {
  margin-top: auto;
  padding: 32px 12px 0;
  display: grid;
  gap: 16px;
  color: #94a3b8;
  font-size: 13px;
  font-weight: 500;
}

.sidebar-bottom a {
  transition: color 0.15s;
}

.sidebar-bottom a:hover {
  color: #ffffff;
}

/* ==========================================================================
   WORKSPACE & TOPBAR
   ========================================================================== */
.workspace {
  flex: 1;
  min-width: 0;
  background: var(--workspace-bg);
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 78px;
  border-bottom: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 42px;
  background: #ffffff;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.03);
}

.topbar > span {
  font-size: 19px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.topbar small {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
}

.topbar > div {
  display: flex;
  align-items: center;
  gap: 18px;
}

/* User Profile Pill like in the reference image */
.profile-button {
  border: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  gap: 12px;
  background: #f8fafc;
  padding: 6px 16px 6px 8px;
  border-radius: 40px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.profile-button:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  box-shadow: var(--shadow-md);
}

.profile-button span {
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #1d4ed8 0%, #3b82f6 100%);
  color: #ffffff;
  font-size: 15px;
  font-weight: 800;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  box-shadow: 0 3px 8px rgba(29, 78, 216, 0.3);
}

.topbar .text-button[data-action="logout"] {
  color: var(--danger);
  font-size: 14px;
  font-weight: 700;
  background: var(--danger-light);
  border: 1px solid #fecaca;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

.topbar .text-button[data-action="logout"]:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  transform: translateY(-1px);
}

.workspace main {
  max-width: 1480px;
  width: 100%;
  padding: 40px 42px 70px;
  margin: 0 auto;
  min-height: calc(100vh - 160px);
}

.workspace footer {
  padding: 24px 42px;
  font-size: 14px;
  color: var(--text-muted);
  border-top: 1px solid var(--card-border);
  display: flex;
  gap: 20px;
  justify-content: space-between;
  background: #ffffff;
}

.workspace footer span {
  font-size: 13px;
  color: #94a3b8;
}

/* ==========================================================================
   WELCOME HERO BANNER (INSPIRED DIRECTLY BY REFERENCE IMAGE)
   ========================================================================== */
.welcome {
  border: 0;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #0e276b 0%, #153c9b 55%, #1e52d6 100%);
  padding: 40px 46px;
  display: flex;
  justify-content: space-between;
  gap: 30px;
  align-items: center;
  box-shadow: 0 14px 34px rgba(14, 39, 107, 0.22);
  margin-bottom: 34px;
  position: relative;
  overflow: hidden;
}

.welcome::after {
  content: "🎓";
  position: absolute;
  right: 40px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 120px;
  opacity: 0.18;
  pointer-events: none;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.2));
}

.welcome .eyebrow {
  color: #93c5fd;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1.5px;
  margin-bottom: 10px;
}

.welcome h1 {
  color: #ffffff;
  font-size: clamp(28px, 3.2vw, 38px);
  font-weight: 800;
  margin-bottom: 10px;
}

.welcome p {
  color: #dbeafe;
  font-size: 16px;
  line-height: 1.6;
  max-width: 580px;
  margin: 14px 0 24px;
}

.welcome .btn {
  background: #ffffff;
  color: #1e3a8a;
  border-color: #ffffff;
  font-size: 15px;
  font-weight: 800;
  padding: 13px 26px;
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.welcome .btn:hover {
  background: #f8fafc;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.welcome-mark {
  display: none;
}

/* ==========================================================================
   STATS CARDS (CLEAN WHITE, BOLD NUMBERS, PROMINENT BORDERS)
   ========================================================================== */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  margin: 24px 0 36px;
}

.stats.four {
  grid-template-columns: repeat(4, 1fr);
}

.stat {
  padding: 26px 28px;
  background: var(--card-bg);
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius-md);
  display: grid;
  gap: 8px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.stat:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.stat:first-child {
  border: 2px solid var(--accent);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.08);
}

.stat strong {
  font-size: clamp(32px, 3vw, 42px);
  font-weight: 800;
  line-height: 1;
  color: var(--text-main);
  letter-spacing: -1px;
}

.stat span {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-muted);
}

/* ==========================================================================
   SECTION HEADINGS
   ========================================================================== */
.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  margin-bottom: 22px;
}

.section-heading h2 {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-main);
}

/* ==========================================================================
   COURSE CARDS (ENROLLED COURSES STYLE)
   ========================================================================== */
.course-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.course-card {
  background: var(--card-bg);
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s ease;
}

.course-card:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.course-cover {
  height: 115px;
  padding: 22px 28px;
  background: linear-gradient(135deg, #16367c 0%, #2563eb 100%);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #ffffff;
}

.course-card:nth-child(even) .course-cover {
  background: linear-gradient(135deg, #0e276b 0%, #1d4ed8 100%);
}

.course-cover span {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: var(--radius-full);
  padding: 6px 14px;
  color: #ffffff;
}

.course-cover b {
  font-size: 42px;
  color: #ffffff;
  opacity: 0.8;
  font-weight: 700;
  line-height: 1;
}

.course-body {
  padding: 28px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.badge {
  display: inline-block;
  align-self: flex-start;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: #f1f5f9;
  color: var(--text-sub);
  border: 1px solid #cbd5e1;
}

.badge.active {
  background: var(--success-light);
  color: var(--success);
  border-color: #bbf7d0;
}

.badge.completed {
  background: var(--primary-light);
  color: var(--primary);
  border-color: #bfdbfe;
}

.badge.suspended {
  background: var(--danger-light);
  color: var(--danger);
  border-color: #fecaca;
}

.course-body h3 {
  margin: 16px 0 10px;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.35;
  color: var(--text-main);
}

.course-body p {
  font-size: 15px;
  margin-bottom: 24px;
  color: var(--text-muted);
}

.course-body .btn {
  width: 100%;
  margin-top: 20px;
  padding: 14px;
  font-size: 15px;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-sub);
  margin-top: auto;
  margin-bottom: 8px;
}

progress {
  appearance: none;
  width: 100%;
  height: 8px;
  border: 0;
  border-radius: 8px;
  background: #e2e8f0;
  overflow: hidden;
}

progress::-webkit-progress-bar {
  background: #e2e8f0;
}

progress::-webkit-progress-value {
  background: linear-gradient(90deg, #2563eb, #3b82f6);
  border-radius: 8px;
}

progress::-moz-progress-bar {
  background: linear-gradient(90deg, #2563eb, #3b82f6);
  border-radius: 8px;
}

/* ==========================================================================
   STUDY SUMMARY & CARDS (MEUS ESTUDOS)
   ========================================================================== */
.study-summary {
  background: var(--card-bg);
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 28px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.study-summary:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-md);
}

.study-summary > div {
  flex: 1;
}

.study-summary h2 {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-main);
  margin: 12px 0 8px;
}

.study-summary p {
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.study-summary small {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  margin-top: 12px;
}

/* ==========================================================================
   HELP FAQ & NOTICES
   ========================================================================== */
.help-faq {
  display: grid;
  gap: 14px;
  margin: 28px 0;
}

.help-faq details {
  background: var(--card-bg);
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 18px 24px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.help-faq details[open] {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}

.help-faq summary {
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  color: var(--text-main);
  user-select: none;
}

.help-faq p {
  font-size: 15px;
  line-height: 1.65;
  color: var(--text-muted);
  margin-top: 14px;
}

.help-strip {
  margin-top: 36px;
  padding: 28px 34px;
  border: 1.5px solid var(--card-border);
  border-left: 6px solid var(--accent);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 25px;
  background: var(--card-bg);
  box-shadow: var(--shadow-sm);
}

.help-strip h3 {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-main);
}

.help-strip p {
  font-size: 15px;
  margin-top: 6px;
  color: var(--text-muted);
}

.help-strip .btn {
  flex-shrink: 0;
}

/* ==========================================================================
   MANAGEMENT TOOLBAR & FILTERS
   ========================================================================== */
.management-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 16px;
  background: var(--card-bg);
  border: 1.5px solid var(--card-border);
  padding: 22px 26px;
  border-radius: var(--radius-md);
  margin-bottom: 26px;
  box-shadow: var(--shadow-sm);
}

.management-toolbar label {
  flex: 1 1 200px;
  min-width: 160px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-sub);
  display: grid;
  gap: 8px;
}

.management-toolbar input,
.management-toolbar select {
  width: 100%;
  height: 48px;
  background: #f8fafc;
  border: 1.5px solid #cbd5e1;
  border-radius: var(--radius-sm);
  padding: 0 16px;
  font-size: 15px;
  color: var(--text-main);
  font-weight: 500;
  transition: border-color 0.15s;
}

.management-toolbar input:focus,
.management-toolbar select:focus {
  border-color: var(--accent);
  background: #ffffff;
}

.toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-left: auto;
}

.toolbar-actions .btn {
  padding: 12px 18px;
  font-size: 14px;
}

.page-heading {
  display: flex;
  justify-content: space-between;
  gap: 25px;
  align-items: center;
  margin: 5px 0 32px;
}

.page-heading > div {
  max-width: 850px;
}

.page-heading h1 {
  font-size: 32px;
  font-weight: 800;
  color: var(--text-main);
}

.page-heading p {
  font-size: 16px;
  margin-top: 10px;
  color: var(--text-muted);
}

.page-heading > .btn {
  flex-shrink: 0;
  padding: 13px 24px;
  font-size: 15px;
}

/* ==========================================================================
   TABLES (SUPER LEGIBLE, MODERN, CRISP)
   ========================================================================== */
.table-scroll {
  overflow: auto;
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius-md);
  background: var(--card-bg);
  box-shadow: var(--shadow-sm);
}

table {
  border-collapse: collapse;
  width: 100%;
  text-align: left;
  font-size: 15px;
}

th {
  background: #f8fafc;
  color: #475569;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  white-space: nowrap;
  padding: 18px 24px;
  border-bottom: 2px solid var(--card-border);
}

td {
  padding: 20px 24px;
  border-bottom: 1px solid #f1f5f9;
  color: var(--text-main);
  vertical-align: middle;
}

td b {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
}

td small {
  display: block;
  font-size: 13px;
  color: #64748b;
  line-height: 1.5;
  margin-top: 4px;
}

.row-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.row-menu .btn,
td .btn {
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  border-radius: 8px;
  white-space: nowrap;
  background: #ffffff;
  color: var(--text-sub);
  border: 1px solid #cbd5e1;
  box-shadow: none;
}

.row-menu .btn:hover,
td .btn:hover {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(29, 78, 216, 0.25);
}

tr:last-child td {
  border-bottom: 0;
}

tr:hover td {
  background: #f8fafc;
}

.result-count {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  margin: 18px 0;
}

/* ==========================================================================
   PANELS & TWO COLUMNS (GESTÃO VISÃO GERAL)
   ========================================================================== */
.two-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.panel {
  background: var(--card-bg);
  border: 1.5px solid var(--card-border);
  padding: 32px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.panel > h2 {
  margin-bottom: 18px;
  font-size: 22px;
  font-weight: 800;
}

.panel > p {
  font-size: 15px;
  margin-bottom: 24px;
  color: var(--text-muted);
}

.quick-actions {
  display: grid;
  gap: 12px;
}

.quick-actions .btn {
  justify-content: space-between;
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 700;
  background: #f8fafc;
  color: var(--text-main);
  border: 1.5px solid #cbd5e1;
  box-shadow: none;
}

.quick-actions .btn:hover {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 6px 18px rgba(29, 78, 216, 0.3);
}

/* ==========================================================================
   MATERIALS & LIBRARY
   ========================================================================== */
.material-list {
  display: grid;
  gap: 14px;
}

.material-row {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 24px 28px;
  background: var(--card-bg);
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.material-row:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-md);
}

.file-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 58px;
  height: 68px;
  border: 1.5px solid #bfdbfe;
  border-radius: var(--radius-sm);
  color: var(--primary);
  background: var(--primary-light);
  font-size: 13px;
  font-weight: 800;
}

.material-info {
  flex: 1;
  min-width: 0;
}

.material-info small {
  font-size: 13px;
  color: #64748b;
  line-height: 1.5;
  display: block;
}

.material-info h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
  margin: 6px 0;
  overflow-wrap: anywhere;
}

.material-info > span {
  font-size: 13px;
  color: var(--text-muted);
}

.material-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.completion {
  font-size: 13px;
  font-weight: 700;
  border: 0;
  background: none;
  color: #64748b;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
}

.completion:hover {
  background: #f1f5f9;
}

.completion.done {
  color: var(--success);
  font-weight: 700;
}

/* ==========================================================================
   SUPPLIES & DETAILS
   ========================================================================== */
.supplies-card {
  padding: 28px;
  background: var(--card-bg);
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.supplies-card h3 {
  margin: 14px 0;
  font-size: 20px;
}

.supplies-card ul {
  list-style: none;
  padding: 0;
  margin: 18px 0 0;
}

.supplies-card li {
  color: var(--text-sub);
  font-size: 15px;
  line-height: 1.65;
  padding: 12px 0 12px 26px;
  position: relative;
  border-bottom: 1px solid #f1f5f9;
  white-space: pre-wrap;
}

.supplies-card li:before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--primary);
  font-weight: 800;
}

.empty {
  padding: 60px 30px;
  text-align: center;
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius-md);
  background: #ffffff;
}

.empty h3 {
  margin: 16px 0;
  font-size: 22px;
  color: var(--text-main);
}

.empty p {
  font-size: 15px;
  max-width: 500px;
  margin: 0 auto 24px;
  color: var(--text-muted);
}

.empty-icon {
  font-size: 40px;
  color: #94a3b8;
}

/* ==========================================================================
   MODAL DIALOGS
   ========================================================================== */
dialog {
  background: #ffffff;
  color: var(--text-main);
  border: 0;
  border-radius: var(--radius-lg);
  padding: 34px 38px;
  width: min(620px, calc(100vw - 32px));
  max-height: 90vh;
  overflow: auto;
  margin: auto;
  box-shadow: 0 25px 80px rgba(15, 23, 42, 0.28);
}

dialog::backdrop {
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(6px);
}

dialog > header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--card-border);
}

dialog h2 {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-main);
}

form {
  display: grid;
  gap: 20px;
}

label {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-sub);
  display: grid;
  gap: 8px;
}

input,
textarea,
select {
  border: 1.5px solid #cbd5e1;
  background: #f8fafc;
  color: var(--text-main);
  border-radius: var(--radius-sm);
  padding: 13px 16px;
  width: 100%;
  min-width: 0;
  font-size: 15px;
  font-weight: 500;
  transition: all 0.15s ease;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

input::placeholder,
textarea::placeholder {
  color: #94a3b8;
}

input:disabled {
  background: #e2e8f0;
  color: #64748b;
  cursor: not-allowed;
}

textarea {
  resize: vertical;
}

form small {
  color: var(--text-muted);
  line-height: 1.6;
  font-size: 13px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 14px;
  margin-top: 26px;
}

.form-actions .btn {
  padding: 13px 24px;
  font-size: 15px;
}

.form-message {
  font-size: 14px;
  line-height: 1.6;
}

.form-message:empty {
  display: none;
}

.student-detail > p {
  margin: 14px 0 26px;
  font-size: 15px;
  color: var(--text-muted);
}

.student-detail > .btn {
  margin-top: 24px;
}

.student-course {
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 18px;
  margin-top: 14px;
  display: grid;
  gap: 8px;
  background: #f8fafc;
}

.student-course b {
  font-size: 17px;
  color: var(--text-main);
}

.student-course small,
.student-course span {
  font-size: 13px;
  color: #64748b;
}

/* ==========================================================================
   AUTH / LOGIN PAGE (ELEGANT DUAL TONE)
   ========================================================================== */
.auth-shell {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  min-height: 100vh;
  background: #ffffff;
}

.auth-story {
  padding: 60px clamp(30px, 6vw, 100px);
  background: linear-gradient(135deg, #091a3e 0%, #102a6b 50%, #1a42a8 100%);
  position: relative;
  overflow: hidden;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-story:after {
  content: "🎓";
  position: absolute;
  font-size: 240px;
  right: -50px;
  bottom: -40px;
  opacity: 0.1;
  pointer-events: none;
}

.auth-brand img {
  display: block;
  width: min(100%, 480px);
  height: auto;
  margin-bottom: 40px;
}

.auth-mobile-brand {
  display: none;
}

.auth-mobile-brand img {
  display: block;
  width: 100%;
  height: auto;
}

.auth-story h1 {
  font-size: clamp(36px, 4vw, 54px);
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: #ffffff;
}

.auth-story h1 em {
  color: #60a5fa;
  font-style: normal;
}

.auth-story > p {
  font-size: 17px;
  line-height: 1.6;
  max-width: 480px;
  margin-top: 24px;
  color: #cbd5e1;
}

.auth-benefits {
  display: grid;
  gap: 22px;
  margin-top: 40px;
}

.auth-benefits > div {
  display: flex;
  gap: 18px;
  align-items: center;
}

.auth-benefits > div > span {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 800;
}

.auth-benefits b {
  display: block;
  font-size: 16px;
  color: #ffffff;
}

.auth-benefits small {
  display: block;
  color: #93c5fd;
  font-size: 14px;
  margin-top: 4px;
}

.auth-form-wrap {
  padding: 60px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: #f8fafc;
}

.auth-card {
  max-width: 440px;
  width: 100%;
  background: #ffffff;
  padding: 44px;
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--card-border);
  box-shadow: var(--shadow-lg);
}

.auth-card h2 {
  font-size: 30px;
  font-weight: 800;
  line-height: 1.2;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.auth-card > p {
  font-size: 15px;
  margin-top: 10px;
  margin-bottom: 28px;
  color: var(--text-muted);
}

.auth-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 15px;
  margin-top: 24px;
}

.auth-links button {
  background: transparent;
  border: 0;
  color: var(--primary);
  font-size: 14px;
  font-weight: 700;
  padding: 0;
}

.support {
  display: block;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  margin-top: 32px;
  transition: color 0.15s;
}

.support:hover {
  color: var(--primary);
}

.auth-footer {
  font-size: 12px;
  letter-spacing: 1.5px;
  font-weight: 700;
  color: #94a3b8;
  margin-top: 40px;
  text-align: center;
}

.demo-entry {
  border-top: 1.5px solid var(--card-border);
  margin-top: 28px;
  padding-top: 24px;
}

.demo-entry > span {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  margin-bottom: 12px;
}

/* ==========================================================================
   TOAST NOTIFICATION
   ========================================================================== */
#toast {
  display: none;
  position: fixed;
  right: 28px;
  bottom: 28px;
  max-width: min(480px, calc(100vw - 48px));
  background: #0f172a;
  color: #ffffff;
  border: 1px solid #334155;
  border-radius: var(--radius-md);
  padding: 18px 24px;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.5;
  z-index: 2000;
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.25);
}

#toast.show {
  display: block;
  animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes toastSlideIn {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.boot {
  padding: 80px 20px;
  text-align: center;
  color: #ffffff;
  font-size: 18px;
  font-weight: 600;
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */
@media (max-width: 1100px) {
  .sidebar {
    width: 230px;
    padding: 24px 14px;
  }
  .workspace main {
    padding: 30px 25px 60px;
  }
  .topbar {
    padding: 0 25px;
  }
  .stats.four {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 850px) {
  .auth-shell {
    grid-template-columns: 1fr;
  }
  .auth-story {
    display: none;
  }
  .auth-mobile-brand {
    display: block;
    width: 100%;
    max-width: 440px;
    padding: 22px;
    margin-bottom: 24px;
    border-radius: var(--radius-lg);
    background: #102a6b;
  }
  .portal-shell {
    display: block;
  }
  .sidebar {
    width: auto;
    padding: 16px 20px;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }
  .portal-brand,
  .nav-caption,
  .sidebar-bottom {
    display: none;
  }
  .sidebar nav {
    display: flex;
    overflow-x: auto;
    gap: 10px;
    padding-bottom: 4px;
  }
  .sidebar nav button {
    flex-shrink: 0;
    padding: 10px 16px;
    font-size: 14px;
  }
  .topbar {
    height: 68px;
    padding: 0 20px;
  }
  .topbar small {
    display: none;
  }
  .workspace main {
    padding: 24px 18px 50px;
  }
  .two-columns {
    grid-template-columns: 1fr;
  }
  .welcome {
    padding: 30px 24px;
  }
  .welcome::after {
    display: none;
  }
  .stats {
    grid-template-columns: 1fr;
  }
  .course-grid {
    grid-template-columns: 1fr;
  }
}
