/* ═══════════════════════════════════════════════════════════════
   EduMart — Design system (Aurora Mist palette)
   Soft indigo · violet · cyan accents — smooth modern UI
═══════════════════════════════════════════════════════════════ */

/* ── Variables ──────────────────────────────────────────────── */
:root {
  --primary: #6366f1;
  --primary-soft: #818cf8;
  --primary-deep: #4f46e5;
  --accent-cyan: #22d3ee;
  --accent-violet: #a78bfa;

  --blue: #6366f1;
  --green: #10b981;
  --yellow: #fbbf24;
  --pink: #f43f5e;
  --orange: #fb923c;
  --purple: #a78bfa;

  --bg: #f5f6fb;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;

  --radius: 18px;
  --radius-sm: 12px;

  --shadow: 0 4px 24px rgba(79, 70, 229, 0.07);
  --shadow-hover: 0 18px 48px rgba(79, 70, 229, 0.12);
  --transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  --ring: 0 0 0 3px rgba(99, 102, 241, 0.22);
  --surface-soft: #f1f5f9;
  --border-ui: rgba(99, 102, 241, 0.09);

  /* Transisi antar halaman (main.js → html.em-page-exit) — masuk lembut, keluar halus */
  --em-page-ease-in: cubic-bezier(0.16, 1, 0.32, 1);
  --em-page-ease-out: cubic-bezier(0.33, 0.86, 0.45, 1);
  --em-page-ease: var(--em-page-ease-out);
  --em-page-enter-dur: 0.5s;
  --em-page-exit-dur: 0.44s;
}

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

html {
  background-color: var(--bg);
  min-height: 100%;
}

body {
  font-family: 'Nunito', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
}

img,
video {
  max-width: 100%;
  height: auto;
}

/* ── Navbar ─────────────────────────────────────────────────── */
.em-navbar {
  background: linear-gradient(135deg, #4338ca 0%, var(--primary) 42%, #8b5cf6 100%);
  box-shadow: 0 8px 32px rgba(79, 70, 229, 0.28);
  padding: .6rem 0;
  transition:
    opacity var(--em-page-exit-dur) var(--em-page-ease-out),
    transform var(--em-page-exit-dur) var(--em-page-ease-out);
}

.em-brand {
  font-size: 1.1rem;
  font-weight: 900;
  color: #fff !important;
  text-decoration: none;
  display: flex; align-items: center; gap: .4rem;
}
#mainLogo {
  height: 28px;
  width: auto;
  margin-right: 6px;
  flex-shrink: 0;
}
.em-brand span {
  display: inline-block;
  line-height: 1.2;
}

.em-nav-link {
  color: rgba(255,255,255,.9) !important;
  font-weight: 700;
  font-size: 1rem;
  border-radius: var(--radius-sm);
  padding: .4rem .7rem !important;
  transition: background .2s, color .2s;
  margin: 0 .1rem;
}
.em-nav-link:hover {
  background: rgba(255,255,255,.2);
  color: #fff !important;
}
.em-nav-active {
  background: rgba(255,255,255,.96) !important;
  color: var(--primary-deep) !important;
  font-weight: 900 !important;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.12);
  pointer-events: none;
}


.em-toggler {
  background: rgba(255,255,255,.2);
  border: none;
  border-radius: 10px;
  padding: .45rem .65rem;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.em-icon-btn {
  font-size: 1.4rem;
  text-decoration: none;
  background: rgba(255,255,255,.2);
  border-radius: 50%;
  width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
  color: #fff;
}
.em-icon-btn:hover { background: rgba(255,255,255,.35); transform: scale(1.1); }
.em-icon-btn svg { display: block; }

.em-badge {
  position: absolute; top: -6px; right: -6px;
  background: linear-gradient(135deg, #fb7185, #f43f5e);
  color: #fff; font-size: .65rem; font-weight: 800;
  border-radius: 50%; width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff;
  animation: pulse 1.5s infinite;
}
@keyframes pulse { 0%,100%{transform:scale(1)} 50%{transform:scale(1.2)} }

.em-avatar-btn {
  background: rgba(255,255,255,.2);
  border: 2px solid rgba(255,255,255,.5);
  border-radius: 30px;
  color: #fff;
  font-weight: 700;
  font-size: .95rem;
  padding: .4rem .9rem;
  cursor: pointer;
  transition: var(--transition);
}
.em-avatar-btn:hover { background: rgba(255,255,255,.35); }

/* Smaller avatar button for mobile navbar */
.em-avatar-btn-sm {
  font-size: .82rem;
  padding: .3rem .7rem;
  border-radius: 20px;
}

.em-dropdown {
  border-radius: var(--radius-sm);
  border: none;
  box-shadow: var(--shadow);
  font-family: 'Nunito', sans-serif;
  font-weight: 600;
}
.em-dropdown .dropdown-item:hover { background: var(--surface-soft); border-radius: 8px; }

/* ── Flash Messages ─────────────────────────────────────────── */
.em-flash-container {
  position: fixed; top: 80px; right: 1rem;
  z-index: 9999; display: flex; flex-direction: column; gap: .6rem;
  max-width: 380px; width: calc(100% - 2rem);
  transition:
    opacity var(--em-page-exit-dur) var(--em-page-ease-out),
    transform var(--em-page-exit-dur) var(--em-page-ease-out);
}
.em-flash {
  display: flex; align-items: flex-start; gap: .75rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: .97rem;
  position: relative;
  line-height: 1.45;
}

/* ✅ SUCCESS — login berhasil / transaksi sukses */
.em-flash-success {
  background: #d1fae5;
  color: #064e3b;
  border-left: 5px solid #059669;
  box-shadow: 0 6px 24px rgba(5, 150, 105, 0.22);
}

/* ❌ ERROR — login salah / akses ditolak */
.em-flash-error {
  background: #ffe4e6;
  color: #881337;
  border-left: 5px solid #e11d48;
  box-shadow: 0 6px 24px rgba(225, 29, 72, 0.22);
}

/* ℹ️ INFO — keluar (logout) / informasi umum */
.em-flash-info {
  background: #e0e7ff;
  color: #1e1b4b;
  border-left: 5px solid #4338ca;
  box-shadow: 0 6px 24px rgba(67, 56, 202, 0.18);
}

/* ⚠️ WARNING */
.em-flash-warning {
  background: #fef3c7;
  color: #78350f;
  border-left: 5px solid #d97706;
  box-shadow: 0 6px 24px rgba(217, 119, 6, 0.18);
}

.em-flash-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 0.28rem;
}
.em-flash-dot-success {
  background: #059669;
  box-shadow: 0 0 0 4px rgba(5, 150, 105, 0.3);
}
.em-flash-dot-error {
  background: #e11d48;
  box-shadow: 0 0 0 4px rgba(225, 29, 72, 0.3);
}
.em-flash-dot-info {
  background: #4338ca;
  box-shadow: 0 0 0 4px rgba(67, 56, 202, 0.28);
}
.em-flash-dot-warning {
  background: #d97706;
  box-shadow: 0 0 0 4px rgba(217, 119, 6, 0.3);
}

.em-flash-close {
  background: none; border: none; font-size: 1.35rem;
  cursor: pointer; margin-left: auto; opacity: .55;
  flex-shrink: 0; line-height: 1;
  padding: 0 0 0 .5rem;
}
.em-flash-close:hover { opacity: 1; }

@keyframes slidein {
  from { transform: translateX(120%); opacity: 0; }
  to   { transform: translateX(0);   opacity: 1; }
}
.animate-slidein { animation: slidein .35s cubic-bezier(0.16, 1, 0.32, 1); }

/* ── Main & Footer ──────────────────────────────────────────── */
/* Transisi halaman: fade + geser halus (opacity/transform saja — tanpa blur berat) */
.em-main {
  min-height: calc(100vh - 200px);
  padding-bottom: 2rem;
  animation: emMainEnter var(--em-page-enter-dur) var(--em-page-ease-in) both;
  transition:
    opacity var(--em-page-exit-dur) var(--em-page-ease-out),
    transform var(--em-page-exit-dur) var(--em-page-ease-out);
}
.em-main .container { margin-bottom: 1.5rem; }

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

html.em-page-exit .em-main {
  animation: none !important;
  opacity: 0;
  transform: translateY(14px);
}

html.em-page-exit .em-navbar {
  opacity: 0;
  transform: translateY(-12px);
}

html.em-page-exit .em-footer {
  opacity: 0;
  transform: translateY(16px);
}

html.em-page-exit .em-flash-container {
  opacity: 0;
  transform: translateX(12px);
}

.em-footer {
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 48%, #4338ca 100%);
  color: #fff; padding: 1.5rem 0; margin-top: 3rem;
  font-weight: 700;
  transition:
    opacity var(--em-page-exit-dur) var(--em-page-ease-out),
    transform var(--em-page-exit-dur) var(--em-page-ease-out);
}
.em-footer-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  flex-wrap: wrap;
  margin-bottom: .35rem;
}
.em-footer-logo {
  height: 28px;
  width: auto;
}
.em-footer-sub { font-size: .85rem; opacity: .8; }

