/* ============================================================
   LinAlg.id — main.css
   Global CSS: variables, reset, layout, components, utilities
   ============================================================ */

/* ── 1. CSS Custom Properties ─────────────────────────────── */
:root {
  /* Colors */
  --color-bg:          #F8F7F4;
  --color-surface:     #FFFFFF;
  --color-border:      #E8E6E0;
  --color-text:        #1C1B18;
  --color-text-muted:  #6B6860;
  --color-primary:     #2563EB;
  --color-primary-bg:  #EFF4FF;
  --color-success:     #16A34A;
  --color-success-bg:  #F0FDF4;
  --color-warning:     #B45309;
  --color-warning-bg:  #FFFBEB;
  --color-danger:      #DC2626;
  --color-danger-bg:   #FEF2F2;
  --color-info:        #0369A1;
  --color-info-bg:     #EFF6FF;
}

/* ── Theme: Biru / Maskulin (default) ───────────────────────── */
:root,
html.theme-male {
  --color-primary:    #2563EB;
  --color-primary-bg: #EFF4FF;
}

/* ── Theme: Pink / Feminin ───────────────────────────────────── */
html.theme-female {
  --color-primary:     #DB2777;
  --color-primary-bg:  #FCE7F3;
  --color-bg:          #FDF2F8;
  --color-surface:     #FFFFFF;
  --color-border:      #FBCFE8;
  --color-text-muted:  #9D174D;
}

html.theme-female body {
  background: var(--color-bg);
}

html.theme-female .sidebar {
  background: #FFFFFF;
  border-right-color: #FBCFE8;
}

html.theme-female .nav-item:hover {
  background: #FCE7F3;
  color: #DB2777;
}

html.theme-female .nav-item.active {
  background: #FCE7F3;
  color: #DB2777;
}

html.theme-female .nav-item.active .nav-icon {
  color: #DB2777;
}

html.theme-female .sidebar-header,
html.theme-female .sidebar-user {
  border-color: #FBCFE8;
}

html.theme-female .card {
  background: #FFFFFF;
  border-color: #FBCFE8;
}

html.theme-female .welcome-banner {
  background: linear-gradient(135deg, #FFFFFF 0%, #FCE7F3 100%);
  border-color: #FBCFE8;
}

html.theme-female .main-content {
  background: #FDF2F8;
}

html.theme-female .progress-bar {
  background: #FBCFE8;
}

html.theme-female .progress-fill {
  background: #DB2777;
}

html.theme-female .chapter-header {
  background: #FDF2F8;
  border-color: #FBCFE8;
}

html.theme-female .module-item:hover {
  background: #FDF2F8;
  border-color: #FBCFE8;
}

html.theme-female .module-item.active {
  background: #FCE7F3;
  border-color: #F9A8D4;
}

html.theme-female .module-item-status.ongoing {
  background: #FCE7F3;
  color: #DB2777;
}

html.theme-female .toc-item.active {
  background: #FCE7F3;
  color: #DB2777;
}

html.theme-female .badge-item {
  border-color: #FBCFE8;
}

html.theme-female .quiz-option:hover:not(.selected):not(.correct):not(.wrong) {
  border-color: #DB2777;
  background: #FCE7F3;
}

html.theme-female .quiz-option.selected {
  border-color: #DB2777;
  background: #FCE7F3;
}

html.theme-female .quick-action-card:hover {
  border-color: #DB2777;
}

html.theme-female .quick-action-icon {
  background: #FCE7F3;
  color: #DB2777;
}

html.theme-female a:hover {
  color: #BE185D;
}

:root {
  /* Typography */
  --font-body:  'Inter', system-ui, sans-serif;
  --font-mono:  'JetBrains Mono', 'Courier New', monospace;
  --text-base:  14px;
  --lh-base:    1.6;

  /* Spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 32px;

  /* Layout */
  --sidebar-w:   220px;
  --topbar-h:    56px;
  --radius-sm:   6px;
  --radius-md:   8px;
  --radius-lg:   12px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,.08);

  /* Transitions */
  --transition: .15s ease;
}

