/* 财务报销工作区：全部颜色、间距和圆角复用 app.css Token。 */
#view-ledger.on:has(.reim-workspace){
  display:flex;
  flex-direction:column;
  overflow:hidden;
}
#view-ledger:has(.reim-workspace)>.toolbar{
  flex:0 0 auto;
}
#lgBody:has(.reim-workspace){
  flex:1 1 auto;
  min-height:0;
  width:100%;
  display:flex;
  flex-direction:column;
  overflow:hidden;
}

.rm-shell{
  height:100%;
  min-height:0;
  max-width:100%;
  display:flex;
  flex-direction:column;
  gap:var(--sp-3);
  overflow:hidden;
}

/* 主线财务页的“记账 / 报销”分段控件可直接使用这一组类。 */
.rm-segmented{
  display:inline-flex;
  align-items:center;
  gap:var(--sp-1);
  padding:var(--sp-1);
  border:var(--bd-w) solid var(--line);
  border-radius:calc(var(--r-lg) * 2);
  background:var(--surface-3);
  box-shadow:inset 0 1px 0 var(--panel);
}
.rm-segmented button{
  min-height:calc(var(--ctl-h) + var(--sp-1));
  padding:0 var(--sp-4);
  border:0;
  border-radius:calc(var(--r-lg) * 2);
  background:transparent;
  color:var(--gray);
  font-size:var(--fs-md);
  white-space:nowrap;
}
.rm-segmented button:hover{
  color:var(--blue-d);
}
.rm-segmented button.on{
  background:var(--panel);
  color:var(--blue-d);
  font-weight:700;
  box-shadow:var(--shadow);
}
.rm-segmented button:focus-visible{
  outline:2px solid var(--blue);
  outline-offset:2px;
}

.rm-head{
  flex:0 0 auto;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:var(--sp-4);
  padding:var(--sp-3) var(--sp-4);
}
.rm-heading{
  min-width:0;
}
.rm-kicker{
  color:var(--blue-d);
  font-size:var(--fs-sm);
  font-weight:700;
}
.rm-heading h2{
  margin:2px 0 var(--sp-1);
  font-size:var(--fs-xl);
  line-height:1.35;
}
.rm-heading p{
  color:var(--muted);
  font-size:var(--fs-md);
  line-height:1.55;
}
.rm-head-actions{
  flex:0 0 auto;
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:var(--sp-2);
  flex-wrap:wrap;
}
.rm-source-chip{
  max-width:100%;
  padding:var(--sp-1) var(--sp-2);
  border:var(--bd-w) solid var(--line);
  border-radius:var(--r-sm);
  background:var(--surface-2);
  color:var(--muted);
  font-size:var(--fs-sm);
  overflow-wrap:anywhere;
}

.rm-work{
  flex:1 1 auto;
  min-height:0;
  display:flex;
  flex-direction:column;
  gap:var(--sp-2);
  padding:var(--sp-3);
  overflow:hidden;
}
.rm-toolbar{
  flex:0 0 auto;
  display:flex;
  align-items:flex-end;
  gap:var(--sp-2);
  flex-wrap:wrap;
}
.rm-filter{
  display:flex;
  flex-direction:column;
  gap:var(--sp-1);
  color:var(--muted);
  font-size:var(--fs-sm);
}
.rm-filter input{
  min-width:140px;
}
.rm-filter select{
  min-width:132px;
}
.rm-group-filter-picks,
.rm-group-shortcuts{
  display:flex;
  align-items:center;
  gap:var(--sp-1);
  flex-wrap:wrap;
}
.rm-group-filter-picks .btn,
.rm-group-shortcuts .btn{
  white-space:nowrap;
}
.rm-group-filter-picks .btn.on,
.rm-group-shortcuts .btn.on{
  border-color:var(--blue);
  background:var(--blue-l);
  color:var(--blue-d);
}
.rm-group-filter [data-rm-group-control]{min-height:var(--ctl-h)}
.rm-group-filter [data-rm-group-control]>select{max-width:220px}
.rm-group-cell .rm-group-shortcuts{align-items:flex-start}
.rm-preview-guide{display:flex;flex-wrap:wrap;gap:var(--sp-2)}
.rm-month-filter{position:relative}
.rm-month-trigger{min-width:136px;text-align:left}
.rm-month-menu{position:absolute;top:100%;left:0;z-index:var(--z-pop);width:240px;max-height:320px;padding:var(--sp-2);margin-top:var(--sp-1);display:flex;flex-direction:column;gap:var(--sp-2);border:var(--bd-w) solid var(--line);border-radius:var(--r-sm);background:var(--panel);box-shadow:var(--shadow-md)}
.rm-month-menu>input{width:100%;min-width:0}
.rm-month-options{min-height:0;overflow:auto;display:grid;grid-template-columns:1fr 1fr;gap:var(--sp-1)}
.rm-month-option{display:flex;align-items:center;gap:var(--sp-1);min-height:30px;padding:0 var(--sp-1);border-radius:var(--r-sm);color:var(--ink);white-space:nowrap}
.rm-month-option:hover{background:var(--surface-2)}
.rm-month-option input{accent-color:var(--blue)}
.rm-filter-search{
  flex:1 1 240px;
  min-width:180px;
}
.rm-filter-search input{
  width:100%;
}
.rm-toolbar-spacer{
  flex:1 1 var(--sp-5);
}
.rm-candidate-total{
  align-self:center;
  color:var(--muted);
  font-size:var(--fs-md);
  white-space:nowrap;
}

