/* ==========================================================================
   SAE FARM — tema publik (mobile-app style)
   Palet: putih dominan + biru dongker + emas
   ========================================================================== */
:root {
  --navy: #0E2A5A;
  --navy-2: #17427F;
  --navy-3: #0A1F45;
  --navy-soft: #E9EFF9;
  --gold: #C9A227;
  --gold-2: #E4C158;
  --gold-soft: #FCF4DE;
  --green: #1F9D63;
  --green-soft: #E6F7EE;
  --red: #D6404E;
  --ink: #16203A;
  --muted: #6B7A99;
  --line: #E6EAF2;
  --bg: #EDF1F8;
  --white: #FFFFFF;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 10px 30px rgba(14, 42, 90, .10);
  --shadow-sm: 0 4px 14px rgba(14, 42, 90, .07);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font);
  color: var(--ink);
  background: radial-gradient(1200px 600px at 20% -10%, #DCE6F7 0%, transparent 60%),
              radial-gradient(900px 500px at 110% 10%, #FBF0D8 0%, transparent 55%),
              var(--bg);
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
}

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

a { color: var(--navy-2); text-decoration: none; }

h1, h2, h3, h4 { margin: 0 0 .35em; line-height: 1.25; letter-spacing: -.01em; }

.ico { width: 22px; height: 22px; flex: 0 0 auto; }

/* ---------------- Shell aplikasi ---------------- */
.app {
  max-width: 520px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--white);
  box-shadow: 0 0 60px rgba(14, 42, 90, .12);
  padding-bottom: 104px;
  position: relative;
  overflow-x: hidden;
}

.main { padding: 20px 18px 8px; display: flex; flex-direction: column; gap: 26px; }

