/* Economics follows the approved Planner palette. Scoped to this module. */
#tab-economics .eco-toolbar { padding: 16px; }
#tab-economics .eco-toolbar-left { display: flex; align-items: end; gap: 12px; width: 100%; }
.eco-filter-field { display: flex; flex-direction: column; gap: 6px; min-width: 170px; }
.eco-filter-field label { color: var(--color-text-muted); font-size: 12px; font-weight: 500; }
.eco-filter-field .eco-period-controls { display: flex; gap: 5px; }
.eco-filter-field select { max-width: 100%; min-width: 0; }
.eco-filter-field .eco-period-controls select:first-of-type { width: 125px; }
.eco-filter-field .eco-period-controls select:nth-of-type(2) { width: 80px; }
.eco-filter-employee { flex: 1 1 230px; }
#tab-economics .eco-right-col { overflow: visible; max-height: none; position: sticky; top: 82px; }
#tab-economics .eco-sidebar { max-height: none; overflow: visible; display: flex; flex-direction: column; gap: 12px; }
#tab-economics .eco-sidebar .sidebar-widget { margin: 0; padding: 16px; }
#tab-economics h2.sidebar-widget-title { margin: 0 0 8px; }
.eco-summary-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 7px 0; font-size: 13px; border-bottom: 1px solid var(--color-border); }
.eco-summary-row strong { white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 500; }
.eco-summary-row.strong { padding-top: 10px; margin-top: 2px; }
.eco-summary-row.strong strong { font-weight: 650; }
.eco-summary-row span { color: var(--color-text-muted); }
.eco-summary-row.strong span { color: var(--color-text); }
.eco-summary-caption { font-size: 13px; color: var(--color-text-muted); margin: 6px 0 10px; overflow-wrap: anywhere; }
.eco-summary-note { font-size: 12px; line-height: 1.5; color: var(--color-text-muted); margin: 9px 0 0; }
.eco-negative { color: var(--color-danger) !important; }
.eco-row-warning { color: var(--color-warning-text); margin-left: 8px; }
#tab-economics .eco-sb-svc-item { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 12px; padding: 7px 0; }
#tab-economics .eco-sb-svc-name { white-space: normal; overflow: visible; font-size: 12px; }
#tab-economics .eco-sb-svc-item strong { font-size: 12px; font-weight: 500; white-space: nowrap; }
#tab-economics .eco-source-details { border-top: 1px solid var(--color-border); padding: 12px 4px; font-size: 12px; color: var(--color-text-muted); }
#tab-economics .eco-source-details summary { cursor: pointer; }
#tab-economics .eco-source-details span { display: block; margin-top: 6px; }
#eco-data-status { color: var(--color-warning-text); font-size: 13px; line-height: 1.5; }
#eco-data-status:empty { display: none; }
#eco-data-status p { margin: 0 0 8px; }
#eco-data-status ul { margin: 8px 0; }
#tab-economics .data-table { background: var(--color-surface); font-size: 14px; }
#tab-economics .data-table th { font-size: 11px; font-weight: 550; letter-spacing: .04em; }
#tab-economics .data-table td { padding: 11px 12px; border-bottom: 1px solid var(--color-border); vertical-align: top; }
#tab-economics .data-table strong { font-weight: 550; }
#tab-economics .eco-master-table td:first-child { width: 24px; }
#tab-economics .eco-master-table td:nth-child(2) { width: 40%; }
#tab-economics .eco-row-active { background: #edf4ef; }
#tab-economics .eco-row-detail > td { padding: 0; }
#tab-economics .eco-row-detail-wrap { background: #faf9f4; padding: 20px; border: 0; }
.eco-detail-meta { font-size: 12px; color: var(--color-text-muted); margin-bottom: 14px; }
.eco-pay-components { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.eco-pay-components > div { display: flex; flex-direction: column; gap: 5px; }
.eco-pay-components span { font-size: 12px; color: var(--color-text-muted); }
.eco-pay-components strong { font-size: 16px; font-variant-numeric: tabular-nums; }
.eco-pay-components > div:last-child strong { color: var(--color-primary); }
.eco-detail-table { overflow-x: auto; }
.eco-detail-table .data-table { background: transparent !important; width: 100%; }
.eco-detail-table td:first-child { width: auto !important; }
.eco-detail-table td:not(:first-child) { white-space: nowrap; text-align: right; }
.eco-detail-table small { display: block; font-size: 11px; color: var(--color-text-muted); }
#tab-economics .ms-toolbar { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-start; align-items: center; }
#tab-economics .ms-toolbar .btn-primary { margin-left: auto; }
#tab-economics .ms-table-wrap { overflow: auto; border: 1px solid var(--color-border); border-radius: 10px; }
#tab-economics #ms-table { table-layout: auto; min-width: 700px; }
#tab-economics #ms-table .ms-record-row td:nth-child(2) { white-space: nowrap; }
#tab-economics #ms-table td:nth-child(3) { min-width: 140px; }
#tab-economics #ms-table .eco-adjustment-note td { padding: 5px 12px 12px; font-size: 12px; color: var(--color-text-muted); line-height: 1.5; overflow-wrap: anywhere; }
#tab-economics #ms-table .ms-record-row td { border-bottom: 0; }
#tab-economics #ms-table .eco-adjustment-note span { font-weight: 500; }
#tab-economics .ms-group-row, #tab-economics .ms-group-row.open { background: #f7f6ef; border: 0; }
#tab-economics .ms-group-row td { padding: 12px !important; border-top: 1px solid var(--color-border); }
.eco-group-button { display: flex; width: 100%; align-items: center; gap: 10px; border: 0; border-radius: 0; padding: 0; background: transparent; color: var(--color-text); text-align: left; cursor: pointer; font: inherit; }
.eco-group-button > span:not(:first-child) { font-size: 12px; color: var(--color-text-muted); }
.eco-group-total { margin-left: auto; white-space: nowrap; }
.eco-group-total small { display: block; color: var(--color-text-muted); font-size: 10px; font-weight: 400; }
.eco-direct-note { display: block; color: var(--color-text-muted); font-size: 11px; margin-top: 4px; }
#modal-eco-tariffs .eco-tariff-row-del svg { width: 16px; height: 16px; }
#tab-economics .ms-status-badge, #tab-economics [class^='ms-type-'] { border-radius: 4px; background: #f0f2ee; color: #52635b; font-size: 11px; font-weight: 500; padding: 4px 6px; }
#tab-economics .ms-status-pending { color: #8c6037; background: #f7f0e4; }
#tab-economics .ms-type-deduction { color: #9b4d42; background: #f7eeeb; }
#tab-economics .ms-status-chip { border: 1px solid var(--color-border); background: transparent; font-weight: 500; }
#tab-economics .ms-status-chip.active { background: #e9f1ec; color: var(--color-primary); border-color: #ceddd3; }
#tab-economics .ms-row-actions { display: flex; gap: 4px; flex-wrap: wrap; min-width: 80px; }
#tab-economics .ms-act-btn, #tab-economics .ms-act-edit, #tab-economics .ms-act-delete { display: inline-flex; justify-content: center; align-items: center; background: transparent; color: var(--color-text-muted); border: 1px solid var(--color-border); width: 28px; height: 28px; border-radius: 5px; padding: 4px; cursor: pointer; }
#tab-economics .ms-act-delete { color: #9b4d42; }
#tab-economics .ms-act-btn svg, #tab-economics .ms-act-edit svg, #tab-economics .ms-act-delete svg { width: 16px; height: 16px; pointer-events: none; }
.eco-margin-modal { width: min(1000px, 94vw); max-width: 1000px; max-height: 85vh; overflow: auto; }
#eco-margin-table { margin-top: 18px; overflow-x: auto; }
#eco-margin-table table { min-width: 650px; width: 100%; }
#eco-margin-table td:not(:first-child), #eco-margin-table th:not(:first-child) { white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; }
#modal-manual-surcharge .modal-box, #modal-monthly-salary .modal-box, #modal-eco-tariffs .modal-box { box-shadow: 0 8px 36px #17273020; }
#modal-manual-surcharge .ms-segments { background: #f5f3eb; }
#modal-manual-surcharge .ms-segment.active { color: var(--color-primary); background: #e9f1ec; box-shadow: none; }
#modal-manual-surcharge .field label, #modal-monthly-salary label { font-size: 12px; font-weight: 500; text-transform: none; letter-spacing: 0; }
#modal-monthly-salary .modal-body { display: grid; gap: 14px; }
#modal-monthly-salary .field { display: flex; flex-direction: column; gap: 6px; }
@media (max-width: 1500px) {
  #tab-economics .eco-toolbar-left { display: grid; grid-template-columns: minmax(290px, 1.4fr) minmax(150px, 1fr); }
  .eco-filter-employee { min-width: 0; }
  #tab-economics .eco-pay-components { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-height: 850px) and (min-width: 751px) {
  #tab-economics .eco-summary-row { padding: 5px 0; }
  #tab-economics .eco-sidebar .sidebar-widget { padding: 12px; }
}
@media (max-width: 750px) {
  #tab-economics .eco-right-col { order: -1; width: 100%; position: static; }
  #tab-economics .eco-sidebar { display: grid; grid-template-columns: 1fr; }
  #tab-economics .eco-toolbar-left { display: flex; flex-wrap: wrap; }
  .eco-filter-field { flex: 1 1 180px; }
  #tab-economics .eco-pay-components { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #tab-economics .eco-group-button { flex-wrap: wrap; }
  #tab-economics .eco-master-table { min-width: 620px; }
}

/* Explicit file intake: one scrollable body, visible action footer. */
#modal-surcharge-import .si-modal { width:min(1220px,96vw); max-width:1220px; max-height:92vh; display:flex; flex-direction:column; padding:24px; overflow:hidden; background:#fff; border:1px solid #ded6c5; }
#modal-surcharge-import .modal-header { flex-shrink:0; }
.si-intro,.si-help { color:#657785; font-size:14px; line-height:1.5; margin:10px 0 16px; }
.si-controls { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; flex-shrink:0; }
.si-controls label { display:flex; flex-direction:column; gap:6px; color:#657785; font-size:13px; }
.si-controls input,.si-controls select,.si-preview input,.si-preview select { border:1px solid #ded6c5; border-radius:7px; padding:8px; background:#fff; color:#172730; min-width:0; width:100%; box-sizing:border-box; font:inherit; }
.si-controls .si-file { grid-column:span 2; }.si-controls .si-expert { grid-column:span 2; }
.si-preview { min-height:0; overflow:auto; flex:1 1 auto; border:1px solid #e5ded0; border-radius:8px; }
.si-preview:empty { border:0; }
.si-preview table { width:100%; border-collapse:collapse; font-size:13px; }
.si-preview th { position:sticky; top:0; background:#f7f5ef; padding:10px; text-align:left; z-index:1; }
.si-preview td { padding:10px; border-top:1px solid #e9e3d7; vertical-align:top; }
.si-preview td:first-child { width:28px; }.si-preview input[type=checkbox] { width:auto; }
.si-preview .si-num { text-align:right; white-space:nowrap; font-variant-numeric:tabular-nums; }
.si-preview .si-work { min-width:240px; }.si-preview .si-hours { width:75px; }
.si-preview small { display:block; color:#657785; margin:5px 0; line-height:1.45; }
.si-preview details { max-width:400px; margin-top:7px; color:#875023; line-height:1.45; }
.si-preview details ul { padding-left:18px; margin:6px 0; }
.si-preview .si-error,#si-message.si-error { color:#ad382e; }
#si-message { margin:12px 0; color:#1c7065; font-size:14px; flex-shrink:0; }
.si-footer { display:flex; flex-wrap:wrap; gap:10px; justify-content:flex-end; padding-top:16px; flex-shrink:0; }.si-footer button { min-height:40px; }
@media(max-width:800px) { .si-controls { grid-template-columns:repeat(2,minmax(0,1fr)); } #modal-surcharge-import .si-modal { padding:16px; }.si-help { display:none; } }
@media(max-width:520px) { .si-controls { grid-template-columns:1fr; }.si-controls .si-file,.si-controls .si-expert { grid-column:auto; }.si-footer button { flex:1 1 auto; } }
