/* =========================================================
   SITREP ISN — Mobile-first redesign
   Dirancang untuk relawan lapangan pengguna HP Android
   ========================================================= */
:root {
  --ink: #14231D;
  --ink-soft: #4A5E56;
  --paper: #F0F3EF;
  --paper-raised: #FFFFFF;
  --line: #D5DDD2;
  --line-strong: #B0BCB0;

  --teal-900: #0F2C25;
  --teal-800: #174D3F;
  --teal-700: #1F6E5C;
  --teal-600: #2F8C74;
  --teal-200: #C0DDD5;
  --teal-100: #DCEAE4;

  --lime: #A8C93F;
  --lime-dark: #7A9A1A;
  --lime-ink: #3D4D15;

  --amber: #C98A2B;
  --amber-100: #F5E7CF;
  --red: #B23A2E;
  --red-100: #F5DCD9;
  --green: #2D8A50;
  --green-100: #D4EDDE;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,.10), 0 2px 4px rgba(0,0,0,.06);

  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --tap-min: 48px;
}

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

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'Inter', var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3 { margin: 0; font-weight: 700; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; font-size: 16px; }

/* ===================== LOGIN ===================== */
.login-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 24px 20px 40px;
  background: radial-gradient(circle at 50% -20%, #1F6E5C 0%, #050d0a 80%);
  position: relative;
  overflow: hidden;
}
.login-screen::before {
  content: "";
  position: absolute;
  top: -10%; left: 50%; transform: translateX(-50%);
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(168,201,63,0.12) 0%, transparent 60%);
  border-radius: 50%;
  pointer-events: none;
}
.login-brand {
  text-align: center;
  margin-bottom: 36px;
  position: relative;
  z-index: 2;
}
.login-logo-container {
  background: rgba(255, 255, 255, 0.95);
  width: 76px; height: 76px;
  border-radius: 22px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.3);
  padding: 12px;
}
.login-brand img { width: 100%; height: 100%; object-fit: contain; }
.login-brand h1 { color: #fff; font-size: 26px; margin-top: 14px; letter-spacing: -0.03em; font-weight: 700; text-shadow: 0 2px 8px rgba(0,0,0,0.3); }
.login-brand p { color: rgba(255,255,255,0.7); font-size: 14px; margin-top: 4px; }

.login-card {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-radius: 28px;
  padding: 32px 24px;
  box-shadow: 0 24px 48px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.15);
  position: relative;
  z-index: 2;
  border: 1px solid rgba(255,255,255,0.1);
  margin: 0 8px;
}

/* Custom inputs inside dark glass card */
.login-card .field-label {
  color: rgba(255,255,255,0.8);
}
.login-card input {
  background: rgba(0,0,0,0.15) !important;
  border: 1.5px solid rgba(255,255,255,0.1) !important;
  color: #fff !important;
}
.login-card input::placeholder {
  color: rgba(255,255,255,0.3);
}
.login-card input:focus {
  border-color: var(--lime) !important;
  box-shadow: 0 0 0 3px rgba(168,201,63,0.15) !important;
  background: rgba(0,0,0,0.3) !important;
}
.login-card .btn--primary {
  background: var(--lime);
  color: var(--lime-ink);
  border: none;
  margin-top: 14px;
  box-shadow: 0 4px 16px rgba(168,201,63,0.25);
}
.login-card .btn--primary:active {
  background: var(--lime-dark);
  transform: scale(0.98);
}