.rm-form-grid{
  flex:0 0 auto;
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:var(--sp-2);
  padding:var(--sp-2);
  border:var(--bd-w) solid var(--line);
  border-radius:var(--r-sm);
  background:var(--surface-2);
}
.rm-field{
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:var(--sp-1);
  color:var(--gray);
  font-size:var(--fs-sm);
}
.rm-field input,
.rm-field textarea{
  width:100%;
  min-width:0;
}
.rm-field textarea{
  min-height:58px;
  resize:vertical;
}
.rm-field input:focus,
.rm-field textarea:focus{
  outline:none;
  border-color:var(--blue);
  box-shadow:0 0 0 3px var(--blue-l);
}

.rm-table-zone{
  flex:1 1 auto;
  min-height:0;
  display:flex;
  flex-direction:column;
  overflow:hidden;
}
.rm-table-scroll{
  flex:1 1 auto;
  min-height:0;
  overflow:auto;
  border:var(--bd-w) solid var(--line);
  border-radius:var(--r-sm);
  background:var(--panel);
}
.rm-table{
  width:100%;
  table-layout:fixed;
  border-collapse:separate;
  border-spacing:0;
}
.rm-table th,
.rm-table td{
  padding:var(--sp-2);
  border-bottom:var(--bd-w) solid var(--line);
  vertical-align:top;
  white-space:normal;
  overflow-wrap:anywhere;
  line-height:1.45;
}
.rm-table th{
  position:sticky;
  top:0;
  z-index:var(--z-2);
  background:var(--surface-3);
  color:var(--gray);
}
.rm-table tbody tr:hover td{
  background:var(--blue-xl);
}
.rm-table tbody tr:last-child td{
  border-bottom:0;
}
.rm-row-done td{
  background:var(--surface-2);
}
.rm-col-check{width:48px}
.rm-col-date{width:12%}
.rm-col-summary{width:23%}
.rm-col-money{width:12%}
.rm-col-status{width:11%}
.rm-col-evidence{width:17%}
.rm-col-note{width:17%}
.rm-check-cell{
  text-align:center;
  width:48px;
  min-width:48px;
  padding-left:var(--sp-1)!important;
  padding-right:var(--sp-1)!important;
  vertical-align:middle!important;
}
.rm-check-cell input{
  width:16px;
  height:16px;
  display:block;
  margin:0 auto;
  accent-color:var(--blue);
}
.rm-date{
  color:var(--gray);
  font-variant-numeric:tabular-nums;
}
.rm-summary b{
  display:block;
  color:var(--ink);
}
.rm-summary>span{
  display:block;
  margin-top:var(--sp-1);
  color:var(--muted);
  font-size:var(--fs-sm);
}
.rm-mobile-meta{
  display:none;
}
.rm-money{
  color:var(--ink);
  font-weight:700;
  text-align:right;
  white-space:nowrap!important;
  font-variant-numeric:tabular-nums;
}
.rm-note{
  color:var(--gray);
  white-space:pre-wrap!important;
}
.rm-group-cell{
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:var(--sp-1);
}
.rm-proof-preview{position:relative;cursor:help}
.rm-proof-popover{position:absolute;left:0;bottom:calc(100% + var(--sp-2));z-index:var(--z-pop);display:block;width:180px;height:140px;padding:var(--sp-1);border:var(--bd-w) solid var(--line);border-radius:var(--r-sm);background:var(--panel);box-shadow:var(--shadow-md);pointer-events:none}
.rm-proof-popover img{width:100%;height:100%;object-fit:contain}
.rm-group-select{
  width:100%;
  min-width:0;
  max-width:100%;
  height:calc(var(--ctl-h) - var(--sp-1));
  padding:0 var(--sp-2);
  border:var(--bd-w) solid var(--line);
  border-radius:var(--r-sm);
  background:var(--panel);
  color:var(--ink);
  font:inherit;
}
.rm-group-select:hover{
  border-color:var(--blue);
}
.rm-group-select:focus-visible{
  outline:none;
  border-color:var(--blue);
  box-shadow:0 0 0 3px var(--blue-l);
}
.rm-group-select:disabled{
  cursor:wait;
  opacity:.65;
}
.rm-original-note{
  display:block;
  color:var(--muted);
  font-size:var(--fs-sm);
  line-height:1.45;
  overflow-wrap:anywhere;
}
.rm-mobile-group{
  display:none;
}
.rm-skeleton{
  padding:var(--sp-2);
}
.rm-empty,
.rm-error{
  margin:auto;
}
.rm-error{
  width:min(620px,100%);
}
.rm-pager{
  flex:0 0 auto;
  min-height:var(--sp-5);
}
.rm-pager .pager{
  margin-top:0;
}

