:root {
    --brand-red: #a00606;
    --brand-red-deep: #690303;
    --brand-white: #ffffff;
    --brand-black: #111111;
    --brand-grey: #4b4b4b;
    --sand: #f4e8da;
    --sand-soft: #fbf6f0;
    --ink: #151515;
    --line: rgba(21, 21, 21, 0.08);
    --line-strong: rgba(21, 21, 21, 0.16);
    --panel: rgba(255, 255, 255, 0.9);
    --panel-dark: rgba(20, 20, 20, 0.95);
    --success: #2c8c4a;
    --warning: #b56a00;
    --shadow: 0 22px 50px rgba(0, 0, 0, 0.14);
    --radius-xl: 32px;
    --radius-lg: 24px;
    --radius-md: 18px;
    --radius-sm: 14px;
    --container: min(1280px, calc(100vw - 40px));
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: "Poppins", sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at top right, rgba(160, 6, 6, 0.12), transparent 24%),
        linear-gradient(180deg, #fff7f2 0%, #f4ece5 100%);
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    display: block;
    max-width: 100%;
}

button {
    font: inherit;
}

.container {
    width: var(--container);
    margin: 0 auto;
}

.eyebrow {
    margin: 0 0 10px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: rgba(21, 21, 21, 0.56);
}

.section-heading {
    display: grid;
    gap: 14px;
    max-width: 760px;
    margin-bottom: 28px;
}

.section-heading h2,
.panel h3 {
    margin: 0;
    font-family: "Oswald", sans-serif;
    font-size: clamp(34px, 4vw, 52px);
    line-height: 0.98;
    text-transform: uppercase;
}

.section-heading p:last-child,
.panel p,
.cabinet-footer p {
    margin: 0;
    color: rgba(21, 21, 21, 0.72);
    line-height: 1.7;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 18px;
    border: 0;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.button:hover {
    transform: translateY(-1px);
}

.button--solid {
    background: linear-gradient(135deg, var(--brand-red) 0%, var(--brand-red-deep) 100%);
    color: var(--brand-white);
    box-shadow: 0 16px 30px rgba(160, 6, 6, 0.24);
}

.button--soft {
    background: rgba(255, 255, 255, 0.82);
    color: var(--ink);
    box-shadow: inset 0 0 0 1px rgba(21, 21, 21, 0.1);
}

.cabinet-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(251, 246, 240, 0.82);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(21, 21, 21, 0.06);
}

.cabinet-header__inner {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 24px;
    align-items: center;
    min-height: 84px;
}

.brand-lockup {
    display: inline-grid;
    grid-template-columns: auto auto;
    gap: 14px;
    align-items: center;
}

.brand-lockup__logo,
.cabinet-footer__logo {
    width: 124px;
}

.brand-lockup__copy {
    display: grid;
    gap: 4px;
}

.brand-lockup__copy span {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: rgba(21, 21, 21, 0.55);
}

.brand-lockup__copy strong {
    font-family: "Oswald", sans-serif;
    font-size: 24px;
    text-transform: uppercase;
}

.cabinet-nav {
    display: flex;
    justify-content: center;
    gap: 22px;
}

.cabinet-nav a {
    font-size: 14px;
    font-weight: 500;
    color: rgba(21, 21, 21, 0.76);
}

.cabinet-hero,
.workspace-section,
.matrix-section,
.gap-section {
    padding: 34px 0 56px;
}

.cabinet-hero__grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
    gap: 24px;
}

.cabinet-hero__copy,
.cabinet-hero__panel,
.panel,
.module-card,
.gap-card,
.role-card {
    box-shadow: var(--shadow);
}

.cabinet-hero__copy {
    display: grid;
    gap: 18px;
    padding: 34px;
    border-radius: var(--radius-xl);
    background: rgba(255, 255, 255, 0.84);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.cabinet-hero__copy h1,
.role-card h3,
.module-card h3,
.gap-card h3 {
    margin: 0;
    font-family: "Oswald", sans-serif;
    line-height: 0.96;
    text-transform: uppercase;
}

.cabinet-hero__copy h1 {
    font-size: clamp(46px, 6vw, 86px);
}

.cabinet-hero__text {
    margin: 0;
    max-width: 720px;
    color: rgba(21, 21, 21, 0.76);
    line-height: 1.75;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.role-switch {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.role-switch__item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 16px;
    border-radius: 999px;
    background: rgba(21, 21, 21, 0.06);
    color: rgba(21, 21, 21, 0.76);
    box-shadow: inset 0 0 0 1px rgba(21, 21, 21, 0.08);
    transition: transform 180ms ease, background 180ms ease, color 180ms ease;
}

.role-switch__item:hover,
.role-switch__item.is-active {
    transform: translateY(-1px);
    background: linear-gradient(135deg, var(--brand-red) 0%, var(--brand-red-deep) 100%);
    color: var(--brand-white);
}

.cabinet-hero__panel {
    position: relative;
    display: grid;
    gap: 16px;
    align-content: start;
    padding: 30px;
    border-radius: var(--radius-xl);
    background: linear-gradient(180deg, rgba(20, 20, 20, 0.96), rgba(20, 20, 20, 0.92));
    color: var(--brand-white);
    overflow: hidden;
}

.cabinet-hero__panel::after {
    content: "";
    position: absolute;
    right: -40px;
    bottom: -40px;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(160, 6, 6, 0.8), rgba(160, 6, 6, 0) 72%);
    pointer-events: none;
}

.cabinet-hero__panel-label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.58);
}

