:root {
    --bg: #07111d;
    --panel: rgba(8, 27, 45, 0.92);
    --panel-2: rgba(5, 20, 35, 0.96);
    --line: rgba(61, 165, 255, 0.26);
    --line-strong: rgba(0, 213, 255, 0.58);
    --text: #f4f9ff;
    --muted: #a9bfd5;
    --blue: #0b8cff;
    --cyan: #12d8ff;
    --green: #22d36e;
    --amber: #f1b51c;
    --red: #ff4268;
    --violet: #9a5cff;
    font-family: "Segoe UI", Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--text);
    background:
        radial-gradient(circle at 14% -5%, rgba(0, 159, 255, 0.22), transparent 34%),
        radial-gradient(circle at 85% 0%, rgba(154, 92, 255, 0.16), transparent 31%),
        linear-gradient(135deg, #050b14, var(--bg) 45%, #031622);
}

button,
input,
select {
    font: inherit;
}

.report-header {
    min-height: 74px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--line);
    background:
        linear-gradient(90deg, rgba(2, 15, 29, 0.98), rgba(5, 28, 50, 0.94)),
        radial-gradient(circle at 16% 0%, rgba(0, 184, 255, 0.22), transparent 30%);
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.28);
    position: sticky;
    top: 0;
    z-index: 20;
}

.brand-block {
    display: flex;
    align-items: center;
    gap: 13px;
}

.brand-logo {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(45, 174, 255, 0.42);
    background: rgba(3, 16, 29, 0.78);
    box-shadow: 0 0 22px rgba(0, 157, 255, 0.25);
}

.brand-logo img {
    width: 44px;
    height: 44px;
    object-fit: contain;
}

.brand-block h1 {
    margin: 0;
    font-size: 1.24rem;
    letter-spacing: 0;
    text-transform: uppercase;
}

.brand-block p {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 0.84rem;
}

.header-actions,
.filter-actions,
.table-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.session-pill {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 13px;
    border-radius: 9px;
    border: 1px solid rgba(50, 194, 255, 0.28);
    color: #d9f1ff;
    background: rgba(8, 28, 49, 0.88);
    font-size: 0.84rem;
    font-weight: 750;
}

.session-pill::before {
    content: "";
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 14px rgba(34, 211, 110, 0.74);
}

.primary-btn,
.ghost-btn {
    min-height: 38px;
    border-radius: 9px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 0 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 850;
    text-decoration: none;
    cursor: pointer;
}

.primary-btn {
    border-color: rgba(43, 217, 255, 0.58);
    background: linear-gradient(145deg, #0bbdf2, #075bd5);
    box-shadow: 0 0 20px rgba(0, 163, 255, 0.28);
}

.ghost-btn {
    background: rgba(14, 34, 57, 0.82);
}

.ghost-btn:hover,
.primary-btn:hover {
    filter: brightness(1.08);
}

.report-shell {
    padding: 16px;
    display: grid;
    gap: 14px;
}

.filters-panel,
.report-panel {
    border: 1px solid var(--line);
    border-radius: 14px;
    background:
        radial-gradient(circle at 2% 0%, rgba(0, 213, 255, 0.12), transparent 32%),
        linear-gradient(180deg, var(--panel), var(--panel-2));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 16px 34px rgba(0, 0, 0, 0.24);
}

.filters-panel {
    display: grid;
    grid-template-columns: repeat(8, minmax(138px, 1fr));
    gap: 10px;
    padding: 12px;
}

.filter-field {
    display: grid;
    gap: 5px;
    min-width: 0;
}

.filter-field.wide {
    grid-column: span 2;
}

.filter-field.compact {
    max-width: 130px;
}

.filter-field label {
    color: #c9deef;
    font-size: 0.68rem;
    font-weight: 900;
    text-transform: uppercase;
}

.filter-field input,
.filter-field select {
    width: 100%;
    min-height: 38px;
    border: 1px solid rgba(89, 169, 230, 0.25);
    border-radius: 8px;
    color: #ecf7ff;
    background: rgba(2, 14, 27, 0.82);
    padding: 0 10px;
    outline: none;
}

.filter-field input:focus,
.filter-field select:focus {
    border-color: var(--line-strong);
    box-shadow: 0 0 0 2px rgba(0, 213, 255, 0.12);
}

.filter-actions {
    grid-column: span 2;
    align-self: end;
    justify-content: flex-end;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(8, minmax(120px, 1fr));
    gap: 10px;
}

.summary-card {
    min-height: 82px;
    border-radius: 13px;
    border: 1px solid rgba(69, 169, 255, 0.25);
    padding: 12px;
    background:
        radial-gradient(circle at 92% 16%, rgba(36, 149, 255, 0.28), transparent 34%),
        linear-gradient(145deg, rgba(9, 45, 78, 0.96), rgba(4, 21, 39, 0.98));
}

.summary-card.red {
    border-color: rgba(255, 66, 104, 0.38);
    background: radial-gradient(circle at 92% 16%, rgba(255, 66, 104, 0.24), transparent 34%), linear-gradient(145deg, rgba(79, 16, 32, 0.96), rgba(22, 8, 22, 0.98));
}

.summary-card.green {
    border-color: rgba(34, 211, 110, 0.34);
    background: radial-gradient(circle at 92% 16%, rgba(34, 211, 110, 0.24), transparent 34%), linear-gradient(145deg, rgba(12, 73, 43, 0.96), rgba(5, 28, 29, 0.98));
}

.summary-card.amber {
    border-color: rgba(241, 181, 28, 0.36);
    background: radial-gradient(circle at 92% 16%, rgba(241, 181, 28, 0.26), transparent 34%), linear-gradient(145deg, rgba(92, 56, 7, 0.96), rgba(30, 20, 7, 0.98));
}

.summary-card.violet {
    border-color: rgba(154, 92, 255, 0.38);
    background: radial-gradient(circle at 92% 16%, rgba(154, 92, 255, 0.25), transparent 34%), linear-gradient(145deg, rgba(57, 28, 93, 0.96), rgba(19, 13, 39, 0.98));
}

.summary-card span {
    display: block;
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 900;
    text-transform: uppercase;
}

.summary-card strong {
    display: block;
    margin-top: 5px;
    color: #fff;
    font-size: 1.55rem;
    line-height: 1;
}

.report-panel {
    overflow: hidden;
}

.report-toolbar {
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
}

.tabs {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
}

.tab-btn {
    min-height: 36px;
    border: 1px solid rgba(89, 169, 230, 0.22);
    border-radius: 9px;
    color: #d7ebff;
    background: rgba(7, 24, 43, 0.82);
    padding: 0 12px;
    font-weight: 850;
    cursor: pointer;
}

.tab-btn.active {
    color: #fff;
    border-color: rgba(0, 213, 255, 0.62);
    background: linear-gradient(145deg, #0b8cff, #074ab2);
    box-shadow: 0 0 18px rgba(0, 157, 255, 0.28);
}

#resultLabel {
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 750;
}

.table-wrap {
    height: calc(100vh - 318px);
    min-height: 360px;
    overflow: auto;
}

.report-table {
    width: 100%;
    min-width: 1180px;
    border-collapse: collapse;
}

.report-table th,
.report-table td {
    border-bottom: 1px solid rgba(74, 139, 198, 0.18);
    padding: 9px 10px;
    text-align: left;
    vertical-align: top;
}

.report-table th {
    position: sticky;
    top: 0;
    z-index: 4;
    color: #cfe8ff;
    background: #071a2e;
    font-size: 0.68rem;
    text-transform: uppercase;
    white-space: nowrap;
}

.report-table td {
    color: #edf7ff;
    font-size: 0.78rem;
    line-height: 1.32;
}

.report-table tbody tr:hover td {
    background: rgba(0, 154, 255, 0.08);
}

.nowrap {
    white-space: nowrap;
}

.status-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 23px;
    padding: 0 8px;
    border-radius: 999px;
    background: rgba(91, 133, 180, 0.18);
    color: #d9eaff;
    font-size: 0.66rem;
    font-weight: 900;
    text-transform: uppercase;
}

