/* ==========================================================================
   GENERATOR PERANGKAT AJAR KURIKULUM MERDEKA & DEEP LEARNING
   Enterprise Mobile-First Architecture & Bespoke Design System
   Custodian & Systems Architect: Anton Maghfiron (A.D.A COMPUTER)
   Copyright © 2026 A.D.A COMPUTER. All rights reserved.
   ========================================================================== */

:root {
  --primary: #0f766e;
  --primary-hover: #115e59;
  --primary-light: #ccfbf1;
  --primary-glow: rgba(15, 118, 110, 0.15);
  
  --secondary: #0284c7;
  --secondary-hover: #0369a1;
  
  --accent: #f59e0b;
  --accent-light: #fef3c7;
  
  --bg-main: #f8fafc;
  --bg-surface: #ffffff;
  --bg-subtle: #f1f5f9;
  
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-subtle: #94a3b8;
  
  --border-light: #e2e8f0;
  --border-focus: #0d9488;
  
  --success: #16a34a;
  --success-bg: #dcfce7;
  --warning: #d97706;
  --warning-bg: #fef3c7;
  --danger: #dc2626;
  --danger-bg: #fee2e2;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
  --shadow-paper: 0 12px 28px -6px rgba(15, 23, 42, 0.12), 0 4px 10px -2px rgba(15, 23, 42, 0.06);

  --font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --header-height: 64px;
  --bottom-nav-height: 68px;
}

/* Reset & Global Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  height: 100%;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-main);
  font-weight: 700;
  line-height: 1.25;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--primary-hover);
}

/* Sponsor & Custodian Top Bar */
.sponsor-bar {
  background: linear-gradient(135deg, #091e1d 0%, #062b29 50%, #022c22 100%);
  color: #e2e8f0;
  padding: 8px 14px;
  font-size: 0.8rem;
  border-bottom: 1px solid rgba(45, 212, 191, 0.25);
  z-index: 100;
}

.sponsor-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.sponsor-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sponsor-logo {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: contain;
  background: transparent;
}

.sponsor-title {
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #5eead4;
}

.sponsor-links {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.sponsor-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.08);
  color: #f1f5f9;
  border: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 0.75rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.sponsor-pill:hover {
  background: rgba(45, 212, 191, 0.2);
  border-color: #5eead4;
  color: #ffffff;
}

/* App Header */
.app-header {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 90;
  box-shadow: var(--shadow-sm);
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: #ffffff;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  box-shadow: 0 2px 8px var(--primary-glow);
  flex-shrink: 0;
}

.app-title-group h1 {
  font-size: 1.05rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.01em;
}

.app-title-group p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px; /* Mandatory positive horizontal clearance >= 10px */
}

.ai-text-full {
  display: inline;
}

.ai-text-short {
  display: none;
}

@media (max-width: 640px) {
  .ai-text-full {
    display: none;
  }
  .ai-text-short {
    display: inline;
  }
  .sponsor-bar {
    padding: 6px 10px;
    font-size: 0.72rem;
  }
  .sponsor-container {
    gap: 6px;
    justify-content: center;
  }
  .sponsor-links {
    gap: 6px;
    justify-content: center;
  }
  .sponsor-pill {
    padding: 2px 8px;
    font-size: 0.68rem;
  }
  .header-container {
    padding: 8px 12px;
    gap: 8px;
  }
  .app-icon {
    width: 32px;
    height: 32px;
    font-size: 1.05rem;
  }
  .app-title-group h1 {
    font-size: 0.88rem;
  }
  .app-title-group p {
    display: none;
  }
  .header-actions {
    gap: 10px;
  }
  .account-switcher-btn {
    max-width: 105px;
    padding: 5px 8px;
    font-size: 0.7rem;
    gap: 4px;
  }
  .ai-status-pill {
    padding: 5px 8px;
    font-size: 0.7rem;
    gap: 4px;
  }
  .nav-tabs-wrapper {
    display: none; /* Native bottom nav serves as mobile primary nav */
  }
}

/* User Account Badge Button */
.account-switcher-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-main);
  transition: all 0.15s ease;
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.account-switcher-btn:hover {
  background: #e2e8f0;
  border-color: #cbd5e1;
}

.account-avatar {
  width: 24px;
  height: 24px;
  background: #0d9488;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  flex-shrink: 0;
}

.ai-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.ai-status-pill.active {
  background: var(--success-bg);
  color: var(--success);
  border-color: #86efac;
}

.ai-status-pill.offline {
  background: var(--warning-bg);
  color: var(--warning);
  border-color: #fde68a;
}

/* Navigation Tabs (Top / Desktop & Sub-Nav) */
.nav-tabs-wrapper {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-light);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.nav-tabs-wrapper::-webkit-scrollbar {
  display: none;
}