/* ── 2. Reset & Base ──────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html { font-size: var(--text-base); scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--lh-base);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

img  { max-width: 100%; display: block; }
a    { color: var(--color-primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: #1d4ed8; }
ul, ol { list-style: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }
h1 { font-size: 22px; font-weight: 600; line-height: 1.3; }
h2 { font-size: 18px; font-weight: 600; line-height: 1.3; }
h3 { font-size: 15px; font-weight: 600; line-height: 1.4; }
h4 { font-size: 13px; font-weight: 600; }
code, pre { font-family: var(--font-mono); }
pre { background: #1e1e2e; color: #cdd6f4; padding: 16px; border-radius: var(--radius-md); overflow-x: auto; font-size: 13px; }

/* ── 3. Layout Utama ──────────────────────────────────────── */
.layout-app {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform var(--transition);
}

.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  padding: var(--space-4);
  overflow-x: hidden;
  min-height: 100vh;
  animation: fadeIn .2s ease;
  box-sizing: border-box;
  width: calc(100% - var(--sidebar-w));
}

.page-header {
  margin-bottom: var(--space-4);
}
.page-header h1 { margin-bottom: 4px; }
.page-header p  { color: var(--color-text-muted); font-size: 13px; }

/* ── 4. Sidebar styles ────────────────────────────────────── */
.sidebar-header {
  padding: 18px 16px;
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--color-text);
  font-weight: 700;
  font-size: 17px;
  text-decoration: none;
}
.sidebar-logo .logo-icon { color: var(--color-primary); font-size: 20px; }
.sidebar-logo .logo-text span { color: var(--color-primary); }

.sidebar-nav {
  flex: 1;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-section-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--color-text-muted);
  padding: 8px 8px 4px;
  font-weight: 600;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  color: var(--color-text);
  font-size: 13.5px;
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
  cursor: pointer;
  text-decoration: none;
}
.nav-item:hover  { background: var(--color-bg); color: var(--color-primary); }
.nav-item.active { background: var(--color-primary-bg); color: var(--color-primary); }
.nav-item.active .nav-icon { color: var(--color-primary); }
.nav-sub { padding-left: 16px; font-size: 13px; font-weight: 400; }

.nav-icon { width: 18px; text-align: center; color: var(--color-text-muted); font-size: 14px; }

.sidebar-user {
  padding: 12px 14px;
  border-top: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { font-size: 11px; color: var(--color-text-muted); }
.sidebar-user-actions { display: flex; gap: 8px; }
.sidebar-user-actions a { color: var(--color-text-muted); font-size: 14px; padding: 8px; border-radius: 6px; display: flex; align-items: center; justify-content: center; }
.sidebar-user-actions a:hover { color: var(--color-primary); }

/* ── 5. Topbar ────────────────────────────────────────────── */
.topbar {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  align-items: center;
  padding: 0 16px;
  gap: 12px;
  z-index: 99;
}
.topbar-logo {
  flex: 1;
  font-weight: 700;
  font-size: 16px;
  color: var(--color-text);
  text-decoration: none;
}
.topbar-logo i { color: var(--color-primary); }
.topbar-actions { display: flex; align-items: center; gap: 8px; }

.hamburger {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--color-text);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}
.hamburger:hover { background: var(--color-bg); }

/* ── 6. Sidebar Overlay (mobile) ──────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 99;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition), visibility var(--transition);
}
.sidebar-overlay.active {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

/* ── 7. Bottom Nav (mobile) ───────────────────────────────── */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  z-index: 98;
  justify-content: space-around;
  padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
}
.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 12px;
  min-height: 44px;
  font-size: 10px;
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color var(--transition);
}
.bottom-nav-item i { font-size: 18px; }
.bottom-nav-item.active, .bottom-nav-item:hover { color: var(--color-primary); }

/* ── 8. Site Footer ───────────────────────────────────────── */
.site-footer {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: 16px var(--space-4);
  margin-top: var(--space-5);
  margin-left: var(--sidebar-w);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--color-text-muted);
  flex-wrap: wrap;
  gap: 8px;
}
.footer-links { display: flex; gap: 16px; }
.footer-links a { color: var(--color-text-muted); }
.footer-links a:hover { color: var(--color-primary); }

