:root {
  --kuning: #FFD500;
  --biru: #1D3E8C;
  --biru-tua: #14295c;
  --hijau: #1E8E3E;
  --hijau-tua: #145c29;
  --abu: #6b7280;
  --abu-muda: #f4f6f9;
  --putih: #ffffff;
  --merah: #dc2626;
  --radius: 12px;
  --shadow: 0 4px 14px rgba(0,0,0,0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Segoe UI', Roboto, Arial, sans-serif;
  background: var(--abu-muda);
  color: #222;
  line-height: 1.5;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
}

.page-container { padding-top: 28px; padding-bottom: 50px; }

/* ---------------- HEADER ---------------- */
.site-header {
  background: var(--putih);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
}

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

.brand img { width: 46px; height: 46px; object-fit: contain; }

.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { color: var(--biru); font-size: 1.05rem; }
.brand-text span { color: var(--hijau); font-size: 0.78rem; }

.main-nav { display: flex; align-items: center; gap: 6px; }

.main-nav a {
  padding: 9px 14px;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 500;
  color: #333;
  transition: 0.15s;
}

.main-nav a:hover, .main-nav a.active { background: var(--abu-muda); color: var(--biru); }

.main-nav a.btn-nav {
  background: var(--hijau);
  color: var(--putih);
}
.main-nav a.btn-nav:hover { background: var(--hijau-tua); color: var(--putih); }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.6rem;
  cursor: pointer;
  color: var(--biru);
}

