/* ================================================================
   MJM NURSERY — PLOT AUDIT SYSTEM
   styles.css
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:opsz,wght@9..40,400;9..40,500;9..40,600;9..40,700&display=swap');

/* ----------------------------------------------------------------
   RESET
---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
img { display: block; max-width: 100%; }
button { cursor: pointer; font-family: inherit; }

/* ----------------------------------------------------------------
   CSS VARIABLES
---------------------------------------------------------------- */
:root {
  /* greens */
  --g900: #0d2b0d;
  --g800: #1a4d1a;
  --g700: #236023;
  --g600: #2d7a2d;
  --g500: #3d9c3d;
  --g400: #5aab5a;
  --g300: #81c784;
  --g200: #b5dfb5;
  --g100: #e0f2e0;
  --g50:  #f2faf2;

  /* warna daun */
  --w1: #1a4d1a;
  --w2: #2d7a2d;
  --w3: #5aab5a;
  --w4: #93c955;
  --w5: #c8d648;

  /* neutrals */
  --white:   #ffffff;
  --surface: #f4f6f4;
  --card:    #ffffff;
  --border:  #dde8dd;
  --border2: #c4d8c4;

  /* text */
  --text1: #182018;
  --text2: #3d5c3d;
  --text3: #6b8a6b;
  --text4: #9db09d;

  /* semantic */
  --danger-bg:     #fff1f1;
  --danger-text:   #b91c1c;
  --danger-border: #fca5a5;
  --warn-bg:       #fffbeb;
  --warn-text:     #92400e;
  --warn-border:   #fcd34d;
  --ok-bg:         #ecfdf5;
  --ok-text:       #065f46;
  --ok-border:     #6ee7b7;

  /* shape */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --r-xl: 24px;
  --r-full: 999px;

  /* shadow */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.06);
  --shadow-sm: 0 1px 4px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 14px rgba(0,0,0,0.09), 0 1px 4px rgba(0,0,0,0.05);
  --shadow-fab: 0 4px 16px rgba(27,77,27,0.45), 0 1px 4px rgba(0,0,0,0.12);

  /* layout */
  --nav-h: 56px;
  --tab-h: 62px;
}

/* ----------------------------------------------------------------
   BASE
---------------------------------------------------------------- */
html, body {
  height: 100%;
  font-family: 'DM Sans', sans-serif;
  font-size: 16px;
  background: var(--surface);
  color: var(--text1);
  -webkit-font-smoothing: antialiased;
}

/* ----------------------------------------------------------------
   APP SHELL
---------------------------------------------------------------- */
#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--surface);
  position: relative;
  overflow-x: hidden;
}

/* ================================================================
   TOP NAVIGATION BAR
================================================================ */
.top-bar {
  position: sticky;
  top: 0;
  z-index: 200;
  height: var(--nav-h);
  background: var(--g800);
  display: flex;
  align-items: center;
  padding: 0 14px;
  gap: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}
.top-bar-logo {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 1;
  min-width: 0;
}
.top-bar-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255,255,255,0.13);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.top-bar-icon svg {
  width: 17px;
  height: 17px;
  stroke: #fff;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.top-bar-title {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.top-bar-sub {
  font-size: 10px;
  color: rgba(255,255,255,0.55);
  margin-top: 1px;
}
.top-bar-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