.nav-tabs {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  padding: 0 16px;
  gap: 4px;
  list-style: none;
  white-space: nowrap; /* Anti-stacking rule */
  align-items: center;
  min-height: 48px;
}

.nav-tab-btn {
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 12px 16px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-tab-btn:hover {
  color: var(--primary);
  background: rgba(15, 118, 110, 0.04);
}

.nav-tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: rgba(15, 118, 110, 0.05);
}

/* Main Layout Container */
.main-content {
  flex: 1;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-bottom: calc(var(--bottom-nav-height) + 24px); /* Clearance for mobile bottom nav */
}

@media (min-width: 1024px) {
  .main-content {
    padding-bottom: 32px;
  }
}

/* Tab Panels */
.tab-panel {
  display: none;
  animation: fadeIn 0.2s ease-in-out;
}

.tab-panel.active {
  display: block;
}

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

/* Studio Grid Layout (Generator & Preview) */
.studio-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 1024px) {
  .studio-grid {
    grid-template-columns: 460px 1fr;
    align-items: start;
  }
}

/* Card Containers */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow 0.2s ease;
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #fafbfc;
}

.card-header h2 {
  font-size: 1.05rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-body {
  padding: 20px;
}

.card-footer {
  padding: 14px 20px;
  background: #fafbfc;
  border-top: 1px solid var(--border-light);
}

/* Form Groups & Inputs */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 6px;
}

.form-label .required {
  color: var(--danger);
}

.form-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.form-control, .form-select, .form-textarea {
  width: 100%;
  font-family: inherit;
  font-size: 0.9rem;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-light);
  background: #ffffff;
  color: var(--text-main);
  outline: none;
  transition: all 0.15s ease;
}

.form-control:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

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

.form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 640px) {
  .form-row.two-col {
    grid-template-columns: 1fr 1fr;
  }
  .form-row.three-col {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: all 0.15s ease;
  user-select: none;
}

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

.btn-primary {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 6px var(--primary-glow);
}

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

.btn-secondary {
  background: var(--secondary);
  color: #ffffff;
}

.btn-secondary:hover {
  background: var(--secondary-hover);
}

.btn-outline {
  background: transparent;
  border-color: var(--border-light);
  color: var(--text-main);
}

.btn-outline:hover {
  background: var(--bg-subtle);
  border-color: #cbd5e1;
}

.btn-success {
  background: var(--success);
  color: #ffffff;
}

.btn-success:hover {
  background: #15803d;
}

.btn-block {
  width: 100%;
}

.btn-lg {
  padding: 14px 22px;
  font-size: 1rem;
  border-radius: var(--radius-lg);
}

/* Quick Document Type Selector Pills */
.doc-type-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}

/* ==========================================================================
   DASHBOARD OVERVIEW & QUICK ACCESS STYLES (AS IN SCREENSHOT LANGKAH 4)
   ========================================================================== */

.dashboard-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

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

.stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.stat-icon {
  font-size: 1.25rem;
}

.stat-value {
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--text-main);
  line-height: 1;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.stat-bar {
  height: 4px;
  background: var(--border-light);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-top: 4px;
}

.stat-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
}

.stat-bar-fill.teal { background: var(--primary); }
.stat-bar-fill.blue { background: var(--secondary); }
.stat-bar-fill.amber { background: var(--accent); }
.stat-bar-fill.emerald { background: var(--success); }

/* Quick Access Cards */
.quick-access-section-title {
  font-size: 1.05rem;
  font-weight: 800;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.quick-access-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-bottom: 24px;
}

@media (min-width: 640px) {
  .quick-access-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .quick-access-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.quick-card {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 18px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  text-align: left;
}

.quick-card:hover {
  border-color: var(--primary);
  background: #f0fdfa;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.quick-card-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.quick-card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
}

.quick-card:hover .quick-card-icon {
  background: #ccfbf1;
}

.quick-card-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 4px;
}

.quick-card-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.quick-card-arrow {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  color: var(--primary);
  font-weight: 700;
  font-size: 0.85rem;
  gap: 4px;
}

/* Upload Dropzone Styling */
.logo-upload-box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1.5px dashed #cbd5e1;
  border-radius: var(--radius-md);
  background: #f8fafc;
  margin-top: 8px;
}

.logo-preview-thumb {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  object-fit: contain;
  background: #ffffff;
  border: 1px solid var(--border-light);
}

.btn-word {
  background: #1d4ed8;
  color: #ffffff;
}

.btn-word:hover {
  background: #1e40af;
}

@media (min-width: 480px) {
  .doc-type-selector {
    grid-template-columns: repeat(2, 1fr);
  }
}