.status-chip::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

.status-chip.danger {
    color: #ff6582;
    background: rgba(255, 66, 104, 0.12);
}

.status-chip.ok {
    color: #38e986;
    background: rgba(34, 211, 110, 0.12);
}

.status-chip.warn {
    color: #ffc642;
    background: rgba(241, 181, 28, 0.12);
}

.detail-btn {
    border: 1px solid rgba(0, 213, 255, 0.42);
    border-radius: 8px;
    color: #dff7ff;
    background: rgba(7, 40, 68, 0.94);
    padding: 6px 10px;
    font-size: 0.72rem;
    font-weight: 850;
    cursor: pointer;
}

.detail-row td {
    padding: 0;
    background: rgba(2, 13, 24, 0.82);
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(180px, 1fr));
    gap: 8px;
    padding: 12px;
}

.detail-item {
    border: 1px solid rgba(89, 169, 230, 0.16);
    border-radius: 9px;
    padding: 8px;
    background: rgba(5, 24, 42, 0.8);
}

.detail-item span {
    display: block;
    color: #87a7c4;
    font-size: 0.63rem;
    font-weight: 900;
    text-transform: uppercase;
}

.detail-item strong {
    display: block;
    margin-top: 4px;
    color: #f8fbff;
    font-size: 0.76rem;
    line-height: 1.32;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.empty-state,
.loading-state {
    min-height: 280px;
    display: grid;
    place-items: center;
    color: var(--muted);
    font-weight: 800;
}

@media (max-width: 1380px) {
    .filters-panel {
        grid-template-columns: repeat(4, minmax(150px, 1fr));
    }

    .summary-grid {
        grid-template-columns: repeat(4, minmax(130px, 1fr));
    }

    .detail-grid {
        grid-template-columns: repeat(2, minmax(180px, 1fr));
    }
}

@media (max-width: 820px) {
    .report-header,
    .report-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .filters-panel,
    .summary-grid {
        grid-template-columns: 1fr;
    }

    .filter-field.wide,
    .filter-actions {
        grid-column: auto;
    }

    .table-wrap {
        height: 62vh;
    }
}

@media print {
    body {
        background: #fff;
        color: #000;
    }

    .report-header,
    .filters-panel,
    .tabs,
    .table-actions {
        display: none;
    }

    .report-shell {
        padding: 0;
    }

    .report-panel,
    .summary-card {
        border: 1px solid #999;
        box-shadow: none;
        background: #fff;
        color: #000;
    }

    .table-wrap {
        height: auto;
        overflow: visible;
    }

    .report-table th,
    .report-table td {
        color: #000;
        background: #fff;
    }
}