/* Back to home button */
.top-bar-back {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  text-decoration: none;
  transition: background 0.15s;
  margin-right: 4px;
}
.top-bar-back:hover { background: rgba(255,255,255,0.22); }
.top-bar-back svg {
  width: 17px;
  height: 17px;
  stroke: #fff;
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.top-bar-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.top-bar-btn:hover { background: rgba(255,255,255,0.1); }
.top-bar-btn svg {
  width: 18px;
  height: 18px;
  stroke: rgba(255,255,255,0.85);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ================================================================
   BOTTOM TAB BAR
================================================================ */
.bottom-tabs {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  margin: 0 auto;
  width: 100%;
  max-width: 480px;
  height: var(--tab-h);
  background: var(--white);
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  z-index: 200;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.07);
}
.tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 4px;
  cursor: pointer;
  border: none;
  background: transparent;
  transition: background 0.15s;
  -webkit-tap-highlight-color: transparent;
  position: relative;
}
.tab-item:hover { background: var(--g50); }
.tab-item.active { background: var(--g50); }
.tab-item.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 20%;
  right: 20%;
  height: 2.5px;
  background: var(--g800);
  border-radius: 0 0 4px 4px;
}
.tab-icon {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tab-icon svg {
  width: 20px;
  height: 20px;
  stroke: var(--text3);
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke 0.15s;
}
.tab-item.active .tab-icon svg { stroke: var(--g800); }
.tab-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text3);
  transition: color 0.15s;
}
.tab-item.active .tab-label { color: var(--g800); font-weight: 700; }
.tab-badge {
  position: absolute;
  top: 6px;
  right: calc(50% - 18px);
  min-width: 16px;
  height: 16px;
  background: var(--g600);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  border-radius: var(--r-full);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* ================================================================
   PAGE SCROLL CONTAINER
================================================================ */
.page-scroll {
  padding-bottom: calc(var(--tab-h) + 1rem);
  min-height: calc(100vh - var(--nav-h));
}

/* ================================================================
   VIEW PANELS (list / form / detail)
================================================================ */
.view { display: none; }
.view.active { display: block; }

/* ================================================================
   SUMMARY / STATS STRIP
================================================================ */
.summary-strip {
  background: var(--g800);
  padding: 14px 16px 20px;
  display: flex;
  gap: 10px;
}
.stat-card {
  flex: 1;
  background: rgba(255,255,255,0.1);
  border-radius: var(--r-md);
  padding: 10px 10px 8px;
  text-align: center;
}
.stat-value {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  line-height: 1;
  margin-bottom: 4px;
}
.stat-label {
  font-size: 10px;
  font-weight: 500;
  color: rgba(255,255,255,0.6);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* ================================================================
   RECORD LIST
================================================================ */
.list-header {
  padding: 14px 16px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.list-heading {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text3);
}
.list-count {
  font-size: 11px;
  font-weight: 600;
  background: var(--g100);
  color: var(--g700);
  padding: 3px 10px;
  border-radius: var(--r-full);
}

.record-list { padding: 0 12px; }

.record-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  margin-bottom: 9px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: var(--shadow-xs);
  -webkit-tap-highlight-color: transparent;
}
.record-item:hover {
  border-color: var(--g300);
  box-shadow: var(--shadow-sm);
  transform: translateX(2px);
}
.record-item:active { transform: scale(0.99); }

.record-thumb {
  width: 52px;
  height: 52px;
  border-radius: var(--r-md);
  object-fit: cover;
  flex-shrink: 0;
  background: var(--g100);
  border: 1px solid var(--border);
}
.record-thumb-placeholder {
  width: 52px;
  height: 52px;
  border-radius: var(--r-md);
  flex-shrink: 0;
  background: var(--g50);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}
.record-thumb-placeholder svg {
  width: 22px;
  height: 22px;
  stroke: var(--g300);
  fill: none;
  stroke-width: 1.5;
}

.record-info { flex: 1; min-width: 0; }
.record-plot {
  font-size: 15px;
  font-weight: 600;
  color: var(--text1);
  margin-bottom: 3px;
}
.record-meta {
  font-size: 12px;
  color: var(--text3);
  margin-bottom: 5px;
}
.record-chips {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.mini-chip {
  font-size: 10px;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 5px;
}
.mc-b { background: var(--danger-bg); color: var(--danger-text); }
.mc-s { background: var(--warn-bg);   color: var(--warn-text); }
.mc-t { background: var(--ok-bg);     color: var(--ok-text); }
.mc-w { color: #fff; font-weight: 600; font-size: 10px; padding: 2px 7px; border-radius: 5px; text-shadow: 0 1px 2px rgba(0,0,0,0.3); }

.record-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}
.icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.icon-btn svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon-btn.edit-btn svg  { stroke: var(--g600); }
.icon-btn.del-btn svg   { stroke: var(--danger-text); }
.icon-btn:hover { box-shadow: var(--shadow-sm); }
.icon-btn.edit-btn:hover { border-color: var(--g300); background: var(--g50); }
.icon-btn.del-btn:hover  { border-color: var(--danger-border); background: var(--danger-bg); }

/* empty state */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem 2rem;
}
.empty-state-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--g100);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}
.empty-state-icon svg {
  width: 30px;
  height: 30px;
  stroke: var(--g400);
  fill: none;
  stroke-width: 1.5;
}
.empty-state h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text2);
  margin-bottom: 6px;
}
.empty-state p {
  font-size: 13px;
  color: var(--text4);
  line-height: 1.5;
}