.cabinet-hero__role {
    font-family: "Oswald", sans-serif;
    font-size: clamp(42px, 4vw, 64px);
    line-height: 0.94;
    text-transform: uppercase;
}

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

.kpi-card {
    padding: 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.kpi-card strong {
    display: block;
    font-family: "Oswald", sans-serif;
    font-size: 34px;
    line-height: 1;
}

.kpi-card span {
    display: block;
    margin-top: 7px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.74);
}

.workspace-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
    gap: 20px;
}

.workspace-main,
.workspace-side {
    display: grid;
    gap: 18px;
    align-content: start;
}

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

.module-card,
.panel,
.gap-card,
.role-card {
    padding: 22px;
    border-radius: var(--radius-lg);
    background: var(--panel);
    border: 1px solid rgba(21, 21, 21, 0.08);
}

.module-card h3,
.gap-card h3,
.role-card h3 {
    font-size: 30px;
}

.module-card p,
.gap-card p,
.role-card p {
    margin: 12px 0 0;
    color: rgba(21, 21, 21, 0.72);
    line-height: 1.7;
}

.module-card__status,
.gap-card__status,
.role-card__label,
.permission-item__status,
.activity-item__time {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    width: fit-content;
    padding: 0 12px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.module-card__status--live,
.permission-item__status--live {
    background: rgba(44, 140, 74, 0.12);
    color: var(--success);
}

.module-card__status--conditional,
.module-card__status--blocked,
.gap-card__status,
.permission-item__status--conditional,
.permission-item__status--blocked {
    background: rgba(181, 106, 0, 0.12);
    color: var(--warning);
}

.role-card__head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: start;
}

.role-card__label {
    background: rgba(160, 6, 6, 0.12);
    color: var(--brand-red);
}

.role-card__badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.role-card__badges span {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(21, 21, 21, 0.06);
    color: rgba(21, 21, 21, 0.65);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.panel h3 {
    font-size: 32px;
}

.permission-list,
.activity-feed {
    display: grid;
    gap: 12px;
    margin-top: 16px;
}

.permission-item,
.activity-item {
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(21, 21, 21, 0.04);
    border: 1px solid rgba(21, 21, 21, 0.08);
}

.permission-item__head,
.activity-item__head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: start;
}

.permission-item strong,
.activity-item strong {
    font-size: 15px;
    line-height: 1.45;
}

.permission-item p,
.activity-item p {
    margin: 8px 0 0;
    color: rgba(21, 21, 21, 0.68);
    line-height: 1.6;
}

.activity-item__time {
    background: rgba(21, 21, 21, 0.08);
    color: rgba(21, 21, 21, 0.58);
}

.matrix-table-wrap {
    overflow: auto;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.matrix-table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(255, 255, 255, 0.92);
}

.matrix-table th,
.matrix-table td {
    padding: 18px 16px;
    border-bottom: 1px solid rgba(21, 21, 21, 0.08);
    text-align: left;
}

.matrix-table th {
    font-size: 12px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(21, 21, 21, 0.54);
    background: rgba(21, 21, 21, 0.02);
}

.matrix-table td {
    font-size: 14px;
    color: rgba(21, 21, 21, 0.74);
}

.matrix-tag {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.matrix-tag--yes {
    background: rgba(44, 140, 74, 0.12);
    color: var(--success);
}

.matrix-tag--conditional {
    background: rgba(181, 106, 0, 0.12);
    color: var(--warning);
}

.matrix-tag--no {
    background: rgba(21, 21, 21, 0.08);
    color: rgba(21, 21, 21, 0.5);
}

.cabinet-footer {
    padding: 0 0 40px;
}

.cabinet-footer__inner {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 24px;
    padding: 28px;
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, rgba(20, 20, 20, 0.95), rgba(20, 20, 20, 0.92));
    color: var(--brand-white);
}

.cabinet-footer__meta p,
.cabinet-footer a {
    color: rgba(255, 255, 255, 0.76);
}

@media (max-width: 1080px) {
    .cabinet-hero__grid,
    .workspace-grid,
    .cabinet-footer__inner {
        grid-template-columns: 1fr;
    }

    .module-grid,
    .gap-grid,
    .roles-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .container {
        width: min(calc(100vw - 28px), 100%);
    }

    .cabinet-header__inner {
        grid-template-columns: 1fr;
        justify-items: start;
        padding: 14px 0;
    }

    .cabinet-nav {
        flex-wrap: wrap;
        justify-content: start;
    }

    .brand-lockup {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .cabinet-hero__copy,
    .cabinet-hero__panel,
    .panel,
    .module-card,
    .gap-card,
    .role-card,
    .cabinet-footer__inner {
        padding: 20px;
    }

    .kpi-grid {
        grid-template-columns: 1fr;
    }

    .matrix-table th,
    .matrix-table td {
        padding: 14px 12px;
    }
}