/* ── 9. Cards ─────────────────────────────────────────────── */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.card-header {
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-header h2, .card-header h3 { margin: 0; }
.card-body  { }
.card-footer {
  padding-top: 14px;
  margin-top: 14px;
  border-top: 1px solid var(--color-border);
}

/* ── 10. Buttons ──────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: background var(--transition), box-shadow var(--transition), opacity var(--transition);
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }

.btn-primary   { background: var(--color-primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: #1d4ed8; color: #fff; }

.btn-secondary { background: transparent; border: 1px solid var(--color-border); color: var(--color-text); }
.btn-secondary:hover:not(:disabled) { background: var(--color-bg); }

.btn-danger    { background: var(--color-danger); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #b91c1c; color: #fff; }

.btn-success   { background: var(--color-success); color: #fff; }
.btn-success:hover:not(:disabled) { background: #15803d; color: #fff; }

.btn-ghost     { background: transparent; color: var(--color-primary); }
.btn-ghost:hover { background: var(--color-primary-bg); }

.btn-sm  { padding: 5px 12px; font-size: 12px; }
.btn-lg  { padding: 11px 22px; font-size: 15px; }
.btn-fw  { width: 100%; justify-content: center; }
.btn-icon { padding: 7px; }

.btn-loading { position: relative; color: transparent !important; }
.btn-loading::after {
  content: '';
  position: absolute;
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

/* ── 11. Badges / Chips ───────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  font-weight: 500;
  white-space: nowrap;
}
.badge-success { background: var(--color-success-bg); color: var(--color-success); }
.badge-warning { background: var(--color-warning-bg); color: var(--color-warning); }
.badge-danger  { background: var(--color-danger-bg);  color: var(--color-danger); }
.badge-info    { background: var(--color-info-bg);    color: var(--color-info); }
.badge-default { background: var(--color-bg);         color: var(--color-text-muted); border: 1px solid var(--color-border); }

/* ── 12. Forms ────────────────────────────────────────────── */
.form-group   { margin-bottom: 16px; }
.form-label   { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; color: var(--color-text); }
.form-hint    { font-size: 11px; color: var(--color-text-muted); margin-top: 4px; }
.form-error   { font-size: 11px; color: var(--color-danger); margin-top: 4px; }

.form-input, .form-select, .form-textarea {
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 9px 12px;
  font-size: 13.5px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  background: var(--color-surface);
  color: var(--color-text);
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.10);
}
.form-input.error { border-color: var(--color-danger); }
.form-textarea { resize: vertical; min-height: 100px; }
.form-select   { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236B6860' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }

.input-wrapper { position: relative; }
.input-icon    { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--color-text-muted); }
.input-icon ~ .form-input { padding-left: 38px; }
.input-suffix  { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); cursor: pointer; color: var(--color-text-muted); background: none; border: none; }

