/* 設計預覽：營業成本、雜項費用（public/js/views/preview/expense.js）。只放這兩頁才用到的樣式，共用的在 app.css 的 .pv-*。 */

.pv-ex-body > * + * {
  margin-top: 14px;
}

.pv-ex-hint {
  margin-top: 10px;
  font-size: 0.85rem;
}

/* 可以直接改的明細表：固定欄寬，格子裡的輸入框塞滿欄寬，iPad 橫放不會出現橫向捲軸 */
.pv-ex-lines {
  margin-top: 14px;
}

.pv-ex-lines table.list {
  table-layout: fixed;
}

.pv-ex-lines table.list th {
  text-align: center;
}

.pv-ex-lines table.list th,
.pv-ex-lines table.list td {
  padding: 6px 4px;
}

.pv-ex-lines input,
.pv-ex-lines select {
  min-width: 0;
  padding: 6px 6px;
  font-size: 0.9rem;
  text-align: center;
}

.pv-ex-lines select {
  text-align: left;
}

.pv-ex-locked,
.pv-ex-lines input:disabled {
  background: #f1ece2;
  border-color: #f1ece2;
  opacity: 1;
}

.pv-ex-sub,
.pv-ex-cellbox {
  display: grid;
  place-items: center;
  min-height: 38px;
  padding: 0 6px;
  border-radius: 8px;
  background: #f1ece2;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pv-ex-cellbox {
  font-weight: 400;
  font-size: 0.9rem;
}

.pv-ex-x {
  min-height: 36px;
  min-width: 36px;
  padding: 0;
  border: none;
  background: none;
  color: var(--alert);
  font-size: 1.2rem;
  line-height: 1;
}

.pv-ex-totals {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.pv-ex-sum-text {
  display: flex;
  align-items: baseline;
  gap: 20px;
  color: var(--muted);
  font-size: 0.9rem;
}

.pv-ex-sum-text b {
  margin: 0 2px;
  color: var(--text);
  font-size: 1.3rem;
}

.pv-ex-rule {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.pv-ex-tight {
  margin: 12px 0 0;
}

.pv-ex-empty {
  padding: 26px 16px;
  border: 1.5px dashed var(--line);
  border-radius: var(--radius);
  text-align: center;
  color: var(--muted);
}

.pv-ex-dark-outline {
  border-color: var(--text);
  font-weight: 700;
}

/* 相機掃描結果上面的四格摘要：米色底 */
.pv-ex-scan .pv-card {
  padding: 10px 14px;
  border: none;
  background: #f4efe6;
}

.pv-ex-scan .pv-card-value {
  font-size: 1.35rem;
}

/* ---- 公司設定：左邊子選單、右邊內容 ---- */
.pv-ex-cfg {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.pv-ex-subnav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pv-ex-subnav button {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-height: 56px;
  padding: 8px 12px;
  border-color: transparent;
  text-align: left;
  white-space: normal;
}

.pv-ex-subnav button small {
  color: var(--muted);
  font-size: 0.75rem;
}

.pv-ex-subnav button[aria-pressed="true"] {
  border-color: var(--green);
  border-left-width: 4px;
  background: var(--green-soft);
}

.pv-ex-note {
  margin: 4px 0 12px;
  font-size: 0.9rem;
}

.pv-ex-sup {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.pv-ex-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pv-ex-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 56px;
  padding: 8px 12px;
  text-align: left;
}

.pv-ex-entry span:first-child {
  display: flex;
  flex-direction: column;
}

.pv-ex-entry small {
  color: var(--muted);
  font-size: 0.78rem;
}

.pv-ex-entry[aria-expanded="true"] {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.pv-ex-entry[aria-expanded="true"] small {
  color: #dfe9e2;
}

.pv-ex-addbox {
  border: 1.5px dashed var(--text);
  font-weight: 700;
}

.pv-ex-edit {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.pv-ex-edit-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.pv-ex-edit-head h3 {
  margin: 0;
  font-size: 1rem;
  color: var(--green);
}

.pv-ex-payrow {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 18px;
  margin-top: 12px;
}

.pv-ex-payrow .pv-label {
  margin-bottom: 6px;
}

.pv-ex-day {
  width: 110px;
}

.pv-ex-gap {
  margin-top: 14px;
}

.pv-ex-cats {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pv-ex-catrow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.pv-ex-catrow > input {
  width: 160px;
}

.pv-ex-use {
  font-size: 0.85rem;
}

/* 一顆一顆的標籤（儲位、支出類別），× 只出現在能刪的 */
.pv-ex-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.pv-ex-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid #ecd9b9;
  border-radius: 99px;
  background: #fbf5ea;
}

.pv-ex-chip small {
  color: var(--muted);
  font-size: 0.78rem;
}

.pv-ex-chip .pv-ex-x {
  min-width: 28px;
  min-height: 28px;
  margin-right: -6px;
}

.pv-ex-addrow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.pv-ex-chips .pv-ex-addrow {
  margin-top: 0;
}

.pv-ex-addrow input {
  width: auto;
  flex: 0 1 340px;
  min-width: 0;
}

.pv-ex-darkbtn {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
  font-weight: 700;
}

/* ---- 雜項費用：左邊欄位、右邊照片區 ---- */
.pv-ex-misc {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: stretch;
}

.pv-ex-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pv-ex-stack .pv-ex-addrow {
  margin-top: -4px;
}

.pv-ex-misc > .pv-field {
  min-height: 100%;
}

.pv-ex-photo {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 300px;
  padding: 16px;
  border: 1.5px dashed #c9b998;
  border-radius: var(--radius);
  background: #fbf6ec;
  color: var(--muted);
  text-align: center;
}

.pv-ex-cam {
  font-size: 2rem;
  line-height: 1;
}

.pv-ex-photo-btns {
  display: flex;
  gap: 8px;
}

.pv-ex-photo-btns button {
  border-color: var(--text);
  color: var(--text);
  font-weight: 700;
}

.pv-ex-photo-done {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  color: var(--text);
}

/* 窄螢幕（iPad 直放）：設定頁和雜項輸入改成上下排 */
@media (max-width: 1000px) {
  .pv-ex-cfg,
  .pv-ex-sup,
  .pv-ex-misc {
    grid-template-columns: minmax(0, 1fr);
  }

  .pv-ex-subnav {
    flex-direction: row;
    flex-wrap: wrap;
  }
}

.pv-ex-lines table.list th.num {
  text-align: center;
}
