/* ==============================================================================
   OMPRENGPINTAR.ID - Core Stylesheet & Design System
   Modern, Cheerful, Accessible, and Mobile-First
   ============================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

:root {
  --font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  
  /* Brand Color Palette */
  --color-primary: #0284c7;        /* Sky 600 - Main Theme */
  --color-primary-light: #e0f2fe;  /* Sky 100 */
  --color-primary-dark: #0369a1;   /* Sky 700 */
  --color-accent-amber: #f59e0b;   /* Points & Warmth */
  --color-accent-orange: #f97316;  /* Energy & Food */
  --color-accent-green: #10b981;   /* Nutrition & Vegetables */
  --color-accent-purple: #8b5cf6;  /* Badges & Quizzes */
  
  /* Neutral Palette */
  --bg-page: #f8fafc;
  --bg-surface: #ffffff;
  --bg-sidebar: #0f172a;
  --border-color: #e2e8f0;
  --border-focus: #38bdf8;
  
  --text-main: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-white: #ffffff;
  
  /* Status Colors */
  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-danger: #ef4444;
  --color-info: #0284c7;

  /* Shadows & Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --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.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.03);
  --shadow-hover: 0 14px 20px -3px rgba(2, 132, 199, 0.15);
  
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

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

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Layout Utilities */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

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

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }

p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-family);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(2, 132, 199, 0.25);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #0369a1 0%, #075985 100%);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: var(--shadow-hover);
}

.btn-secondary {
  background-color: #f1f5f9;
  color: var(--text-main);
  border-color: #e2e8f0;
}

.btn-secondary:hover {
  background-color: #e2e8f0;
}