/* ── Hero Section ───────────────────────────────────────────── */
.em-hero {
  background: linear-gradient(135deg, #3730a3 0%, var(--primary) 45%, #7c3aed 100%);
  color: #fff; padding: 3.5rem 0 2.5rem;
  border-radius: 0 0 40px 40px;
  position: relative; overflow: hidden;
}
.em-hero::before {
  content: '';
  position: absolute; top: -50%; right: -20%;
  width: 500px; height: 500px;
  background: rgba(255,255,255,.07);
  border-radius: 50%;
}
.em-hero h1 { font-size: 2.5rem; font-weight: 900; }
.em-hero p  { font-size: 1.15rem; opacity: .9; }

/* Hero — rich home (tanpa kolom kosong, akses cepat) */
.em-hero--rich {
  padding: 2.65rem 0 2.45rem;
}
.em-hero--rich::before {
  top: -42%;
  right: -12%;
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.18) 0%, transparent 62%);
}
.em-hero--rich::after {
  content: '';
  position: absolute;
  bottom: -38%;
  left: -12%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.22) 0%, transparent 68%);
  border-radius: 50%;
  pointer-events: none;
}
.em-hero__top {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.em-hero-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.38rem 0.9rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.24);
  color: rgba(255, 255, 255, 0.96);
}
.em-hero-pill--accent {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.34);
}
.em-hero__title {
  font-size: clamp(1.8rem, 4.2vw, 2.75rem);
  font-weight: 900;
  letter-spacing: -0.035em;
  line-height: 1.18;
  margin-bottom: 0.85rem;
  max-width: 46rem;
}
.em-hero__lead {
  font-size: clamp(1rem, 2.1vw, 1.14rem);
  line-height: 1.65;
  opacity: 0.94;
  max-width: 42rem;
  margin-bottom: 0;
}
.em-hero__highlight {
  border-bottom: 2px solid rgba(34, 211, 238, 0.55);
  padding-bottom: 1px;
}
.em-hero__school {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 1.1rem;
  margin-bottom: 0;
  font-size: 0.98rem;
  font-weight: 600;
  opacity: 0.92;
}
.em-hero__school-icon {
  flex-shrink: 0;
  opacity: 0.88;
}
.em-hero__cta {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1.35rem;
}
.em-hero__quick {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.45rem;
}
.em-hero-quick-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 1.05rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.91rem;
  color: #fff !important;
  text-decoration: none !important;
  background: rgba(255, 255, 255, 0.11);
  border: 1px solid rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: background 0.22s ease, transform 0.22s ease, box-shadow 0.22s ease;
}
.em-hero-quick-link:hover {
  background: rgba(255, 255, 255, 0.22);
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.14);
  color: #fff !important;
}
.em-hero-quick-badge {
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  background: linear-gradient(135deg, #f43f5e, #fb7185);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ── Section Title ──────────────────────────────────────────── */
.em-section-title {
  font-size: 1.6rem; font-weight: 900; color: var(--text);
  position: relative; display: inline-block; margin-bottom: 1.5rem;
}
.em-section-title::after {
  content: '';
  position: absolute; bottom: -6px; left: 0;
  width: 50%; height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--accent-cyan));
  border-radius: 10px;
}

/* ── Product Cards ──────────────────────────────────────────── */
.em-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: var(--transition);
  height: 100%;
  border: 1px solid var(--border-ui);
}
.em-card:hover {
  transform: translateY(-6px) scale(1.01);
  box-shadow: var(--shadow-hover);
}