.doc-type-card {
  border: 2px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 12px;
  cursor: pointer;
  background: var(--bg-surface);
  transition: all 0.2s ease;
  text-align: left;
}

.doc-type-card:hover {
  border-color: #99f6e4;
  background: #f0fdfa;
}

.doc-type-card.active {
  border-color: var(--primary);
  background: #f0fdfa;
  box-shadow: 0 0 0 1px var(--primary);
}

.doc-type-icon {
  font-size: 1.4rem;
  margin-bottom: 6px;
}

.doc-type-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
}

.doc-type-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.25;
}

/* Document Paper Preview (A4 Standard) */
.preview-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: #1e293b;
  color: #ffffff;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  flex-wrap: wrap;
  gap: 10px;
}

.preview-title {
  font-size: 0.88rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.preview-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.paper-viewport {
  background: #cbd5e1;
  padding: 16px;
  overflow-x: auto;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  display: flex;
  justify-content: center;
}

@media (min-width: 768px) {
  .paper-viewport {
    padding: 24px;
  }
}

.document-paper {
  background: #ffffff;
  color: #0f172a;
  width: 100%;
  max-width: 800px;
  min-height: 1050px;
  padding: 36px 32px;
  box-shadow: var(--shadow-paper);
  border-radius: 4px;
  font-size: 0.95rem;
  line-height: 1.6;
}

@media (min-width: 640px) {
  .document-paper {
    padding: 48px 42px;
  }
}

/* Formal Official KOP SURAT */
.kop-surat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 12px;
  border-bottom: 3px double #000000;
  margin-bottom: 24px;
  text-align: center;
}

.kop-logo-left, .kop-logo-right {
  width: 68px;
  height: 68px;
  object-fit: contain;
  flex-shrink: 0;
}

.kop-text-center {
  flex: 1;
}

.kop-text-center .kop-instansi {
  font-size: 0.92rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.25;
}

.kop-text-center .kop-dinas {
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.25;
}

.kop-text-center .kop-sekolah {
  font-size: 1.22rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 2px 0;
  line-height: 1.2;
}

.kop-text-center .kop-alamat {
  font-size: 0.76rem;
  line-height: 1.35;
  color: #334155;
}

.kop-text-center .kop-kontak {
  font-size: 0.74rem;
  color: #475569;
  font-style: italic;
}

/* Document Body Elements */
.doc-header-title {
  text-align: center;
  margin-bottom: 20px;
}

.doc-header-title h3 {
  font-size: 1.15rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
  color: #000000;
}

.doc-header-title p {
  font-size: 0.9rem;
  font-weight: 600;
  color: #334155;
}

.doc-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
  font-size: 0.88rem;
}

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

.doc-table th {
  background-color: #f1f5f9;
  font-weight: 700;
  text-align: left;
}

.doc-table.no-border td {
  border: none;
  padding: 4px 6px;
}

.doc-section-heading {
  font-size: 0.98rem;
  font-weight: 800;
  text-transform: uppercase;
  margin: 18px 0 8px 0;
  padding-bottom: 4px;
  border-bottom: 1.5px solid #0f172a;
}

.doc-signatures {
  display: flex;
  justify-content: space-between;
  margin-top: 40px;
  padding: 0 20px;
}

.sig-box {
  text-align: center;
  min-width: 220px;
}

.sig-spacer {
  height: 64px;
}

.sig-name {
  font-weight: 700;
  text-decoration: underline;
}

.sig-nip {
  font-size: 0.82rem;
  color: #334155;
}

/* ==========================================================================
   INTERACTIVE GUIDE (PANDUAN CERDAS & SEARCH HIGHLIGHT)
   Anti-slop dual-tone subtle contrast aesthetics
   ========================================================================== */

.guide-search-box {
  position: relative;
  margin-bottom: 20px;
}

.guide-search-input {
  width: 100%;
  padding: 14px 18px 14px 46px;
  border-radius: var(--radius-full);
  border: 2px solid #cbd5e1;
  background: #ffffff;
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.guide-search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-glow);
}

.guide-search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 1.15rem;
  pointer-events: none;
}

/* Filter Tag Pills */
.filter-pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 10px;
  margin-bottom: 20px;
  scrollbar-width: none;
  white-space: nowrap;
}

.filter-pills::-webkit-scrollbar {
  display: none;
}

.filter-pill {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.filter-pill:hover {
  background: #f1f5f9;
  color: var(--primary);
}

.filter-pill.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 2px 6px var(--primary-glow);
}

/* Search Highlighting: Subtle Dual-Tone Colors */
mark.search-highlight {
  background-color: rgba(254, 240, 138, 0.7); /* Subtle warm pastel gold */
  color: #854d0e;
  padding: 2px 4px;
  border-radius: 4px;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(133, 77, 14, 0.1);
}