.rm-selection-bar{
  flex:0 0 auto;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:var(--sp-3);
  padding-top:var(--sp-2);
  border-top:var(--bd-w) solid var(--line);
}
.rm-selection-copy{
  min-width:0;
  display:flex;
  align-items:baseline;
  gap:var(--sp-3);
  flex-wrap:wrap;
}
.rm-selection-copy b{
  color:var(--ink);
  font-size:var(--fs-lg);
}
.rm-selection-copy span{
  color:var(--muted);
  font-size:var(--fs-md);
  font-variant-numeric:tabular-nums;
}
.rm-selection-actions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:var(--sp-2);
  flex-wrap:wrap;
}
.rm-selection-actions button:focus-visible,
.rm-head-actions button:focus-visible,
.rm-toolbar button:focus-visible{
  outline:2px solid var(--blue);
  outline-offset:2px;
}

.rm-preview-mask{
  position:fixed;
  inset:0;
  z-index:var(--z-modal);
  display:flex;
  align-items:center;
  justify-content:center;
  padding:var(--sp-4);
  background:color-mix(in srgb,var(--ink) 48%,transparent);
  backdrop-filter:blur(3px);
}
.rm-preview-dialog{
  width:min(var(--rm-preview-max-width),var(--rm-preview-width));
  height:min(var(--rm-preview-max-height),var(--rm-preview-height));
  min-height:0;
  display:flex;
  flex-direction:column;
  gap:var(--sp-2);
  padding:var(--sp-3);
  border:var(--bd-w) solid var(--line);
  border-radius:var(--r-md);
  background:var(--panel);
  box-shadow:var(--shadow-md);
  overflow:hidden;
}
.rm-preview-head,
.rm-preview-foot{
  flex:0 0 auto;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:var(--sp-3);
}
.rm-preview-head h3{
  font-size:var(--fs-xl);
}
.rm-preview-head p,
.rm-preview-foot span{
  color:var(--muted);
  font-size:var(--fs-sm);
  line-height:1.5;
}
.rm-preview-warnings{
  flex:0 0 auto;
  display:flex;
  gap:var(--sp-2);
  flex-wrap:wrap;
  max-height:calc(var(--sp-5) * 3);
  overflow:auto;
}
.rm-preview-body{
  flex:1 1 auto;
  min-height:0;
  overflow:hidden;
  border:var(--bd-w) solid var(--line);
  border-radius:var(--r-sm);
  background:var(--surface-2);
}
.rm-preview-frame{
  width:100%;
  height:100%;
  border:0;
  background:var(--panel);
}
.rm-preview-foot{
  justify-content:flex-end;
  flex-wrap:wrap;
}
.rm-preview-foot span{
  min-width:220px;
  margin-right:auto;
}