.em-card-img {
  width: 100%; height: 180px;
  object-fit: cover;
  background: linear-gradient(135deg, rgba(224, 231, 255, 0.9), rgba(237, 233, 254, 0.85));
}
.em-card-img-placeholder {
  width: 100%; height: 180px;
  background: linear-gradient(145deg, #eef2ff 0%, #f5f3ff 50%, #ecfeff 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: 4rem;
}

.em-card-body { padding: 1.2rem; }
.em-card-title { font-size: 1.05rem; font-weight: 800; margin-bottom: .3rem; }
.em-card-price {
  font-size: 1.2rem; font-weight: 900;
  color: var(--primary-deep);
  background: rgba(99, 102, 241, 0.1);
  display: inline-block;
  padding: .1rem .7rem; border-radius: 20px;
}
.em-card-seller { font-size: .82rem; color: var(--muted); margin: .4rem 0; }
.em-stars { color: #f59e0b; font-size: .9rem; }

/* ── Buttons ────────────────────────────────────────────────── */
.em-btn {
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  border-radius: 50px;
  padding: .6rem 1.4rem;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  font-size: 1rem;
  display: inline-flex; align-items: center; gap: .4rem;
  text-decoration: none;
}
.em-btn:hover { transform: translateY(-3px) scale(1.03); }
.em-btn:active { transform: scale(.97); }
.em-btn:focus-visible,
.em-input:focus-visible,
.em-avatar-btn:focus-visible,
.em-nav-link:focus-visible,
.em-icon-btn:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}

.em-btn-primary {
  background: linear-gradient(135deg, var(--primary-deep) 0%, var(--primary) 50%, #8b5cf6 100%);
  color: #fff;
  box-shadow: 0 8px 28px rgba(99, 102, 241, 0.38);
}
.em-btn-success {
  background: linear-gradient(135deg, #059669 0%, var(--green) 55%, #34d399 100%);
  color: #fff;
  box-shadow: 0 8px 28px rgba(16, 185, 129, 0.32);
}
.em-btn-danger {
  background: linear-gradient(135deg, #e11d48 0%, #fb7185 100%);
  color: #fff;
  box-shadow: 0 8px 24px rgba(244, 63, 94, 0.3);
}
.em-btn-warning {
  background: linear-gradient(135deg, #fb923c 0%, var(--yellow) 100%);
  color: #422006;
  box-shadow: 0 8px 24px rgba(251, 146, 60, 0.28);
}
.em-btn-outline {
  background: transparent;
  border: 2px solid rgba(99, 102, 241, 0.45);
  color: var(--primary-deep);
}
.em-btn-outline:hover {
  background: linear-gradient(135deg, var(--primary-soft), var(--primary));
  border-color: transparent;
  color: #fff;
}

.em-btn-sm { padding: .35rem .9rem; font-size: .88rem; }
.em-btn-lg { padding: .9rem 2rem; font-size: 1.15rem; }
.em-btn-full { width: 100%; justify-content: center; }

/* ── Inputs / Forms ─────────────────────────────────────────── */
.em-input {
  font-family: 'Nunito', sans-serif;
  font-weight: 600;
  border: 1.5px solid rgba(99, 102, 241, 0.18);
  border-radius: var(--radius-sm);
  padding: .65rem 1rem;
  font-size: 1rem;
  width: 100%;
  transition: border-color .2s, box-shadow .2s;
  background: #fafbff;
}
.em-input:focus {
  outline: none;
  border-color: var(--primary-soft);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.14);
  background: #fff;
}

.em-label {
  font-weight: 800; font-size: .9rem; color: var(--text);
  margin-bottom: .4rem; display: block;
}

.em-form-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem;
  border: 1px solid var(--border-ui);
}

/* ── Search Bar ─────────────────────────────────────────────── */
.em-search-wrap {
  position: relative; max-width: 500px;
}
.em-search-wrap input {
  padding-left: 3rem;
  border-radius: 50px !important;
}
.em-search-icon {
  position: absolute; left: 1rem; top: 50%;
  transform: translateY(-50%);
  font-size: 1.1rem; pointer-events: none;
}

/* ── Stat Cards ─────────────────────────────────────────────── */
.em-stat-card {
  border-radius: var(--radius);
  padding: 1.5rem;
  color: #fff;
  box-shadow: var(--shadow);
  position: relative; overflow: hidden;
}
.em-stat-card::after {
  content: '';
  position: absolute;
  right: -18%;
  bottom: -22%;
  width: 168px;
  height: 168px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(255, 255, 255, 0.38) 0%, rgba(255, 255, 255, 0.06) 55%, transparent 72%);
  opacity: 0.85;
  pointer-events: none;
}
.em-stat-card h2 { font-size: 2.2rem; font-weight: 900; }
.em-stat-card p  { font-size: .9rem; opacity: .85; font-weight: 700; margin: 0; }
.em-stat-blue   { background: linear-gradient(145deg, #4f46e5 0%, var(--primary) 45%, #a78bfa 100%); }
.em-stat-green  { background: linear-gradient(145deg, #047857 0%, var(--green) 50%, #6ee7b7 100%); }
.em-stat-yellow { background: linear-gradient(145deg, #ea580c 0%, var(--orange) 45%, var(--yellow) 100%); }
.em-stat-pink   { background: linear-gradient(145deg, #be123c 0%, #ec4899 50%, #fda4af 100%); }

/* ── Table ──────────────────────────────────────────────────── */
.em-table-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border-ui);
}
.em-table {
  width: 100%; border-collapse: collapse;
  font-size: .93rem;
  min-width: 640px;
}
.em-table thead th {
  background: linear-gradient(135deg, var(--primary-deep) 0%, var(--primary) 55%, #7c3aed 100%);
  color: #fff; font-weight: 800;
  padding: 1rem; text-align: left;
}
.em-table tbody tr {
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  transition: background .2s;
}
.em-table tbody tr:hover { background: rgba(99, 102, 241, 0.04); }
.em-table tbody td { padding: .85rem 1rem; font-weight: 600; }
.em-table-mobile tbody td { vertical-align: top; }

/* ── Balance Display ────────────────────────────────────────── */
.em-balance {
  background: linear-gradient(135deg, #059669 0%, var(--green) 50%, #5eead4 100%);
  color: #fff; border-radius: var(--radius);
  padding: 1.2rem 1.8rem;
  font-size: 1.4rem; font-weight: 900;
  display: inline-flex; align-items: center; gap: .6rem;
  box-shadow: 0 10px 32px rgba(16, 185, 129, 0.35);
}

/* ── Mode Toggle ────────────────────────────────────────────── */
.em-mode-badge {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .5rem 1.2rem;
  border-radius: 50px;
  font-weight: 800; font-size: .95rem;
}
.em-mode-buyer  { background: rgba(99, 102, 241, 0.12); color: var(--primary-deep); }
.em-mode-seller { background: rgba(16, 185, 129, 0.12); color: #047857; }

/* ── Receipt ────────────────────────────────────────────────── */
.em-receipt {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2.5rem;
  max-width: 520px; margin: 0 auto;
  border-top: 8px solid var(--green);
}
.em-receipt-container { max-width: 600px; }
.em-receipt-header { text-align: center; margin-bottom: 1.5rem; }
.em-receipt-header h2 { font-size: 1.8rem; font-weight: 900; color: var(--green); }

.em-receipt-success-mark {
  width: 72px;
  height: 72px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #34d399, #059669);
  box-shadow: 0 12px 32px rgba(5, 150, 105, 0.35);
  position: relative;
}
.em-receipt-success-mark::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 45%;
  width: 14px;
  height: 24px;
  border: solid #fff;
  border-width: 0 3px 3px 0;
  transform: translate(-50%, -50%) rotate(45deg);
}

.em-notif-type-icon {
  width: 50px;
  height: 50px;
  flex-shrink: 0;
  border-radius: 50%;
  background: rgba(74, 144, 226, 0.12);
  border: 1px solid rgba(74, 144, 226, 0.2);
}
.em-notif-type-sale {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(5, 150, 105, 0.15));
  border-color: rgba(16, 185, 129, 0.35);
}
.em-notif-type-purchase {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(79, 70, 229, 0.12));
  border-color: rgba(99, 102, 241, 0.35);
}
.em-receipt-row {
  display: flex; justify-content: space-between;
  padding: .5rem 0; border-bottom: 1px dashed #E0E0E0;
  font-weight: 600;
}
.em-receipt-total {
  display: flex; justify-content: space-between;
  padding: .8rem 0; font-size: 1.2rem; font-weight: 900;
  color: var(--primary-deep);
}

/* ── Star Rating ────────────────────────────────────────────── */
.em-star-rating { display: flex; gap: .3rem; flex-direction: row-reverse; justify-content: flex-end; }
.em-star-rating input { display: none; }
.em-star-rating label {
  font-size: 2rem; cursor: pointer; color: #ddd;
  transition: color .2s, transform .2s;
}
.em-star-rating label:hover,
.em-star-rating label:hover ~ label,
.em-star-rating input:checked ~ label {
  color: #f59e0b;
  transform: scale(1.2);
}

/* ── Page Header ────────────────────────────────────────────── */
.em-page-header {
  background: linear-gradient(135deg, #4338ca 0%, var(--primary) 42%, #a855f7 100%);
  color: #fff; padding: 2rem 0;
  border-radius: 0 0 30px 30px;
  margin-bottom: 2rem;
  box-shadow: 0 16px 48px rgba(79, 70, 229, 0.2);
}
.em-page-header h1 { font-size: 1.9rem; font-weight: 900; }

/* ── Notification ────────────────────────────────────────────── */
.em-notif-item {
  background: var(--card);
  border-radius: var(--radius-sm);
  padding: 1rem 1.2rem;
  margin-bottom: .7rem;
  box-shadow: var(--shadow);
  font-weight: 600;
  transition: var(--transition);
  border: 1px solid var(--border-ui);
  border-left: 4px solid var(--primary-soft);
  color: var(--text);
}
.em-notif-item.unread { border-left-color: #fb7185; background: rgba(254, 242, 242, 0.85); }
.em-notif-item:hover { transform: translateX(4px); box-shadow: var(--shadow-hover); }
.em-notif-link {
  cursor: pointer;
  display: block;
}
.em-notif-link:hover .em-notif-arrow {
  transform: translateX(4px);
  color: var(--primary);
}
.em-notif-arrow {
  color: var(--muted);
  flex-shrink: 0;
  transition: transform .2s, color .2s;
}
.em-notif-msg {
  font-size: 1rem;
  line-height: 1.45;
  margin-bottom: 0.2rem;
}
.em-notif-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.em-notif-receipt-hint {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--primary-deep);
  background: rgba(99,102,241,0.1);
  padding: 0.15rem 0.55rem;
  border-radius: 20px;
  letter-spacing: 0.01em;
}
.em-notif-container { max-width: 700px; }

/* ── Empty State ────────────────────────────────────────────── */
.em-empty {
  text-align: center; padding: 3rem 1rem;
  font-size: 3.5rem; color: var(--muted);
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.9), rgba(241, 245, 249, 0.95));
  border-radius: var(--radius);
  border: 1px dashed rgba(99, 102, 241, 0.2);
}
.em-empty p { font-size: 1.1rem; font-weight: 700; margin-top: .8rem; }

/* ── Login Page ─────────────────────────────────────────────── */
.em-login-page {
  min-height: 100vh;
  background: linear-gradient(145deg, #312e81 0%, var(--primary-deep) 35%, #7c3aed 70%, #22d3ee 130%);
  display: flex; align-items: center; justify-content: center;
  padding: 2rem;
}
.em-login-card {
  background: #fff;
  border-radius: 28px;
  box-shadow: 0 30px 80px rgba(0,0,0,.25);
  padding: 3rem 2.5rem;
  width: 100%; max-width: 420px;
  text-align: center;
}
.em-login-logo-wrap { margin-bottom: .6rem; }
.em-login-logo {
  height: 84px;
  width: auto;
}
.em-login-title { font-size: 1.9rem; font-weight: 900; color: var(--text); }
.em-login-sub { color: var(--muted); font-weight: 600; margin-bottom: 2rem; }

/* ── Misc Utilities ─────────────────────────────────────────── */
.em-tag {
  display: inline-block; font-size: .75rem; font-weight: 800;
  padding: .2rem .7rem; border-radius: 20px;
  letter-spacing: .01em;
}
.em-tag-success { background: rgba(16, 185, 129, 0.14); color: #047857; }
.em-tag-warning { background: rgba(251, 191, 36, 0.18); color: #b45309; }
.em-tag-danger  { background: rgba(244, 63, 94, 0.12); color: #be123c; }
.em-tag-info    { background: rgba(99, 102, 241, 0.12); color: var(--primary-deep); }

.em-divider { border: none; border-top: 2px dashed #E0E7FF; margin: 1.5rem 0; }

.em-avatar-circle {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  background: linear-gradient(145deg, var(--primary-deep) 0%, var(--primary) 50%, var(--accent-violet) 100%);
  color: #fff;
  box-shadow: 0 14px 40px rgba(99, 102, 241, 0.35);
}

.em-cart-thumb-letter {
  width: 80px;
  height: 80px;
  border-radius: 14px;
  flex-shrink: 0;
  background: linear-gradient(135deg, #e2e8f0, #f1f5f9);
  border: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.65rem;
  font-weight: 800;
  color: #64748b;
}

.em-file-drop {
  border: 2px dashed #c7d2fe;
  border-radius: 14px;
  padding: 1.25rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  background: #fafbff;
}
.em-file-drop:hover {
  border-color: #818cf8;
  background: #f5f7ff;
}
.em-file-drop-icon {
  width: 40px;
  height: 40px;
  margin: 0 auto;
  border-radius: 10px;
  background: linear-gradient(135deg, #e0e7ff, #ede9fe);
  border: 1px solid #e2e8f0;
}

.em-thumb-letter-sm {
  width: 45px;
  height: 45px;
  border-radius: 8px;
  flex-shrink: 0;
  background: linear-gradient(135deg, #e2e8f0, #f1f5f9);
  border: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 800;
  color: #64748b;
}

/* ── Menu Card (Dashboard Guru) ──────────────────────────────── */
.em-menu-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border-ui);
  padding: 1.5rem 1rem;
  text-align: center;
  transition: var(--transition);
  cursor: pointer;
  height: 100%;
}
.em-menu-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: var(--shadow-hover);
}
.em-menu-icon {
  width: 64px; height: 64px;
  border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem;
  margin: 0 auto .8rem;
  box-shadow: 0 6px 20px rgba(0,0,0,.15);
}
.em-menu-label {
  font-size: 1rem; font-weight: 800; color: var(--text);
  margin-bottom: .25rem;
}
.em-menu-count {
  font-size: .85rem; font-weight: 600; color: var(--muted);
}



/* ── Custom Modal ─────────────────────────────────────────────── */
.em-modal-content {
  border: none;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(79, 70, 229, 0.18);
  font-family: 'Nunito', sans-serif;
}
.em-modal-header {
  background: linear-gradient(135deg, var(--primary-deep) 0%, var(--primary) 60%, #9333ea 100%);
  color: #fff;
  border: none;
  padding: 1.2rem 1.5rem;
}
.em-modal-header .modal-title { font-size: 1.1rem; }
.em-modal-body {
  padding: 1.5rem;
  font-weight: 600;
  font-size: 1rem;
}
.em-modal-body p { margin-bottom: .5rem; }


.em-bounce { animation: bounce .6s ease infinite alternate; }
@keyframes bounce { from{transform:translateY(0)} to{transform:translateY(-6px)} }

.em-spin { animation: spin 2s linear infinite; }
@keyframes spin { to{transform:rotate(360deg)} }

/* ── Mobile Bottom Navigation ──────────────────────────────── */
.em-bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 9998;
  background: linear-gradient(135deg, #1e3a8a 0%, #4338ca 46%, #7c3aed 100%);
  display: flex;
  align-items: stretch;
  border-top: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 -8px 32px rgba(15,23,42,.32);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.em-bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: .5rem .2rem .45rem;
  color: rgba(255,255,255,.52);
  text-decoration: none !important;
  font-size: .63rem;
  font-weight: 700;
  gap: .18rem;
  position: relative;
  transition: color .18s ease, background .18s ease;
  letter-spacing: .01em;
  -webkit-tap-highlight-color: transparent;
}
.em-bottom-nav-item svg {
  width: 21px; height: 21px;
  stroke-width: 1.8;
  transition: transform .22s cubic-bezier(0.34,1.56,0.64,1);
}
.em-bottom-nav-item.active {
  color: #fff;
  background: rgba(255,255,255,.11);
}
.em-bottom-nav-item.active svg {
  transform: translateY(-2px) scale(1.13);
  stroke-width: 2.2;
}
.em-bottom-nav-item.active::after {
  content: '';
  position: absolute;
  top: 0; left: 16%; right: 16%;
  height: 3px;
  background: linear-gradient(90deg, #a5b4fc, #c4b5fd);
  border-radius: 0 0 4px 4px;
}
.em-bottom-nav-item:hover { color: rgba(255,255,255,.85); background: rgba(255,255,255,.07); }
.em-bottom-nav-item:active svg { transform: scale(.88); }

/* Notif dot */
.em-bottom-nav-notif-wrap { position: relative; display: inline-flex; }
.em-bottom-notif-dot {
  position: absolute; top: -3px; right: -4px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #f43f5e;
  border: 1.5px solid rgba(255,255,255,.8);
  animation: pulse 1.5s infinite;
}

/* Push content above bottom nav on mobile */
@media (max-width: 1199px) {
  body.em-app-theme .em-main { padding-bottom: 5.5rem; }
  .em-footer { margin-bottom: 4.5rem; }
}

/* ── Mobile Feature Cards Enhancement ──────────────────────── */
@media (max-width: 768px) {
  /* Stat cards */
  .em-stat-card {
    border-radius: 18px;
    padding: 1.1rem 1rem;
  }
  .em-stat-card h2 {
    font-size: 1.55rem;
    margin-bottom: .1rem;
  }
  .em-stat-card p {
    font-size: .76rem;
    opacity: .88;
  }

  /* Menu feature tiles (teacher/admin dashboard) */
  .em-menu-card {
    padding: 1.15rem .65rem;
    border-radius: 16px;
  }
  .em-menu-icon {
    width: 50px; height: 50px;
    border-radius: 14px;
    margin-bottom: .5rem;
  }
  .em-menu-label { font-size: .87rem; }
  .em-menu-count { font-size: .73rem; }

  /* Product cards */
  .em-card { border-radius: 14px; }
  .em-card-img,
  .em-card-img-placeholder {
    height: 125px;
    border-radius: 14px 14px 0 0;
  }
  .em-card-body { padding: .7rem; }
  .em-card-title {
    font-size: .86rem;
    margin-bottom: .18rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .em-card-price { font-size: .85rem; padding: .1rem .5rem; }
  .em-card-seller { font-size: .69rem; }
  .em-stars { font-size: .72rem; }

  /* Card action buttons: stack vertically */
  .em-card-body .d-flex.gap-2,
  .em-card-body .d-flex.mt-3 {
    flex-direction: column;
    gap: .3rem !important;
    margin-top: .45rem !important;
  }
  .em-card-body .d-flex > .em-btn,
  .em-card-body .d-flex > form,
  .em-card-body .d-flex > a.em-btn {
    width: 100%;
    flex: 1 1 100%;
    text-align: center;
  }
  .em-card-body .d-flex > form .em-btn { width: 100%; }

  /* Hero quick links: horizontal scroll */
  .em-hero__quick {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: .35rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .em-hero__quick::-webkit-scrollbar { display: none; }
  .em-hero-quick-link {
    flex-shrink: 0;
    white-space: nowrap;
    padding: .48rem .85rem;
    font-size: .82rem;
  }

  /* Balance display */
  .em-balance {
    font-size: 1rem;
    padding: .7rem 1rem;
    border-radius: 14px;
  }

  /* Section titles */
  .em-section-title { font-size: 1.12rem; margin-bottom: .9rem; }
  .em-section-title::after { height: 3px; width: 34px; }
}

/* Extra small < 400px */
@media (max-width: 400px) {
  .em-stat-card h2 { font-size: 1.25rem; }
  .em-bottom-nav-item {
    font-size: .56rem;
    padding: .42rem .1rem .38rem;
  }
  .em-bottom-nav-item svg { width: 18px; height: 18px; }
  .em-card-img,
  .em-card-img-placeholder { height: 105px; }
  .em-card-title { font-size: .8rem; }
}

/* ── Responsive (below XL) — navbar collapses at 1199px ──────── */

@media (max-width: 1199px) {
  /* Collapsed navbar: notif + avatar area goes full-width */
  .em-navbar .navbar-collapse > .d-flex.align-items-center {
    width: 100%;
    padding: .55rem 0 .2rem;
    border-top: 1px solid rgba(255,255,255,.15);
    margin-top: .45rem;
  }
  .em-navbar .navbar-collapse .em-avatar-btn {
    flex: 1;
    justify-content: center;
  }
  /* Brand: prevent text overflow on tablet */
  .em-brand span {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* ── Responsive (mobile ≤768px) ──────────────────────────────── */
@media (max-width: 768px) {
  .container,
  .container-fluid {
    padding-left: .9rem;
    padding-right: .9rem;
  }

  .em-main {
    padding-bottom: 1rem;
  }

  .em-main .container {
    margin-bottom: 1rem;
  }

  /* Navbar — prevent brand overflow on phones */
  .em-navbar .container {
    gap: .5rem;
    flex-wrap: nowrap;
  }

  .em-brand {
    font-size: .95rem;
  }
  .em-brand span {
    font-size: .85rem;
  }
  #mainLogo {
    height: 22px;
    margin-right: 4px;
  }

  .em-nav-link {
    padding: .55rem .7rem !important;
    font-size: .92rem;
  }

  .em-avatar-btn {
    width: 100%;
    justify-content: center;
  }

  /* Flash messages full-width */
  .em-flash-container {
    left: .9rem;
    right: .9rem;
    top: 72px;
    max-width: none;
  }

  .em-flash {
    padding: .75rem .9rem;
    font-size: .9rem;
  }

  .em-hero {
    padding: 1.8rem 0 1.4rem;
    border-radius: 0 0 20px 20px;
  }

  .em-hero h1 { font-size: 1.65rem; }
  .em-hero p { font-size: .95rem; }

  .em-hero__title {
    font-size: 1.55rem;
  }
  .em-hero__quick {
    flex-direction: column;
    gap: .5rem;
  }
  .em-hero-quick-link {
    justify-content: flex-start;
    padding: .6rem 1rem;
  }
  .em-hero__cta {
    flex-direction: column;
    align-items: stretch;
  }
  .em-hero__cta .em-balance {
    width: 100%;
    justify-content: center;
  }

  .em-section-title {
    font-size: 1.3rem;
  }

  .em-balance {
    width: 100%;
    justify-content: center;
    text-align: center;
    font-size: 1.1rem;
    padding: .9rem 1rem;
  }

  /* Product cards — 2 column grid stays, but body smaller */
  .em-btn {
    justify-content: center;
    min-height: 40px;
  }

  .em-table.em-table-mobile {
    min-width: 100%;
  }

  .em-table.em-table-mobile thead {
    display: none;
  }

  .em-table.em-table-mobile,
  .em-table.em-table-mobile tbody,
  .em-table.em-table-mobile tr,
  .em-table.em-table-mobile td {
    display: block;
    width: 100%;
  }

  .em-table.em-table-mobile tbody tr {
    background: #fff;
    border: 1px solid #E8EEFF;
    border-radius: 14px;
    padding: .4rem 0;
    margin-bottom: .8rem;
    box-shadow: 0 4px 14px rgba(74,144,226,.08);
  }

  .em-table.em-table-mobile tbody td {
    border: none;
    padding: .5rem .9rem;
    text-align: right;
    position: relative;
    min-height: 34px;
  }

  .em-table.em-table-mobile tbody td::before {
    content: attr(data-label);
    float: left;
    font-weight: 800;
    color: var(--muted);
    margin-right: .8rem;
    text-align: left;
    font-size: .82rem;
    text-transform: uppercase;
    letter-spacing: .03em;
  }

  .em-table.em-table-mobile tbody td[data-label="Aksi"] {
    text-align: left;
  }

  .em-table.em-table-mobile tbody td[data-label="Aksi"]::before {
    float: none;
    display: block;
    margin: 0 0 .35rem 0;
  }

  .em-btn-lg {
    width: 100%;
    padding: .75rem 1.2rem;
  }

  .em-card-body {
    padding: .85rem;
  }

  .em-card-title {
    font-size: .93rem;
  }

  .em-card-price {
    font-size: 1rem;
  }

  .em-card-seller {
    font-size: .76rem;
  }

  .em-stars {
    font-size: .8rem;
  }

  /* Make card buy+detail buttons stack neatly */
  .em-card .d-flex.gap-2.mt-3 {
    flex-wrap: wrap;
    gap: .4rem !important;
  }

  .em-card .d-flex.gap-2.mt-3 .em-btn,
  .em-card .d-flex.gap-2.mt-3 > * {
    flex: 1 1 100%;
    display: flex;
  }

  .em-form-card {
    padding: 1rem;
  }

  .em-page-header {
    padding: 1.2rem 0;
    border-radius: 0 0 16px 16px;
    margin-bottom: 1rem;
  }

  .em-page-header h1 {
    font-size: 1.35rem;
  }

  /* Product detail — stack image and info */
  .em-product-detail .row {
    flex-direction: column;
  }
  .em-product-detail .em-product-media {
    padding-bottom: 0 !important;
  }

  /* Buy form on detail page */
  #buy-form-detail {
    flex-direction: column;
    align-items: stretch !important;
  }
  #buy-form-detail > div {
    justify-content: center;
  }
  #btn-beli-detail {
    width: 100%;
  }

  /* Notification */
  .em-notif-item {
    padding: .85rem 1rem;
  }
  .em-notif-msg {
    font-size: .95rem;
  }
  .em-notif-type-icon {
    width: 42px;
    height: 42px;
  }

  .em-profile-avatar {
    font-size: 4rem !important;
  }

  .em-profile-card h2 {
    font-size: 1.2rem;
  }

  .em-profile-balance {
    font-size: 1.05rem !important;
  }

  .em-product-main-image,
  .em-product-main-placeholder {
    max-height: 240px !important;
    height: 240px !important;
    font-size: 5rem !important;
  }

  .em-product-price {
    font-size: 1.1rem !important;
  }

  .em-volume-amount {
    font-size: 1.7rem !important;
    line-height: 1.2;
    word-break: break-word;
  }

  .em-receipt { padding: 1.2rem; }
  .em-receipt-row,
  .em-receipt-total {
    gap: .5rem;
    flex-wrap: wrap;
  }

  .em-receipt-actions {
    flex-wrap: wrap;
  }

  .em-receipt-actions .em-btn {
    flex: 1 1 100%;
  }

  .em-login-card { padding: 1.8rem 1.2rem; }
  .em-login-logo { height: 60px; }
  .em-login-title { font-size: 1.4rem; }
  .em-stat-card h2 { font-size: 1.7rem; }
  .em-empty { font-size: 2.2rem; }
  .em-empty p { font-size: .95rem; }

  /* Brand text: tighter on phone */
  .em-brand span {
    max-width: 150px;
    font-size: .82rem;
  }

  /* Product detail — stack title and price vertically */
  .em-product-detail .d-flex.align-items-center.mb-4 {
    flex-direction: column;
    align-items: flex-start !important;
    gap: .6rem !important;
  }
  .em-product-detail h1.em-section-title {
    font-size: 1.4rem !important;
    line-height: 1.3 !important;
  }
  .em-product-price {
    white-space: normal !important;
    font-size: 1rem !important;
    padding: .4rem .85rem !important;
  }

  /* Sell page — submit button + counter text */
  .col-12 > .em-btn-lg + .text-muted {
    display: block;
    margin-left: 0 !important;
    margin-top: .45rem;
    text-align: center;
  }

  /* Section header: title + "Lihat semua" row */
  .d-flex.justify-content-between.align-items-center {
    gap: .4rem;
    flex-wrap: wrap;
  }
  .d-flex.justify-content-between.align-items-center .em-btn {
    flex-shrink: 0;
  }

  /* Stat cards: prevent number overflow */
  .em-stat-card h2 {
    word-break: break-word;
    overflow-wrap: break-word;
  }
  .em-stat-card {
    overflow: hidden;
  }

  /* Admin/schools form button alignment */
  .col-md-2.d-flex.align-items-end {
    align-items: flex-start !important;
  }
}

@media (max-width: 576px) {
  .em-hero h1 {
    font-size: 1.45rem;
  }

  .em-icon-btn {
    width: 38px;
    height: 38px;
    font-size: 1.2rem;
  }

  .em-badge {
    width: 18px;
    height: 18px;
    font-size: .58rem;
    top: -5px;
    right: -5px;
  }

  .em-card-img,
  .em-card-img-placeholder {
    height: 145px;
  }

  .em-product-main-image,
  .em-product-main-placeholder {
    max-height: 220px !important;
    height: 220px !important;
    font-size: 4.3rem !important;
  }

  .em-cart-item .fw-bold.fs-6 {
    font-size: .95rem !important;
  }

  .em-volume-amount {
    font-size: 1.1rem !important;
  }

  /* Stat card number size on very small screens */
  .em-stat-card h2 {
    font-size: 1.45rem;
  }

  /* Brand: hide text label, show only logo on xs */
  .em-brand span {
    max-width: 120px;
    font-size: .78rem;
  }

  /* Avatar button: full width on xs */
  .em-avatar-btn {
    width: 100%;
    justify-content: center;
  }

  .em-input {
    font-size: .95rem;
    padding: .6rem .85rem;
  }

  .em-btn {
    min-height: 42px;
    font-size: .92rem;
  }

  .em-search-wrap input {
    padding-left: 2.6rem;
  }

  .em-search-icon {
    left: .9rem;
    font-size: 1rem;
  }

  .em-section-title {
    margin-bottom: 1rem;
  }

  .em-table.em-table-mobile tbody td {
    padding: .5rem .8rem;
    font-size: .9rem;
  }
}

@media (min-width: 769px) and (max-width: 1199px) {
  .em-hero h1 {
    font-size: 2.1rem;
  }

  .em-brand {
    font-size: 1.05rem;
  }
  #mainLogo {
    height: 26px;
  }

  .em-card-img,
  .em-card-img-placeholder {
    height: 165px;
  }

  .em-table {
    min-width: 720px;
  }

  /* Tablet: navbar avatar full-width inside collapse */
  .em-navbar .navbar-collapse > .d-flex.align-items-center {
    width: 100%;
    padding: .5rem 0 .25rem;
    border-top: 1px solid rgba(255,255,255,.15);
    margin-top: .4rem;
  }
  .em-navbar .navbar-collapse .em-avatar-btn {
    flex: 1;
    justify-content: center;
  }

  /* Product detail on tablet */
  .em-product-detail .d-flex.align-items-center.mb-4 {
    flex-wrap: wrap;
    gap: .75rem !important;
  }
  .em-product-detail h1.em-section-title {
    font-size: 1.7rem !important;
  }

  /* Stat cards volume */
  .em-volume-amount {
    font-size: 1.15rem !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* ── App theme (siswa / guru / admin saat login) ─────────────
   Tanpa foto latar; palet sama seperti login: navy ringan · indigo · violet. */
body.em-app-theme {
  font-family: 'Plus Jakarta Sans', 'Nunito', sans-serif;
  background-color: #f1f5f9;
  background-image:
    radial-gradient(ellipse 110% 85% at 95% -5%, rgba(99, 102, 241, 0.14), transparent 52%),
    radial-gradient(ellipse 85% 65% at -8% 35%, rgba(30, 58, 138, 0.09), transparent 48%),
    radial-gradient(ellipse 70% 50% at 78% 95%, rgba(168, 85, 247, 0.08), transparent 45%),
    linear-gradient(165deg, #f8fafc 0%, #eef2ff 42%, #f1f5f9 100%);
  background-attachment: fixed;
}
body.em-app-theme .em-btn,
body.em-app-theme .em-input,
body.em-app-theme .em-label {
  font-family: inherit;
}

body.em-app-theme .em-navbar {
  background: linear-gradient(135deg, #1e3a8a 0%, var(--primary) 46%, #9333ea 100%);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 8px 32px rgba(30, 58, 138, 0.28);
}
body.em-app-theme .em-brand span {
  /* No shape */
}

body.em-app-theme .em-footer {
  background: linear-gradient(135deg, #172554 0%, #1e3a8a 38%, #4338ca 100%);
  border-top: 1px solid rgba(165, 180, 252, 0.18);
  padding: 2rem 0;
  margin-top: 3rem;
  box-shadow: 0 -12px 36px rgba(15, 23, 42, 0.18);
}

body.em-app-theme .em-page-header {
  background: linear-gradient(135deg, #1e3a8a 0%, var(--primary) 42%, #a855f7 95%);
  border-radius: 0 0 26px 26px;
  box-shadow: 0 16px 48px rgba(15, 23, 42, 0.35);
}
body.em-app-theme .em-page-header h1 {
  font-weight: 800;
  letter-spacing: -0.02em;
}
body.em-app-theme .em-page-header p {
  opacity: 0.92;
  font-weight: 600;
}

body.em-app-theme .em-section-title {
  font-weight: 800;
  letter-spacing: -0.02em;
}
body.em-app-theme .em-section-title::after {
  height: 3px;
  width: 72px;
  background: linear-gradient(90deg, var(--primary), #a5b4fc);
  border-radius: 6px;
}

body.em-app-theme .em-form-card {
  border-radius: 16px;
  border: 1px solid rgba(99, 102, 241, 0.1);
  box-shadow: 0 4px 28px rgba(79, 70, 229, 0.06);
  background: rgba(255, 255, 255, 0.92);
}

body.em-app-theme .em-table-card {
  border-radius: 16px;
  border: 1px solid rgba(99, 102, 241, 0.1);
  box-shadow: 0 4px 28px rgba(79, 70, 229, 0.06);
  background: rgba(255, 255, 255, 0.95);
}
body.em-app-theme .em-table thead th {
  background: linear-gradient(135deg, var(--primary-deep) 0%, var(--primary) 50%, #9333ea 100%);
  font-weight: 700;
  letter-spacing: 0.02em;
}

body.em-app-theme .em-empty {
  font-size: 1rem;
  color: #64748b;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.85), rgba(241, 245, 249, 0.95));
  border: 1px dashed rgba(99, 102, 241, 0.22);
}
body.em-app-theme .em-empty::before {
  content: '';
  display: block;
  width: 48px;
  height: 48px;
  margin: 0 auto 0.75rem;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.18), rgba(165, 180, 252, 0.14));
  border: 1px solid rgba(99, 102, 241, 0.15);
}

body.em-app-theme .em-hero {
  background: linear-gradient(135deg, #1e3a8a 0%, var(--primary) 45%, #a855f7 100%);
  border-radius: 0 0 32px 32px;
  box-shadow: 0 16px 48px rgba(15, 23, 42, 0.35);
  padding: 3rem 0 2.25rem;
}
body.em-app-theme .em-hero__highlight {
  border-bottom-color: rgba(165, 180, 252, 0.65);
}
body.em-app-theme .em-hero::before {
  opacity: 0.28;
}
body.em-app-theme .em-hero--rich::before {
  opacity: 0.72;
}
body.em-app-theme .em-hero--rich::after {
  opacity: 1;
  background: radial-gradient(circle, rgba(165, 180, 252, 0.28) 0%, transparent 68%);
}
body.em-app-theme .em-hero h1 {
  letter-spacing: -0.02em;
}
body.em-app-theme .em-balance {
  background: linear-gradient(135deg, #059669 0%, #10b981 45%, #5eead4 100%);
  box-shadow: 0 10px 32px rgba(16, 185, 129, 0.32);
}
body.em-app-theme .em-search-wrap .em-search-icon {
  font-size: 0;
  width: 18px;
  height: 18px;
  opacity: 0.55;
  background: no-repeat center / contain;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%236366f1' stroke-width='2'%3E%3Ccircle cx='8' cy='8' r='6'/%3E%3Cpath d='M13 13l4 4'/%3E%3C/svg%3E");
}
body.em-app-theme .em-card {
  border-radius: 16px;
  border: 1px solid rgba(99, 102, 241, 0.1);
  box-shadow: 0 4px 24px rgba(79, 70, 229, 0.07);
  background: rgba(255, 255, 255, 0.95);
}
body.em-app-theme .em-card:hover {
  box-shadow: 0 14px 40px rgba(79, 70, 229, 0.12);
  border-color: rgba(99, 102, 241, 0.18);
}
body.em-app-theme .em-card-img-placeholder--letter {
  font-size: 2.25rem;
  font-weight: 800;
  color: #64748b;
  letter-spacing: -0.05em;
}

body.em-app-theme .em-menu-card {
  border-radius: 16px;
  border: 1px solid rgba(99, 102, 241, 0.1);
  box-shadow: 0 4px 24px rgba(79, 70, 229, 0.06);
  background: rgba(255, 255, 255, 0.96);
}
body.em-app-theme .em-menu-card:hover {
  border-color: rgba(129, 140, 248, 0.45);
  box-shadow: 0 16px 44px rgba(99, 102, 241, 0.14);
}

body.em-app-theme .em-modal-header {
  background: linear-gradient(135deg, #1e3a8a 0%, var(--primary) 48%, #a855f7 100%);
}

body.em-app-theme .em-flash {
  border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, 0.04);
  backdrop-filter: blur(8px);
}

/* Quick-link / dashboard tiles */
body.em-app-theme .em-dash-tile-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 0.75rem;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 10px 28px rgba(79, 70, 229, 0.22);
}
body.em-app-theme .em-dash-tile-icon svg {
  width: 28px;
  height: 28px;
  opacity: 0.95;
}

body.em-app-theme .em-menu-icon {
  font-size: 0;
}
body.em-app-theme .em-menu-icon svg {
  width: 30px;
  height: 30px;
  color: #fff;
}

@media print {
  body, html {
    background: #fff !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    filter: none !important;
  }
  .em-navbar, .em-footer, .em-flash-container, .d-print-none {
    display: none !important;
  }
  .em-main {
    padding: 0 !important;
    min-height: auto !important;
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .em-receipt-container {
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  .em-receipt {
    box-shadow: none !important;
    border: 2px dashed #ccc !important;
    border-top: 8px solid var(--green) !important;
    border-radius: 0 !important;
    max-width: 500px !important;
    margin: 0 auto !important;
    padding: 20px !important;
    color: #000 !important;
    page-break-inside: avoid;
  }
  .em-receipt-row {
    page-break-inside: avoid;
  }
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
}
