:root {
  color-scheme: light;
  font-family: "Segoe UI Variable", "Segoe UI", sans-serif;
  font-synthesis: none;
  color: #202923;
  background: #f5f3ed;
  --paper: #f5f3ed;
  --surface: #fffefa;
  --ink: #202923;
  --muted: #52635b;
  --line: #d9ddd3;
  --accent: #315b45;
  --accent-dark: #234735;
  --accent-pale: #e7eee6;
  --accent-border: #b9c9bc;
  --accent-field: #bbc8bb;
  --accent-hover: #f7faf5;
  --accent-quiet: #eef0e9;
  --accent-ring: #315b4521;
  --accent-selection: #cfdfce;
  --accent-status: #285039;
  --green: var(--accent);
  --green-dark: var(--accent-dark);
  --green-pale: var(--accent-pale);
  --rust: #a44b34;
  --rust-pale: #f7eae3;
  --ease: cubic-bezier(.16, 1, .3, 1);
}

:root[data-mode="uang"] {
  --accent: #8a6500;
  --accent-dark: #614700;
  --accent-pale: #fff2bd;
  --accent-border: #d7bd6a;
  --accent-field: #c9b264;
  --accent-hover: #fff9df;
  --accent-quiet: #f8f0d5;
  --accent-ring: #8a650024;
  --accent-selection: #f6df87;
  --accent-status: #6b4e00;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scrollbar-gutter: stable; }
html:has(dialog[open]), body:has(dialog[open]) { overflow: hidden; }
body { margin: 0; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .58; }
[hidden] { display: none !important; }
::selection { background: var(--accent-selection); color: var(--ink); }
:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.shell { max-width: 1240px; margin: auto; padding: 0 38px; }
.topbar {
  height: 80px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  border-bottom: 1px solid var(--line);
  view-transition-name: topbar;
}
.top-add { justify-self: end; }
.account-bar { display: flex; justify-content: flex-end; align-items: center; gap: 16px; padding: 16px 0; flex-wrap: wrap; }
#account-email { overflow-wrap: anywhere; font-size: 13px; color: var(--muted); }
.auth-section { max-width: 440px; margin: 64px auto; }
.auth-section h1 { font-size: clamp(28px, 5vw, 38px); letter-spacing: -.04em; }
.auth-section > p { color: var(--muted); line-height: 1.6; }
.auth-form .form-body { padding: 16px 0 24px; }
.auth-form > .button { width: 100%; }
.auth-form .notice { margin: 16px 0; }
#brand-mode { view-transition-name: brand-mode; display: inline-block; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 25px;
  font-weight: 760;
  letter-spacing: -.06em;
  text-decoration: none;
}
.brand-mark {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  background: var(--green);
  color: white;
  font-size: 18px;
  letter-spacing: 0;
}
.brand-dot { color: var(--rust); }
.mode-switch { display: flex; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 7px; background: #eaece5; view-transition-name: mode-switch; }
.mode-switch button { min-height: 38px; padding: 7px 18px; border: 0; border-radius: 5px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 650; transition: background-color .22s var(--ease), color .22s var(--ease), box-shadow .22s var(--ease); }
.mode-switch button[aria-pressed="true"] { background: var(--surface); color: var(--green-dark); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08); }
.mode-switch button:hover { background: var(--green-pale); }
.button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 17px;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  transition: background-color .2s, border-color .2s, color .2s, transform .2s var(--ease);
}
.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button-primary { background: var(--green); color: white; }
.button-primary:hover { background: var(--green-dark); }
.button-outline { border-color: var(--accent-border); background: transparent; color: var(--green-dark); }
.button-outline:hover { border-color: var(--green); background: var(--green-pale); }
.button-quiet { background: transparent; color: var(--muted); }
.button-quiet:hover { background: var(--accent-quiet); }
.button-danger { background: var(--rust); color: white; }
.button-danger:hover { background: #813824; }

.intro {
  max-width: 940px;
  padding: 75px 0 60px;
  view-transition-name: mode-intro;
}
.intro h1 {
  margin: 0 0 19px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(42px, 5.1vw, 73px);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -.035em;
}
.intro h1 em { color: var(--green); font-weight: 400; }
.intro p {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}
.intro-add { display: none; margin-top: 25px; }

.overview {
  display: grid;
  grid-template-columns: 1.3fr repeat(3, 1fr);
  align-items: center;
  gap: 24px;
  padding: 26px 0;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--line);
}
#barang-overview { view-transition-name: barang-overview; }
.overview-title h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -.025em;
}
.metric {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-left: 24px;
  border-left: 1px solid var(--line);
}
.metric-number { font-size: 29px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.metric-label { color: var(--muted); font-size: 12px; line-height: 1.4; }

.inventory { padding: 68px 0 90px; view-transition-name: barang-content; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 23px; }
.section-actions { display: flex; align-items: center; gap: 10px; }
.section-head h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(36px, 3.3vw, 44px);
  font-weight: 500;
  letter-spacing: -.03em;
}
.toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 21px; }
.search {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 44px;
  min-width: 215px;
  flex: 1;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--green);
  font-size: 21px;
  transition: border-color .2s, box-shadow .2s;
}
.search:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px var(--accent-ring); }
.search input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 13px; }
.search input::placeholder { color: #64746b; }
.filters {
  display: flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #eaece5;
}
.filter {
  min-height: 36px;
  padding: 7px 13px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
  transition: background-color .23s var(--ease), color .23s, box-shadow .23s;
}
.filter:hover { color: var(--green-dark); background: #ffffff91; }
.filter.active { background: var(--surface); color: var(--green-dark); box-shadow: 0 1px 4px #20292312; }
.filter-dropdown { min-width: 155px; }
.filter-dropdown .dropdown-trigger { min-height: 44px; border-color: var(--line); border-radius: 6px; background: var(--surface); font-size: 12px; }
.filter-dropdown .dropdown-menu { right: 0; left: auto; min-width: max(100%, 190px); }

.item-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: 16px;
  view-transition-name: inventory;
}
.item-list.animate-in .item-card { animation: card-enter .24s var(--ease) both; }
.item-card {
  min-width: 0;
  align-self: start;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.card-top { display: flex; align-items: flex-start; gap: 13px; }
.thumb {
  width: 54px;
  height: 54px;
  flex: none;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 6px;
  background: var(--green-pale);
  color: var(--green);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 25px;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.card-info { flex: 1; min-width: 0; }
.card-name { margin: 0 0 4px; font-size: 17px; font-weight: 700; letter-spacing: -.02em; overflow-wrap: anywhere; }
.card-category { margin-bottom: 5px; color: var(--green); font-size: 12px; font-weight: 650; }
.card-location { color: var(--muted); font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }
.card-location::before { content: "⌖"; margin-right: 4px; font-size: 16px; vertical-align: -1px; }
.card-body { margin-top: 17px; padding-top: 16px; border-top: 1px solid var(--line); }
.card-badges { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.status { display: inline-flex; padding: 5px 8px; border-radius: 4px; font-size: 11px; font-weight: 700; }
.status-ready { background: var(--rust-pale); color: #8d3d29; }
.status-stock, .status-enough { background: var(--green-pale); color: var(--accent-status); }
.status-durable, .status-repeat { background: #eceee8; color: #394b40; }
.status-expired { background: #fbeae6; color: #b02a11; }
.status-expiring { background: #fff2bd; color: #7a5a00; }
.card-note { margin: 12px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.card-age { margin: 6px 0 0; color: var(--green-dark); font-size: 12px; line-height: 1.5; }
.units, .history { margin-top: 15px; padding-top: 13px; border-top: 1px solid var(--line); }
.units summary, .history summary {
  width: fit-content;
  color: var(--green-dark);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  list-style-position: inside;
}
.units summary:hover, .history summary:hover { text-decoration: underline; text-underline-offset: 3px; }
.unit-list, .history-list { margin-top: 9px; }
.unit-row { padding: 14px 0; border-top: 1px solid var(--line); font-size: 12px; }
.unit-row:first-child { border-top: 0; }
.unit-head { display: flex; justify-content: space-between; gap: 10px; color: var(--ink); }
.unit-head strong { font-size: 12px; }
.unit-state { color: var(--green-dark); font-weight: 700; text-align: right; }
.unit-photo { float: right; width: 44px; height: 44px; margin: 0 0 7px 8px; border-radius: 5px; object-fit: cover; }
.unit-dates { margin: 8px 0; color: var(--muted); line-height: 1.6; }
.progress-head { display: flex; justify-content: space-between; margin: 10px 0 7px; color: var(--muted); font-size: 12px; }
.progress-head strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.progress { width: 100%; height: 7px; display: block; margin: 7px 0; appearance: none; border-radius: 99px; background: var(--green-pale); }
.progress::-webkit-slider-thumb { width: 18px; height: 18px; appearance: none; border: 3px solid white; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 1px var(--green); cursor: pointer; }
.progress::-moz-range-thumb { width: 13px; height: 13px; border: 3px solid white; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 1px var(--green); cursor: pointer; }
.unit-actions, .history-row { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; }
.unit-actions { margin-top: 9px; }
.unit-finish-date { display: flex; align-items: end; gap: 6px; margin-top: 8px; }
.unit-finish-date label { flex: 1; display: grid; gap: 5px; color: var(--muted); }
.unit-finish-date input, .history-row input {
  min-width: 0;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: white;
  color: var(--ink);
  font-size: 12px;
}
.unit-finish-date input { width: 100%; }
.history-row { padding: 7px 0; }
.history-row input { flex: 1; }
.card-bottom { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 9px; margin-top: 14px; padding-top: 13px; border-top: 1px solid var(--line); }
.card-meta { color: var(--muted); font-size: 11px; }
.card-actions { display: flex; flex-wrap: wrap; gap: 2px; }
.text-button { min-height: 34px; padding: 6px 7px; border: 0; border-radius: 4px; background: transparent; color: var(--green-dark); font-size: 11px; font-weight: 700; }
.text-button:hover { background: var(--green-pale); }
.text-button.delete-unit, .text-button.delete-product, .history-delete { color: #9a4732; }
.text-button.delete-unit:hover, .text-button.delete-product:hover, .history-delete:hover { background: var(--rust-pale); }

.empty { padding: 52px 25px; border: 1px dashed var(--accent-border); border-radius: 10px; background: var(--surface); text-align: center; }
.empty:not([hidden]) { animation: card-enter .24s var(--ease) both; }
.empty-icon { display: none; }
.empty h3 { margin: 0 0 8px; font-family: Georgia, "Times New Roman", serif; font-size: 26px; font-weight: 500; }
.empty p { margin: 0 0 20px; color: var(--muted); font-size: 13px; }
.notice { padding: 12px 15px; border: 1px solid #e5bcac; border-radius: 6px; background: var(--rust-pale); color: #813824; font-size: 13px; line-height: 1.45; }
.page-notice { position: fixed; z-index: 12; right: max(18px, calc((100vw - 1240px) / 2 + 38px)); bottom: 22px; display: flex; align-items: start; gap: 16px; max-width: min(410px, calc(100vw - 36px)); box-shadow: 0 12px 28px #17261b22; }
.page-notice button { flex: none; margin: -4px -6px -4px 0; padding: 3px 7px; border: 0; border-radius: 4px; background: transparent; color: inherit; font-size: 20px; line-height: 1; }
.page-notice button:hover { background: #ead3c8; }
.form-notice { flex: none; margin: 16px 28px 0; }
.form-body [aria-invalid="true"] { border-color: var(--rust) !important; box-shadow: 0 0 0 3px #a44b3424 !important; }
footer { display: flex; align-items: baseline; gap: 18px; padding: 27px 0 37px; border-top: 1px solid var(--line); color: var(--green-dark); font-size: 18px; font-weight: 750; }
footer span:last-child { color: var(--muted); font-size: 12px; font-weight: 400; }

dialog {
  width: min(570px, calc(100vw - 28px));
  max-height: calc(100dvh - 28px);
  overflow: hidden;
  padding: 0;
  border: 1px solid #bfc9bd;
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 28px 70px #17261b38;
  opacity: 0;
  transform: translateY(12px) scale(.985);
  transition: opacity .26s var(--ease), transform .26s var(--ease), display .26s allow-discrete, overlay .26s allow-discrete;
}
dialog[open] { opacity: 1; transform: translateY(0) scale(1); }
@starting-style { dialog[open] { opacity: 0; transform: translateY(12px) scale(.985); } }
dialog::backdrop { background: #18231d00; backdrop-filter: blur(2px); transition: background-color .26s; }
dialog[open]::backdrop { background: #18231db8; }
@starting-style { dialog[open]::backdrop { background: #18231d00; } }
.item-form { display: flex; flex-direction: column; max-height: calc(100dvh - 30px); min-height: 0; }
.dialog-head { display: flex; justify-content: space-between; align-items: start; padding: 25px 28px 19px; border-bottom: 1px solid var(--line); }
.dialog-head, .dialog-actions { flex: none; }
.dialog-head h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 28px; font-weight: 500; }
.icon-button { width: 33px; height: 33px; border: 0; border-radius: 5px; background: var(--accent-quiet); color: var(--green-dark); font-size: 22px; line-height: 1; }
.icon-button:hover { background: var(--green-pale); }
.form-body { display: grid; gap: 19px; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 23px 28px; }
.form-body:has(.dropdown-menu:not([hidden])) { overflow-y: hidden; }
.form-body label { display: flex; flex-direction: column; gap: 7px; min-width: 0; color: var(--ink); font-size: 12px; font-weight: 700; }
.form-body input, .form-body select {
  width: 100%;
  height: 42px;
  padding: 0 11px;
  border: 1px solid var(--accent-field);
  border-radius: 5px;
  outline: 0;
  background: white;
  color: var(--ink);
  font-size: 13px;
  font-weight: 450;
  transition: border-color .2s, box-shadow .2s, background-color .2s;
}
.form-body input:hover, .form-body select:hover { border-color: var(--green); }
.form-body input:focus, .form-body select:focus { border-color: var(--green); box-shadow: 0 0 0 3px var(--accent-ring); }
.form-body input[name="category"]:not(:placeholder-shown) { background: var(--accent-hover); }
.form-body .category-picker input { padding-right: 34px; }
.form-body input[type=file] { height: auto; padding: 9px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.type-field { display: flex; flex-direction: column; gap: 7px; min-width: 0; color: var(--ink); font-size: 12px; font-weight: 700; }
.dropdown { position: relative; display: block; min-width: 0; }
.dropdown-native { position: absolute; width: 1px !important; height: 1px !important; padding: 0 !important; opacity: 0; pointer-events: none; }
.dropdown-trigger {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 11px;
  border: 1px solid var(--accent-field);
  border-radius: 5px;
  background: white;
  color: var(--ink);
  font-size: 13px;
  font-weight: 450;
  text-align: left;
  transition: border-color .2s, box-shadow .2s, background-color .2s;
}
.dropdown-trigger::after, .category-picker::after { content: ""; width: 7px; height: 7px; flex: none; border-right: 1.5px solid var(--green-dark); border-bottom: 1.5px solid var(--green-dark); transform: rotate(45deg); transition: transform .2s; }
.dropdown-trigger::after { margin: -4px 2px 0 0; }
.dropdown-trigger:hover, .dropdown-trigger[aria-expanded="true"] { border-color: var(--green); background: var(--accent-hover); }
.dropdown-trigger:focus-visible { outline: 0; border-color: var(--green); box-shadow: 0 0 0 3px var(--accent-ring); }
.dropdown-trigger[aria-expanded="true"]::after { margin-top: 3px; transform: rotate(225deg); }
.category-picker::after { position: absolute; top: 17px; right: 15px; pointer-events: none; }
.category-picker:has(input[aria-expanded="true"])::after { top: 20px; transform: rotate(225deg); }
.dropdown-menu {
  position: absolute;
  z-index: 5;
  top: calc(100% + 5px);
  left: 0;
  width: 100%;
  max-height: min(230px, 45dvh);
  overflow-y: auto;
  padding: 5px;
  border: 1px solid var(--accent-border);
  border-radius: 7px;
  background: var(--surface);
  box-shadow: 0 12px 24px #17261b1c;
  animation: field-enter .2s var(--ease) both;
}
.dropdown-option {
  width: 100%;
  min-height: 39px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  text-align: left;
}
.dropdown-option:hover, .dropdown-option:focus-visible, .dropdown-option.is-active { outline: 0; background: var(--accent-pale); }
.dropdown-option[aria-selected="true"] { color: var(--green-dark); font-weight: 700; }
.dropdown-option[aria-selected="true"]::after { content: ""; width: 7px; height: 7px; flex: none; border-radius: 50%; background: var(--green); }
.hint { color: var(--muted); font-weight: 450; }
.required { color: var(--rust); }
.usage-fields { display: grid; gap: 9px; }
.usage-fields:not([hidden]) { animation: field-enter .27s var(--ease) both; }
.field-help { margin: 0; color: var(--muted); font-size: 11px; font-weight: 400; line-height: 1.5; }
.form-body .checkbox-field { flex-direction: row; align-items: center; gap: 10px; }
.form-body .checkbox-field input { width: 18px; height: 18px; flex: none; padding: 0; accent-color: var(--green); }
.money-input { display: flex; align-items: center; padding-left: 11px; border: 1px solid var(--accent-field); border-radius: 5px; color: var(--muted); font-size: 12px; transition: border-color .2s, box-shadow .2s; }
.money-input:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px var(--accent-ring); }
.money-input input { border: 0; box-shadow: none !important; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 28px; border-top: 1px solid var(--line); }
.confirm-dialog { width: min(430px, calc(100vw - 28px)); }
.confirm-content { padding: 28px 30px 25px; }
.confirm-eyebrow { color: var(--rust); font-size: 11px; font-weight: 800; letter-spacing: .13em; }
.confirm-content h2 { margin: 12px 0 10px; font-family: Georgia, "Times New Roman", serif; font-size: 30px; font-weight: 500; line-height: 1.15; }
.confirm-content p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 15px 22px; border-top: 1px solid var(--line); }
.toast { position: fixed; z-index: 10; bottom: 24px; left: 50%; padding: 11px 16px; border-radius: 6px; background: var(--green-dark); color: white; font-size: 12px; font-weight: 700; opacity: 0; pointer-events: none; transform: translate(-50%, 12px); transition: opacity .22s, transform .22s var(--ease); }
.toast.visible { opacity: 1; transform: translate(-50%, 0); }

#shopping-dialog { width: min(640px, calc(100vw - 28px)); }
.shopping-container { display: flex; flex-direction: column; max-height: calc(100dvh - 30px); min-height: 0; }
.shopping-subtitle { display: block; margin-top: 4px; font-size: 13px; color: var(--muted); }
.shopping-quick-add {
  display: grid;
  grid-template-columns: 1.5fr 1.1fr 1fr auto;
  gap: 8px;
  padding: 16px 28px;
  border-bottom: 1px solid var(--line);
  background: var(--accent-quiet);
  align-items: center;
}
.shopping-quick-add input {
  width: 100%;
  height: 42px;
  padding: 0 11px;
  border: 1px solid var(--accent-field);
  border-radius: 5px;
  outline: 0;
  background: white;
  color: var(--ink);
  font-size: 13px;
  font-weight: 450;
  transition: border-color .2s, box-shadow .2s;
}
.shopping-quick-add input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--accent-ring);
}
.shopping-price-input {
  height: 42px;
  background: white;
}
.shopping-content {
  min-height: 160px;
  max-height: 48vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 12px 28px;
}
.shopping-item-list { display: flex; flex-direction: column; }
.shopping-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.shopping-row:last-child { border-bottom: 0; }
.shopping-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}
.shopping-checkbox {
  width: 20px;
  height: 20px;
  flex: none;
  accent-color: var(--green);
  cursor: pointer;
}
.shopping-item-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.shopping-item-name {
  font-size: 14px;
  font-weight: 650;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.shopping-item-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--muted);
  flex-wrap: wrap;
}
.shopping-tag {
  display: inline-flex;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 700;
  background: var(--accent-pale);
  color: var(--green-dark);
}
.shopping-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
  text-align: right;
}
.shopping-item-price {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.shopping-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px 28px;
  border-top: 1px solid var(--line);
}
.shopping-total {
  font-size: 13px;
  font-weight: 700;
  color: var(--green-dark);
}
#purchase-dialog { width: min(440px, calc(100vw - 28px)); }

.money-section { padding: 34px 0 58px; view-transition-name: uang-content; }
.money-overview { grid-template-columns: 1.1fr repeat(3, 1fr); }
.money-overview .metric-number { font-size: clamp(18px, 2vw, 27px); overflow-wrap: anywhere; }
.money-help { color: var(--muted); font-size: 12px; line-height: 1.6; }
.money-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 48px; margin: 36px 0; }
.money-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.money-layout h3 { margin: 0 0 12px; font-size: 18px; font-weight: 650; }
.money-heading h3 { margin: 0; }
.transaction-row { display: flex; justify-content: space-between; align-items: start; gap: 18px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.transaction-details { min-width: 0; overflow-wrap: anywhere; }
.transaction-row h4 { margin: 0 0 5px; font-size: 15px; }
.transaction-meta, .transaction-note { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.transaction-note { margin-top: 7px; color: var(--ink); white-space: pre-wrap; }
.transaction-value { flex: none; text-align: right; color: var(--green-dark); font-variant-numeric: tabular-nums; }
.transaction-value strong { font-size: 15px; }
.negative, .text-button.delete-transaction { color: #8d3d29; }
.text-button.delete-transaction:hover { background: var(--rust-pale); }
.money-ledger .empty { margin-top: 20px; }
.category-bar { margin-top: 22px; }
.category-bar-head { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 5px 12px; font-size: 12px; }
.category-bar-head span { overflow-wrap: anywhere; min-width: 0; }
.category-bar-head strong { font-variant-numeric: tabular-nums; }
.bar-track { height: 9px; margin-top: 8px; overflow: hidden; border-radius: 3px; background: var(--green-pale); }
.bar-track div { height: 100%; background: var(--green); }
.category-bar p { margin: 6px 0 0; color: var(--muted); font-size: 11px; }
.data-tools { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 24px 0 34px; border-top: 1px solid var(--line); }
.data-tools h2 { margin: 0 0 7px; font-size: 15px; }
.data-tools p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.data-actions { display: flex; flex-wrap: wrap; gap: 8px; }

@keyframes field-enter { from { opacity: .45; transform: translateY(-5px); } to { opacity: 1; transform: translateY(0); } }
@keyframes card-enter { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
::view-transition-old(topbar),
::view-transition-new(topbar),
::view-transition-old(mode-switch),
::view-transition-new(mode-switch) {
  animation: none;
  mix-blend-mode: normal;
}

::view-transition-old(brand-mode) { animation: .14s ease-out both fade-out; }
::view-transition-new(brand-mode) { animation: .22s var(--ease) both fade-in; }

::view-transition-old(mode-intro) { animation: .16s ease-out both mode-content-out; }
::view-transition-new(mode-intro) { animation: .28s var(--ease) both mode-content-in; }

::view-transition-old(barang-overview),
::view-transition-old(barang-content),
::view-transition-old(uang-content) {
  animation: .16s ease-out both mode-content-out;
}

::view-transition-new(barang-overview),
::view-transition-new(barang-content),
::view-transition-new(uang-content) {
  animation: .28s var(--ease) both mode-content-in;
}

.mode-transition::view-transition-old(root) { animation: .18s ease-out both fade-out; }
.mode-transition::view-transition-new(root) { animation: .3s var(--ease) both fade-in; }

@keyframes fade-out { to { opacity: 0; } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes mode-content-out {
  to {
    opacity: 0;
    transform: translateY(-8px);
  }
}
@keyframes mode-content-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1060px) {
  .toolbar { flex-wrap: wrap; }
  .search { flex-basis: 100%; }
  .item-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .shell { padding: 0 18px; }
  .topbar { height: 68px; }
  .topbar { height: auto; min-height: 112px; display: flex; flex-wrap: wrap; padding: 14px 0; gap: 12px; }
  .mode-switch { order: 3; flex-basis: 100%; }
  .mode-switch button { flex: 1; }
  .brand { font-size: 23px; }
  .top-add { padding: 8px 11px; font-size: 11px; }
  .intro { padding: 52px 0 42px; }
  .intro h1 { font-size: clamp(39px, 10vw, 56px); }
  .intro p { font-size: 14px; }
  .intro-add { display: inline-flex; }
  .overview { grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 19px 0; }
  .overview-title { grid-column: 1 / -1; }
  .overview-title h2 { font-size: 21px; }
  .metric { min-width: 0; padding-left: 10px; }
  .metric:nth-child(2) { padding-left: 0; border-left: 0; }
  .metric-number { font-size: 25px; }
  .metric-label { font-size: 11px; }
  .inventory { padding: 48px 0 68px; }
  .money-overview { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .money-overview .metric-number { font-size: clamp(15px, 4vw, 22px); }
  .money-toolbar .filter-dropdown { flex-basis: calc(50% - 6px); }
  .money-layout { grid-template-columns: 1fr; gap: 36px; margin: 28px 0; }
  .transaction-row { flex-wrap: wrap; gap: 10px; }
  .transaction-value { margin-left: auto; }
  .data-tools { flex-direction: column; align-items: start; gap: 16px; }
  .section-head h2 { font-size: 30px; }
  .section-head .button { display: none; }
  .filters { max-width: 100%; overflow-x: auto; }
  .filter-dropdown { flex: 1; }
  .item-list { grid-template-columns: 1fr; }
  .item-card { padding: 18px; }
  .field-row { grid-template-columns: 1fr; }
  .form-body { padding: 20px; }
  .dialog-head, .dialog-actions { padding-left: 20px; padding-right: 20px; }
  .form-notice { margin-left: 20px; margin-right: 20px; }
  .confirm-content { padding: 25px 22px; }
  .shopping-quick-add { grid-template-columns: 1fr; gap: 8px; padding: 14px 20px; }
  .shopping-content { padding: 10px 20px; }
  .shopping-actions { padding: 14px 20px; }
  footer { flex-wrap: wrap; gap: 4px 15px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation: none !important;
  }
}