.form-check { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.form-check input[type=checkbox] { width: 15px; height: 15px; cursor: pointer; accent-color: var(--color-primary); }

/* ── 13. Alerts ───────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
}
.alert i { margin-top: 1px; flex-shrink: 0; }
.alert-success { background: var(--color-success-bg); color: #166534; border: 1px solid #bbf7d0; }
.alert-danger  { background: var(--color-danger-bg);  color: #991b1b; border: 1px solid #fecaca; }
.alert-warning { background: var(--color-warning-bg); color: #92400e; border: 1px solid #fde68a; }
.alert-info    { background: var(--color-info-bg);    color: #075985; border: 1px solid #bae6fd; }

/* ── 14. Progress Bar ─────────────────────────────────────── */
.progress-track {
  height: 8px;
  background: var(--color-bg);
  border-radius: var(--radius-full);
  overflow: hidden;
  border: 1px solid var(--color-border);
}
.progress-fill {
  height: 100%;
  background: var(--color-primary);
  border-radius: var(--radius-full);
  transition: width .6s ease;
}
.progress-fill.success { background: var(--color-success); }
.progress-fill.warning { background: #f59e0b; }
.progress-fill.danger  { background: var(--color-danger); }

/* ── 15. Avatar ───────────────────────────────────────────── */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background: var(--color-primary-bg);
  color: var(--color-primary);
  font-weight: 700;
  font-size: 14px;
  width: 36px; height: 36px;
  flex-shrink: 0;
  text-decoration: none;
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-xs  { width: 28px; height: 28px; font-size: 11px; }
.avatar-sm  { width: 32px; height: 32px; font-size: 12px; }
.avatar-lg  { width: 56px; height: 56px; font-size: 22px; }
.avatar-xl  { width: 80px; height: 80px; font-size: 30px; }

/* ── 16. Loading Spinner ──────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 20px; height: 20px;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.spinner-lg { width: 36px; height: 36px; border-width: 3px; }

.loading-overlay {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 40px;
  color: var(--color-text-muted);
  font-size: 13px;
}

/* ── 17. Empty State ──────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--color-text-muted);
}
.empty-state i    { font-size: 36px; color: var(--color-border); margin-bottom: 12px; display: block; }
.empty-state h3   { color: var(--color-text); margin-bottom: 6px; font-size: 15px; }
.empty-state p    { font-size: 13px; }

/* ── 18. Tables ───────────────────────────────────────────── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
thead th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--color-text-muted);
  font-weight: 600;
  padding: 10px 14px;
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
  background: var(--color-bg);
}
tbody td { padding: 10px 14px; border-bottom: 1px solid var(--color-border); vertical-align: middle; }
tbody tr:hover { background: var(--color-bg); }
tbody tr:last-child td { border-bottom: none; }

/* ── 19. Grid helpers ─────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-4); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-4); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-4); }

.flex-row     { display: flex; flex-direction: row; }
.flex-col     { display: flex; flex-direction: column; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center  { display: flex; justify-content: center; align-items: center; }
.flex-gap-2   { gap: 8px; }
.flex-gap-3   { gap: 16px; }
.gap-wrap     { flex-wrap: wrap; }

/* ── 20. MathJax overrides ────────────────────────────────── */
.math-display { overflow-x: auto; padding: 16px 0; -webkit-overflow-scrolling: touch; }
mjx-container { overflow-x: auto; max-width: 100%; }

/* ── 21. Utilities ────────────────────────────────────────── */
.text-muted    { color: var(--color-text-muted) !important; }
.text-primary  { color: var(--color-primary) !important; }
.text-success  { color: var(--color-success) !important; }
.text-danger   { color: var(--color-danger) !important; }
.text-sm       { font-size: 12px !important; }
.text-xs       { font-size: 11px !important; }
.text-center   { text-align: center; }
.text-right    { text-align: right; }
.font-mono     { font-family: var(--font-mono); }
.font-bold     { font-weight: 700; }
.font-medium   { font-weight: 500; }

.mt-1 { margin-top: var(--space-1); } .mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); } .mt-4 { margin-top: var(--space-4); }
.mb-1 { margin-bottom: var(--space-1); } .mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); } .mb-4 { margin-bottom: var(--space-4); }
.p-1  { padding: var(--space-1); } .p-2 { padding: var(--space-2); }
.p-3  { padding: var(--space-3); } .p-4 { padding: var(--space-4); }

.d-none  { display: none !important; }
.d-block { display: block !important; }
.d-flex  { display: flex !important; }
.w-full  { width: 100%; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Divider */
.divider {
  display: flex; align-items: center; gap: 12px;
  color: var(--color-text-muted); font-size: 12px; margin: 16px 0;
}
.divider::before, .divider::after {
  content: ''; flex: 1; height: 1px; background: var(--color-border);
}

/* Breadcrumb */
.breadcrumb {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--color-text-muted);
  margin-bottom: 12px; flex-wrap: wrap;
}
.breadcrumb a { color: var(--color-text-muted); }
.breadcrumb a:hover { color: var(--color-primary); }
.breadcrumb-sep { color: var(--color-border); }

/* Stat card */
.stat-card       { text-align: center; padding: 20px; }
.stat-card-value { font-size: 28px; font-weight: 700; color: var(--color-primary); line-height: 1; margin-bottom: 4px; }
.stat-card-label { font-size: 12px; color: var(--color-text-muted); }

/* ── 22. Animations ───────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-16px); }
  to   { opacity: 1; transform: none; }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: .5; }
}
.animate-pulse { animation: pulse 1.5s ease-in-out infinite; }

/* ── 23. Responsive — Tablet ──────────────────────────────── */
@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay { display: block; visibility: hidden; }

  .main-content { margin-left: 0; padding-top: calc(var(--topbar-h) + 16px); width: 100%; }
  .topbar { display: flex; }
  .site-footer { margin-left: 0; }

  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

/* ── 24. Responsive — Mobile ──────────────────────────────── */
@media (max-width: 640px) {
  .main-content { padding: 72px 16px 88px; width: 100%; box-sizing: border-box; }
  .bottom-nav { display: flex; }

  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .flex-between { flex-wrap: wrap; gap: 8px; }

  h1 { font-size: 18px; }
  h2 { font-size: 15px; }

  .card { padding: 16px; border-radius: var(--radius-md); }

  /* Hide text in topbar on very small screens */
  .topbar-logo { font-size: 14px; }
}