/* ================================================================
   FAB (Floating Action Button)
================================================================ */
.fab {
  position: fixed;
  bottom: calc(var(--tab-h) + 16px);
  right: 50%;
  transform: translateX(calc(50% + 160px));
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--g600);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-fab);
  z-index: 150;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.fab:hover  { background: var(--g500); transform: translateX(calc(50% + 160px)) scale(1.06); }
.fab:active { transform: translateX(calc(50% + 160px)) scale(0.95); }
.fab svg {
  width: 24px;
  height: 24px;
  stroke: #fff;
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
}
@media (max-width: 480px) {
  .fab {
    right: 16px;
    transform: none;
  }
  .fab:hover  { transform: scale(1.06); }
  .fab:active { transform: scale(0.95); }
}

/* ================================================================
   FORM VIEW
================================================================ */
.form-view-header {
  background: var(--g800);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.back-btn {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: rgba(255,255,255,0.13);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}
.back-btn:hover { background: rgba(255,255,255,0.2); }
.back-btn svg {
  width: 18px;
  height: 18px;
  stroke: #fff;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.form-view-title { font-size: 16px; font-weight: 700; color: #fff; }
.form-view-id {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  background: rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.9);
  padding: 4px 12px;
  border-radius: var(--r-full);
}

.form-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  margin: 14px 12px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.form-section-head {
  padding: 12px 16px;
  background: var(--g50);
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--g700);
  display: flex;
  align-items: center;
  gap: 7px;
}
.form-section-head svg {
  width: 14px;
  height: 14px;
  stroke: var(--g600);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.form-inner { padding: 16px; }
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.form-field { margin-bottom: 16px; }
.form-field:last-child { margin-bottom: 0; }

.field-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text2);
  margin-bottom: 7px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.req { color: #e02020; font-size: 11px; }
.opt {
  font-size: 10px;
  font-weight: 500;
  color: var(--text4);
  margin-left: auto;
  background: var(--surface);
  padding: 1px 7px;
  border-radius: 4px;
}

.input, select.input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  font-size: 14px;
  font-family: 'DM Sans', sans-serif;
  border: 1px solid var(--border2);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--text1);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  -webkit-appearance: none;
  appearance: none;
}
.input:focus, select.input:focus {
  border-color: var(--g500);
  box-shadow: 0 0 0 3px rgba(61,156,61,0.14);
  background: var(--white);
}
.input[readonly] { color: var(--text3); background: var(--surface); cursor: default; }
.select-wrap { position: relative; }
.select-wrap::after {
  content: '';
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--text3);
  pointer-events: none;
}
.select-wrap select { padding-right: 32px; cursor: pointer; }

.divider-line {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}

/* tri-buttons */
.tri-group {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 7px;
}
.tri-btn {
  padding: 10px 4px;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  font-family: 'DM Sans', sans-serif;
  border: 1px solid var(--border2);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--text2);
  transition: all 0.14s;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.tri-btn:hover { border-color: var(--g400); background: var(--g50); }
.tri-btn.sel-b { background: var(--danger-bg); color: var(--danger-text); border-color: var(--danger-border); font-weight: 600; }
.tri-btn.sel-s { background: var(--warn-bg);   color: var(--warn-text);   border-color: var(--warn-border);   font-weight: 600; }
.tri-btn.sel-t { background: var(--ok-bg);     color: var(--ok-text);     border-color: var(--ok-border);     font-weight: 600; }

