/* 設計預覽：營業收入（public/js/views/preview/revenue.js）。只放這頁用的 .pv-rv-*，共用的 .pv-* 在 app.css。 */

/* 頂端分頁：原型是標題旁的底線分頁 */
.pv-rv-top {
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
  padding-bottom: 0;
}

.pv-rv-tabs.cat-tabs {
  gap: 4px;
}

.pv-rv-tabs.cat-tabs button {
  border: none;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  padding: 6px 18px;
}

.pv-rv-tabs.cat-tabs button[aria-pressed="true"] {
  background: transparent;
  color: var(--green);
  border-bottom-color: var(--terracotta);
  font-weight: 700;
}

.pv-rv-body > * + * {
  margin-top: 12px;
}

/* 輸入：左邊兩張輸入卡，右邊圖表 */
.pv-rv-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 14px;
  align-items: start;
}

.pv-rv-input .pv-panel {
  margin: 0;
}

.pv-rv-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 220px);
  gap: 16px;
  align-items: start;
}

.pv-rv-fields {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pv-rv-fields .pv-field {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.pv-rv-fields .pv-label {
  color: var(--text);
}

.pv-rv-fields input,
.pv-rv-fields select {
  width: 100%;
  min-width: 0;
}

.pv-rv-items > .pv-label {
  margin-bottom: 6px;
}

.pv-rv-itembox {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
}

.pv-rv-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-top: 1px solid var(--line);
}

.pv-rv-item-head {
  border-top: none;
  background: var(--green-soft);
  color: #4d554a;
  font-size: 0.85rem;
  text-align: center;
}

.pv-rv-item-rows {
  max-height: 340px;
  overflow-y: auto;
}

.pv-rv-item-name {
  text-align: center;
  font-size: 0.95rem;
}

.pv-rv-item-name small {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
}

.pv-rv-item input {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  padding: 6px 8px;
}

.pv-rv-item-edit {
  grid-template-columns: minmax(0, 1fr) 40px;
}

.pv-rv-x {
  font-size: 1.2rem;
  line-height: 1;
  padding: 4px 8px;
}

.pv-rv-additem {
  width: 100%;
  border: none;
  border-top: 1px dashed var(--line);
  border-radius: 0;
  background: #fff;
  color: var(--green);
  font-weight: 700;
}

.pv-rv-empty {
  padding: 10px;
  font-size: 0.85rem;
}

.pv-rv-itembox-foot {
  display: flex;
  justify-content: flex-end;
  padding: 8px;
  background: var(--green-soft);
  border-top: 1px solid var(--line);
}

.pv-rv-chip {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--green);
  border-radius: 99px;
  background: #fff;
  color: var(--green);
  font-size: 0.82rem;
  font-weight: 700;
}

.pv-rv-chip-on {
  background: var(--green);
  color: #fff;
}

.pv-rv-hint {
  margin: 8px 0 0;
  font-size: 0.85rem;
}

.pv-rv-photo {
  margin-bottom: 12px;
}

.pv-rv-save {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

/* 圖表 */
.pv-rv-period {
  margin-left: 8px;
  font-size: 0.85rem;
  color: var(--text);
}

.pv-rv-unit {
  margin-top: 10px;
  font-size: 0.8rem;
}

.pv-rv-chart {
  display: block;
  width: 100%;
  height: auto;
}

.pv-rv-grid {
  stroke: var(--line);
  stroke-dasharray: 4 3;
}

.pv-rv-axis {
  stroke: #9a9a90;
}

.pv-rv-tick,
.pv-rv-month {
  font-size: 11px;
  fill: var(--muted);
}

.pv-rv-month {
  fill: var(--text);
  font-size: 12px;
}

.pv-rv-val {
  font-size: 11px;
  font-weight: 700;
  fill: var(--text);
}

.pv-rv-bar-0 {
  fill: #e6a23c;
}

.pv-rv-bar-1 {
  fill: #c0583a;
}

.pv-rv-bar-2 {
  fill: #5b8a96;
}

.pv-rv-note {
  margin: 6px 0 0;
  font-size: 0.8rem;
}

/* 本月明細：輸入狀況格子 */
.pv-rv-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 10px;
  font-size: 0.85rem;
}

