/* ===================================================================
   EDU-GEN AI — Generator Perangkat Pembelajaran Cerdas
   Design System & Modern CSS Stylesheet
   Palette: Deep Navy (#0b192c, #0f172a, #1e293b), Teal/Emerald (#0d9488, #10b981), Cyan (#06b6d4)
   =================================================================== */

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

:root {
  /* Color Palette */
  --navy-950: #070e18;
  --navy-900: #0b1524;
  --navy-850: #0f1c30;
  --navy-800: #14243b;
  --navy-700: #1e3352;
  --navy-600: #2d4a73;
  
  --teal-600: #0d9488;
  --teal-500: #14b8a6;
  --teal-400: #2dd4bf;
  --teal-100: #ccfbf1;
  --teal-50:  #f0fdfa;

  --emerald-600: #059669;
  --emerald-500: #10b981;
  --emerald-400: #34d399;
  --emerald-100: #d1fae5;
  --emerald-50:  #ecfdf5;

  --cyan-600: #0891b2;
  --cyan-500: #06b6d4;
  --cyan-400: #22d3ee;

  --amber-500: #f59e0b;
  --amber-100: #fef3c7;
  --rose-500: #f43f5e;
  --rose-100: #ffe4e6;
  --indigo-500: #6366f1;
  --indigo-100: #e0e7ff;

  --slate-900: #0f172a;
  --slate-800: #1e293b;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-500: #64748b;
  --slate-400: #94a3b8;
  --slate-300: #cbd5e1;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --slate-50:  #f8fafc;
  --white: #ffffff;

  /* Typography */
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Outfit', var(--font-sans);
  --font-mono: 'JetBrains Mono', monospace;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --shadow-glow: 0 0 25px -5px rgba(20, 184, 166, 0.35);

  /* Borders & Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --radius-2xl: 28px;
  --radius-full: 9999px;

  /* Layout */
  --sidebar-width: 270px;
  --header-height: 72px;
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  font-size: 15px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: #f1f5f9;
  color: var(--slate-800);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}

/* App Wrapper */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* ===================================================================
   SIDEBAR NAVIGATION
   =================================================================== */
.sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(180deg, var(--navy-950) 0%, var(--navy-900) 50%, var(--navy-850) 100%);
  color: var(--slate-200);
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  z-index: 100;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.25);
  transition: transform var(--transition-normal);
}

.sidebar-header {
  padding: 20px 22px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.logo-badge {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--teal-500) 0%, var(--navy-800) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(20, 184, 166, 0.35);
  overflow: hidden;
  flex-shrink: 0;
}

.logo-badge img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-info {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--white);
  line-height: 1.2;
  display: flex;
  align-items: center;
  gap: 6px;
}

.brand-title span {
  background: linear-gradient(135deg, var(--teal-400), var(--emerald-400));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-subtitle {
  font-size: 0.72rem;
  color: var(--teal-400);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sidebar-nav {
  flex: 1;
  padding: 18px 14px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-section-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--slate-500);
  padding: 12px 12px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  color: var(--slate-300);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  cursor: pointer;
  position: relative;
}

.nav-item i {
  font-size: 1.1rem;
  width: 22px;
  text-align: center;
  color: var(--slate-400);
  transition: color var(--transition-fast);
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--white);
}

.nav-item:hover i {
  color: var(--teal-400);
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(20, 184, 166, 0.18) 0%, rgba(20, 184, 166, 0.05) 100%);
  color: var(--white);
  font-weight: 600;
  border-left: 3px solid var(--teal-400);
}

.nav-item.active i {
  color: var(--teal-400);
}

.nav-badge {
  margin-left: auto;
  padding: 2px 7px;
  font-size: 0.68rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  background: rgba(20, 184, 166, 0.2);
  color: var(--teal-300);
  border: 1px solid rgba(20, 184, 166, 0.3);
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.2);
}

.identity-mini-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  padding: 12px;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.identity-mini-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  color: var(--slate-400);
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.identity-mini-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.identity-mini-school {
  font-size: 0.75rem;
  color: var(--teal-300);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===================================================================
   MAIN CONTENT AREA & HEADER
   =================================================================== */
.main-wrapper {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
}

.top-header {
  height: var(--header-height);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--slate-200);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 90;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.4rem;
  color: var(--slate-700);
  cursor: pointer;
}