/* ---------------- HERO ---------------- */
.hero {
  background: linear-gradient(135deg, var(--biru) 0%, var(--biru-tua) 100%);
  color: var(--putih);
  padding: 60px 0;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 60px;
  background: var(--kuning);
  clip-path: polygon(0 60%, 100% 0, 100% 100%, 0% 100%);
  opacity: 0.15;
}
.hero-inner { display: flex; align-items: center; gap: 40px; flex-wrap: wrap; }
.hero-text { flex: 1; min-width: 280px; }
.hero-text h1 { font-size: 2.1rem; margin-bottom: 12px; }
.hero-text p { color: #dbe4ff; font-size: 1rem; max-width: 540px; }
.hero-logo { width: 150px; height: 150px; object-fit: contain; filter: drop-shadow(0 8px 20px rgba(0,0,0,0.35)); }
.hero-actions { margin-top: 22px; display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------------- BUTTONS ---------------- */
.btn {
  display: inline-block;
  padding: 11px 22px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  border: none;
  transition: 0.15s;
}
.btn-primary { background: var(--hijau); color: var(--putih); }
.btn-primary:hover { background: var(--hijau-tua); }
.btn-secondary { background: var(--kuning); color: var(--biru-tua); }
.btn-secondary:hover { filter: brightness(0.95); }
.btn-outline { background: transparent; border: 2px solid var(--putih); color: var(--putih); }
.btn-outline:hover { background: rgba(255,255,255,0.12); }
.btn-danger { background: var(--merah); color: var(--putih); }
.btn-danger:hover { background: #b91c1c; }
.btn-sm { padding: 7px 14px; font-size: 0.82rem; border-radius: 6px; }
.btn-block { width: 100%; text-align: center; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* ---------------- SECTION TITLES ---------------- */
.section-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; gap: 10px;}
.section-title h2 { color: var(--biru); font-size: 1.5rem; margin: 0; }
.section-title p { color: var(--abu); margin: 4px 0 0; font-size: 0.9rem; }

/* ---------------- FILTER BAR ---------------- */
.filter-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  background: var(--putih);
  padding: 16px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}
.filter-bar input, .filter-bar select {
  padding: 10px 12px;
  border: 1px solid #dfe3ea;
  border-radius: 8px;
  font-size: 0.9rem;
}
.filter-bar input[type="text"] { flex: 1; min-width: 200px; }

/* ---------------- PRODUCT GRID ---------------- */
.grid-produk {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

.kartu-produk {
  background: var(--putih);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: transform 0.15s;
}
.kartu-produk:hover { transform: translateY(-4px); }

.kartu-produk .foto-wrap { aspect-ratio: 4/3; background: #eef1f6; overflow: hidden; }
.kartu-produk .foto-wrap img { width: 100%; height: 100%; object-fit: cover; }

.kartu-produk .isi { padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.kartu-produk .nama-produk { font-weight: 700; font-size: 1.02rem; color: #1a1a1a; }
.kartu-produk .harga { color: var(--hijau); font-weight: 700; font-size: 1.05rem; }
.kartu-produk .meta { font-size: 0.8rem; color: var(--abu); display: flex; flex-direction: column; gap: 2px; }
.kartu-produk .meta span { display: flex; gap: 6px; align-items: flex-start; }
.kartu-produk .aksi { margin-top: auto; padding: 10px 16px 16px; }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}
.badge-aktif { background: #dcfce7; color: #15803d; }
.badge-pending { background: #fef9c3; color: #92600a; }
.badge-nonaktif { background: #fee2e2; color: #b91c1c; }
.badge-stok-habis { background: #fee2e2; color: #b91c1c; }

/* ---------------- CARDS / PANELS ---------------- */
.card {
  background: var(--putih);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}
.card + .card { margin-top: 20px; }

.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; flex-wrap: wrap; gap: 10px; }
.card-header h3 { margin: 0; color: var(--biru); }

/* ---------------- FORM ---------------- */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 0.9rem; }
.form-group .hint { font-size: 0.78rem; color: var(--abu); margin-top: 4px; }
.form-control {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #dfe3ea;
  border-radius: 8px;
  font-size: 0.92rem;
  font-family: inherit;
}
.form-control:focus { outline: none; border-color: var(--biru); }
textarea.form-control { resize: vertical; min-height: 90px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }

.form-box {
  max-width: 460px;
  margin: 20px auto;
}
.form-box.wide { max-width: 680px; }

/* ---------------- AUTH PAGES ---------------- */
.auth-wrap {
  display: flex;
  min-height: 70vh;
  align-items: center;
  justify-content: center;
  padding: 30px 0;
}
.auth-card {
  background: var(--putih);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 34px;
  width: 100%;
  max-width: 440px;
}
.auth-card .logo-top { text-align: center; margin-bottom: 14px; }
.auth-card .logo-top img { width: 64px; margin: 0 auto 10px; }
.auth-card h2 { text-align: center; color: var(--biru); margin-bottom: 4px; }
.auth-card p.sub { text-align: center; color: var(--abu); font-size: 0.88rem; margin-bottom: 22px; }
.auth-footer-link { text-align: center; margin-top: 16px; font-size: 0.88rem; color: var(--abu); }

/* ---------------- ALERTS ---------------- */
.alert {
  padding: 13px 16px;
  border-radius: 8px;
  margin-bottom: 18px;
  font-size: 0.9rem;
  border-left: 4px solid transparent;
}
.alert-success { background: #dcfce7; color: #14532d; border-color: #16a34a; }
.alert-danger { background: #fee2e2; color: #7f1d1d; border-color: #dc2626; }
.alert-warning { background: #fef9c3; color: #713f12; border-color: #ca8a04; }
.alert-info { background: #dbeafe; color: #1e3a8a; border-color: #2563eb; }

/* ---------------- TABLES ---------------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
table.table th, table.table td { padding: 11px 12px; text-align: left; border-bottom: 1px solid #edf0f4; white-space: nowrap; }
table.table th { background: var(--abu-muda); color: #333; font-weight: 700; }
table.table tr:hover td { background: #fafbfd; }
table.table img.thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; }

/* ---------------- STAT CARDS (dashboard) ---------------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--putih);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  border-left: 5px solid var(--biru);
}
.stat-card.hijau { border-color: var(--hijau); }
.stat-card.kuning { border-color: #eab308; }
.stat-card.merah { border-color: var(--merah); }
.stat-card .label { font-size: 0.8rem; color: var(--abu); text-transform: uppercase; letter-spacing: 0.4px; }
.stat-card .value { font-size: 1.5rem; font-weight: 800; color: #1a1a1a; margin-top: 4px; }

/* ---------------- DASHBOARD LAYOUT ---------------- */
.dash-layout { display: flex; gap: 24px; align-items: flex-start; }
.dash-sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--putih);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  position: sticky;
  top: 90px;
}
.dash-sidebar a {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  color: #333;
  margin-bottom: 4px;
  font-weight: 500;
}
.dash-sidebar a:hover, .dash-sidebar a.active { background: var(--biru); color: var(--putih); }
.dash-content { flex: 1; min-width: 0; }

@media (max-width: 800px) {
  .dash-layout { flex-direction: column; }
  .dash-sidebar { width: 100%; position: static; display: flex; flex-wrap: wrap; gap: 6px; }
  .dash-sidebar a { flex: 1; text-align: center; min-width: 130px; }
}

/* ---------------- PRODUCT DETAIL / ORDER PAGE ---------------- */
.detail-produk { display: flex; gap: 30px; flex-wrap: wrap; }
.detail-produk .foto { flex: 1; min-width: 280px; }
.detail-produk .foto img { border-radius: var(--radius); box-shadow: var(--shadow); width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.detail-produk .info { flex: 1; min-width: 280px; }
.detail-produk .info h1 { color: #1a1a1a; margin-bottom: 6px; }
.detail-produk .info .harga-besar { font-size: 1.7rem; color: var(--hijau); font-weight: 800; margin: 10px 0; }
.info-list { list-style: none; padding: 0; margin: 16px 0; }
.info-list li { padding: 8px 0; border-bottom: 1px solid #edf0f4; font-size: 0.92rem; display: flex; gap: 8px; }
.info-list li b { min-width: 110px; color: var(--abu); font-weight: 600; }

.ringkasan-order {
  background: var(--abu-muda);
  border-radius: 10px;
  padding: 16px;
  margin: 16px 0;
  font-size: 0.9rem;
}
.ringkasan-order .baris { display: flex; justify-content: space-between; padding: 5px 0; }
.ringkasan-order .total { font-weight: 800; font-size: 1.1rem; color: var(--biru); border-top: 1px dashed #ccc; margin-top: 6px; padding-top: 10px; }

/* ---------------- EMPTY STATE ---------------- */
.empty-state { text-align: center; padding: 60px 20px; color: var(--abu); }
.empty-state .icon { font-size: 3rem; margin-bottom: 10px; }

/* ---------------- MISC ---------------- */
.text-muted { color: var(--abu); }
.text-center { text-align: center; }
.mb-0 { margin-bottom: 0; }
.mt-20 { margin-top: 20px; }
.flex-between { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.tag-pill { background: var(--abu-muda); padding: 4px 10px; border-radius: 999px; font-size: 0.75rem; color: var(--biru); font-weight: 600; }

/* ---------------- FOOTER ---------------- */
.site-footer { background: var(--biru-tua); color: #cfd9f5; padding: 30px 0; margin-top: 50px; }
.footer-inner { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.footer-logo { width: 54px; height: 54px; object-fit: contain; }
.footer-inner strong { color: var(--putih); }
.footer-inner p { margin: 2px 0; font-size: 0.82rem; }

/* ---------------- RESPONSIVE NAV ---------------- */
@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .main-nav {
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: var(--putih);
    flex-direction: column;
    align-items: stretch;
    padding: 10px 20px 16px;
    box-shadow: var(--shadow);
    display: none;
  }
  .main-nav.show { display: flex; }
  .main-nav a { padding: 12px; }
}