/* warna daun */
.warna-group {
  display: grid;
  grid-template-columns: repeat(5,1fr);
  gap: 7px;
}
.warna-btn {
  height: 46px;
  border-radius: var(--r-md);
  border: 2.5px solid transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: rgba(255,255,255,0.9);
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.warna-btn span { text-shadow: 0 1px 3px rgba(0,0,0,0.4); }
.warna-btn.active {
  border-color: var(--g900);
  box-shadow: 0 0 0 3px rgba(13,43,13,0.2), inset 0 0 0 1px rgba(255,255,255,0.25);
  transform: scale(1.07);
}
.warna-labels {
  display: grid;
  grid-template-columns: repeat(5,1fr);
  gap: 7px;
  margin-top: 5px;
}
.warna-label {
  font-size: 9px;
  text-align: center;
  color: var(--text4);
  line-height: 1.3;
}

/* photo upload */
.photo-drop {
  border: 1.5px dashed var(--border2);
  border-radius: var(--r-md);
  padding: 22px 14px;
  text-align: center;
  cursor: pointer;
  background: var(--surface);
  transition: all 0.18s;
}
.photo-drop:hover { border-color: var(--g400); background: var(--g50); }
.photo-drop svg { width: 28px; height: 28px; stroke: var(--text4); fill: none; stroke-width: 1.5; margin: 0 auto 8px; }
.photo-drop-title { font-size: 13px; font-weight: 500; color: var(--text2); margin-bottom: 3px; }
.photo-drop-sub   { font-size: 11px; color: var(--text4); }
.photo-preview-wrap {
  display: none;
  position: relative;
  border-radius: var(--r-md);
  overflow: hidden;
  border: 1px solid var(--border);
}
.photo-preview-wrap img {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
}
.photo-clear {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0,0,0,0.55);
  border: none;
  color: #fff;
  font-size: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.photo-clear:hover { background: rgba(185,28,28,0.8); }
#photo-input { display: none; }

/* form action bar */
.form-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 14px 12px;
}
.btn {
  height: 44px;
  border-radius: var(--r-md);
  font-size: 14px;
  font-weight: 600;
  font-family: 'DM Sans', sans-serif;
  border: none;
  transition: all 0.15s;
}
.btn:active { transform: scale(0.97); }
.btn-cancel {
  background: var(--white);
  border: 1px solid var(--border2);
  color: var(--text2);
}
.btn-cancel:hover { background: var(--surface); }
.btn-save {
  background: var(--g800);
  color: #fff;
  box-shadow: 0 2px 8px rgba(26,77,26,0.3);
}
.btn-save:hover { background: var(--g600); }

/* ================================================================
   DETAIL VIEW
================================================================ */
.detail-hero {
  position: relative;
  height: 200px;
  background: var(--g100);
  overflow: hidden;
}
.detail-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.detail-hero-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--g50);
}
.detail-hero-placeholder svg {
  width: 48px;
  height: 48px;
  stroke: var(--g300);
  fill: none;
  stroke-width: 1.2;
}
.detail-hero-back {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: rgba(0,0,0,0.45);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.detail-hero-back svg {
  width: 18px;
  height: 18px;
  stroke: #fff;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.detail-body { padding: 16px 14px; }
.detail-tag-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.detail-nursery-tag {
  font-size: 11px;
  font-weight: 700;
  background: var(--g800);
  color: #fff;
  padding: 4px 12px;
  border-radius: var(--r-full);
  letter-spacing: 0.3px;
}
.detail-id {
  font-size: 12px;
  color: var(--text3);
  font-weight: 500;
}
.detail-date {
  margin-left: auto;
  font-size: 11px;
  color: var(--text4);
}
.detail-plot {
  font-size: 20px;
  font-weight: 700;
  color: var(--text1);
  margin-bottom: 4px;
}
.detail-batch {
  font-size: 12px;
  color: var(--text3);
  margin-bottom: 14px;
}
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}
.detail-cell {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 10px;
  text-align: center;
}
.detail-cell-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text4);
  margin-bottom: 5px;
}
.detail-cell-val {
  font-size: 13px;
  font-weight: 700;
}
.val-b { color: var(--danger-text); }
.val-s { color: var(--warn-text); }
.val-t { color: var(--ok-text); }

.warna-display {
  border-radius: var(--r-md);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.warna-display-label {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,0.9);
  text-shadow: 0 1px 3px rgba(0,0,0,0.35);
}
.warna-display-val {
  margin-left: auto;
  font-size: 11px;
  background: rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.95);
  padding: 3px 10px;
  border-radius: var(--r-full);
  font-weight: 600;
}

