/**
 * Scoped under .atti-table-wrap so theme rules like
 * .content-area table td / .page-content table th (Gana theme) do not override.
 */

.atti-table-wrap {
  overflow-x: auto;
  margin: 1em 0;
}

/* Inner vertical scroll */
.atti-table-wrap--scroll .atti-table-scroll {
  max-height: calc(2.5em + 2.75em * var(--atti-scroll-rows, 0));
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.atti-table-wrap--scroll .atti-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f6f7f7;
  box-shadow: 0 1px 0 #ddd;
}

/* Double class + element chain beats .content-area table td (theme) */
.atti-table-wrap table.atti-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95em;
  border: 1px solid #ddd !important;
  margin-bottom: 0;
}

/* Outer box from table border only; no vertical lines; horizontal row lines */
.atti-table-wrap table.atti-table th,
.atti-table-wrap table.atti-table td {
  border-left: none !important;
  border-right: none !important;
  border-top: none !important;
  border-bottom: 1px solid #ddd !important;
  padding: 0.5em 0.75em !important;
  vertical-align: top;
}

.atti-table-wrap table.atti-table tbody tr:last-child td {
  border-bottom: none !important;
}

.atti-table-wrap table.atti-table th.atti-padding-tight,
.atti-table-wrap table.atti-table td.atti-padding-tight {
  padding-left: 0.2em !important;
  padding-right: 0.2em !important;
}

.atti-table-wrap table.atti-table > thead > tr > th {
  text-align: left;
}

.atti-table-wrap table.atti-table thead th.atti-align-left,
.atti-table-wrap table.atti-table tbody td.atti-align-left {
  text-align: left;
}

.atti-table-wrap table.atti-table thead th.atti-align-center,
.atti-table-wrap table.atti-table tbody td.atti-align-center {
  text-align: center;
}

.atti-table-wrap table.atti-table thead th.atti-align-right,
.atti-table-wrap table.atti-table tbody td.atti-align-right {
  text-align: right;
}

.atti-table-wrap table.atti-table thead th {
  background: #f6f7f7;
  font-weight: 600;
}

.atti-table-wrap table.atti-table tbody tr:nth-child(even) {
  background: #fafafa;
}

.atti-table-wrap table.atti-table td.atti-num-positive {
  font-weight: 700;
  color: #0d7d0d;
}

.atti-table-wrap table.atti-table td.atti-num-negative {
  font-weight: 700;
  color: #c62828;
}

.atti-table-wrap table.atti-table td.atti-display-tags {
  line-height: 1.6;
}

.atti-table-wrap table.atti-table .atti-tag {
  display: inline-block;
  margin: 2px 4px 2px 0;
  padding: 0.2em 0.55em;
  font-size: 0.85em;
  font-weight: 600;
  color: #1d2327;
  background: #e8eef5;
  border: 1px solid #c5d0df;
  border-radius: 4px;
}

p.atti-error {
  color: #b32d2e;
}

p.atti-warning {
  color: #996800;
}

.atti-table-wrap .atti-table-last-update {
  margin: 0.65em 0 0;
  padding: 0.5em 0 0;
  font-size: 0.9em;
  color: #50575e;
  border-top: 1px solid #ddd;
}

.atti-table-wrap--scroll .atti-table-last-update {
  margin-top: 0.75em;
  padding-top: 0.65em;
}

.atti-table-wrap .atti-last-update-label {
  font-weight: 600;
  margin-right: 0.35em;
}

.atti-table-wrap table.atti-table a.atti-link {
  font-weight: 600;
  color: #1d4ed8;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.atti-table-wrap table.atti-table a.atti-link:hover,
.atti-table-wrap table.atti-table a.atti-link:focus {
  color: #1e3a8a;
}
