:root {
    --ink: #2f3e46;
    --paper: #f1faee;
    --line: #d7dfd8;
    --gold: #e9c46a;
    --blue: #457b9d;
    --red: #b75d69;
    --green: #3f7d58;
    --white: #ffffff;
    --shadow: 0 18px 50px rgba(47, 62, 70, .14);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-width: 320px;
    background: var(--paper);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    min-height: 44px;
    border: 0;
    cursor: pointer;
}

.app-shell {
    min-height: 100vh;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px clamp(14px, 3vw, 34px);
    background: rgba(241, 250, 238, .94);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(16px);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    color: inherit;
    text-decoration: none;
}

.brand img {
    flex: 0 0 auto;
}

.brand strong,
.brand small {
    display: block;
}

.brand strong {
    font-size: 18px;
    line-height: 1.05;
}

.brand small {
    margin-top: 2px;
    color: rgba(47, 62, 70, .68);
    font-size: 12px;
}

.topbar__status {
    flex: 0 1 auto;
    max-width: 44vw;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
    color: rgba(47, 62, 70, .74);
    font-size: 12px;
    overflow-wrap: anywhere;
}

.workspace {
    padding: 14px clamp(12px, 3vw, 34px) 36px;
}

.summary-strip {
    position: sticky;
    top: 67px;
    z-index: 10;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px;
    overflow: hidden;
    border: 1px solid var(--ink);
    border-radius: 8px;
    background: var(--ink);
    box-shadow: var(--shadow);
}

.summary-strip div {
    min-height: 88px;
    padding: 13px;
    background: var(--ink);
    color: var(--paper);
}

.summary-strip span,
.metric-block span {
    display: block;
    color: rgba(241, 250, 238, .72);
    font-size: 12px;
}

.summary-strip strong,
.metric-block strong {
    display: block;
    margin-top: 8px;
    font-size: clamp(32px, 9vw, 58px);
    line-height: .9;
}

.summary-strip div:nth-child(2) strong {
    color: var(--gold);
}

.summary-strip div:nth-child(3) strong {
    color: #ffddd2;
}

.summary-strip div:nth-child(4) strong {
    color: #a8dadc;
}

.tabs {
    display: flex;
    gap: 8px;
    margin: 14px 0;
    overflow-x: auto;
    scrollbar-width: thin;
}

.tab {
    flex: 0 0 auto;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
    color: rgba(47, 62, 70, .74);
}

.tab.is-active {
    background: var(--gold);
    border-color: #d1a63f;
    color: var(--ink);
    font-weight: 800;
}

.screen {
    display: none;
}

.screen.is-active {
    display: block;
    animation: rise .22s ease-out;
}

.toolbar {
    display: grid;
    gap: 10px;
    margin-bottom: 12px;
}

.search-field,
.select-field,
.feedback-form label {
    display: grid;
    gap: 6px;
    color: rgba(47, 62, 70, .7);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

input,
select,
textarea {
    width: 100%;
    min-height: 48px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
    color: var(--ink);
    padding: 11px 12px;
    outline: none;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(69, 123, 157, .18);
}

.table-wrap {
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
}

.shift-table {
    width: 100%;
    min-width: 920px;
    border-collapse: collapse;
}

th,
td {
    padding: 14px 13px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
}

th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #e5eee4;
    color: rgba(47, 62, 70, .76);
    font-size: 12px;
    text-transform: uppercase;
}

td strong,
td small {
    display: block;
}

td small {
    margin-top: 5px;
    max-width: 260px;
    color: rgba(47, 62, 70, .64);
    line-height: 1.35;
}

.status,
.risk {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 5px 9px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 800;
}

.status--active {
    background: rgba(63, 125, 88, .14);
    color: var(--green);
}

.status--planned {
    background: rgba(69, 123, 157, .14);
    color: var(--blue);
}

.status--review {
    background: rgba(233, 196, 106, .25);
    color: #856015;
}

.risk--stable {
    background: rgba(63, 125, 88, .13);
}

.risk--attention {
    background: rgba(233, 196, 106, .28);
}

.risk--open {
    background: rgba(183, 93, 105, .15);
    color: var(--red);
}

.progress {
    width: 120px;
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: #dfe8df;
}

.progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--blue), var(--gold));
    transition: width .22s ease;
}

.row-action,
.primary-action,
.feedback-form button {
    min-width: 72px;
    padding: 0 14px;
    border-radius: 8px;
    background: var(--ink);
    color: var(--paper);
    font-weight: 800;
}

.row-action:hover,
.primary-action:hover,
.feedback-form button:hover {
    transform: translateY(-1px);
}

.analytics-grid {
    display: grid;
    gap: 10px;
}

.metric-block {
    min-height: 124px;
    padding: 17px;
    border-radius: 8px;
    background: var(--ink);
    color: var(--paper);
}

.metric-block:nth-child(2) {
    background: var(--blue);
}

.metric-block:nth-child(3) {
    background: #64512b;
}

.lane {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

.member-line {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 120px 48px;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, .62);
}

.member-line strong,
.member-line small {
    display: block;
}

.member-line small {
    margin-top: 3px;
    color: rgba(47, 62, 70, .64);
}

meter {
    width: 100%;
}

.import-panel,
.public-board {
    display: grid;
    gap: 14px;
    padding: 18px 0;
    border-bottom: 1px solid var(--line);
}

.import-panel h1,
.public-board h1 {
    margin: 0 0 8px;
    font-size: clamp(24px, 7vw, 44px);
    line-height: 1;
}

.import-panel p,
.public-board p {
    max-width: 680px;
    margin: 0;
    color: rgba(47, 62, 70, .68);
    line-height: 1.5;
}

.feedback-form {
    display: grid;
    gap: 10px;
    margin: 14px 0;
}

.feedback-list {
    display: grid;
    gap: 8px;
}

.feedback-list article,
.public-row {
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
}

.feedback-list p,
.public-row p {
    margin: 7px 0;
    color: rgba(47, 62, 70, .72);
}

.feedback-list small {
    color: var(--blue);
    font-weight: 800;
}

.public-row {
    display: grid;
    gap: 6px;
    margin-top: 10px;
}

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (min-width: 760px) {
    .summary-strip {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .toolbar {
        grid-template-columns: minmax(260px, 1fr) 220px;
        align-items: end;
    }

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

    .import-panel,
    .public-board {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
    }

    .feedback-form {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: end;
    }
}

@media (max-width: 520px) {
    .topbar {
        align-items: flex-start;
    }

    .brand small {
        display: none;
    }

    .topbar__status {
        max-width: 40vw;
        font-size: 11px;
    }

    .summary-strip {
        top: 66px;
    }

    .summary-strip div {
        min-height: 78px;
        padding: 11px;
    }

    .member-line {
        grid-template-columns: minmax(0, 1fr);
    }
}
