:root {
    --rex-red: #E30613;
    --rex-ink: #111827;
    --rex-muted: #6b7280;
    --rex-line: #e6e8ee;
    --rex-soft: #f6f7f9;
    --rex-success: #15803d;
    --rex-danger: #b91c1c;
    --rex-warning: #f59e0b;
    --rex-radius: 8px;
    --rex-shadow: 0 18px 48px rgba(17, 24, 39, .05);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--rex-soft);
    color: var(--rex-ink);
}

a {
    color: var(--primary, var(--rex-red));
    font-weight: 800;
    text-decoration: none;
}

.rx-grid {
    display: grid;
    gap: 18px;
}

.layout {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 246px 1fr;
}

.layout aside {
    background: #fff;
    border-right: 1px solid #e5e7eb;
    padding: 24px 18px;
}

.logo,
.mark {
    width: 44px;
    height: 44px;
    border-radius: var(--rex-radius);
    background: var(--primary, var(--rex-red));
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 900;
}

.logo {
    margin-bottom: 28px;
}

nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border-radius: var(--rex-radius);
    color: #4b5563;
    text-decoration: none;
    font-weight: 650;
    margin-bottom: 4px;
}

nav a.active,
nav a:hover {
    background: color-mix(in srgb, var(--primary, var(--rex-red)), white 90%);
    color: var(--primary, var(--rex-red));
}

main {
    padding: 30px clamp(22px, 4vw, 52px);
}

header {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    margin-bottom: 24px;
}

h1 {
    margin: 0;
    letter-spacing: 0;
}

.muted {
    color: var(--rex-muted);
}

.grid {
    display: grid;
    gap: 18px;
}

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

.form-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(160px, 1fr));
    gap: 12px;
    align-items: end;
}

.form-grid.wide {
    grid-template-columns: 1.3fr 1fr 1fr 1fr auto;
}

.field label,
label {
    display: block;
    color: var(--rex-muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-bottom: 6px;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid #d9dde6;
    border-radius: var(--rex-radius);
    padding: 9px 10px;
    color: var(--rex-ink);
    background: #fff;
}

input[type="color"] {
    width: 44px;
    min-width: 44px;
    height: 38px;
    padding: 4px;
}

input[type="checkbox"] {
    width: 16px;
    height: 16px;
}

.checkline,
.checks {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.checkline label,
.checks label {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    color: #374151;
    font-size: 13px;
    font-weight: 800;
}

.rx-card,
.rx-panel,
.card {
    background: #fff;
    border: 1px solid var(--rex-line);
    border-radius: var(--rex-radius);
    box-shadow: var(--rex-shadow);
}

.rx-card,
.card {
    padding: 20px;
}

.rx-muted {
    color: var(--rex-muted);
}

.rx-button {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: var(--rex-radius);
    background: var(--primary, var(--rex-red));
    color: #fff;
    padding: 0 14px;
    font-weight: 800;
    cursor: pointer;
    text-decoration: none;
}

.button {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: var(--rex-radius);
    background: var(--primary, var(--rex-red));
    color: #fff;
    padding: 0 14px;
    font-weight: 800;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}

.rx-button.secondary {
    background: #fff;
    color: var(--rex-ink);
    border: 1px solid #e5e7eb;
}

.button.secondary {
    background: #fff;
    color: var(--rex-ink);
    border: 1px solid #e5e7eb;
}

.rx-button.danger {
    background: #fee2e2;
    color: var(--rex-danger);
}

.button.danger {
    background: #fee2e2;
    color: var(--rex-danger);
}

.rx-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: var(--rex-radius);
    font-weight: 800;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: var(--rex-radius);
    font-weight: 800;
}

.rx-badge.ok {
    background: #dcfce7;
    color: var(--rex-success);
}

.badge.ok,
.ok {
    background: #dcfce7;
    color: var(--rex-success);
}

.rx-badge.fail,
.rx-badge.blocked {
    background: #fee2e2;
    color: var(--rex-danger);
}

.badge.fail,
.badge.blocked,
.blocked,
.fail {
    background: #fee2e2;
    color: var(--rex-danger);
}

.badge.custom {
    background: color-mix(in srgb, var(--chip), white 84%);
    color: var(--chip);
}

.rx-table {
    width: 100%;
    border-collapse: collapse;
}

.rx-table,
table {
    width: 100%;
    border-collapse: collapse;
}

.rx-table th,
.rx-table td {
    text-align: left;
    padding: 13px 10px;
    border-bottom: 1px solid #eef0f4;
    font-size: 14px;
}

.rx-table th,
.rx-table td,
th,
td {
    text-align: left;
    padding: 13px 10px;
    border-bottom: 1px solid #eef0f4;
    font-size: 14px;
}

.rx-table th {
    color: var(--rex-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.rx-table th,
th {
    color: var(--rex-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.rx-flash {
    margin-bottom: 18px;
    padding: 12px 14px;
    border-radius: var(--rex-radius);
    background: #dcfce7;
    color: var(--rex-success);
    font-weight: 800;
}

.rx-errors {
    margin-bottom: 18px;
    padding: 12px 14px;
    border-radius: var(--rex-radius);
    background: #fee2e2;
    color: var(--rex-danger);
    font-weight: 800;
}

.rx-track {
    height: 11px;
    border-radius: 99px;
    background: #eef0f4;
    overflow: hidden;
}

.track {
    height: 11px;
    border-radius: 99px;
    background: #eef0f4;
    overflow: hidden;
}

.rx-fill {
    height: 100%;
    border-radius: inherit;
    background: var(--primary, var(--rex-red));
    animation: rx-grow .75s ease both;
}

.fill {
    height: 100%;
    border-radius: inherit;
    background: var(--primary, var(--rex-red));
    animation: rx-grow .75s ease both;
}

@keyframes rx-grow {
    from {
        transform: scaleX(.2);
        opacity: .5;
        transform-origin: left;
    }

    to {
        transform: scaleX(1);
        opacity: 1;
        transform-origin: left;
    }
}

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

    .layout aside {
        border-right: 0;
        border-bottom: 1px solid #e5e7eb;
    }

    nav {
        display: flex;
        flex-wrap: wrap;
    }

    .form-grid,
    .form-grid.wide {
        grid-template-columns: 1fr;
    }

    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .rx-responsive-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}