/* ================================================================
   TOAST
================================================================ */
.toast {
  position: fixed;
  bottom: calc(var(--tab-h) + 16px);
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: var(--g900);
  color: #fff;
  padding: 10px 20px;
  border-radius: var(--r-full);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  z-index: 9999;
  transition: all 0.28s ease;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ================================================================
   CONFIRM MODAL
================================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 300;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}
.modal-overlay.show {
  opacity: 1;
  pointer-events: all;
}
.modal-box {
  background: var(--white);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: 20px 20px 32px;
  width: 100%;
  max-width: 480px;
  transform: translateY(20px);
  transition: transform 0.25s ease;
}
.modal-overlay.show .modal-box { transform: translateY(0); }
.modal-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text1);
  margin-bottom: 8px;
}
.modal-msg {
  font-size: 13px;
  color: var(--text3);
  margin-bottom: 20px;
  line-height: 1.5;
}
.modal-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.btn-modal-cancel {
  height: 44px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--border2);
  color: var(--text2);
  font-size: 14px;
  font-weight: 600;
  font-family: 'DM Sans', sans-serif;
}
.btn-modal-delete {
  height: 44px;
  border-radius: var(--r-md);
  background: var(--danger-text);
  border: none;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  font-family: 'DM Sans', sans-serif;
  box-shadow: 0 2px 8px rgba(185,28,28,0.3);
}

/* ================================================================
   UTILITIES
================================================================ */

@media (max-width: 360px) {
  .form-row { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr 1fr; }
}


/* ================================================================
   LOADING OVERLAY
================================================================ */
#loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
}
#loading-overlay.hidden { display: none !important; }
.loading-box {
  background: #fff;
  border-radius: 16px;
  padding: 24px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #e0f2e0;
  border-top-color: #1a4d1a;
  border-radius: 50%;
  animation: loading-spin 0.7s linear infinite;
}
.loading-text {
  font-size: 13px;
  font-weight: 600;
  color: #3d5c3d;
  font-family: "DM Sans", sans-serif;
}
@keyframes loading-spin { to { transform: rotate(360deg); } }
.hidden { display: none !important; }


/* Lightbox */
.lightbox{position:fixed;inset:0;background:rgba(0,0,0,.9);z-index:9000;display:none;align-items:center;justify-content:center}
.lightbox.open{display:flex}
.lightbox img{max-width:95vw;max-height:90vh;border-radius:10px;object-fit:contain}
.lightbox-close{position:absolute;top:16px;right:16px;width:36px;height:36px;border-radius:50%;background:rgba(255,255,255,.15);border:none;color:#fff;font-size:20px;display:flex;align-items:center;justify-content:center;cursor:pointer}
/* PHOTO SLOTS */
.photo-slots{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}
.photo-slot{position:relative;aspect-ratio:1/1;border-radius:var(--r-md);overflow:hidden;border:1.5px dashed var(--border2);background:var(--surface);cursor:pointer;transition:all .15s;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;-webkit-tap-highlight-color:transparent}
.photo-slot:hover{border-color:var(--g400);background:var(--g50)}
.photo-slot.has-photo{border-style:solid;border-color:var(--border)}
.photo-slot svg{width:22px;height:22px;stroke:var(--text4);fill:none;stroke-width:1.5}
.photo-slot-label{font-size:10px;font-weight:600;color:var(--text4);text-transform:uppercase;letter-spacing:.4px}
.photo-slot-num{width:24px;height:24px;border-radius:50%;background:var(--g400);color:#fff;font-size:11px;font-weight:700;display:flex;align-items:center;justify-content:center}
.photo-slot img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.photo-slot-clear{position:absolute;top:4px;right:4px;width:22px;height:22px;border-radius:50%;background:rgba(0,0,0,.55);border:none;color:#fff;font-size:14px;display:flex;align-items:center;justify-content:center;z-index:2;line-height:1;cursor:pointer}
.photo-req-note{font-size:11px;color:var(--text4);text-align:center;margin-top:8px}
.photo-req-note.error{color:var(--danger-text);font-weight:500}