@media print{
  .rm-preview-mask,
  .rm-preview-dialog,
  .rm-preview-head,
  .rm-preview-foot{
    display:none!important;
  }
}

@media(max-width:900px){
  .rm-head{
    flex-direction:column;
  }
  .rm-head-actions{
    width:100%;
    justify-content:flex-start;
  }
  .rm-form-grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  .rm-col-check{width:48px}
  .rm-col-date{width:13%}
  .rm-col-summary{width:24%}
  .rm-col-money{width:13%}
  .rm-col-status{width:12%}
  .rm-col-evidence{width:17%}
  .rm-col-note{width:15%}
}

@media(max-width:620px){
  .rm-shell{
    gap:var(--sp-2);
  }
  .rm-head{
    align-items:center;
    flex-direction:row;
    padding:var(--sp-2);
  }
  .rm-heading p,
  .rm-source-chip{
    display:none;
  }
  .rm-heading h2{
    margin:0;
    font-size:var(--fs-lg);
  }
  .rm-head-actions{
    width:auto;
  }
  .rm-work{
    padding:var(--sp-2);
  }
  .rm-toolbar,
  .rm-selection-bar{
    align-items:stretch;
  }
  .rm-toolbar{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  .rm-filter,
  .rm-filter-search{
    flex:none;
    min-width:0;
  }
  .rm-filter input{
    min-width:0;
    width:100%;
  }
  .rm-filter select{
    min-width:0;
    width:100%;
  }
  .rm-group-filter-picks{max-width:100%}
  .rm-group-filter-picks .btn{white-space:normal}
  .rm-filter-search{
    grid-column:1/-1;
  }
  .rm-toolbar-spacer{
    display:none;
  }
  .rm-candidate-total{
    grid-column:1/-1;
    justify-self:start;
    white-space:normal;
  }
  .rm-form-grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  .rm-month-filter{grid-column:1/-1}
  .rm-field textarea{
    min-height:44px;
  }
  .rm-table-zone{
    min-height:96px;
  }
  .rm-table th:nth-child(5),
  .rm-table td:nth-child(5),
  .rm-table th:nth-child(6),
  .rm-table td:nth-child(6),
  .rm-table th:nth-child(7),
  .rm-table td:nth-child(7){
    display:none;
  }
  .rm-col-check{width:10%}
  .rm-col-date{width:26%}
  .rm-col-summary{width:44%}
  .rm-col-money{width:20%}
  .rm-date{
    white-space:nowrap!important;
    font-size:var(--fs-xs);
  }
  .rm-summary b,
  .rm-summary>span{
    overflow-wrap:anywhere;
  }
  .rm-mobile-meta{
    display:flex;
    align-items:center;
    gap:var(--sp-1);
    flex-wrap:wrap;
    margin-top:var(--sp-1);
  }
  .rm-mobile-note{
    flex-basis:100%;
    color:var(--muted);
    font-size:var(--fs-sm);
    line-height:1.45;
    white-space:pre-wrap;
    overflow-wrap:anywhere;
  }
  .rm-mobile-group{
    display:flex;
    flex-basis:100%;
  }
  .rm-mobile-group .rm-group-select,
  .rm-mobile-group .tag{
    width:100%;
  }
  .rm-selection-bar{
    flex-direction:column;
    gap:var(--sp-1);
  }
  .rm-selection-actions{
    width:100%;
    justify-content:space-between;
  }
  .rm-preview-mask{
    padding:var(--sp-1);
  }
  .rm-preview-dialog{
    width:100%;
    height:98vh;
    padding:var(--sp-2);
  }
  .rm-preview-head,
  .rm-preview-foot{
    align-items:flex-start;
    flex-direction:column;
  }
  .rm-preview-foot span{
    min-width:0;
  }
}