.pv-rv-legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 4px;
  border-radius: 2px;
}

.pv-rv-gridwrap {
  overflow-x: auto;
}

.pv-rv-grid {
  width: 100%;
  border-collapse: separate;
  border-spacing: 3px;
  table-layout: fixed;
}

.pv-rv-grid th {
  font-size: 0.82rem;
  font-weight: 700;
  text-align: center;
}

.pv-rv-grid th:first-child {
  width: 64px;
  text-align: left;
}

.pv-rv-grid thead small {
  display: block;
  font-size: 0.7rem;
  font-weight: 400;
}

.pv-rv-grid th.pv-rv-we {
  color: var(--terracotta-dark);
}

.pv-rv-cell {
  display: grid;
  place-items: center;
  width: 100%;
  min-width: 0;
  min-height: 34px;
  height: 34px;
  padding: 0;
  border: none;
  border-radius: 6px;
  font-size: 0.75rem;
}

.pv-rv-ok {
  background: #cfe3d4;
  color: var(--text);
}

.pv-rv-miss {
  background: #f6d3c8;
  border: 1px solid #d9826a;
  color: #9a3412;
  font-weight: 700;
}

.pv-rv-off {
  background: #ebe6de;
}

/* 公司設定：左邊分類、中間清單、右邊編輯 */
.pv-rv-cfg {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.pv-rv-subnav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pv-rv-subnav button {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  text-align: left;
  white-space: normal;
}

.pv-rv-subnav button[aria-current="page"] {
  border-color: var(--green);
  background: #eef4ef;
  box-shadow: inset 3px 0 0 var(--green);
}

.pv-rv-subnav small,
.pv-rv-pt small {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 400;
}

.pv-rv-cfgnote {
  margin: 4px 0 14px;
  font-size: 0.9rem;
}

.pv-rv-points {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.pv-rv-ptlist {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pv-rv-pt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  text-align: left;
}

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

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

.pv-rv-ptlist .pv-add {
  margin-top: 0;
  border-color: var(--text);
}

.pv-rv-empty-editor {
  padding: 30px 16px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  text-align: center;
}

.pv-rv-editor {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.pv-rv-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.pv-rv-editor-head h3 {
  margin: 0;
  font-size: 1.05rem;
}

.pv-rv-sublabel {
  margin: 14px 0 6px;
}

.pv-rv-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pv-rv-tag {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px 4px 2px 12px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: #f6f1e6;
  font-size: 0.85rem;
}

.pv-rv-tag .pv-rv-x {
  min-height: 0;
  font-size: 1rem;
}

.pv-rv-tag-new {
  gap: 6px;
  padding: 2px;
  background: #fff;
}

.pv-rv-tag-new input {
  width: 110px;
  min-height: 32px;
  padding: 4px 10px;
  border-radius: 99px;
}

.pv-rv-tag-new button {
  min-height: 32px;
  padding: 0 12px;
  border-radius: 99px;
}

.pv-rv-day input {
  width: 64px;
}

.pv-rv-cfg .pv-table input {
  min-width: 0;
}

/* 窄螢幕（iPad 直放）：輸入頁圖表掉到下面，設定改成上下排 */
@media (max-width: 1000px) {
  .pv-rv-input,
  .pv-rv-cfg,
  .pv-rv-points {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 640px) {
  .pv-rv-form {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* 發票輸入（真的頁面 public/js/views/revenue.js） */
.pv-rv-ivsum {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  padding: 12px 16px;
  border-radius: 10px;
  background: #e8efe9;
}
.pv-rv-ivtotal {
  font-size: 22px;
}
button.pv-rv-cell.pv-rv-off {
  border: 0;
  cursor: pointer;
}
