.amanta-personnel-panel {
  display: flex;
  flex-direction: column;
  height: min(900px, calc(100dvh - 40px));
  max-height: calc(100dvh - 40px);
  overflow: hidden;
}
.amanta-personnel-panel > div:first-child {
  flex-shrink: 0;
  padding: 14px 24px !important;
}
.amanta-personnel-panel > div:first-child h2 {
  margin-top: 4px;
  font-size: 25px;
}
.amanta-personnel-body {
  flex: 1;
  min-height: 0;
  padding: 16px 24px;
  overflow: hidden;
}
.amanta-personnel-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  height: 100%;
  min-height: 0;
}
.amanta-personnel-sidebar {
  background: #f8fafc;
  border: 1px solid #e1e7ef;
  border-radius: 16px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  min-height: 0;
}
.amanta-personnel-stat {
  padding: 7px 8px;
  text-align: center;
  background: #fff4e8;
  border-radius: 10px;
}
.amanta-personnel-stat strong {
  display: block;
  font-size: 19px;
  line-height: 1.3;
}
.amanta-personnel-stat span {
  font-size: 11px;
  color: #64748b;
}
.amanta-personnel-main {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.amanta-personnel-main > * {
  flex-shrink: 0;
}
.amanta-personnel-tabs {
  position:relative;
  display: flex;
  gap: 20px;
  border-bottom: 1px solid #e1e7ef;
}
.amanta-personnel-tabs > button[role=tab] {
  padding: 7px 0;
  border-bottom: 3px solid transparent;
  font-size: 13px;
}
.amanta-personnel-tabs > button[aria-selected="true"] {
  border-color: #334155;
  color: #0f172a;
  font-weight: 600;
}
.amanta-personnel-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px 14px;
}
.amanta-personnel-panel .amanta-personnel-control {
  height: 38px !important;
  min-height: 38px !important;
  font-size: 13px;
}
.amanta-personnel-grid > div > div:first-child,
.amanta-personnel-context > div > div:first-child {
  margin-bottom: 4px;
  font-size: 10px;
  letter-spacing: 0.06em;
}
.amanta-personnel-table {
  width: 100%;
  min-width: 0 !important;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 12px;
}
.amanta-personnel-table th,
.amanta-personnel-table td {
  text-align: center;
  padding: 6px;
  overflow-wrap: anywhere;
  border-bottom: 1px solid #e1e7ef;
}
.amanta-personnel-table th {
  background: #f8fafc;
}
.amanta-personnel-table input {
  width: 100%;
  min-width: 0;
}
.amanta-personnel-filter {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) 38px;
  gap: 8px;
}
.amanta-personnel-filter .amanta-date-range-trigger {
  height: 38px;
  min-height: 38px;
}
.amanta-personnel-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}
.amanta-personnel-actions button,
.amanta-personnel-switch button {
  padding: 8px 12px;
  font-size: 12px;
}
.amanta-personnel-switch {
  display: flex;
  gap: 8px;
}
.amanta-personnel-switch button[aria-pressed="true"] {
  background: #334155;
  color: #fff;
  border-color: #334155;
}
.amanta-personnel-main > p {
  margin: 0;
  font-size: 11px;
  line-height: 1.4;
}
.amanta-personnel-by-work {
  min-height: 0;
}
.amanta-personnel-by-work h3 {
  font-size: 11px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin: 4px 0;
}
.amanta-personnel-work-stat {
  display: grid;
  padding: 7px 9px;
  margin-top: 6px;
  gap: 2px;
  background: #eff6ff;
  border: 1px solid #dbeafe;
  border-radius: 10px;
  font-size: 10px;
}
.amanta-personnel-work-stat > strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}
.amanta-personnel-pager {
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
  font-size: 11px;
}
.amanta-personnel-pager button {
  padding: 2px 10px;
  min-height: 26px;
}
.amanta-personnel-sidebar > button:last-child {
  margin-top: auto;
  font-size: 12px;
  padding: 6px;
}
@media (min-width: 1100px) {
  .amanta-personnel-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 950px) {
  .amanta-personnel-layout {
    grid-template-columns: 190px minmax(0, 1fr);
    gap: 12px;
  }
  .amanta-personnel-body {
    padding: 12px;
  }
  .amanta-personnel-filter {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-height: 720px) {
  .amanta-personnel-panel > div:first-child {
    padding: 8px 20px !important;
  }
  .amanta-personnel-panel > div:first-child h2 {
    font-size: 22px;
  }
  .amanta-personnel-body {
    padding: 10px 16px;
  }
  .amanta-personnel-main {
    gap: 5px;
  }
  .amanta-personnel-grid {
    gap: 6px 10px;
  }
  .amanta-personnel-panel .amanta-personnel-control {
    height: 32px !important;
    min-height: 32px !important;
  }
  .amanta-personnel-stat {
    padding: 4px;
  }
  .amanta-personnel-work-stat {
    padding: 4px 6px;
  }
}
.amanta-personnel-sheet { display:flex; flex-direction:column; min-height:0; gap:10px; flex:1; font-size:13px; }
.amanta-personnel-sheet-tools { flex:none; padding:10px; border:1px solid #e2e8f0; border-radius:14px; }
.amanta-personnel-sheet-tools p { margin:0 0 8px; color:#64748b; }
.amanta-personnel-sheet-data { display:flex; flex-direction:column; gap:8px; min-height:0; flex:1; border:1px solid #e2e8f0; border-radius:14px; padding:8px; }
.amanta-personnel-sheet-scroll { min-height:0; overflow:auto; flex:1; overscroll-behavior:contain; }
.amanta-personnel-sheet table { width:100%; table-layout:fixed; border-collapse:separate; border-spacing:0; }
.amanta-personnel-sheet th { position:sticky; top:0; z-index:2; background:#f8fafc; color:#64748b; padding:8px 4px; font-size:11px; text-align:left; }
.amanta-personnel-sheet td { padding:3px; vertical-align:top; border-bottom:1px solid #e2e8f0; overflow-wrap:anywhere; }
.amanta-personnel-sheet input:not([type=checkbox]), .amanta-personnel-sheet select { width:100%; min-width:0; height:34px; padding:3px 5px; border:1px solid #e2e8f0; border-radius:5px; background:white; font-size:12px; }
.amanta-personnel-sheet td input[type=date] { font-size:11px; }
.amanta-personnel-sheet-detail { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.amanta-personnel-sheet-detail label { display:flex; align-items:center; gap:5px; flex:1; min-width:150px; }
.amanta-personnel-sheet-detail span { flex:1; min-width:180px; }
.amanta-personnel-sheet footer { flex:none; padding-top:5px; }
.amanta-personnel-sheet button { border:1px solid #dbe3ef; border-radius:9px; padding:7px 12px; min-height:34px; background:white; color:#334155; white-space:nowrap; font-weight:600; }
.amanta-personnel-sheet button.btn-secondary { color:#fff; border-color:#171717; background:#171717; }
.amanta-personnel-sheet button.btn-secondary:hover:not(:disabled) { background:#292929; border-color:#292929; }
.amanta-personnel-sheet button.btn-primary { color:white; border-color:#f04420; background:#f04420; }
.amanta-personnel-sheet button:disabled { opacity:.45; cursor:not-allowed; }
.amanta-personnel-sheet-detail label { white-space:nowrap; }
.amanta-personnel-sheet-detail label input { flex:1; }
.amanta-personnel-sheet input[aria-label^="monto fila"] { color:#dc2626; }
.amanta-pay-toolbar { display:flex; flex-wrap:wrap; gap:8px; align-items:center; justify-content:space-between; flex:none; }
.amanta-pay-toolbar > input { flex:1; max-width:420px; }
.amanta-pay-modes { display:flex; gap:6px; flex-wrap:wrap; }
.amanta-pay-modes button[aria-pressed=true] { background:#f04420; border-color:#f04420; color:white; }
.amanta-pay-entry .amanta-personnel-sheet-tools p { margin:9px 0 0; }
.amanta-pay-entry .amanta-personnel-sheet-tools { flex:none; }
.amanta-pay-draft { border-top:1px solid #e2e8f0; padding-top:8px; margin-top:8px; }
.amanta-pay-draft table { margin:8px 0; }
.amanta-pay-draft .amanta-pay-details { grid-template-columns:repeat(5,minmax(0,1fr)); gap:10px; }
.amanta-pay-draft .amanta-pay-details label { grid-column:auto!important; }
.amanta-pay-work-setting { display:flex; flex-wrap:wrap; gap:6px; align-items:center; color:#52657f; flex:none; }
.amanta-pay-work-setting span { font-size:12px; color:#64748b; }
.amanta-pay-total { color:#dc2626; font-weight:600; font-variant-numeric:tabular-nums; }
.amanta-pay-entry td { padding:7px 4px; }
.amanta-pay-entry input:not([type=checkbox]), .amanta-pay-entry select { height:40px; border-radius:8px; padding:6px; }
.amanta-pay-row-summary { display:flex; flex-wrap:wrap; align-items:center; gap:10px; color:#64748b; font-size:12px; }
.amanta-pay-row-summary button { font-size:12px; }
.amanta-pay-details, .amanta-pay-common { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; padding:12px; background:#f8fafc; border-radius:10px; margin-top:8px; }
.amanta-pay-details label, .amanta-pay-common label { display:flex; flex-direction:column; min-width:0; gap:5px; color:#52657f; }
.amanta-pay-help { color:#64748b; font-size:12px; align-self:center; }
.amanta-pay-details label:has(input[aria-label^=observacion]), .amanta-pay-details label:has(input[aria-label^=referencia]) { grid-column:span 2; }
.amanta-pay-entry tr[data-selected=true] td { background:#eff6ff; }
.amanta-pay-entry footer { border-top:1px solid #e2e8f0; padding-top:10px; }
.amanta-pay-entry footer { justify-content:flex-end; }
.amanta-pay-entry footer > span { margin-right:auto; }
.amanta-personnel-panel:has(.amanta-personnel-sheet-container:not([hidden])) { height:min(900px,calc(100dvh - 32px)); }
.amanta-pay-entry .amanta-personnel-sheet-data > .amanta-pay-toolbar:last-child { justify-content:flex-end; }
.amanta-pay-entry .amanta-personnel-sheet-data > .amanta-pay-toolbar:last-child > button:first-child { margin-right:auto; }
.amanta-pay-batch { display:flex; flex-direction:column; gap:10px; min-height:0; flex:1; overflow-y:auto; padding:12px; border:1px solid #e2e8f0; border-radius:14px; }
.amanta-pay-batch p { margin:4px 0 0; color:#64748b; }
.amanta-pay-common { flex:none; margin:0; }
.amanta-pay-common label:has(input[aria-label="Común Referencia"]), .amanta-pay-common label:has(input[aria-label="Común Observación"]) { grid-column:span 2; }
.amanta-pay-common button[aria-label^="Buscar Común"] { height:40px; min-height:40px; padding:6px; }
.amanta-pay-people { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; min-height:70px; overflow:auto; flex:1; }
.amanta-pay-people label { display:flex; align-items:center; gap:10px; padding:8px; border:1px solid #dbe3ef; border-radius:9px; }
.amanta-pay-people small { display:block; color:#64748b; }
.amanta-pay-entry input[type=checkbox] { width:17px; height:17px; flex:none; }
.amanta-pay-filters { display:grid; grid-template-columns:minmax(180px,1.7fr) repeat(3,minmax(100px,1fr)) minmax(135px,1fr) auto; gap:8px; align-items:center; flex:none; }
.amanta-pay-filters > * { min-width:0; }
.amanta-pay-filters .amanta-date-range-trigger { height:40px; min-height:40px; }
@media(max-width:1000px) { .amanta-pay-filters { grid-template-columns:repeat(3,minmax(0,1fr)); } }
@media(max-width:1100px) { .amanta-pay-common,.amanta-pay-details { grid-template-columns:repeat(3,minmax(0,1fr)); } }
@media(max-width:700px) { .amanta-pay-common,.amanta-pay-details,.amanta-pay-people { grid-template-columns:minmax(0,1fr); } .amanta-pay-details label { grid-column:auto!important; } }

.amanta-personnel-sheet-container { display:flex; flex-direction:column; flex:1; min-height:0; }
.amanta-personnel-sheet-container[hidden] { display:none; }

/* Stable navigation; entry and prepared worksheet share one content scroll. */
.amanta-personnel-layout { grid-template-columns:minmax(0,1fr); gap:0; }
.amanta-personnel-panel { width:min(1560px,calc(100vw - 32px)); max-width:calc(100vw - 32px); }
.amanta-personnel-body { display:flex; flex-direction:column; }
.amanta-personnel-layout { flex:1; width:100%; }
.amanta-personnel-main { overflow:auto; }
.amanta-personnel-main:has(.amanta-personnel-sheet-container:not([hidden])) { overflow:hidden; }
.amanta-personnel-main > .amanta-personnel-sheet-container { flex:1; min-height:0; flex-shrink:1; }
.amanta-personnel-tabs { position:sticky; top:0; z-index:5; background:white; gap:24px; flex:none; }
.amanta-personnel-tabs > button[role=tab] { min-height:44px; font-size:14px; }
.amanta-personnel-tabs > button[aria-selected=true] { color:var(--color-primary,#e84420); border-color:var(--color-primary,#e84420); }
.amanta-personnel-context-row { display:grid; grid-template-columns: minmax(210px,1.4fr) repeat(3,minmax(0,1fr)); gap:16px; align-items:center; padding:12px 0; }
.amanta-personnel-stat { background:none; border:0; box-shadow:none; padding:0; text-align:left; }
.amanta-personnel-stat strong { color:#dc2626; }
.amanta-personnel-stat span { font-size:13px; }
.amanta-pay-content { flex:1; min-height:0; overflow:auto; display:flex; flex-direction:column; gap:14px; padding-right:4px; }
.amanta-pay-content > * { flex-shrink:0; }
.amanta-personnel-sheet-tools[hidden] { display:none; }
.amanta-pay-draft { border:0; padding:0; margin:0; }
.amanta-personnel-sheet-data { flex:none; min-height:0; padding:12px; }
.amanta-personnel-sheet-scroll { flex:none; max-height:400px; }
.amanta-pay-batch { flex:none; overflow:visible; padding:14px; }
.amanta-pay-people { flex:none; max-height:230px; }
.amanta-pay-modes { padding:4px 0; flex:none; }
.amanta-pay-modes button { min-width:110px; }
.amanta-pay-modes button[aria-pressed=true],.amanta-personnel-sheet button.btn-primary { background:var(--color-primary,#e84420); border-color:var(--color-primary,#e84420); }
.amanta-pay-entry footer { background:white; margin-top:0; padding:10px 0 0; }
.amanta-personnel-sheet .amanta-select-field > button { min-height:40px; height:40px; font-weight:400; width:100%; min-width:0; }
.amanta-pay-entry .amanta-pay-details { grid-template-columns:repeat(3,minmax(0,1fr)); }
.amanta-pay-entry input::placeholder { color:#94a3b8; opacity:1; }
@media(max-width:1100px) {
 .amanta-personnel-body { padding:12px 16px; }
 .amanta-personnel-context-row { grid-template-columns:repeat(2,minmax(0,1fr)); }
 .amanta-pay-draft table,.amanta-pay-draft tbody,.amanta-pay-draft tr { display:block; }
 .amanta-pay-draft thead { display:none; }
 .amanta-pay-draft tbody tr { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; }
 .amanta-pay-draft td { display:block; border:0; }
 .amanta-pay-draft td::before { display:block; color:#64748b; font-size:12px; margin-bottom:5px; }
 .amanta-pay-draft td:nth-child(1)::before { content:'Fecha'; }
 .amanta-pay-draft td:nth-child(2)::before { content:'Personal'; }
 .amanta-pay-draft td:nth-child(3)::before { content:'Obra (opcional)'; }
 .amanta-pay-draft td:nth-child(4)::before { content:'Importe'; }
 .amanta-pay-draft td:nth-child(5)::before { content:'Caja'; }
 .amanta-pay-draft td:nth-child(6)::before { content:'Modalidad'; }
}
.amanta-pay-records { display:flex; flex-direction:column; min-height:0; gap:12px; flex:1; }
.amanta-pay-records-scroll { overflow:auto; min-height:100px; flex:1; }
.amanta-pay-records-scroll th { position:sticky; top:0; z-index:1; background:#f6f8fb; }
.amanta-pay-records small { display:block; color:#64748b; font-size:12px; margin-top:4px; }
.amanta-pay-records-summary { display:flex; justify-content:space-between; gap:12px; align-items:center; flex-wrap:wrap; }
.amanta-pay-row-actions { display:flex; gap:6px; flex-wrap:wrap; }
.amanta-pay-records button { padding:8px 12px; border:1px solid #dbe3ef; border-radius:10px; }
.amanta-pay-pending-filters { display:grid; grid-template-columns:minmax(180px,2fr) repeat(3,minmax(120px,1fr)) auto; gap:8px; }
.amanta-pay-history-filters { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; }
.amanta-pay-records input { width:100%; min-width:0; padding:10px 12px; border:1px solid #dbe3ef; border-radius:10px; }
.amanta-pay-records input::placeholder { color:#94a3b8; }
.amanta-pay-records .amanta-select-trigger,.amanta-pay-records .amanta-select-field { width:100%; min-width:0; }
.amanta-pay-records table { table-layout:fixed; width:100%; }
.amanta-pay-records th,.amanta-pay-records td { overflow-wrap:anywhere; padding:10px 8px; }
@media(max-width:1100px){ .amanta-pay-pending-filters,.amanta-pay-history-filters { grid-template-columns:repeat(3,minmax(0,1fr)); } }
.amanta-personnel-confirm .amanta-personnel-control { height:40px!important; min-height:40px!important; }
.amanta-pay-entry button.amanta-date-picker-trigger { padding:0; width:26px; height:26px; min-height:26px; border:0; background:transparent; }
.amanta-pay-entry button.amanta-date-picker-trigger svg { flex-shrink:0; width:16px; height:16px; }
.amanta-personnel-view { display:flex; flex-direction:column; gap:12px; min-height:0; flex:1; }
.amanta-personnel-view[hidden] { display:none; }

/* Unified entry: one compact row, explicit loading, optional Excel append. */
.amanta-pay-entry .amanta-pay-draft > strong { display:block; margin-bottom:4px; }
.amanta-pay-entry .amanta-pay-draft .amanta-pay-details { grid-template-columns:repeat(4,minmax(0,1fr)) minmax(0,1.5fr); }
.amanta-pay-draft .amanta-pay-toolbar > span,.amanta-pay-excel-tools > span { flex:1; }
.amanta-pay-draft .amanta-pay-toolbar,.amanta-pay-excel-tools { justify-content:flex-end; }
.amanta-pay-entry .amanta-pay-cheque { margin-top:10px; padding:12px; border:1px solid #dbe3ef; border-radius:12px; }
.amanta-pay-entry .amanta-pay-cheque .amanta-pay-details { grid-template-columns:repeat(3,minmax(0,1fr)); }
@media(max-width:1100px) {
 .amanta-pay-entry .amanta-pay-draft .amanta-pay-details { grid-template-columns:repeat(3,minmax(0,1fr)); }
 .amanta-pay-draft .amanta-pay-details label:last-child:nth-child(5) { grid-column:span 2!important; }
}

.amanta-pay-total { display:flex; flex-direction:column; justify-content:center; gap:4px; padding:10px 16px; min-width:180px; max-width:100%; border:1px solid #e2e8f0; border-radius:8px; background:#f1f5f9; text-align:right; }
.amanta-pay-total-label { color:#64748b; text-transform:uppercase; letter-spacing:.08em; font-size:10px; font-weight:600; }
.amanta-pay-total strong { color:#b91c1c; font-size:20px; white-space:nowrap; }

/* The total is a cell in the table header, never a detached card. */
.amanta-pay-table-header { display:flex; align-items:stretch; flex-wrap:nowrap; gap:0; background:#f8fafc; border-bottom:1px solid #e2e8f0; border-radius:13px 13px 0 0; overflow:hidden; flex:none; }
.amanta-pay-table-heading { display:flex; flex-direction:column; justify-content:center; gap:4px; flex:1; min-width:0; padding:12px; }
.amanta-pay-table-heading > strong { color:#171717; font-size:14px; }
.amanta-pay-table-heading > span { color:#64748b; font-size:12px; }
.amanta-pay-table-header > .amanta-pay-total { border:0; border-left:1px solid #e2e8f0; border-radius:0; padding:10px 16px; flex:none; }
.amanta-personnel-sheet-data > .amanta-pay-table-header { margin:-12px -12px 0; }
.amanta-pay-batch > .amanta-pay-table-header { margin:-14px -14px 0; }
.amanta-pay-records { border:1px solid #e2e8f0; border-radius:14px; }
.amanta-pay-records > :is(.amanta-pay-pending-filters,.amanta-pay-history-filters,.amanta-pay-records-scroll,.amanta-personnel-pager) { margin-left:12px; margin-right:12px; }
.amanta-pay-records > .amanta-pay-records-scroll { margin-bottom:12px; }
.amanta-personnel-sheet input[type=checkbox] { accent-color:#171717; }

/* Hybrid filter and total share the same row of their own table header. */
.amanta-pay-header-with-filters { flex-direction:column; overflow:visible; }
.amanta-pay-header-with-filters .amanta-pay-table-heading { padding:10px 12px 4px; }
.amanta-pay-filterbar { display:flex; align-items:flex-start; gap:10px; padding:8px 12px 12px; min-width:0; }
.amanta-pay-filterbar > [role=search] { flex:1; min-width:0; margin:0; }
.amanta-pay-filterbar > .amanta-pay-total { flex:none; min-width:175px; min-height:48px; padding:4px 12px; gap:1px; border:1px solid #e2e8f0; border-radius:8px; }
.amanta-pay-filterbar .amanta-pay-filters { grid-template-columns:repeat(6,minmax(0,1fr)); }
.amanta-pay-filterbar .amanta-pay-pending-filters { grid-template-columns:repeat(5,minmax(0,1fr)); }
.amanta-pay-filterbar :is(.amanta-pay-filters,.amanta-pay-pending-filters,.amanta-pay-history-filters) > input,
.amanta-pay-filterbar :is(.amanta-select-trigger,.amanta-date-range-trigger),
.amanta-pay-filterbar [role=search] > button { min-height:48px; height:48px; }
@media(max-width:1300px) { .amanta-pay-filterbar .amanta-pay-filters,.amanta-pay-filterbar .amanta-pay-pending-filters { grid-template-columns:repeat(3,minmax(0,1fr)); } }
@media(max-width:1100px) { .amanta-pay-filterbar .amanta-pay-history-filters { grid-template-columns:repeat(3,minmax(0,1fr)); } }

.amanta-pay-filterbar .amanta-select-field,.amanta-pay-filterbar input[role=combobox] { height:48px!important; min-height:48px!important; }
.amanta-pay-filterbar > .amanta-pay-total { height:48px; padding:5px 12px; }
.amanta-pay-filterbar .amanta-pay-total-label { line-height:12px; }
.amanta-pay-filterbar .amanta-pay-total strong { line-height:22px; }

.amanta-pay-filterbar :is(input[role=combobox],input[type=search],.amanta-date-range-trigger),
.amanta-pay-filterbar [role=search] > button { border-radius:8px; font-size:13px; }

.amanta-pay-total[data-money-direction="in"] strong { color:#15803d; }
.amanta-pay-total[data-money-direction="neutral"] strong { color:#171717; }
.amanta-account { overflow:hidden; }
.amanta-account-panel { height:min(690px,calc(100dvh - 40px)); }
.amanta-account-panel .amanta-account { max-height:calc(100dvh - 160px); }
.amanta-account-panel .amanta-pay-records-scroll { flex:0 1 auto; }
.amanta-account > .amanta-pay-records { min-height:0; overflow:hidden; }
.amanta-account .amanta-pay-records-scroll { min-height:0; }
.amanta-account td { padding:10px 8px; }
/* Pestañas del estado de cuenta: son subrayadas (como en el resto de las pestañas de pagos). El borde y el radio de botón genérico
   las dejaban con el texto pegado al contorno y sin aire a los costados (control visual del 01/10/2026, 1024-1920 px). */
.amanta-account .amanta-personnel-tabs > button[role=tab] { padding:7px 14px; border-width:0 0 3px; border-radius:0; border-bottom-color:transparent; }
.amanta-account .amanta-personnel-tabs > button[aria-selected=true] { border-bottom-color:var(--color-primary,#e84420); }
.amanta-account-assignment { gap:16px; }
.amanta-account-assignment label { display:flex; flex-direction:column; gap:8px; }
.amanta-account-assignment input[role=combobox] { height:44px; }
.amanta-account-assignment footer { justify-content:flex-end; }

/* One content scroll: entry yields space, worksheet headings remain visible. */
.amanta-pay-entry .amanta-personnel-sheet-scroll { overflow:visible; max-height:none; }
.amanta-pay-sticky-heading { position:sticky; top:0; z-index:4; background:white; margin:-12px -12px 0; padding-bottom:8px; }
.amanta-pay-sticky-heading > .amanta-pay-toolbar { padding:8px 12px 0; }
.amanta-pay-entry .amanta-personnel-sheet-scroll th { top:var(--payment-heading-height, 148px); z-index:3; }
.amanta-personnel-excel-slot { position:absolute; right:0; top:50%; transform:translateY(-50%); }
.amanta-personnel-excel-slot[hidden] { display:none; }
.amanta-pay-draft-note { display:grid; grid-template-columns:minmax(150px,1fr) minmax(200px,3fr) auto auto; gap:12px; align-items:end; padding:8px 4px 4px; }
.amanta-pay-draft-note label { display:flex; flex-direction:column; gap:5px; min-width:0; color:#52657f; }
.amanta-pay-draft-note > button { height:40px; }
/* Align actual input borders, including the autocomplete wrapper, to the actions. */
.amanta-pay-draft-note > label { align-self:end; }
.amanta-pay-draft-note > label > span { line-height:18px; }
.amanta-pay-draft-note > label > input,
.amanta-pay-draft-note > label > .amanta-select-field,
.amanta-pay-draft-note input[role=combobox] { height:40px!important; min-height:40px!important; margin:0; box-sizing:border-box; }
.amanta-pay-draft-note > label > .amanta-select-field { display:block; }
@media(max-width:1100px) {
 .amanta-pay-draft-note { grid-template-columns:minmax(120px,1fr) minmax(160px,2fr) auto auto; gap:8px; }
}
@media(max-width:750px) {
 .amanta-pay-draft-note { grid-template-columns:repeat(2,minmax(0,1fr)); }
}

/* Keep the import action inside the existing navigation, including its border. */
.amanta-personnel-excel-slot { right:2px; }
.amanta-personnel-excel-slot button.amanta-excel-import-trigger { height:40px; min-height:40px; padding:8px 12px; border-width:1px; border-radius:10px; }
/* One row: wider search, equal-height fields and square reset. */
.amanta-pay-filterbar .amanta-pay-filters { grid-template-columns:minmax(0,2fr) repeat(4,minmax(0,1fr)) 48px; }
.amanta-pay-filterbar .amanta-pay-pending-filters { grid-template-columns:minmax(0,2fr) repeat(3,minmax(0,1fr)) 48px; }
.amanta-pay-filterbar .amanta-pay-history-filters { grid-template-columns:minmax(0,2fr) repeat(6,minmax(0,1fr)) 48px; }
.amanta-pay-filterbar .amanta-pay-account-filters { display:grid; grid-template-columns:minmax(0,2fr) repeat(2,minmax(0,1fr)) 48px; gap:8px; }
.amanta-pay-filterbar [role=search] > * { min-width:0; }
.amanta-pay-filterbar [role=search] > button.amanta-reset-filters { width:48px; height:48px; min-height:48px; padding:0; display:inline-flex; align-items:center; justify-content:center; border:1px solid #dbe3ef; border-radius:8px; background:white; }
.amanta-reset-filters svg { flex:none; }
.amanta-pay-filterbar .amanta-pay-account-filters > input { height:48px; min-height:48px; }
@media(max-width:1300px) {
 .amanta-pay-filterbar .amanta-pay-history-filters { gap:6px; }
 .amanta-pay-filterbar .amanta-pay-history-filters input[role=combobox] { padding-left:6px; padding-right:6px; font-size:12px; }
 .amanta-pay-filterbar .amanta-pay-history-filters .amanta-date-range-trigger { padding-left:4px; padding-right:4px; gap:4px; }
}

/* One uninterrupted row per payment, retaining the existing sticky header. */
 .amanta-pay-continuous :is(th,td) { padding:4px; vertical-align:top; }
.amanta-pay-continuous td > span:has(> .date-field-input) { display:flex; }
.amanta-pay-continuous :is(.amanta-select-field,input:not([aria-hidden=true])) { display:block; height:40px!important; min-height:40px!important; box-sizing:border-box; margin:0; }
.amanta-pay-continuous button[aria-label^="Quitar pago"] { display:flex; align-items:center; justify-content:center; width:40px; height:40px; min-height:40px; padding:0; margin:0; }

.amanta-pay-continuous tbody td:first-child { vertical-align:middle; }

/* The three payment windows share navigation, filters and continuous rows. */
.amanta-counterparty-panel .amanta-personnel-main { overflow:hidden; }
.amanta-counterparty-extra { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px 12px; margin-top:10px; padding-top:10px; border-top:1px solid #e2e8f0; }
.amanta-counterparty-extra label { min-width:0; display:flex; flex-direction:column; gap:5px; font-size:12px; color:#52637d; }
.amanta-counterparty-extra :is(input:not([type=checkbox]),.amanta-select-field) { height:40px!important; min-height:40px!important; width:100%; min-width:0; margin:0; box-sizing:border-box; }
.amanta-counterparty-extra label > span:has(.date-field-input) { display:flex; }
.amanta-counterparty-load { justify-content:flex-end; margin-top:10px; }
.amanta-counterparty-extra > .amanta-counterparty-load { align-self:end; margin:0; flex-wrap:nowrap; }
.amanta-counterparty-extra:not(.amanta-counterparty-supplier-extra) > .amanta-counterparty-load { grid-column:-2/-1; }
.amanta-counterparty-load > button { height:40px; min-height:40px; }
.amanta-counterparty-extra.amanta-counterparty-supplier-extra { grid-template-columns:minmax(0,1fr) auto; }
.amanta-counterparty-supplier-extra:has(input[aria-label$="numeroCheque"]) { grid-template-columns:repeat(3,minmax(0,1fr)); }
.amanta-counterparty-panel input[aria-label$="monto"] { color:#dc2626; }
.amanta-counterparty-panel .amanta-pay-entry > footer { margin:0!important; width:100%!important; }
.amanta-counterparty-panel .amanta-pay-records > .amanta-pay-toolbar { justify-content:flex-end; padding:8px 12px; }
.amanta-counterparty-row-actions { display:flex; gap:4px; }
.amanta-counterparty-row-actions > button { display:flex; align-items:center; justify-content:center; width:40px; height:40px; min-height:40px; padding:0; margin:0; }
.amanta-counterparty-panel .amanta-pay-continuous td { vertical-align:top; }
.amanta-counterparty-panel .amanta-personnel-sheet-tools td > span:has(.date-field-input) { display:flex; }
.amanta-counterparty-panel .amanta-personnel-sheet-tools :is(.amanta-select-field,input:not([aria-hidden=true])) { display:block; height:40px!important; min-height:40px!important; box-sizing:border-box; margin:0; }
.amanta-counterparty-panel .amanta-pay-records-scroll th button { width:100%; border:0; background:transparent; white-space:normal; padding:4px; font-weight:600; }
.amanta-counterparty-errors { padding:8px; color:#b91c1c; }
.amanta-counterparty-compact { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:12px; align-items:end; }
.amanta-counterparty-compact.amanta-subcontract-compact { grid-template-columns:minmax(0,1fr) minmax(0,2fr) auto; }
.amanta-counterparty-extras { border-top:1px solid #e2e8f0; margin-top:10px; padding-top:10px; }
.amanta-counterparty-compact label { display:flex; flex-direction:column; gap:5px; min-width:0; font-size:12px; color:#52637d; }
.amanta-counterparty-compact :is(input,.amanta-select-field) { display:block; width:100%; min-width:0; height:40px!important; min-height:40px!important; box-sizing:border-box; margin:0; }
.amanta-counterparty-compact input { border:1px solid #dbe3ef; border-radius:8px; padding:6px; background:white; }
.amanta-counterparty-compact .amanta-counterparty-load { margin:0; flex-wrap:nowrap; }
.amanta-counterparty-detail .amanta-subcontract-compact { grid-template-columns:minmax(0,1fr) minmax(0,2fr); }
.amanta-payment-completion-summary { margin:0 0 16px; color:#52637d; font-size:13px; }
.amanta-counterparty-detail .amanta-counterparty-compact:not(.amanta-subcontract-compact) { grid-template-columns:minmax(0,1fr); }
.amanta-payment-breadcrumb { display:flex; gap:12px; align-items:center; }
.amanta-payment-breadcrumb > button { height:40px; padding:6px 12px; border:1px solid #dbe3ef; border-radius:8px; background:white; color:#1d4ed8; }
.amanta-pay-records table[aria-label="Pendientes por proveedor"] th { text-align:center; }
.amanta-pay-records .amanta-provider-drill { border:0; background:transparent; padding:4px; color:#1d4ed8; text-align:left; }
.amanta-payment-record-actions { display:flex; flex-direction:column; gap:4px; }
.amanta-pay-records .amanta-payment-record-actions button { min-height:36px; padding:4px 6px; font-size:11px; line-height:1.2; white-space:normal; }
.amanta-pay-records .amanta-payment-record-actions button.btn-secondary { background:#eff6ff; color:#1d4ed8; border:1px solid #bfdbfe; }
.amanta-counterparty-panel .amanta-pay-records tbody td { vertical-align:middle; }
.amanta-counterparty-account .amanta-personnel-body { display:flex; flex-direction:column; gap:12px; }
.amanta-resolver-filters > .amanta-reset-filters { width:38px; height:38px; min-height:38px; padding:0; display:flex; align-items:center; justify-content:center; }
.amanta-counterparty-detail { max-height:90dvh; overflow:auto; }
.amanta-counterparty-detail .amanta-counterparty-extra { grid-template-columns:repeat(3,minmax(0,1fr)); }
.amanta-counterparty-detail .amanta-counterparty-extra.amanta-counterparty-supplier-extra { grid-template-columns:minmax(0,1fr); }
.amanta-counterparty-detail input { border:1px solid #dbe3ef; border-radius:8px; padding:6px; background:white; }
.amanta-counterparty-detail .amanta-pay-toolbar > button { height:40px; min-height:40px; border:1px solid #dbe3ef; border-radius:8px; padding:6px 16px; }
.amanta-counterparty-detail .amanta-pay-toolbar > button.btn-primary { background:#e84420; color:white; border-color:#e84420; }
.amanta-counterparty-detail .amanta-pay-toolbar { justify-content:flex-end; padding-top:12px; }
.amanta-payment-state { display:inline-block; padding:3px 6px; border-radius:6px; background:#fef3c7; color:#92400e; }
.amanta-payment-state[data-state=ACTIVO],.amanta-payment-state[data-state=PAGADO],.amanta-payment-state[data-state=COBRADO] { background:#dcfce7; color:#166534; }
.amanta-payment-state[data-state=ANULADO],.amanta-payment-state[data-state=RECHAZADO] { background:#fee2e2; color:#991b1b; }
@media(max-width:1100px) {
 .amanta-counterparty-extra { grid-template-columns:repeat(3,minmax(0,1fr)); }
 .amanta-counterparty-panel .amanta-personnel-sheet th { font-size:10px; }
 .amanta-counterparty-panel .amanta-pay-filterbar { gap:6px; }
 .amanta-counterparty-panel .amanta-pay-filterbar > .amanta-pay-total { min-width:140px; padding:5px 8px; }
 .amanta-counterparty-panel .amanta-pay-filters { gap:6px; }
}
