/* RAM Sawit PWA — style.css (mobile-first) */
:root {
  --hijau: #1B5E20;
  --hijau2: #2E7D32;
  --biru: #1565C0;
  --merah: #C62828;
  --abu: #546E7A;
  --bg: #F5F5F5;
  --input-bg: #FFFDE7;
  --auto-bg: #E8F5E9;
  --txt: #212121;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--txt);
  padding-bottom: 64px;
  font-size: 15px;
}

/* HEADER */
header {
  background: var(--hijau);
  color: #fff;
  padding: 12px 14px;
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: 0 2px 6px rgba(0,0,0,.2);
}
header h1 { margin: 0; font-size: 17px; font-weight: 700; }
.status-row { display: flex; gap: 12px; margin-top: 4px; font-size: 11px; color: #A5D6A7; }

/* TABS (bottom nav) */
nav.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0;
  display: flex; background: #fff;
  border-top: 1px solid #ddd; z-index: 20;
}
nav.tabbar button {
  flex: 1; border: none; background: none; padding: 8px 2px 6px;
  font-size: 11px; color: #777; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
nav.tabbar button .ico { font-size: 20px; }
nav.tabbar button.active { color: var(--hijau); font-weight: 700; }

/* VIEWS */
.view { display: none; padding: 12px; }
.view.active { display: block; }

/* CARD / FIELD */
.card {
  background: #fff; border-radius: 10px; padding: 14px;
  margin-bottom: 12px; box-shadow: 0 1px 3px rgba(0,0,0,.1);
}
.card h2 { margin: 0 0 10px; font-size: 15px; color: var(--hijau); }

label.field { display: block; margin-bottom: 10px; }
label.field span { display: block; font-size: 12px; color: #555; margin-bottom: 3px; }
input, select, textarea {
  width: 100%; padding: 10px; font-size: 16px; /* 16px: cegah zoom iOS */
  border: 1px solid #ccc; border-radius: 8px; background: var(--input-bg);
}
input[readonly], .auto { background: var(--auto-bg); font-weight: 700; }

.total-box {
  background: var(--auto-bg); border-radius: 8px; padding: 12px;
  text-align: right; font-size: 22px; font-weight: 800; color: var(--hijau2);
}
.terbilang { font-size: 12px; color: var(--hijau); font-style: italic; margin-top: 6px; }

/* BUTTONS */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: none; border-radius: 8px; padding: 12px; font-size: 15px; font-weight: 700;
  color: #fff; cursor: pointer; width: 100%; margin-top: 6px;
}
.btn-hijau { background: var(--hijau2); }
.btn-biru { background: var(--biru); }
.btn-abu { background: var(--abu); }
.btn-merah { background: var(--merah); }
.btn-row { display: flex; gap: 8px; }
.btn-row .btn { margin-top: 0; }

/* REKAP */
.rekap-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rekap-item { background: var(--auto-bg); border-radius: 8px; padding: 10px; }
.rekap-item .k { font-size: 11px; color: #666; }
.rekap-item .v { font-size: 16px; font-weight: 700; color: var(--hijau); }

/* LIST */
.list-item {
  background: #fff; border-radius: 8px; padding: 10px 12px; margin-bottom: 8px;
  box-shadow: 0 1px 2px rgba(0,0,0,.08); display: flex; justify-content: space-between; align-items: center;
}
.list-item .meta { font-size: 12px; color: #777; }
.badge { font-size: 11px; padding: 2px 8px; border-radius: 10px; }
.badge.ok { background: #C8E6C9; color: #1B5E20; }
.badge.no { background: #FFCDD2; color: #B71C1C; }

/* MODAL NOTA */
.modal-bg {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5);
  z-index: 50; align-items: center; justify-content: center; padding: 12px;
}
.modal-bg.show { display: flex; }
.modal {
  background: #fff; border-radius: 12px; width: 100%; max-width: 420px;
  max-height: 90vh; overflow-y: auto; padding: 16px;
}
/* NOTA — tampilan monospace mirip struk */
#notaPreview {
  font-family: "Courier New", monospace; font-size: 12px; white-space: pre;
  background: #fff; color: #000; border: 1px dashed #999; padding: 10px;
  overflow-x: auto; line-height: 1.35;
}

.section-title { font-size: 12px; font-weight: 700; color: var(--hijau); margin: 14px 0 4px; text-transform: uppercase; }

.toast {
  position: fixed; bottom: 76px; left: 50%; transform: translateX(-50%);
  background: #323232; color: #fff; padding: 10px 16px; border-radius: 20px;
  font-size: 13px; z-index: 60; opacity: 0; transition: opacity .3s; pointer-events: none;
  max-width: 90%;
}
.toast.show { opacity: 1; }
