/* Correspondence workbench. Saved views and native table semantics stay intact.
 * Column minimums live on both header and cells so extra columns scroll inside
 * the sheet instead of compressing text. No font or palette overrides. */
@media screen {
  .sx-correspondence-list { padding:24px; color:var(--sx-text); background:var(--sx-canvas); min-width:0; }
  .sx-correspondence-list [class*="col-"],
  .sx-correspondence-list__toolbar, .sx-correspondence-list__stats,
  .sx-correspondence-list__table-region { min-width:0; }
  .sx-correspondence-list__toolbar { padding:0 0 20px; margin:0; border:0; }
  .sx-correspondence-list__toolbar > .row { margin:0; }
  .sx-correspondence-list__toolbar > .row:not(.ng-hide) { display:flex; flex-wrap:wrap; gap:16px; align-items:center; }
  .sx-correspondence-list__toolbar .row::before,
  .sx-correspondence-list__toolbar .row::after { display:none; }
  .sx-correspondence-list__toolbar .row > div { width:auto; padding:0; }
  .sx-correspondence-list__toolbar .row > div:first-child { flex:1 1 auto; }
  .sx-correspondence-list__toolbar .row > div:last-child:not(.ng-hide) { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
  .sx-correspondence-list__toolbar .btn-group { margin:0; }
  .sx-correspondence-list__toolbar .btn { min-height:40px; padding:8px 12px; border-radius:var(--sx-radius); font-size:14px; }
  .sx-correspondence-list__toolbar .btn-group .btn-group { margin:0; }
  .sx-correspondence-list__toolbar h1 { font-size:24px; font-weight:700; line-height:1.4; margin:0; }
  .sx-correspondence-list__toolbar h1 i { font-size:20px; margin-inline-end:8px; color:var(--sx-muted); }
  .sx-correspondence-list__toolbar hr { display:none; }
  .sx-correspondence-list .current-view { display:inline-block; max-width:210px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; vertical-align:middle; }
  .sx-correspondence-list .dropdown-menu { min-width:190px; max-width:min(320px,calc(100vw - 32px)); border-color:var(--sx-border); border-radius:var(--sx-radius); }
  .sx-correspondence-list .dropdown-menu > li > a { padding:10px 14px; white-space:normal; line-height:1.5; }
  .sx-correspondence-list__stats { display:block; margin:0 0 20px; }
  .sx-correspondence-list__stats > .padder-v { padding:0; border:0; }
  .sx-statistics-cards { display:flex; flex-wrap:wrap; gap:12px; }
  .sx-statistics-cards > div { flex:1 1 115px; min-width:0; }
  .sx-statistics-cards > .sx-statistics-card-chart { flex:1.6 1 218px; }
  .sx-statistics-cards > div > div { width:100%; padding:0; float:none; }
  .sx-statistics-cards .stat-box { position:relative; padding:18px; margin:0; min-height:168px; height:168px; border:1px solid var(--sx-border); border-radius:var(--sx-radius-lg); background:var(--sx-surface); overflow:hidden; }
  .sx-statistics-cards .stat-box h3 { font-size:14px; line-height:1.5; margin:0 24px 18px 0; margin-inline:0 24px; min-height:42px; }
  .sx-statistics-cards .stat-box-content { height:auto; min-height:76px; position:relative; }
  .sx-statistics-cards .stat-box-content h4 { font-size:36px; font-weight:700; line-height:1.2; margin:0; padding:0; align-self:center; }
  .sx-statistics-cards .stat-box-content h4.centered { margin:0; }
  .sx-statistics-cards .stat-box-content .box-horizontal { gap:8px; align-items:center; min-width:0; overflow:visible; }
  .sx-statistics-cards .stat-box-content .box-horizontal h4 { border:0; }
  .sx-statistics-cards .chart-labels { min-width:0; font-size:11px; color:var(--sx-muted); }
  .sx-statistics-cards .chart-labels ul { padding:0; margin:0; list-style:none; }
  .sx-statistics-cards .chart-labels li { margin:4px 0; }
  .sx-statistics-cards .chart { width:64px; height:64px; flex:0 0 64px; }
  .sx-statistics-cards .stat-icon { position:absolute; inset-inline-end:12px; bottom:-14px; opacity:.12; font-size:13px; }
  .sx-statistics-cards .stat-icon i { font-size:80px; }
  .sx-statistics-cards .chart-labels { overflow:visible; }
  .sx-statistics-cards .report_widgets { cursor:pointer; }
  .sx-statistics-cards .report_widgets:hover .stat-box { border-color:var(--sx-primary); }
  .sx-list-views { display:flex; align-items:center; gap:4px; padding-top:20px; border-bottom:1px solid var(--sx-border); overflow:auto; }
  .sx-list-views > button { flex:0 0 auto; padding:10px 16px; border:0; border-bottom:3px solid transparent; background:transparent; color:var(--sx-muted); font-size:13px; min-height:42px; }
  .sx-list-views > button.active { border-bottom-color:var(--sx-primary); color:var(--sx-primary); font-weight:700; }
  .sx-list-total { margin-inline-start:auto; padding:8px; color:var(--sx-muted); font-size:12px; white-space:nowrap; }
  .sx-list-total strong { color:var(--sx-text); margin-inline-start:6px; }
  .sx-correspondence-list .sx-filter-help { margin:0 0 12px; color:var(--sx-muted); font-size:13px; }
  .sx-correspondence-list .sx-filter-help summary { cursor:pointer; width:fit-content; }
  .sx-correspondence-list .sx-filter-help p { margin:8px 0; max-width:720px; line-height:1.6; }
  .sx-correspondence-list__search { display:block; margin-bottom:20px; }
  .sx-correspondence-list__table-region { container-type:inline-size; max-width:100%; overflow:auto; border:1px solid var(--sx-border); border-radius:var(--sx-radius-lg); background:var(--sx-surface); -webkit-overflow-scrolling:touch; }
  .sx-correspondence-list__table-region > .panel { border:0; border-radius:0; margin:0; }
  .sx-correspondence-list__table-region table { display:table; width:100%; min-width:1040px; max-width:none; table-layout:auto; margin:0; border-collapse:separate; border-spacing:0; background:var(--sx-surface); }
  .sx-correspondence-list__table-region thead { display:table-header-group; }
  .sx-correspondence-list__table-region tbody { display:table-row-group; }
  .sx-correspondence-list__table-region tfoot { display:table-footer-group; }
  .sx-correspondence-list__table-region tr:not(.ng-hide) { display:table-row; }
  .sx-correspondence-list__table-region th,
  .sx-correspondence-list__table-region td { padding:10px 12px; font-size:13px; line-height:1.55; vertical-align:middle; text-align:start; word-break:normal; overflow-wrap:normal; border-color:var(--sx-border); border-bottom:1px solid var(--sx-border); }
  .sx-correspondence-list__table-region th:not(.ng-hide),
  .sx-correspondence-list__table-region td:not(.ng-hide) { display:table-cell; width:auto; }
  .sx-correspondence-list__table-region thead th { font-weight:600; color:var(--sx-muted); background:var(--sx-surface-muted); }
  .sx-correspondence-list__table-region [table-head] th { white-space:nowrap; }
  .sx-correspondence-list__table-region [data-column] { min-width:120px; }
  .sx-correspondence-list__table-region [data-column="subject"] { min-width:260px; width:320px; max-width:380px; }
  .sx-correspondence-list__table-region td[data-column="subject"] { font-weight:600; }
  .sx-correspondence-list__table-region td[data-column="subject"] a { display:block; }
  .sx-correspondence-list__table-region td[data-column="subject"] > div { min-width:240px; max-width:380px; white-space:normal; overflow-wrap:break-word; }
  .sx-correspondence-list__table-region [data-column="code"] { min-width:130px; width:140px; }
  .sx-correspondence-list__table-region td[data-column="code"] a { display:block; max-width:152px; overflow:hidden; text-overflow:ellipsis; color:var(--sx-primary); font-weight:600; white-space:nowrap; }
  .sx-correspondence-list__table-region [data-column="updated_at"],
  .sx-correspondence-list__table-region [data-column="created_at"] { min-width:180px; }
  .sx-correspondence-list__table-region [data-column="registration_date"],
  .sx-correspondence-list__table-region [data-column="due_date"] { min-width:120px; }
  .sx-correspondence-list__table-region [data-column="source_entity"],
  .sx-correspondence-list__table-region [data-column="current_destination_entity"],
  .sx-correspondence-list__table-region [data-column="project"] { min-width:156px; max-width:220px; }
  .sx-correspondence-list__table-region td[data-column="source_entity"] > div,
  .sx-correspondence-list__table-region td[data-column="current_destination_entity"] > div,
  .sx-correspondence-list__table-region td[data-column="project"] > div { max-width:240px; white-space:normal; overflow-wrap:break-word; }
  .sx-correspondence-list__table-region .label { display:inline-block; padding:5px 9px; border-radius:var(--sx-radius-sm); line-height:1.5; white-space:nowrap; font-size:12px; }
  .sx-correspondence-list .sx-correspondence-list__table-region table.box .item-labels { min-width:84px; width:84px; max-width:84px; padding-inline:8px; white-space:normal; }
  .sx-correspondence-list__table-region .item-labels > a { display:inline-flex; vertical-align:middle; }
  .sx-correspondence-list__table-region .item-labels .badge { display:inline-flex; align-items:center; justify-content:center; width:22px; height:22px; padding:0; margin:0 2px; font-size:11px; vertical-align:middle; }
  .sx-correspondence-list__table-region [table-row] > td:first-child,
  .sx-correspondence-list__table-region [table-head] > th:first-child { width:44px; min-width:44px; }
  .sx-correspondence-list__table-region [table-row] > td:last-child,
  .sx-correspondence-list__table-region [table-head] > th:last-child { width:64px; min-width:64px; }
  .sx-correspondence-list__table-region [table-row] > td:last-child .btn { width:36px; height:36px; border-radius:var(--sx-radius); }
  .sx-correspondence-list__table-region [table-row] > td:last-child .dropdown-menu { inset-inline-start:auto; inset-inline-end:0; }
  .sx-correspondence-list__table-region input[type="checkbox"] { width:18px; height:18px; accent-color:var(--sx-primary); }
  .sx-correspondence-list__table-region tbody tr:nth-child(odd) > td { background:var(--sx-surface); }
  .sx-correspondence-list__table-region tbody tr:hover > td,
  .sx-correspondence-list__table-region tbody tr:focus-within > td { background:var(--sx-brand-soft); }
  .sx-correspondence-list__table-region a { color:var(--sx-primary); }
  .sx-correspondence-list__table-region .table-filters th { padding:8px 12px; }
  .sx-correspondence-list__table-region .table-filters .form-control,
  .sx-correspondence-list__table-region .table-filters .bootstrap-tagsinput,
  .sx-correspondence-list__table-region .table-filters .ui-select-multiple { width:100%; min-width:0; min-height:36px; border:1px solid var(--sx-border-strong); border-radius:var(--sx-radius); background:var(--sx-surface); box-shadow:none; }
  .sx-correspondence-list__table-region .table-filters input { font-size:13px; }
  .sx-correspondence-list__table-region .bootstrap-tagsinput > input { min-width:0; width:100%; padding:5px 8px; }
  .sx-correspondence-list__table-region .sx-table-tools-cell { padding:16px; background:var(--sx-surface); }
  .sx-table-footer { position:sticky; inset-inline-start:16px; width:calc(100cqw - 32px); display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
  .sx-table-footer > div { float:none !important; margin:0; }
  .sx-table-footer > div:last-child { margin-inline-start:auto; }
  .sx-table-tools { position:sticky; inset-inline-start:16px; width:calc(100cqw - 32px); display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
  .sx-table-tools__search { flex:1 1 320px; }
  .sx-correspondence-list .sx-table-tools__search .bootstrap-tagsinput { width:100%; min-height:40px; padding:3px 8px; border:1px solid var(--sx-border-strong); border-radius:var(--sx-radius); background:var(--sx-surface); box-shadow:none; }
  .sx-correspondence-list__table-region tfoot td { padding:12px 16px; font-size:13px; background:var(--sx-surface-muted); border:0; }
  .sx-correspondence-list__table-region tfoot .pagination { margin:0; }
  .sx-correspondence-list__table-region tfoot .pagination a { min-width:36px; min-height:36px; }
  .sx-correspondence-list__table-region .no-results { padding:40px 24px; text-align:center; color:var(--sx-muted); }
  @media (max-width:767px) {
    .sx-correspondence-list { padding:16px; }
    .sx-correspondence-list__toolbar h1 { font-size:22px; }
    .sx-statistics-cards { gap:10px; }
    .sx-statistics-cards .stat-box { padding:14px; }
    .sx-list-views { padding-top:12px; }
    .sx-list-views > button { padding-inline:12px; }
  }
}