.page-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--slate-500);
}

.page-breadcrumb .current {
  color: var(--slate-900);
  font-weight: 700;
  font-size: 1.05rem;
  font-family: var(--font-display);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.ai-engine-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--slate-100);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--slate-700);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.ai-engine-status:hover {
  background: var(--teal-50);
  border-color: var(--teal-400);
  color: var(--teal-600);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--emerald-500);
  box-shadow: 0 0 8px var(--emerald-500);
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.header-quick-action {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Main Content Views */
.content-body {
  flex: 1;
  padding: 32px;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

.view-section {
  display: none;
  animation: fadeIn 0.3s ease-in-out;
}

.view-section.active {
  display: block;
}

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

/* ===================================================================
   BUTTONS & FORM ELEMENTS
   =================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  line-height: 1.4;
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: linear-gradient(135deg, var(--teal-600) 0%, var(--emerald-600) 100%);
  color: var(--white);
  box-shadow: 0 4px 14px rgba(13, 148, 136, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--teal-500) 0%, var(--emerald-500) 100%);
  box-shadow: 0 6px 18px rgba(13, 148, 136, 0.4);
}

.btn-navy {
  background: var(--navy-800);
  color: var(--white);
  border-color: var(--navy-700);
}

.btn-navy:hover {
  background: var(--navy-900);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: var(--white);
  color: var(--slate-700);
  border-color: var(--slate-300);
}

.btn-secondary:hover {
  background: var(--slate-100);
  color: var(--slate-900);
  border-color: var(--slate-400);
}

.btn-outline-teal {
  background: transparent;
  color: var(--teal-600);
  border-color: var(--teal-500);
}

.btn-outline-teal:hover {
  background: var(--teal-50);
  color: var(--teal-600);
}

.btn-danger {
  background: var(--rose-500);
  color: var(--white);
}

.btn-danger:hover {
  background: #e11d48;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.82rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 13px 26px;
  font-size: 1.05rem;
  border-radius: var(--radius-lg);
}

/* Form Groups */
.form-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  border: 1px solid var(--slate-200);
  box-shadow: var(--shadow-sm);
  padding: 28px;
  margin-bottom: 24px;
}

.form-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 18px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--slate-100);
}

.form-card-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--slate-900);
  display: flex;
  align-items: center;
  gap: 10px;
}

.form-card-title i {
  color: var(--teal-600);
  font-size: 1.3rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 20px;
}

.col-12 { grid-column: span 12; }
.col-8  { grid-column: span 8; }
.col-6  { grid-column: span 6; }
.col-4  { grid-column: span 4; }
.col-3  { grid-column: span 3; }

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--slate-700);
  display: flex;
  align-items: center;
  gap: 6px;
}

.form-label .required {
  color: var(--rose-500);
  font-weight: 700;
}

.form-hint {
  font-size: 0.76rem;
  color: var(--slate-400);
}

.form-control, .form-select, .form-textarea {
  font-family: var(--font-sans);
  font-size: 0.92rem;
  color: var(--slate-800);
  background: var(--white);
  border: 1.5px solid var(--slate-200);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  transition: all var(--transition-fast);
  width: 100%;
}

.form-control:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--teal-500);
  box-shadow: 0 0 0 3.5px rgba(20, 184, 166, 0.15);
}

.form-textarea {
  min-height: 90px;
  resize: vertical;
}

/* Custom Checkbox and Radios */
.checkbox-card, .radio-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: var(--slate-50);
  border: 1.5px solid var(--slate-200);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.checkbox-card:hover, .radio-card:hover {
  background: var(--teal-50);
  border-color: var(--teal-400);
}

.checkbox-card.selected, .radio-card.selected {
  background: var(--teal-50);
  border-color: var(--teal-600);
  box-shadow: 0 0 0 1px var(--teal-600);
}

.checkbox-card input, .radio-card input {
  margin-top: 3px;
  accent-color: var(--teal-600);
  width: 17px;
  height: 17px;
  cursor: pointer;
}

.checkbox-card-content, .radio-card-content {
  flex: 1;
}

