* {
    box-sizing: border-box;
}

.controls {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem;
    padding: 1rem;
    background: #26272d;
    border: 1px solid #33343a;
    border-radius: 8px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

input, select, button {
    font-family: inherit;
    font-size: 0.85rem;
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    border: 1px solid #44454d;
    background: #1e1f24;
    color: #e6e6e6;
}

button {
    cursor: pointer;
    background: #1f6f43;
    border-color: #1f6f43;
    color: #d6ffe9;
    font-weight: 600;
}

button:hover {
    background: #248150;
}

/* Chart.js measures a canvas against its immediate parent, so that parent
   exists purely to be measured: no padding of its own, a definite height,
   and the canvas as its only child. */
.chart-canvas {
    position: relative;
    height: 18rem;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

th.sortable {
    cursor: pointer;
    user-select: none;
}

th.sortable:hover {
    color: #ccc;
}

th.sortable.active {
    color: #e6e6e6;
}

th.sortable .arrow {
    color: #7ee0a3;
    margin-left: 0.3rem;
}

td.num, th.num {
    text-align: right;
}

.table-box.scroll {
    max-height: 26rem;
    overflow-y: auto;
}

tbody tr.slow {
    background: #3a1f1f66;
}

tbody tr.slow td:first-child {
    box-shadow: inset 3px 0 0 #ff8080;
}

.uuid {
    font-family: ui-monospace, Consolas, monospace;
    color: #9ecbff;
    font-size: 0.78rem;
}

.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.7rem;
    border: 1px solid #44454d;
    border-radius: 999px;
    font-size: 0.78rem;
    cursor: pointer;
    color: #ccc;
}

.chip input {
    padding: 0;
    width: auto;
}

.stat-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}

.stat {
    flex: 1;
    min-width: 10rem;
    background: #26272d;
    border: 1px solid #33343a;
    border-radius: 8px;
    padding: 0.9rem 1rem;
}

.stat .label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #888;
}

.stat .value {
    font-size: 1.3rem;
    font-weight: 600;
    margin-top: 0.2rem;
}

.message {
    padding: 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-top: 1rem;
}

.note {
    padding: 0.7rem 0.9rem;
    border-radius: 8px;
    background: #24211a;
    border-left: 2px solid #6f5a1f;
    color: #ffe9b0;
    font-size: 0.78rem;
    line-height: 1.5;
    margin-bottom: 1.5rem;
}

.events {
    max-height: 12rem;
    overflow-y: auto;
}

@media (max-width: 1000px) {
    .grid-2 {
        grid-template-columns: 1fr;
    }
}