/* ---------------- Hero / appbar ---------------- */
.hero {
  position: relative;
  background: linear-gradient(140deg, var(--navy) 0%, var(--navy-2) 55%, #1D4E93 100%);
  color: #fff;
  padding: 18px 18px 44px;
  border-bottom-left-radius: 26px;
  border-bottom-right-radius: 26px;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(420px 200px at 90% 0%, rgba(201,162,39,.35), transparent 70%);
  pointer-events: none;
}
.hero-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; position: relative; z-index: 2; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo { width: 40px; height: 40px; background: #fff; border-radius: 50%; padding: 3px; }
.brand strong { display: block; font-size: 15px; letter-spacing: .06em; }
.brand span { display: block; font-size: 10.5px; opacity: .8; }
.bell {
  position: relative; width: 38px; height: 38px; border-radius: 50%;
  background: rgba(255,255,255,.16); color: #fff;
  display: grid; place-items: center; backdrop-filter: blur(6px);
}
.bell .dot {
  position: absolute; top: -3px; right: -3px; background: var(--gold-2); color: var(--navy-3);
  font-size: 10px; font-weight: 700; min-width: 18px; height: 18px; border-radius: 9px;
  display: grid; place-items: center; font-style: normal; padding: 0 4px;
}
.hero-text { position: relative; z-index: 2; margin-top: 18px; }
.hero-greet { margin: 0; font-size: 13px; opacity: .85; }
.hero-text h1 { font-size: 30px; margin: 2px 0 4px; letter-spacing: .01em; }
.hero-tag { margin: 0; font-style: italic; font-size: 15px; color: #F4E3A9; }
.hero-wave { position: absolute; left: 0; right: 0; bottom: -2px; width: 100%; height: 44px; }

.appbar {
  position: sticky; top: 0; z-index: 40;
  background: var(--navy); color: #fff;
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  box-shadow: 0 6px 18px rgba(14,42,90,.18);
}
.appbar h1 { font-size: 17px; margin: 0; flex: 1; }
.appbar-logo { width: 32px; height: 32px; background: #fff; border-radius: 50%; padding: 2px; }
.appbar .icon-btn { color: #fff; background: rgba(255,255,255,.14); border-radius: 50%; width: 36px; height: 36px; display: grid; place-items: center; }
.appbar .btn-gold { margin-left: auto; }

/* ---------------- Kartu ---------------- */
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: 0; }
.card-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.card-title h2, .card-title h3 { font-size: 17px; margin: 0; }
.card-title a { font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 2px; }
.card-contact { background: linear-gradient(160deg, var(--navy) 0%, var(--navy-3) 100%); color: #fff; border: none; }
.card-contact h3 { color: #fff; }
.contact-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.contact-list li { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; opacity: .92; }
.contact-list .ico { width: 18px; height: 18px; margin-top: 2px; color: var(--gold-2); }
.foot-note {
  margin: 16px 0 0; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.15);
  font-size: 10.5px; letter-spacing: .16em; text-align: center; color: #D9C57E;
}

/* ---------------- Slider ---------------- */
.slider { position: relative; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: var(--navy); }
.slider-track { display: flex; transition: transform .55s cubic-bezier(.4,0,.2,1); }
.slide {
  min-width: 100%; position: relative; min-height: 210px;
  display: flex; align-items: flex-end;
  background-size: cover; background-position: center;
}
.slide-body { position: relative; z-index: 2; padding: 18px; color: #fff; width: 100%; }
.slide-body h2 { font-size: 19px; margin: 6px 0 4px; }
.slide-body p { margin: 0 0 12px; font-size: 12.5px; opacity: .92; }
.slide-badge {
  display: inline-block; background: var(--gold-2); color: var(--navy-3);
  font-size: 10.5px; font-weight: 700; padding: 4px 10px; border-radius: 999px; text-transform: uppercase; letter-spacing: .06em;
}
.slide::after {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(180deg, rgba(10,31,69,.15) 0%, rgba(10,31,69,.85) 100%);
}
.slider-dots { position: absolute; bottom: 12px; right: 14px; z-index: 3; display: flex; gap: 6px; }
.slider-dots button {
  width: 8px; height: 8px; border-radius: 50%; border: none; padding: 0;
  background: rgba(255,255,255,.45); cursor: pointer; transition: all .25s;
}
.slider-dots button.active { background: var(--gold-2); width: 22px; border-radius: 5px; }

/* ---------------- Menu cepat / tiles ---------------- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.grid-4 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }

.tile {
  border-radius: var(--radius); padding: 16px 14px; color: #fff;
  display: flex; flex-direction: column; gap: 8px; min-height: 108px;
  justify-content: space-between; box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease;
}
.tile:active { transform: scale(.98); }
.tile:hover { box-shadow: var(--shadow); }
.tile .ico { width: 26px; height: 26px; }
.tile strong { font-size: 14.5px; display: block; }
.tile small { font-size: 11px; opacity: .85; }
.tile-navy  { background: linear-gradient(145deg, #17427F, #0E2A5A); }
.tile-gold  { background: linear-gradient(145deg, #D7B23F, #A9831A); }
.tile-green { background: linear-gradient(145deg, #2AAE74, #16744A); }
.tile-blue  { background: linear-gradient(145deg, #2F6FD0, #1B4A96); }

/* ---------------- Tombol ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: none; border-radius: 999px; padding: 13px 20px;
  font-family: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
  text-align: center; transition: transform .15s ease, box-shadow .15s ease, background .2s;
}
.btn:active { transform: scale(.985); }
.btn-primary { background: linear-gradient(120deg, var(--navy-2), var(--navy)); color: #fff; box-shadow: 0 8px 20px rgba(14,42,90,.25); }
.btn-gold { background: linear-gradient(120deg, var(--gold-2), var(--gold)); color: #3A2C05; box-shadow: 0 8px 20px rgba(201,162,39,.28); }
.btn-wa { background: linear-gradient(120deg, #34C46B, #1F9D63); color: #fff; box-shadow: 0 8px 20px rgba(31,157,99,.25); }
.btn-ghost { background: #fff; color: var(--navy); border: 1.5px solid var(--navy-soft); }
.btn-light { background: var(--navy-soft); color: var(--navy); }
.btn-danger { background: #FDECEE; color: var(--red); }
.btn-block { width: 100%; }
.btn-mini { padding: 8px 14px; font-size: 12.5px; }
.btn-sm { padding: 9px 15px; font-size: 13px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------------- Chip / badge ---------------- */
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.chip {
  border: 1px solid var(--line); background: #fff; color: var(--muted);
  padding: 7px 14px; border-radius: 999px; font-size: 12.5px; font-weight: 600; cursor: pointer;
  font-family: inherit;
}
.chip.active { background: var(--navy); border-color: var(--navy); color: #fff; }

.badge { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.badge.warn { background: var(--gold-soft); color: #8A6D0B; }
.badge.ok { background: var(--green-soft); color: #14744A; }
.badge.info { background: var(--navy-soft); color: var(--navy-2); }
.badge.danger { background: #FDECEE; color: var(--red); }
.badge.muted { background: #F1F3F8; color: var(--muted); }

/* ---------------- Statistik ---------------- */
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.stat {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 14px; box-shadow: var(--shadow-sm);
}
.stat .stat-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; margin-bottom: 10px; background: var(--navy-soft); color: var(--navy-2); }
.stat .stat-ico.gold { background: var(--gold-soft); color: #9C7A10; }
.stat .stat-ico.green { background: var(--green-soft); color: var(--green); }
.stat .stat-ico .ico { width: 18px; height: 18px; }
.stat-label { font-size: 12px; color: var(--muted); margin: 0 0 2px; font-weight: 600; }
.stat-value { font-size: 20px; font-weight: 800; margin: 0; letter-spacing: -.02em; }
.stat-delta { font-size: 11px; margin: 4px 0 0; color: var(--muted); display: flex; align-items: center; gap: 4px; }
.stat-delta.up { color: var(--green); }
.stat-delta.down { color: var(--red); }
.stat-delta .ico { width: 13px; height: 13px; }

/* ---------------- Daftar / list ---------------- */
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.row {
  display: flex; gap: 12px; align-items: center;
  padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff;
}
.row-thumb { width: 54px; height: 54px; border-radius: 12px; object-fit: cover; background: var(--navy-soft); flex: 0 0 auto; }
.row-body { flex: 1; min-width: 0; }
.row-body strong { display: block; font-size: 14px; }
.row-body span { font-size: 12px; color: var(--muted); display: block; }
.row-end { text-align: right; flex: 0 0 auto; }
.row.plain { border: none; padding: 0; }

.icon-soft { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--navy-soft); color: var(--navy-2); flex: 0 0 auto; }
.icon-soft.gold { background: var(--gold-soft); color: #9C7A10; }
.icon-soft.green { background: var(--green-soft); color: var(--green); }
.icon-soft .ico { width: 19px; height: 19px; }

.price { font-weight: 800; color: var(--navy); font-size: 15px; }
.price small { font-weight: 500; font-size: 11px; color: var(--muted); }

/* ---------------- Produk ---------------- */
.product-card { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; }
.product-card img { height: 128px; width: 100%; object-fit: cover; background: var(--navy-soft); }
.product-card .pc-body { padding: 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.product-card h4 { margin: 0; font-size: 14px; }
.product-card .pc-cat { font-size: 11px; color: var(--muted); }
.product-card .pc-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; }

/* ---------------- CTA promo ---------------- */
.cta {
  border-radius: var(--radius); padding: 20px; color: #fff; position: relative; overflow: hidden;
  background: linear-gradient(130deg, var(--gold) 0%, #8A6A12 100%);
  box-shadow: var(--shadow);
}
.cta h3 { color: #fff; font-size: 17px; }
.cta p { font-size: 12.5px; opacity: .92; margin: 0 0 14px; }
.cta .cta-btn { background: rgba(255,255,255,.94); color: #7A5C0B; }

/* ---------------- Form ---------------- */
.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: 12.5px; font-weight: 700; color: var(--navy); }
.field .hint { font-size: 11.5px; color: var(--muted); }
.field input, .field select, .field textarea {
  font-family: inherit; font-size: 14px; color: var(--ink);
  padding: 12px 14px; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  background: #fff; outline: none; width: 100%; transition: border .2s, box-shadow .2s;
}
.field textarea { min-height: 92px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--navy-2); box-shadow: 0 0 0 4px rgba(23,66,127,.09); }
.field-row { display: flex; gap: 12px; }
.field-row > * { flex: 1; }
.switch { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; color: var(--navy); }
.switch input { width: auto; }

.qty-box { display: flex; align-items: center; gap: 0; border: 1.5px solid var(--line); border-radius: 999px; overflow: hidden; width: fit-content; }
.qty-box button {
  border: none; background: var(--navy-soft); color: var(--navy); width: 42px; height: 42px;
  font-size: 20px; font-weight: 700; cursor: pointer; font-family: inherit;
}
.qty-box input { border: none; width: 62px; text-align: center; font-size: 15px; font-weight: 700; padding: 10px 0; }

.total-bar {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--navy); color: #fff; border-radius: var(--radius-sm); padding: 14px 16px;
}
.total-bar span { font-size: 12.5px; opacity: .85; }
.total-bar strong { font-size: 19px; }

/* ---------------- Kalender panen ---------------- */
.month-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.month-card {
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; background: #fff;
  box-shadow: var(--shadow-sm);
}
.month-card h4 { font-size: 13px; margin: 0 0 6px; color: var(--navy); }
.month-card ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.month-card li { font-size: 11.5px; color: var(--ink); display: flex; flex-direction: column; gap: 2px; }
.month-card li em { font-style: normal; color: var(--muted); font-size: 10.5px; }
.month-card.is-now { border-color: var(--gold); background: linear-gradient(160deg, #FFFDF6, #FCF4DE); }

/* ---------------- Akun / profil ---------------- */
.profile-head { display: flex; align-items: center; gap: 14px; }
.avatar {
  width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(140deg, var(--navy-2), var(--navy)); color: #fff; font-weight: 800; font-size: 20px;
}
.avatar.gold { background: linear-gradient(140deg, var(--gold-2), var(--gold)); color: #40310A; }
.menu-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.menu-list li + li { border-top: 1px solid var(--line); }
.menu-list a, .menu-list .ml-item {
  display: flex; align-items: center; gap: 12px; padding: 14px 2px; font-size: 14px; font-weight: 600; color: var(--ink);
}
.menu-list .ico { color: var(--navy-2); }
.menu-list .chev { margin-left: auto; color: var(--muted); }
.menu-list .chev .ico { width: 18px; height: 18px; }

.tabs { display: flex; gap: 6px; background: var(--navy-soft); padding: 5px; border-radius: 999px; margin-bottom: 16px; }
.tabs a, .tabs button {
  flex: 1; text-align: center; padding: 9px 6px; border-radius: 999px; font-size: 12.5px; font-weight: 700;
  color: var(--navy-2); border: none; background: transparent; cursor: pointer; font-family: inherit;
}
.tabs a.active, .tabs button.active { background: #fff; color: var(--navy); box-shadow: var(--shadow-sm); }

.empty { text-align: center; padding: 26px 16px; color: var(--muted); }
.empty .ico { width: 34px; height: 34px; color: #C3CDDF; margin-bottom: 8px; }
.empty p { margin: 0 0 4px; font-size: 13.5px; }

/* ---------------- Tiket / kode ---------------- */
.ticket-stub {
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  background: linear-gradient(140deg, var(--navy) 0%, var(--navy-3) 100%); color: #fff;
}
.ticket-stub .ts-head { padding: 16px 18px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.ticket-stub .ts-code { font-size: 20px; font-weight: 800; letter-spacing: .06em; }
.ticket-stub .ts-body { background: #fff; color: var(--ink); padding: 16px 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ticket-stub .ts-body div span { display: block; font-size: 11px; color: var(--muted); }
.ticket-stub .ts-body div strong { font-size: 13.5px; }
.dashed { border-top: 2px dashed var(--line); position: relative; }
.ticket-stub .ts-foot { background: #fff; padding: 0 18px 18px; display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------------- Notifikasi ---------------- */
.toast {
  display: flex; align-items: center; gap: 10px; padding: 13px 15px; border-radius: var(--radius-sm);
  font-size: 13.5px; font-weight: 600; box-shadow: var(--shadow-sm); transition: opacity .35s, transform .35s;
}
.toast .ico { width: 19px; height: 19px; }
.toast-success { background: var(--green-soft); color: #14744A; border: 1px solid #C6EBD8; }
.toast-error { background: #FDECEE; color: var(--red); border: 1px solid #F8D4D8; }
.toast-info { background: var(--navy-soft); color: var(--navy-2); }
.toast-out { opacity: 0; transform: translateY(-8px); }

/* ---------------- Bottom nav ---------------- */
.bottomnav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 520px; z-index: 50;
  background: rgba(255,255,255,.97); backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 8px 4px calc(8px + env(safe-area-inset-bottom));
}
.bottomnav a {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: 10.5px; font-weight: 600; color: var(--muted); padding: 4px 0;
}
.bottomnav a .ico { width: 21px; height: 21px; }
.bottomnav a.active { color: var(--navy); }
.bottomnav a.active .ico { color: var(--gold); }

/* ---------------- Utilitas ---------------- */
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.text-center { text-align: center; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: -8px; }
.section-head h2 { font-size: 17px; margin: 0; }
.section-head a { font-size: 12.5px; font-weight: 700; }
.divider { height: 1px; background: var(--line); margin: 4px 0; }
.hidden { display: none !important; }
.pill-note { background: var(--gold-soft); border: 1px solid #F0E0AE; color: #7A5C0B; border-radius: var(--radius-sm); padding: 12px 14px; font-size: 12.5px; display: flex; gap: 10px; }
.pill-note .ico { width: 18px; height: 18px; margin-top: 1px; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }

@media (max-width: 400px) {
  .month-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-text h1 { font-size: 26px; }
}

@media (min-width: 860px) {
  .app { margin: 24px auto; border-radius: 28px; min-height: calc(100vh - 48px); padding-bottom: 92px; overflow: hidden; }
  .bottomnav { border-radius: 0 0 28px 28px; bottom: 24px; }
  .hero { border-radius: 0; }
}
