.chart-wrapper {
    display: flex;
    align-items: center;
    gap: 20px;
}

.chart-container {
    position: relative;
}


.chart-center-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: var(--chart-label-fit, 30px);
    font-weight: bold;
    line-height: 1;
    pointer-events: none;
    z-index: 0;
}

/* ChartRepr tooltip (js/chart_repr.js): floats in <body>, so the canvas never clips it. */
.chart-repr-tooltip {
    position: absolute;
    z-index: 2000;
    transform: translate(-50%, calc(-100% - 10px));
    padding: 6px 10px;
    border-radius: 6px;
    background: #333333;
    color: #ffffff;
    font-size: 12px;
    line-height: 1.4;
    white-space: nowrap;
    pointer-events: none;
    transition: opacity 0.1s ease;
}

.chart-repr-tooltip-title {
    font-weight: 600;
    margin-bottom: 2px;
}

.chart-repr-tooltip-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.chart-repr-tooltip-dot {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    flex: 0 0 auto;
}

.chart-container canvas {
    position: relative;
    z-index: 1;
}

.chart-legend {
    display: grid;
    grid-auto-flow: column;
    grid-template-rows: repeat(3, auto); /* massimo 3 righe per colonna */
    font-size: 18px;
    gap: 8px 20px; /* riga-colonna */
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    display: inline-block;
}

.legend-label {
    font-weight: 500;
    flex: 1;
}

.legend-value {
    font-weight: bold;
}

.charts-row {
    display: flex;
    gap: 50px; /* spazio tra i due chart */
    align-items: center;
    justify-content: flex-end;
}

body:has(div.login) {
    background-image: url('../../img/img_1.png');
}

.detail-auth-list {
    width: 300px;
}

/* External App Credentials */
.detail-auth-list .second-col {
  word-break: break-all;
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
}

.ext_state {
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 20px;
}

.deployed {
    background-color: deepskyblue;
    color: black;
}

.unavailable {
    background-color: lightgray;
    color: black;
}

.available {
    background-color: lightgreen;
    color: black;
}

.suspended {
    background-color: orange;
    color: black;
}

.prepared {
    background-color: yellow;
    color: black;
}

.removed {
    background-color: red;
    color: white;
}

a:has(i.disabled) {
  pointer-events: none;
  cursor: default;
}

/* Credentials Archives */
.status-badge {
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-left: 20px;
}

.status-badge.status-success {
    background-color: lightgreen;
    color: black;
}

.status-badge.status-issuing {
    background-color: lightblue;
    color: black;
}

.status-badge.status-revoked {
    background-color: red;
    color: white;
}

.status-badge.status-created {
    background-color: #cfe8ff;
    color: #0b3d73;
}

.status-badge.status-pending {
    background-color: #fff3cd;
    color: #7a5a00;
}

.status-badge.status-requested {
    background-color: #e5e5ff;
    color: #3b3b7a;
}

.status-badge.status-failed {
    background-color: #f8d7da;
    color: #7a1f23;
}

.credentials-table-wrapper {
    background: #ffffff;
    border: 1px solid #e2e6ea;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
    padding: 8px;
}

.credentials-table {
    margin: 0;
}

.credentials-table .part-number-row td {
    background: #f7f9fb;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.credentials-table .part-number-row:hover td {
    background: #eef3f7;
}

.credentials-table .collapse-icon,
.panel-heading-custom .collapse-icon {
    display: inline-block;
    transition: transform 0.2s ease;
    margin-right: 6px;
}

.credentials-table .part-number-row[aria-expanded="true"] .collapse-icon,
.panel-heading-custom a[aria-expanded="true"] .collapse-icon {
    transform: rotate(180deg);
}

.inner-table-wrapper {
    background: #ffffff;
    padding: 12px;
}

.credentials-inner-table th {
    background: #f0f2f5;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.04em;
}

.credentials-inner-table td {
    vertical-align: top;
}

.panel-group-custom {
    margin: 0;
}

.panel-custom {
    border: 1px solid #e2e6ea;
    border-radius: 8px;
    margin-bottom: 8px;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.panel-heading-custom {
    padding: 8px 12px;
    background: #f7f9fb;
    border-bottom: 1px solid #e2e6ea;
    border-radius: 8px 8px 0 0;
}

.panel-heading-custom h5 {
    margin: 0;
    font-size: 13px;
}

.panel-heading-custom a {
    color: #333333;
    text-decoration: none;
    display: flex;
    align-items: center;
}

.panel-heading-custom a:hover,
.panel-heading-custom a:focus {
    text-decoration: none;
    color: #111111;
}

.panel-body-custom {
    padding: 10px 12px;
}

.detail-list {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 4px 12px;
}

.detail-label {
    font-weight: 600;
    color: #555555;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.detail-value {
    color: #222222;
    word-break: break-all;
}

.resources-column {
    width: 45%;
}

.hid_part_number {
    font-weight: 700;
}

.hid_credential_id {
    font-weight: 700;
}

.select2-search--inline {
    width: 100%;
}

/* Credential history notes (log screens and dashboard): the whole note opens in a popover. */
.log-note { cursor: pointer; }
.log-note:focus { outline: none; text-decoration: underline; }
.popover.log-note-popover { max-width: 520px; }
.popover.log-note-popover .popover-content { white-space: pre-wrap; word-break: break-word; }

/* Scrollable tables (every .table-responsive, dashboard included): a 14px bar with a
   clearly visible thumb instead of the 4px one commons sets on every element. */
.table-responsive {
    scrollbar-width: auto;
}

.table-responsive::-webkit-scrollbar {
    width: 14px;
    height: 14px;
    background: #f0f0f0;
}

.table-responsive::-webkit-scrollbar-track {
    border-radius: 8px;
    background: #e9e9e9;
    box-shadow: none;
}

.table-responsive::-webkit-scrollbar-thumb {
    border-radius: 8px;
    border: 3px solid #e9e9e9;
    background-clip: padding-box;
    background-color: #8a8a8a;
    box-shadow: none;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
    background-color: #5c5c5c;
}