/* ===================== MASTHEAD ===================== */
.masthead {
  background: var(--teal-900);
  color: #EFF4F1;
  padding: 12px 16px 0;
  position: sticky;
  top: 0;
  z-index: 30;
}
.masthead__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.masthead__logo { height: 32px; width: auto; object-fit: contain; }
.masthead__title { padding: 4px 0 16px; }
.masthead__title .label { font-size: 11px; color: var(--teal-200); font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 2px; }
.masthead__title .date { font-size: 20px; color: #fff; font-weight: 700; line-height: 1.2; }
.statusbar {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--teal-100);
  background: rgba(0,0,0,.18);
  padding: 5px 16px;
  font-family: var(--font-mono);
}
.statusbar .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--lime); flex-shrink: 0;
}
.statusbar.is-offline .dot { background: var(--amber); }
.statusbar.is-dirty .dot { background: #FF8C6B; animation: pulse 1s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.4} }

.iconbtn {
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.2);
  color: #EFF4F1;
  width: var(--tap-min); height: var(--tap-min);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.iconbtn:active { background: rgba(255,255,255,.22); }

/* ===================== MAIN LAYOUT ===================== */
.app-body {
  max-width: 600px;
  margin: 0 auto;
  padding: 0 0 100px;
}

/* ===================== HOME VIEW ===================== */
.home-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 16px 12px;
}
.home-header h2 { font-size: 18px; }
.report-count {
  font-size: 13px;
  color: var(--ink-soft);
  background: var(--teal-100);
  border-radius: 999px;
  padding: 3px 10px;
  font-family: var(--font-mono);
}

/* Kartu laporan di Home */
.report-card {
  background: var(--paper-raised);
  border-radius: var(--radius);
  margin: 0 12px 10px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  border: 1px solid var(--line);
}
.report-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--line);
}
.report-card__date { font-size: 15px; font-weight: 700; }
.report-card__meta {
  font-size: 12px; color: var(--ink-soft);
  font-family: var(--font-mono);
  margin-top: 3px;
}
.report-card__actions {
  display: flex;
  gap: 0;
  border-top: 1px solid var(--line);
}
.report-card__actions .rc-btn {
  flex: 1;
  min-height: var(--tap-min);
  border: none;
  background: transparent;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.rc-btn--edit { color: var(--teal-700); }
.rc-btn--edit:active { background: var(--teal-100); }
.rc-btn--delete { color: var(--red); border-left: 1px solid var(--line); }
.rc-btn--delete:active { background: var(--red-100); }

/* FAB Buat Laporan */
.fab {
  position: fixed;
  bottom: 24px;
  right: 20px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--teal-700);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 14px 22px 14px 18px;
  font-size: 15px;
  font-weight: 700;
  box-shadow: 0 4px 16px rgba(31,110,92,.45);
  transition: transform .15s, box-shadow .15s;
}
.fab:active { transform: scale(.96); box-shadow: 0 2px 8px rgba(31,110,92,.35); }
.fab svg { flex-shrink: 0; }

/* ===================== EDITOR VIEW ===================== */
/* Section navigation tabs */
.section-tabs {
  display: flex;
  overflow-x: auto;
  background: var(--paper-raised);
  border-bottom: 2px solid var(--line);
  padding: 0 8px;
  position: sticky;
  top: 0;
  z-index: 20;
  scrollbar-width: none;
  gap: 2px;
}
.section-tabs::-webkit-scrollbar { display: none; }
.stab {
  flex: 0 0 auto;
  min-height: 48px;
  padding: 0 14px;
  border: none;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  white-space: nowrap;
  position: relative;
}
.stab.is-active {
  color: var(--teal-700);
  border-bottom-color: var(--teal-700);
}
.stab .stab-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--line);
}
.stab.is-filled .stab-dot { background: var(--teal-600); }
.stab.is-active.is-filled .stab-dot { background: var(--teal-700); }

/* Satu section panel (ditampilkan satu per satu) */
.section-panel {
  padding: 16px;
  display: none;
}
.section-panel.is-active { display: block; }

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.section-letter {
  background: var(--teal-700);
  color: #fff;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
  width: 32px; height: 32px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.section-title h2 { font-size: 17px; }
.section-hint {
  font-size: 13px;
  color: var(--ink-soft);
  background: var(--teal-100);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 16px;
  line-height: 1.5;
}

/* ===================== FORM FIELDS ===================== */
.field {
  display: block;
  margin-bottom: 14px;
}
.field > .field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 6px;
  letter-spacing: .01em;
}
.field input[type="text"],
.field input[type="password"],
.field input[type="date"],
.field input[type="url"],
.field input[type="number"],
.field select,
.field textarea {
  width: 100%;
  border: 1.5px solid var(--line-strong);
  background: var(--paper-raised);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 16px;
  color: var(--ink);
  -webkit-appearance: none;
  appearance: none;
  transition: border-color .15s, box-shadow .15s;
}
.field textarea { min-height: 80px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--teal-600);
  box-shadow: 0 0 0 3px rgba(47,140,116,.15);
}