.btn-outline {
  background: transparent;
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.btn-outline:hover {
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
}

.btn-accent {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(245, 158, 11, 0.25);
}

.btn-accent:hover {
  background: #d97706;
  color: #ffffff;
}

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

.btn-danger:hover {
  background-color: #dc2626;
}

.btn-block {
  width: 100%;
}

.btn-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

/* Cards & Surfaces */
.card {
  background-color: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

/* Badges & Tags */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-primary { background-color: #e0f2fe; color: #0369a1; }
.badge-success { background-color: #d1fae5; color: #065f46; }
.badge-warning { background-color: #fef3c7; color: #92400e; }
.badge-danger  { background-color: #fee2e2; color: #991b1b; }
.badge-purple  { background-color: #ede9fe; color: #5b21b6; }

/* Alert Messages */
.alert {
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.alert-success { background-color: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; }
.alert-warning { background-color: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.alert-danger  { background-color: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.alert-info    { background-color: #f0f9ff; border: 1px solid #bae6fd; color: #075985; }

/* Forms */
.form-group {
  margin-bottom: 1.25rem;
}

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

.form-control {
  width: 100%;
  padding: 0.65rem 0.9rem;
  font-family: var(--font-family);
  font-size: 0.9rem;
  color: var(--text-main);
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

/* Demo Mode Watermark / Header Banner */
.demo-banner {
  background: linear-gradient(90deg, #f59e0b 0%, #ea580c 100%);
  color: #ffffff;
  padding: 0.4rem 1rem;
  font-size: 0.78rem;
  font-weight: 600;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

/* Navigation - Public */
.public-nav {
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 50;
}

.public-nav .nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--color-primary);
  text-decoration: none;
  flex-shrink: 0;
}

.brand-logo .logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  font-size: 1.1rem;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  align-items: center;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.9rem;
  text-decoration: none;
  transition: color 0.15s ease;
}

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

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.public-menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: #f1f5f9;
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 1.1rem;
  transition: all 0.2s ease;
}

.public-menu-toggle:hover {
  background: #e2e8f0;
  color: var(--color-primary);
}

/* Dropdown Drawer Menu untuk Navigasi Publik di Ponsel */
.public-mobile-drawer {
  display: none;
  background: #ffffff;
  border-top: 1px solid var(--border-color);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
  padding: 1rem 1.25rem 1.25rem;
}

.public-mobile-drawer.open {
  display: block;
}

.public-mobile-links {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.public-mobile-links a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.85rem;
  color: var(--text-main);
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
  border-radius: var(--radius-md);
  transition: background 0.15s ease;
}

.public-mobile-links a i {
  width: 20px;
  color: var(--color-primary);
  text-align: center;
}

.public-mobile-links a:hover,
.public-mobile-links a:active {
  background: #f0f9ff;
  color: var(--color-primary);
}

.public-mobile-auth {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--border-color);
}

.btn-block {
  display: flex;
  width: 100%;
  justify-content: center;
  align-items: center;
  text-align: center;
}

/* Hero Section */
.hero {
  padding: 3.5rem 0 3rem;
  background: linear-gradient(180deg, #f0f9ff 0%, #f8fafc 100%);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 3rem;
  align-items: center;
}

.hero-title {
  font-size: 2.75rem;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 1rem;
  color: #0369a1;
  word-break: normal;
  overflow-wrap: break-word;
}

.hero-title span {
  color: #f59e0b;
}

.hero-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.hero-btn {
  padding: 0.75rem 1.4rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.mbg-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 3rem;
  align-items: center;
}

.hero-illustration {
  background: #ffffff;
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  text-align: center;
}

/* Features Grid */
.features-section {
  padding: 3rem 0;
}

.feature-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-top: 2rem;
}

.feature-card {
  text-align: center;
  padding: 1.75rem 1.25rem;
}

.feature-icon-box {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  font-size: 1.5rem;
}

.feature-icon-box.blue   { background: #e0f2fe; color: #0284c7; }
.feature-icon-box.green  { background: #d1fae5; color: #10b981; }
.feature-icon-box.amber  { background: #fef3c7; color: #f59e0b; }
.feature-icon-box.purple { background: #ede9fe; color: #8b5cf6; }

/* Dashboard Application Shell */
.app-layout {
  display: flex;
  min-height: 100vh;
}

.app-sidebar {
  width: 250px;
  background-color: #0f172a;
  color: #f8fafc;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 40;
  transition: var(--transition);
}

.sidebar-header {
  padding: 1.25rem;
  border-bottom: 1px solid #1e293b;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.sidebar-menu {
  flex: 1;
  padding: 1rem 0.75rem;
  overflow-y: auto;
  list-style: none;
}

.sidebar-menu li {
  margin-bottom: 0.25rem;
}

.sidebar-menu a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-md);
  color: #94a3b8;
  font-size: 0.88rem;
  font-weight: 500;
  transition: var(--transition);
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
  background-color: #1e293b;
  color: #ffffff;
}

.sidebar-menu a.active {
  background: linear-gradient(90deg, rgba(2, 132, 199, 0.25) 0%, rgba(2, 132, 199, 0.05) 100%);
  border-left: 3px solid #0284c7;
  color: #38bdf8;
}

.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid #1e293b;
  font-size: 0.8rem;
}

/* App Main Content */
.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.app-topbar {
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 30;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.avatar-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
}

.app-content {
  flex: 1;
  padding: 1.5rem;
}

/* Stat Grid */
.stat-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.15rem;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.stat-icon.green  { background: #d1fae5; color: #10b981; }
.stat-icon.blue   { background: #e0f2fe; color: #0284c7; }
.stat-icon.amber  { background: #fef3c7; color: #f59e0b; }
.stat-icon.purple { background: #ede9fe; color: #8b5cf6; }

.stat-val {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.1;
}

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

/* Quick Menus (Storyboard Screen 5) */
.quick-menu-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.75rem;
}

.quick-menu-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem 0.5rem;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: var(--transition);
  text-decoration: none;
  color: var(--text-main);
}

.quick-menu-btn:hover {
  transform: translateY(-2px);
  border-color: var(--color-primary);
  box-shadow: var(--shadow-hover);
  color: var(--color-primary);
}

.quick-menu-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.5rem;
  font-size: 1.15rem;
}

.quick-menu-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-align: center;
}

/* ==============================================================================
   TEMA PONSEL & MOBILE-FIRST DESIGN SYSTEM (SISWA & GURU)
   Dioptimalkan untuk smartphone: Android & iOS / Edge-to-Edge / Safe-Area
   ============================================================================== */

/* Tombol Hamburger di Topbar Ponsel */
.mobile-menu-toggle {
  display: none;
  background: #f1f5f9;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 1.15rem;
  padding: 0.45rem;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  align-items: center;
  justify-content: center;
  min-width: 40px;
  min-height: 40px;
  margin-right: 0.65rem;
}

.mobile-menu-toggle:active {
  background: #e2e8f0;
  transform: scale(0.92);
}

/* Tombol Tutup di Header Drawer */
.drawer-close-btn {
  display: none;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #ffffff;
  font-size: 1rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  margin-left: auto;
}

.drawer-close-btn:active {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(0.9);
}

/* Backdrop Overlay Hitam Blur saat Drawer Terbuka */
.drawer-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.3s ease;
}

body.sidebar-open .drawer-backdrop {
  opacity: 1;
  visibility: visible;
}

/* Mobile Bottom Navigation Dock (Tab Bar Ponsel Modern - Clean White) */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  border-radius: 16px 16px 0 0;
  padding: 0.3rem 0.25rem calc(0.35rem + env(safe-area-inset-bottom, 0px));
  z-index: 95;
  box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.07);
}

.mobile-bottom-nav ul {
  display: flex;
  justify-content: space-around;
  align-items: flex-end;
  list-style: none;
  margin: 0;
  padding: 0;
}

.mobile-bottom-nav li {
  flex: 1;
  text-align: center;
}

/* Semua item nav — tinggi seragam & label sejajar */
.mobile-bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 0.18rem;
  font-size: 0.64rem;
  font-weight: 600;
  color: #94a3b8;
  text-decoration: none;
  padding: 0.35rem 0 0.25rem;
  transition: all 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
  min-height: 52px;
  border-radius: 10px;
  position: relative;
}

.mobile-bottom-nav a i {
  font-size: 1.2rem;
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.mobile-bottom-nav a:active {
  transform: scale(0.9);
  background: #f8fafc;
}

.mobile-bottom-nav a.active {
  color: var(--color-primary);
  font-weight: 700;
}

.mobile-bottom-nav a.active i {
  transform: scale(1.15);
  color: var(--color-primary);
  filter: drop-shadow(0 0 4px rgba(2, 132, 199, 0.4));
}

/* Dot indicator biru kecil di atas ikon aktif */
.mobile-bottom-nav a.active::before {
  content: '';
  position: absolute;
  top: 5px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--color-primary);
}

/* ============================================================
   FAB — Tombol Kamera Foto MBG (sedikit terangkat, label sejajar)
   ============================================================ */
.mobile-bottom-nav .fab-slot {
  position: relative;
  top: -8px;      /* elevasi kecil agar tidak terlalu tinggi */
  flex: 1;
}

/* Wrapper untuk FAB + label agar sejajar secara visual */
.mobile-bottom-nav .fab-slot-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  min-height: 52px;
  padding-bottom: 0.25rem;
  gap: 0.18rem;
}

.mobile-bottom-nav .fab-btn {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff !important;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  box-shadow:
    0 0 0 3px #ffffff,
    0 0 0 5px rgba(16, 185, 129, 0.25),
    0 6px 18px rgba(5, 150, 105, 0.4);
  border: none;
  transition: all 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
  padding: 0;
}

.mobile-bottom-nav .fab-btn i {
  font-size: 1.35rem;
  color: #ffffff !important;
}

.mobile-bottom-nav .fab-btn:active {
  transform: scale(0.88);
  box-shadow:
    0 0 0 3px #ffffff,
    0 0 0 5px rgba(16, 185, 129, 0.15),
    0 3px 8px rgba(5, 150, 105, 0.35);
}

.mobile-bottom-nav .fab-btn.active {
  background: linear-gradient(135deg, #34d399 0%, #059669 100%);
  box-shadow:
    0 0 0 3px #ffffff,
    0 0 0 5px rgba(52, 211, 153, 0.35),
    0 6px 20px rgba(5, 150, 105, 0.55);
}

/* Label "Foto MBG" — sejajar dengan label ikon lain */
.mobile-bottom-nav .fab-label {
  display: block;
  font-size: 0.64rem;
  font-weight: 700;
  color: #059669;
  letter-spacing: 0.01em;
  line-height: 1;
}


/* ============================================================
   Riwayat Kuis — Card List (ganti tabel yang sempit di ponsel)
   ============================================================ */
.quiz-history-cards {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.quiz-history-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  transition: box-shadow 0.15s ease;
}

.quiz-history-card:hover {
  box-shadow: 0 2px 10px rgba(15,23,42,0.07);
}

.qhc-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.qhc-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: #1e293b;
  line-height: 1.35;
  flex: 1;
  /* Batasi judul ke 2 baris, tidak meluber */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.qhc-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

/* ============================================================
   Global Fix: Teks & Konten Tidak Meluber di Ponsel
   ============================================================ */

/* Cegah semua elemen overflow horisontal */
.card,
.content-container,
.app-content {
  word-break: normal;
  overflow-wrap: break-word;
}

/* Badge tidak terpotong */
.badge {
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}

/* ==============================================================================
   TABLE RESPONSIVE & HORIZONTAL SCROLLING SYSTEM
   Menangani tabel di desktop dan layar ponsel sempit (360px - 480px)
   ============================================================================== */
.table-responsive,
.table-wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 1rem;
  border-radius: var(--radius-md);
  position: relative;
}

/* Custom modern scrollbar untuk tabel */
.table-responsive::-webkit-scrollbar,
.table-wrapper::-webkit-scrollbar {
  height: 6px;
}
.table-responsive::-webkit-scrollbar-track,
.table-wrapper::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 999px;
}
.table-responsive::-webkit-scrollbar-thumb,
.table-wrapper::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
}

/* Base table styling */
table.data-table,
.table-responsive table,
.table-wrapper table,
table.responsive-table {
  width: 100%;
  min-width: 640px; /* Cegah kolom terhimpit jadi 1 huruf per baris di HP */
  border-collapse: collapse;
  font-size: 0.88rem;
  text-align: left;
}

/* Cegah teks header pecah per-huruf vertikal */
table.data-table th,
.table-responsive th,
.table-wrapper th,
table.responsive-table th {
  white-space: nowrap;
  word-break: normal !important;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* Isi sel tabel */
table.data-table td,
.table-responsive td,
.table-wrapper td,
table.responsive-table td {
  white-space: normal;
  word-break: normal !important;
  vertical-align: middle;
}

/* Kolom teks penting yang sebaiknya tidak wrap */
.text-nowrap {
  white-space: nowrap !important;
}

/* Tombol aksi di tabel — jangan stretch */
.table .btn,
table .btn {
  white-space: nowrap;
}

/* Indikator scroll di layar ponsel */
.table-scroll-hint {
  display: none;
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 0.35rem;
  margin-bottom: 0.5rem;
  align-items: center;
  gap: 0.35rem;
}
@media (max-width: 768px) {
  .table-scroll-hint {
    display: flex;
  }
}

/* Judul section: font lebih kecil di ponsel agar tidak terpotong */
@media (max-width: 640px) {
  .card h2,
  .card h3 {
    font-size: 1rem !important;
  }

  /* Stat value di dashboard */
  .stat-value {
    font-size: 1.4rem !important;
  }
}


.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.dashboard-info-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1.5rem;
}

/* Site Footer */
.site-footer {
  background: #ffffff;
  border-top: 1px solid var(--border-color);
  padding: 3rem 0;
  margin-top: 4rem;
}

.site-footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

/* ==============================================================================
   RESPONSIVE MEDIA QUERIES (LAYAR SMARTPHONE / TABLET < 900PX)
   ============================================================================== */
@media (max-width: 900px) {
  /* === Navigasi Publik Responsif === */
  .public-nav .nav-links {
    display: none !important;
  }

  .public-menu-toggle {
    display: flex !important;
  }

  .hide-mobile {
    display: none !important;
  }

  .public-nav .nav-container {
    height: 56px;
  }

  /* === Hero Section Responsif === */
  .hero {
    padding: 2rem 0 1.75rem;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }

  .hero-title {
    font-size: 1.85rem;
    line-height: 1.25;
    margin-bottom: 0.85rem;
    letter-spacing: -0.02em;
  }

  .hero-subtitle {
    font-size: 0.92rem;
    line-height: 1.55;
    margin-bottom: 1.5rem;
  }

  .hero-actions {
    flex-direction: column;
    width: 100%;
    gap: 0.65rem;
  }

  .hero-actions .hero-btn,
  .hero-actions .btn {
    width: 100%;
    min-height: 48px;
    font-size: 0.95rem;
    font-weight: 700;
    border-radius: 12px;
    justify-content: center;
  }

  .hero-illustration {
    padding: 1rem;
  }

  /* === Grid Fitur Kartu: Horizontal Compact di Ponsel === */
  .feature-cards-grid {
    grid-template-columns: 1fr !important;
    gap: 0.75rem;
  }

  .feature-card {
    text-align: left;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
  }

  .feature-card .feature-icon-box {
    margin: 0;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    font-size: 1.15rem;
  }

  .feature-card h4 {
    margin-bottom: 0.15rem !important;
    font-size: 0.95rem;
  }

  .feature-card p {
    font-size: 0.8rem !important;
    line-height: 1.4;
  }

  /* === Section MBG Grid 1 Kolom === */
  .mbg-grid {
    grid-template-columns: 1fr !important;
    gap: 1.5rem;
  }

  /* === Section Padding Responsif === */
  .features-section {
    padding: 2rem 0;
  }

  #mbg {
    padding: 2rem 0 !important;
  }

  /* === Sidebar Desktop Menjadi Drawer Ponsel === */
  .mobile-menu-toggle {
    display: inline-flex;
  }

  .drawer-close-btn {
    display: flex;
  }

  .app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 290px;
    max-width: 82vw;
    height: 100%;
    z-index: 999;
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: none;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  body.sidebar-open {
    overflow: hidden;
  }

  body.sidebar-open .app-sidebar {
    transform: translateX(0);
    box-shadow: 14px 0 35px rgba(0, 0, 0, 0.4);
  }

  .app-sidebar .sidebar-menu a {
    padding: 0.75rem 1rem;
    font-size: 0.88rem;
    border-radius: var(--radius-sm);
  }

  .mobile-bottom-nav {
    display: block;
  }

  .app-content {
    padding: 1.15rem 0.85rem;
    padding-bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px));
  }

  /* === Stat Cards Grid 2 Kolom Rapi === */
  .stat-cards-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
    margin-bottom: 1rem;
  }

  .stat-card {
    padding: 0.75rem;
    gap: 0.55rem;
  }

  .stat-icon {
    width: 36px;
    height: 36px;
    font-size: 0.95rem;
  }

  .stat-val {
    font-size: 1.05rem;
  }

  .stat-sub {
    font-size: 0.68rem;
  }

  /* === Quick Menu Grid 3 Kolom Rapi di Ponsel === */
  .quick-menu-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
  }

  .quick-menu-btn {
    padding: 0.65rem 0.25rem;
  }

  .quick-menu-icon {
    width: 36px;
    height: 36px;
    font-size: 1rem;
    margin-bottom: 0.3rem;
  }

  .quick-menu-label {
    font-size: 0.7rem;
    line-height: 1.2;
  }

  /* === Footer Responsif Vertikal di Ponsel === */
  .site-footer {
    padding: 2rem 0;
    margin-top: 2.5rem;
  }

  .site-footer-inner {
    flex-direction: column;
    text-align: center;
    gap: 0.75rem;
  }

  .site-footer-inner .brand-logo {
    justify-content: center;
  }

  /* === Feature Cards 2 Kolom di Tablet/Ponsel === */
  .feature-cards-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.75rem;
  }

  .feature-card {
    text-align: left;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
  }

  .feature-card .feature-icon-box {
    margin: 0;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    font-size: 1.15rem;
  }

  .feature-card h4 {
    margin-bottom: 0.15rem !important;
    font-size: 0.95rem;
  }

  .feature-card p {
    font-size: 0.8rem !important;
    line-height: 1.4;
  }

  /* === Dashboard Grid Menjadi 1 Kolom di Ponsel === */
  .dashboard-info-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .dashboard-header h2 {
    font-size: 1.1rem;
  }
}