.checkbox-card-title, .radio-card-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--slate-800);
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.checkbox-card-desc, .radio-card-desc {
  font-size: 0.78rem;
  color: var(--slate-500);
  line-height: 1.4;
}

/* ===================================================================
   DASHBOARD VIEW
   =================================================================== */
.hero-banner {
  background: linear-gradient(135deg, var(--navy-950) 0%, var(--navy-900) 60%, var(--navy-800) 100%);
  border-radius: var(--radius-2xl);
  padding: 36px 40px;
  color: var(--white);
  position: relative;
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(11, 21, 36, 0.25);
  margin-bottom: 32px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.hero-banner::after {
  content: '';
  position: absolute;
  top: -40%;
  right: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(20, 184, 166, 0.2) 0%, rgba(20, 184, 166, 0) 70%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 720px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: rgba(20, 184, 166, 0.18);
  border: 1px solid rgba(20, 184, 166, 0.35);
  color: var(--teal-300);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 16px;
}

.hero-title {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.hero-title span {
  background: linear-gradient(135deg, var(--teal-400), var(--emerald-400));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-description {
  font-size: 1.02rem;
  color: var(--slate-300);
  line-height: 1.6;
  margin-bottom: 24px;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 22px;
  border: 1px solid var(--slate-200);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 16px;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.stat-icon.teal { background: var(--teal-50); color: var(--teal-600); }
.stat-icon.indigo { background: var(--indigo-100); color: var(--indigo-500); }
.stat-icon.amber { background: var(--amber-100); color: var(--amber-500); }
.stat-icon.emerald { background: var(--emerald-50); color: var(--emerald-600); }

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--slate-900);
  line-height: 1.1;
}

.stat-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--slate-500);
}

/* Feature Quick Launch Cards */
.section-heading {
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--slate-900);
  display: flex;
  align-items: center;
  gap: 10px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 20px;
  margin-bottom: 36px;
}

.feature-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 24px;
  border: 1px solid var(--slate-200);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.feature-card:hover {
  transform: translateY(-4px);
  border-color: var(--teal-400);
  box-shadow: 0 12px 24px -4px rgba(13, 148, 136, 0.15);
}

.feature-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
}

.feature-icon-box {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.feature-tag {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

.feature-card-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--slate-900);
  margin-bottom: 8px;
}

.feature-card-desc {
  font-size: 0.85rem;
  color: var(--slate-600);
  line-height: 1.5;
  margin-bottom: 20px;
}

.feature-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--slate-100);
  color: var(--teal-600);
  font-size: 0.88rem;
  font-weight: 600;
}

/* Deep Learning 3 Pillars Infographic Panel */
.dl-pillars-panel {
  background: linear-gradient(135deg, var(--white) 0%, var(--slate-50) 100%);
  border-radius: var(--radius-xl);
  border: 1px solid var(--slate-200);
  padding: 28px;
  margin-bottom: 36px;
}

.pillars-header {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 28px;
}

.pillars-header h3 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--slate-900);
  margin-bottom: 6px;
}

.pillars-header p {
  font-size: 0.88rem;
  color: var(--slate-600);
}

