:root {
    color-scheme: light;
    --bg: #f6f8fb;
    --surface: #ffffff;
    --surface-muted: #eef3f8;
    --text: #172033;
    --text-muted: #61708a;
    --border: #d8e1ec;
    --accent: #1677ff;
    --accent-soft: #e8f1ff;
    --danger: #b42318;
    --warning: #a15c00;
    --shadow: 0 10px 30px rgba(21, 35, 56, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.5;
}

.page {
    width: 95%;
    margin: 0 auto;
    padding: 32px 0;
}

.topbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
}

h1 {
    margin: 0;
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    line-height: 1.1;
    letter-spacing: 0;
}

.subtitle {
    margin: 8px 0 0;
    color: var(--text-muted);
    font-size: 0.98rem;
}

.actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.button {
    display: inline-block;
    text-align: center;
    min-height: 40px;
    padding: 0 14px;
    border-radius: 8px;
    background: var(--accent);
    color: #ffffff;
    font-size: 0.92rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.filter {
    width: 100px;
}

.user-badge {
    max-width: 260px;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text-muted);
    font-size: 0.9rem;
    overflow-wrap: anywhere;
}

.metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}

.metric {
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.metric span {
    display: block;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.metric strong {
    display: block;
    margin-top: 6px;
    font-size: 1.35rem;
    line-height: 1.2;
}

.status {
    padding: 32px;
    border: 1px dashed var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text-muted);
    text-align: center;
}

.status.error {
    border-color: #f0b8b2;
    background: #fff4f2;
    color: var(--danger);
}

.content-layout {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.filter-panel,
.list-controls,
.pagination {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.filter-panel {
    position: sticky;
    top: 18px;
    padding: 16px;
}

.filter-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.filter-panel h2 {
    margin: 0;
    font-size: 1rem;
    letter-spacing: 0;
}

.filter-form {
    display: grid;
    gap: 14px;
}

.control {
    display: grid;
    gap: 6px;
}

.control span,
.page-size span {
    color: var(--text-muted);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.control input,
.control select,
.page-size select {
    width: 100%;
    min-height: 40px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    font: inherit;
}

.filter-message {
    min-height: 20px;
    margin: 0;
    color: var(--warning);
    font-size: 0.86rem;
}

.sessions-panel {
    min-width: 0;
}

.list-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-bottom: 12px;
    padding: 12px;
}

.secondary-button,
.text-button {
    min-height: 36px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
}

.secondary-button {
    padding: 0 12px;
}

.text-button {
    min-height: 32px;
    padding: 0 8px;
    border-color: transparent;
    color: var(--accent);
}

.secondary-button:disabled {
    cursor: not-allowed;
    opacity: 0.48;
}

.page-size {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.page-size select {
    width: 76px;
}

.session-table {
    width: 100%;
    min-width: 880px;
    border: 1px solid var(--border);
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.session-table th,
.session-table td {
    padding: 13px 14px;
    border-bottom: 1px solid var(--surface-muted);
    text-align: left;
    vertical-align: top;
}

.session-table th {
    background: var(--surface-muted);
    color: var(--text-muted);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
}

.session-table tr:last-child td {
    border-bottom: 0;
}

.session-table td {
    color: var(--text);
    font-size: 0.88rem;
    overflow-wrap: anywhere;
}

.table-sort {
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    letter-spacing: inherit;
    text-transform: inherit;
    cursor: pointer;
}

.table-sort.active {
    color: var(--accent);
}

.session-title {
    min-width: 0;
}

.session-title strong {
    display: block;
    margin-bottom: 4px;
    font-size: 1rem;
    line-height: 1.25;
    letter-spacing: 0;
}

.session-title span,
.session-table td > span:not(.badge) {
    display: block;
    color: var(--text-muted);
    overflow-wrap: anywhere;
}

.session-table td:last-child span {
    font-family: "Courier New", monospace;
    font-size: 0.82rem;
}

.badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    max-width: 100%;
    padding: 4px 9px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.badge.empty {
    background: #fff5e8;
    color: var(--warning);
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-top: 12px;
    padding: 12px;
}

.pagination span {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 700;
}

@media (max-width: 860px) {
    .topbar {
        display: block;
    }

    .actions {
        margin-top: 16px;
        justify-content: space-between;
    }

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

    .content-layout {
        grid-template-columns: 1fr;
    }

    .filter-panel {
        position: static;
    }

    .sessions-panel {
        overflow-x: auto;
    }
}

@media (max-width: 560px) {
    .page {
        width: min(100% - 24px, 1180px);
        padding: 20px 0;
    }

    .actions,
    .list-controls,
    .metrics {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .list-controls {
        display: grid;
    }

    .page-size {
        justify-content: space-between;
    }
}

.separator {
    display: inline-block;
    width: 100%;
    height: 1px;
    background: var(--border);
}