/* ==============================================================================
   OPTIMASI KHUSUS PONSEL KECIL (< 640PX)
   ============================================================================== */
@media (max-width: 640px) {
  .app-topbar {
    padding: 0.55rem 0.75rem;
  }

  .app-topbar h3 {
    font-size: 0.92rem !important;
  }

  .app-topbar p {
    font-size: 0.7rem !important;
  }

  .topbar-user {
    gap: 0.3rem;
    flex-shrink: 0;
  }

  .topbar-user .badge {
    padding: 0.2rem 0.4rem !important;
    font-size: 0.68rem !important;
    white-space: nowrap;
  }

  .topbar-user .badge span {
    display: none;
  }

  .avatar-circle {
    width: 30px;
    height: 30px;
    font-size: 0.75rem;
  }

  .card {
    padding: 0.85rem;
    border-radius: var(--radius-md);
  }

  input[type="text"],
  input[type="number"],
  input[type="password"],
  input[type="email"],
  input[type="date"],
  select,
  textarea {
    font-size: 16px !important;
    min-height: 44px;
    border-radius: 10px;
  }

  .btn {
    min-height: 44px;
    font-size: 0.85rem;
  }

  .btn-sm {
    min-height: 36px;
    font-size: 0.75rem;
    padding: 0.3rem 0.6rem;
  }

  .table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-sm);
  }

  .demo-banner {
    font-size: 0.65rem;
    padding: 0.3rem 0.5rem;
  }

  h2 { font-size: 1.15rem; }
  h3 { font-size: 1.05rem; }
  h4 { font-size: 0.95rem; }

  .alert {
    padding: 0.65rem 0.85rem;
    font-size: 0.82rem;
    gap: 0.5rem;
  }

  /* === Feature Cards: 1 Kolom penuh di Ponsel Kecil === */
  .feature-cards-grid {
    grid-template-columns: 1fr !important;
  }

  /* === Quick Menu: 3 Kolom di Ponsel Kecil === */
  .quick-menu-grid {
    grid-template-columns: repeat(3, 1fr) !important;
  }

  /* === Hero Tombol Penuh di Ponsel Kecil === */
  .hero-actions .hero-btn,
  .hero-actions .btn {
    width: 100% !important;
    min-height: 48px !important;
    justify-content: center !important;
  }
}

/* ==============================================================================
   RESPONSIVE DATA VIEW: TABEL DI DESKTOP / CARD DI PONSEL
   ============================================================================== */
.desktop-table-view {
  display: block;
}
.mobile-cards-view {
  display: none;
}

@media (max-width: 768px) {
  .desktop-table-view {
    display: none !important;
  }
  .mobile-cards-view {
    display: flex !important;
    flex-direction: column;
    gap: 0.85rem;
  }
  .btn {
    white-space: normal;
    max-width: 100%;
  }
}