.field--split { display: flex; gap: 10px; }
.field--split > label { flex: 1; }

/* ===================== ROWCARD (item list) ===================== */
.rowcard {
  background: var(--paper-raised);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.rowcard__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--teal-100);
  padding: 10px 14px;
}
.rowcard.from-plan .rowcard__head { background: #EDF5D4; }
.rowcard__index { font-family: var(--font-mono); font-size: 12px; color: var(--teal-700); font-weight: 700; }
.rowcard__body { padding: 14px; }
.rowcard .field { margin-bottom: 10px; }
.rowcard .field:last-child { margin-bottom: 0; }
.rowcard__del-btn {
  min-height: 36px;
  padding: 0 12px;
  background: var(--red-100);
  border: none;
  border-radius: 6px;
  color: var(--red);
  font-size: 13px;
  font-weight: 700;
  display: flex; align-items: center; gap: 5px;
}
.rowcard__del-btn:active { background: #EFC9C5; }

.chip-plan {
  font-size: 11px;
  background: var(--lime);
  color: var(--lime-ink);
  border-radius: 999px;
  padding: 2px 8px;
  font-weight: 700;
  font-family: var(--font-mono);
}

/* ===================== ADD BUTTON ===================== */
.btn-add {
  width: 100%;
  min-height: var(--tap-min);
  border: 2px dashed var(--teal-200);
  background: transparent;
  color: var(--teal-700);
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 4px;
}
.btn-add:active { background: var(--teal-100); }
.btn-add:disabled { opacity: .4; cursor: not-allowed; }

/* ===================== PHOTO CARDS ===================== */
.photocard {
  background: var(--paper-raised);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.photocard__thumb {
  width: 100%;
  height: 140px;
  background: var(--paper);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  cursor: pointer;
}
.photocard__thumb img { width: 100%; height: 100%; object-fit: cover; }
.photocard__body { padding: 12px 14px 14px; }
.photocard__quota {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-soft);
  margin-bottom: 10px;
  text-align: center;
  background: var(--paper);
  border-radius: 6px;
  padding: 6px;
}

/* ===================== NAVIGATION ARROWS (prev/next) ===================== */
.section-nav {
  display: flex;
  gap: 10px;
  padding: 12px 16px 0;
  border-top: 1px solid var(--line);
  margin-top: 8px;
}
.nav-btn {
  flex: 1;
  min-height: var(--tap-min);
  border: 1.5px solid var(--line-strong);
  background: var(--paper-raised);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.nav-btn:active { background: var(--paper); }
.nav-btn--primary {
  background: var(--teal-700);
  border-color: var(--teal-700);
  color: #fff;
}
.nav-btn--primary:active { background: var(--teal-800); }

/* ===================== BUTTONS ===================== */
.btn {
  border-radius: var(--radius-sm);
  padding: 13px 18px;
  font-size: 15px;
  font-weight: 700;
  border: 1.5px solid transparent;
  min-height: var(--tap-min);
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn--primary { background: var(--teal-700); color: #fff; }
.btn--primary:active { background: var(--teal-800); }
.btn--outline { background: var(--paper-raised); border-color: var(--line-strong); color: var(--ink); }
.btn--outline:active { background: var(--paper); }
.btn--wa { background: #25D366; border-color: #25D366; color: #fff; }
.btn--wa:active { background: #1DA851; }
.btn--ghost { background: transparent; border-color: transparent; color: var(--teal-700); }
.btn--danger { background: var(--red-100); border-color: var(--red); color: var(--red); }
.btn--full { width: 100%; }

/* ===================== ACTION BAR (bottom) ===================== */
.action-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--paper-raised);
  border-top: 1px solid var(--line);
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  display: flex;
  gap: 8px;
  z-index: 25;
  box-shadow: 0 -4px 16px rgba(0,0,0,.08);
}
.action-bar .btn { flex: 1; font-size: 14px; }

/* ===================== BADGES ===================== */
.badge {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 700;
}
.badge--draft { background: var(--amber-100); color: #7A5416; }
.badge--sent { background: var(--green-100); color: var(--green); }
.badge--pending { background: var(--red-100); color: var(--red); }

/* ===================== EMPTY STATE ===================== */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--ink-soft);
}
.empty-state__icon { font-size: 48px; margin-bottom: 16px; opacity: .5; }
.empty-state h3 { font-size: 16px; color: var(--ink); margin-bottom: 8px; }
.empty-state p { font-size: 14px; }

/* ===================== DRAWER (Settings) ===================== */
.drawer {
  position: fixed; inset: 0;
  background: rgba(10,25,20,.55);
  z-index: 50;
  display: flex; align-items: flex-end;
}
.drawer[hidden] { display: none !important; }
.drawer__panel {
  background: var(--paper-raised);
  width: 100%; max-height: 90vh; overflow-y: auto;
  border-radius: 20px 20px 0 0;
  padding: 16px 16px calc(24px + env(safe-area-inset-bottom));
  max-width: 600px; margin: 0 auto;
}
.drawer__handle {
  width: 40px; height: 4px;
  background: var(--line-strong);
  border-radius: 999px;
  margin: 0 auto 16px;
}
.drawer__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.drawer__head h2 { font-size: 18px; }
.drawer__head .iconbtn { background: var(--paper); border-color: var(--line); color: var(--ink); }
.drawer__hint { font-size: 13px; color: var(--ink-soft); margin: 0 0 16px; background: var(--paper); border-radius: var(--radius-sm); padding: 10px 12px; }
.drawer__divider { font-size: 12px; font-weight: 700; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .08em; margin: 18px 0 12px; padding-top: 18px; border-top: 1px solid var(--line); }

/* ===================== CONFIRM SHEET ===================== */
.confirm-sheet {
  position: fixed; inset: 0;
  background: rgba(10,25,20,.55);
  z-index: 60;
  display: flex; align-items: flex-end;
}
.confirm-sheet[hidden] { display: none !important; }
.confirm-sheet__panel {
  background: var(--paper-raised);
  width: 100%;
  border-radius: 20px 20px 0 0;
  padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
  max-width: 600px; margin: 0 auto;
}
.confirm-sheet__title { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.confirm-sheet__msg { font-size: 14px; color: var(--ink-soft); margin-bottom: 20px; }
.confirm-sheet__actions { display: flex; flex-direction: column; gap: 8px; }

/* ===================== TOAST ===================== */
.toast {
  position: fixed; left: 50%; bottom: 90px;
  transform: translateX(-50%);
  background: var(--ink); color: #fff;
  padding: 10px 20px; border-radius: 999px;
  font-size: 14px; z-index: 80;
  box-shadow: 0 6px 24px rgba(0,0,0,.28);
  white-space: nowrap;
  pointer-events: none;
}

/* ===================== BACK BUTTON ===================== */
.back-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 0;
  background: transparent;
  border: none;
  color: var(--teal-200);
  font-size: 15px;
  font-weight: 600;
  min-height: 44px;
  margin-left: -4px;
}
.back-btn:active { color: #fff; }

/* ===================== SELECT STYLED ===================== */
.field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%234A5E56' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
  cursor: pointer;
}

/* ===================== PROGRESS BAR ===================== */
.progress-bar {
  height: 3px;
  background: var(--teal-200);
  position: relative;
  overflow: hidden;
}
.progress-bar__fill {
  height: 100%;
  background: var(--lime);
  transition: width .3s ease;
}

/* ===================== FOCUS & A11Y ===================== */
:focus-visible { outline: 2px solid var(--teal-600); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