.pillars-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.pillar-item {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 22px;
  border: 1.5px solid var(--slate-200);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.pillar-item:hover {
  border-color: var(--teal-500);
  transform: translateY(-3px);
}

.pillar-item.mindful { border-top: 4px solid #3b82f6; }
.pillar-item.meaningful { border-top: 4px solid #10b981; }
.pillar-item.joyful { border-top: 4px solid #f59e0b; }

.pillar-badge {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
  display: inline-block;
}

.pillar-item.mindful .pillar-badge { color: #2563eb; }
.pillar-item.meaningful .pillar-badge { color: #059669; }
.pillar-item.joyful .pillar-badge { color: #d97706; }

.pillar-item h4 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--slate-900);
  margin-bottom: 8px;
}

.pillar-item p {
  font-size: 0.82rem;
  color: var(--slate-600);
  line-height: 1.5;
}

/* ===================================================================
   DOCUMENT EDITOR & PREVIEW (A4 PAPER FORMAT)
   =================================================================== */
.editor-workspace {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
  align-items: start;
}

.editor-sidebar {
  background: var(--white);
  border-radius: var(--radius-xl);
  border: 1px solid var(--slate-200);
  padding: 20px;
  position: sticky;
  top: calc(var(--header-height) + 20px);
  max-height: calc(100vh - var(--header-height) - 40px);
  overflow-y: auto;
  box-shadow: var(--shadow-sm);
}

.editor-toc-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--slate-900);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--slate-100);
  display: flex;
  align-items: center;
  gap: 8px;
}

.toc-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.toc-item a {
  display: block;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  color: var(--slate-600);
  font-size: 0.8rem;
  text-decoration: none;
  transition: all var(--transition-fast);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.toc-item a:hover {
  background: var(--teal-50);
  color: var(--teal-600);
  font-weight: 600;
}

.editor-toolbar {
  background: var(--white);
  border-radius: var(--radius-xl);
  border: 1px solid var(--slate-200);
  padding: 14px 20px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.toolbar-divider {
  width: 1px;
  height: 24px;
  background: var(--slate-200);
  margin: 0 4px;
}

/* Realistic A4 Document Simulation */
.document-canvas-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.document-sheet {
  background: var(--white);
  max-width: 850px;
  width: 100%;
  margin: 0 auto;
  min-height: 1100px;
  padding: 50px 60px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--slate-300);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
  font-family: 'Times New Roman', 'Liberation Serif', serif;
  font-size: 12pt;
  line-height: 1.45;
  color: #111827;
  position: relative;
}

/* Document typography */
.doc-header-kemenag-dinas {
  text-align: center;
  border-bottom: 3px double #000;
  padding-bottom: 14px;
  margin-bottom: 24px;
}

.doc-school-title {
  font-size: 15pt;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.doc-school-meta {
  font-size: 10pt;
  font-style: italic;
  color: #374151;
}

.doc-main-title {
  text-align: center;
  font-size: 16pt;
  font-weight: bold;
  text-transform: uppercase;
  margin: 20px 0 6px;
  letter-spacing: 0.5px;
}

.doc-sub-title {
  text-align: center;
  font-size: 12pt;
  font-weight: bold;
  color: #1f2937;
  margin-bottom: 24px;
}

.doc-h1 {
  font-size: 13pt;
  font-weight: bold;
  margin-top: 24px;
  margin-bottom: 10px;
  color: #000;
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 4px;
}

.doc-h2 {
  font-size: 12pt;
  font-weight: bold;
  margin-top: 16px;
  margin-bottom: 8px;
  color: #111827;
}

.doc-p {
  margin-bottom: 10px;
  text-align: justify;
  text-justify: inter-word;
}

.doc-table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0 20px;
  font-size: 10.5pt;
}

.doc-table th, .doc-table td {
  border: 1px solid #1f2937;
  padding: 8px 10px;
  vertical-align: top;
}

.doc-table th {
  background-color: #f3f4f6;
  font-weight: bold;
  text-align: center;
}

/* Styling Notasi & Rumus Matematika Semantik */
.doc-math-inline {
  font-family: 'Cambria Math', 'Times New Roman', serif;
  font-size: 11pt;
  padding: 0 1px;
}

.doc-math-block {
  text-align: center;
  margin: 14px 0;
  padding: 8px 16px;
  background-color: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 6px;
  font-family: 'Cambria Math', 'Times New Roman', serif;
  font-size: 11.5pt;
  color: #0f172a;
}

.doc-math-frac {
  display: inline-block;
  vertical-align: middle;
  text-align: center;
  font-size: 0.95em;
  margin: 0 2px;
}

.doc-math-frac > sup {
  display: block;
  font-size: 0.85em;
  line-height: 1;
  border-bottom: 1px solid #334155;
  padding-bottom: 1px;
}

.doc-math-frac > sub {
  display: block;
  font-size: 0.85em;
  line-height: 1;
  padding-top: 1px;
}

.doc-signature-block {
  margin-top: 40px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  page-break-inside: avoid;
}

.signature-box {
  text-align: center;
  font-size: 11pt;
}

.signature-space {
  height: 75px;
}

.signature-name {
  font-weight: bold;
  text-decoration: underline;
}

/* Deep Learning Badge in Document */
.doc-dl-badge {
  display: inline-block;
  background: #f0fdfa;
  border: 1px solid #0d9488;
  color: #0f766e;
  font-family: var(--font-sans);
  font-size: 9pt;
  font-weight: bold;
  padding: 2px 8px;
  border-radius: 4px;
  margin-right: 6px;
}

/* ===================================================================
   TOAST NOTIFICATIONS
   =================================================================== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  min-width: 320px;
  max-width: 440px;
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  border-left: 4px solid var(--teal-500);
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideInRight 0.3s ease-out;
  transition: all var(--transition-fast);
}

.toast.success { border-left-color: var(--emerald-500); }
.toast.error   { border-left-color: var(--rose-500); }
.toast.warning { border-left-color: var(--amber-500); }
.toast.info    { border-left-color: var(--cyan-500); }

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(50px); }
  to { opacity: 1; transform: translateX(0); }
}

.toast-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
}

.toast.success .toast-icon { color: var(--emerald-500); }
.toast.error .toast-icon   { color: var(--rose-500); }
.toast.warning .toast-icon { color: var(--amber-500); }
.toast.info .toast-icon    { color: var(--cyan-500); }

.toast-content {
  flex: 1;
}

.toast-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--slate-900);
}

.toast-desc {
  font-size: 0.78rem;
  color: var(--slate-600);
}

/* ===================================================================
   MODAL WINDOWS
   =================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(11, 21, 36, 0.65);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
  animation: fadeIn 0.2s ease-out;
}

.modal-dialog {
  background: var(--white);
  border-radius: var(--radius-2xl);
  max-width: 650px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

.modal-header {
  padding: 20px 26px;
  border-bottom: 1px solid var(--slate-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--slate-900);
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 1.2rem;
  color: var(--slate-400);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
}

.modal-close-btn:hover {
  color: var(--slate-700);
}

.modal-body {
  padding: 24px 26px;
  overflow-y: auto;
}

.modal-footer {
  padding: 16px 26px;
  background: var(--slate-50);
  border-top: 1px solid var(--slate-100);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

/* ===================================================================
   DOCUMENT HISTORY TABLE & CARDS
   =================================================================== */
.history-table-container {
  background: var(--white);
  border-radius: var(--radius-xl);
  border: 1px solid var(--slate-200);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.history-table {
  width: 100%;
  border-collapse: collapse;
}

.history-table th {
  background: var(--slate-50);
  padding: 14px 18px;
  text-align: left;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--slate-500);
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--slate-200);
}

.history-table td {
  padding: 16px 18px;
  border-bottom: 1px solid var(--slate-100);
  font-size: 0.9rem;
  vertical-align: middle;
}

.history-table tr:hover td {
  background: var(--slate-50);
}

/* ===================================================================
   PRINT STYLES FOR HIGH QUALITY PDF PRINTING
   =================================================================== */
@media print {
  body {
    background: transparent !important;
  }
  .sidebar, .top-header, .editor-sidebar, .editor-toolbar, .toast-container, .modal-overlay, .btn {
    display: none !important;
  }
  .main-wrapper {
    margin-left: 0 !important;
    padding: 0 !important;
  }
  .content-body {
    padding: 0 !important;
    max-width: 100% !important;
  }
  .document-sheet {
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }
}

/* ===================================================================
   RESPONSIVE DESIGN (TABLET & MOBILE)
   =================================================================== */
@media (max-width: 1024px) {
  .hero-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .pillars-row {
    grid-template-columns: 1fr;
  }
  .editor-workspace {
    grid-template-columns: 1fr;
  }
  .editor-sidebar {
    position: static;
    max-height: none;
  }
}

@media (max-width: 768px) {
  :root {
    --sidebar-width: 260px;
  }
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-wrapper {
    margin-left: 0;
  }
  .mobile-menu-btn {
    display: block;
  }
  .top-header {
    padding: 0 16px;
  }
  .content-body {
    padding: 16px;
  }
  .hero-banner {
    padding: 24px 20px;
  }
  .hero-title {
    font-size: 1.6rem;
  }
  .col-12, .col-8, .col-6, .col-4, .col-3 {
    grid-column: span 12;
  }
  .document-sheet {
    padding: 24px 18px;
  }
  .hero-stats {
    grid-template-columns: 1fr;
  }
}