mark.search-highlight.secondary {
  background-color: rgba(204, 251, 241, 0.85); /* Subtle cool pastel mint */
  color: #0f766e;
}

/* Guide Accordion & Cards */
.guide-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.guide-card:hover {
  border-color: #cbd5e1;
}

.guide-header {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  background: #ffffff;
  user-select: none;
  gap: 12px;
}

.guide-header-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.guide-step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #f0fdfa;
  color: var(--primary);
  border: 1.5px solid #99f6e4;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 700;
  flex-shrink: 0;
}

.guide-header h3 {
  font-size: 0.98rem;
  font-weight: 700;
}

.guide-chevron {
  font-size: 1rem;
  color: #94a3b8;
  transition: transform 0.2s ease;
}

.guide-card.open .guide-chevron {
  transform: rotate(180deg);
}

.guide-content {
  display: none;
  padding: 0 20px 20px 20px;
  border-top: 1px solid #f1f5f9;
  color: #334155;
  font-size: 0.9rem;
  line-height: 1.6;
}

.guide-card.open .guide-content {
  display: block;
  animation: fadeIn 0.2s ease;
}

.guide-tip-box {
  background: #f8fafc;
  border-left: 4px solid var(--primary);
  padding: 12px 16px;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin: 12px 0;
  font-size: 0.85rem;
}

.guide-code-box {
  background: #0f172a;
  color: #f8fafc;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-family: monospace;
  font-size: 0.85rem;
  overflow-x: auto;
  margin: 10px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Modals */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

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

.modal-dialog {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  max-width: 540px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15);
  overflow: hidden;
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-header h3 {
  font-size: 1.1rem;
}

.modal-close-btn {
  background: transparent;
  border: none;
  font-size: 1.25rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close-btn:hover {
  background: var(--bg-subtle);
  color: var(--text-main);
}

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

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-light);
  background: #fafbfc;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

/* Mobile Bottom Navigation Bar */
.bottom-nav {
  display: flex;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottom-nav-height);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--border-light);
  z-index: 80;
  justify-content: space-around;
  align-items: center;
  padding: 0 8px;
}

@media (min-width: 1024px) {
  .bottom-nav {
    display: none; /* Hidden on desktop */
  }
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  font-family: inherit;
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 600;
  gap: 4px;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  transition: all 0.15s ease;
  white-space: nowrap;
}

.bottom-nav-item .icon {
  font-size: 1.25rem;
}

.bottom-nav-item.active {
  color: var(--primary);
  background: rgba(15, 118, 110, 0.08);
}

/* Footer & Creator Attribution */
.app-footer {
  background: #0f172a;
  color: #94a3b8;
  padding: 24px 16px;
  font-size: 0.8rem;
  border-top: 1px solid #1e293b;
  margin-top: auto;
}

.footer-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
  text-align: center;
}

@media (min-width: 768px) {
  .footer-container {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-brand img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
}

.footer-copy {
  color: #cbd5e1;
  font-weight: 500;
}

.footer-meta {
  color: #64748b;
  font-size: 0.75rem;
}

/* ==========================================================================
   STRICT 6-PILLAR PRINT ISOLATION RULES
   Evaluates target document body to pure white (#ffffff)
   All cockpit/modal/buttons/headers evaluated to display: none !important
   ========================================================================== */

@media print {
  @page {
    size: A4 portrait;
    margin: 1.5cm;
  }

  *, *::before, *::after {
    background: transparent !important;
    color: #000000 !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  html, body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 11pt !important;
    line-height: 1.4 !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
  }

  /* All non-document UI strictly hidden */
  .no-print,
  .sponsor-bar,
  .app-header,
  .nav-tabs-wrapper,
  .bottom-nav,
  .preview-controls,
  .studio-grid > .card:first-child,
  .app-footer,
  .modal-overlay,
  .guide-search-box,
  .filter-pills,
  .account-switcher-btn,
  .ai-status-pill,
  button,
  .btn {
    display: none !important;
  }

  /* Document area becomes full width and clean */
  .main-content {
    padding: 0 !important;
    margin: 0 !important;
    max-width: 100% !important;
  }

  .studio-grid {
    display: block !important;
  }

  .paper-viewport {
    background: #ffffff !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: visible !important;
  }

  .document-paper {
    background: #ffffff !important;
    color: #000000 !important;
    box-shadow: none !important;
    border: none !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    min-height: auto !important;
    page-break-after: avoid;
  }

  .kop-surat {
    border-bottom: 3px double #000000 !important;
  }

  .doc-table th, .doc-table td {
    border: 1px solid #000000 !important;
  }

  .doc-table th {
    background-color: #f1f5f9 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}
