:root {
    color-scheme: light;
    --bg: #f3f5f7;
    --panel: #ffffff;
    --line: #d7dce3;
    --text: #172033;
    --muted: #657083;
    --accent: #126a66;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    display: grid;
    grid-template-columns: 220px 1fr;
    background: var(--bg);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
}

.sidebar {
    background: #16202f;
    color: #ffffff;
    padding: 18px 14px;
}

.brand {
    display: grid;
    gap: 4px;
    margin-bottom: 24px;
}

.brand span {
    color: #b9c3d0;
    font-size: 0.82rem;
}

nav {
    display: grid;
    gap: 6px;
}

nav a {
    color: #e8edf4;
    text-decoration: none;
    padding: 9px 10px;
    border-radius: 6px;
}

nav a:hover {
    background: #243348;
}

.content {
    padding: 24px;
    overflow: auto;
}

.back-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #ffffff;
    color: var(--text);
    font-weight: 700;
    padding: 8px 12px;
    margin-bottom: 14px;
    cursor: pointer;
}

.back-button:hover {
    background: #edf2f6;
}

.page-header {
    margin-bottom: 18px;
}

h1 {
    margin: 0 0 4px;
    font-size: 1.6rem;
}

h2 {
    margin: 24px 0 10px;
    font-size: 1.1rem;
}

p {
    color: var(--muted);
    margin: 0;
}

.metrics {
    display: grid;
    grid-template-columns: repeat(6, minmax(120px, 1fr));
    gap: 10px;
    margin-bottom: 22px;
}

.metrics div {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
}

.metrics span {
    display: block;
    color: var(--muted);
    font-size: 0.82rem;
}

.metrics strong {
    display: block;
    margin-top: 4px;
    font-size: 1.45rem;
}

.grid-two {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.config-block {
    margin: 0 0 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    padding: 14px;
}

.config-block pre {
    margin: 0;
    white-space: pre-wrap;
    font: 0.92rem/1.45 Consolas, "Courier New", monospace;
    color: var(--text);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: visible;
}

th,
td {
    border-bottom: 1px solid var(--line);
    padding: 9px 10px;
    text-align: left;
    vertical-align: top;
    font-size: 0.9rem;
}

th {
    background: #e9edf2;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0;
    color: #3c4656;
}

.row-number-column,
.row-number-cell {
    width: 42px;
    min-width: 42px;
    max-width: 42px;
    padding-left: 6px;
    padding-right: 6px;
    text-align: center;
    white-space: nowrap;
}

.compact-number-column {
    width: 64px;
    min-width: 64px;
    max-width: 64px;
    padding-left: 6px;
    padding-right: 6px;
    text-align: center;
    white-space: nowrap;
}

.sortable-column {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.sortable-column span:first-child {
    margin-right: 6px;
}

.sort-indicator {
    color: var(--accent);
    font-size: 0.72rem;
}

.table-filter-row th {
    background: #f7f9fb;
    padding: 6px;
}

.table-filter-row .row-number-column {
    padding-left: 4px;
    padding-right: 4px;
}

.table-filter-row .compact-number-column {
    padding-left: 4px;
    padding-right: 4px;
}

.table-filter-row .compact-number-column input {
    min-width: 44px;
    padding-left: 4px;
    padding-right: 4px;
}

.table-filter-row input {
    width: 100%;
    min-width: 74px;
    border: 1px solid var(--line);
    border-radius: 5px;
    padding: 6px 7px;
    font-family: inherit;
    font-size: 0.78rem;
    text-transform: none;
}

.table-select {
    width: 100%;
    min-width: 96px;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: #ffffff;
    color: var(--text);
    padding: 6px 7px;
    font: inherit;
}

.table-action {
    border: 0;
    border-radius: 5px;
    background: var(--accent);
    color: #ffffff;
    cursor: pointer;
    font-weight: 700;
    padding: 7px 10px;
}

.table-action:hover {
    filter: brightness(0.94);
}

.inline-dropdown {
    position: relative;
    width: max-content;
    max-width: 220px;
}

.inline-dropdown summary {
    cursor: pointer;
    color: var(--accent);
    font-weight: 700;
}

.inline-dropdown-menu {
    position: absolute;
    z-index: 20;
    min-width: 180px;
    max-height: 220px;
    overflow: auto;
    margin-top: 6px;
    padding: 6px 0;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #ffffff;
    box-shadow: 0 8px 20px rgba(23, 32, 51, 0.14);
}

.inline-dropdown-menu div {
    padding: 7px 10px;
    white-space: nowrap;
}

.inline-dropdown-menu div:hover {
    background: #f0f7f6;
}

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

.detail-row td {
    background: #fbfcfd;
    color: var(--muted);
    font-size: 0.86rem;
}

.clickable-row {
    cursor: pointer;
}

.clickable-row:hover td {
    background: #f0f7f6;
}

a {
    color: var(--accent);
    font-weight: 700;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.search {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
}

.search input {
    width: min(360px, 100%);
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    font-size: 0.95rem;
}

.search button {
    border: 0;
    border-radius: 6px;
    padding: 10px 14px;
    background: var(--accent);
    color: #ffffff;
    font-weight: 700;
}

@media (max-width: 980px) {
    body {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
    }

    nav {
        grid-template-columns: repeat(5, max-content);
        overflow: auto;
    }

    .metrics,
    .grid-two {
        grid-template-columns: 1fr;
    }
}
