:root {
    --bg: #f5f7f4;
    --panel: #ffffff;
    --ink: #17211f;
    --muted: #64736d;
    --line: #d8e0dc;
    --accent: #16745f;
    --accent-dark: #0d4f43;
    --warn: #a15c13;
    --danger: #b3261e;
    --shadow: 0 10px 28px rgba(25, 37, 33, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 15px;
    letter-spacing: 0;
}

a {
    color: var(--accent-dark);
}

.topbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    padding: 22px 28px;
    background: #ffffff;
    border-bottom: 1px solid var(--line);
}

.topbar h1 {
    margin: 0;
    font-size: 28px;
}

.topbar p {
    margin: 6px 0 0;
    color: var(--muted);
}

.target-note {
    max-width: 380px;
    padding: 10px 12px;
    border-left: 3px solid var(--accent);
    color: var(--muted);
    line-height: 1.4;
}

.workspace {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 18px;
    padding: 18px;
    align-items: start;
}

.sidebar,
.content {
    display: grid;
    gap: 18px;
}

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

.panel h2,
.panel h3 {
    margin: 0 0 12px;
}

.panel h2 {
    font-size: 18px;
}

.panel h3 {
    font-size: 14px;
    color: var(--muted);
}

.profile {
    display: grid;
    gap: 4px;
    margin: 12px 0;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #f8fbf9;
}

.profile span,
.muted {
    color: var(--muted);
}

label {
    display: grid;
    gap: 6px;
    margin-bottom: 10px;
    font-weight: 700;
    color: #31413c;
}

input,
select,
textarea {
    width: 100%;
    min-height: 38px;
    border: 1px solid #b8c5c0;
    border-radius: 6px;
    padding: 8px 10px;
    font: inherit;
    background: #ffffff;
    color: var(--ink);
}

textarea {
    min-height: 76px;
    resize: vertical;
}

button,
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    border: 1px solid var(--accent);
    border-radius: 6px;
    padding: 8px 12px;
    background: var(--accent);
    color: #ffffff;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.button.secondary,
button.secondary {
    background: #ffffff;
    color: var(--accent-dark);
}

.button.disabled {
    pointer-events: none;
    opacity: 0.45;
}

.button-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.inline-link {
    margin-top: 10px;
}

.checkbox-line {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 400;
}

.checkbox-line input {
    width: 18px;
    min-height: 18px;
}

.plain-list {
    margin: 0;
    padding-left: 18px;
    color: var(--muted);
    line-height: 1.45;
}

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

.metric {
    min-height: 96px;
    display: grid;
    gap: 8px;
    align-content: center;
    padding: 14px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.metric span {
    color: var(--muted);
    font-size: 13px;
}

.metric strong {
    font-size: 24px;
    line-height: 1.1;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
    gap: 18px;
}

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

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 9px;
    border-radius: 14px;
    background: #e7f2ee;
    color: var(--accent-dark);
    font-weight: 700;
    white-space: nowrap;
}

.progress {
    height: 10px;
    background: #e2e8e5;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 16px;
}

.progress span {
    display: block;
    width: 0;
    height: 100%;
    background: var(--accent);
    transition: width 180ms ease;
}

.split {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(260px, 0.9fr);
    gap: 16px;
}

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

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

th {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
}

.warning-list {
    display: grid;
    gap: 10px;
}

.warning-list div {
    display: grid;
    grid-template-columns: 54px 1fr;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fbfaf6;
}

.warning-list strong {
    color: var(--warn);
    font-size: 22px;
}

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

.compact-form label {
    margin-bottom: 0;
}

.result-box {
    margin-top: 12px;
    min-height: 58px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #f8fbf9;
    color: var(--muted);
}

.result-box strong,
.result-box span {
    display: block;
}

.priority-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(120px, 1fr));
    gap: 10px;
}

.priority-grid div {
    min-height: 72px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #f8fbf9;
    color: #31413c;
}

.toast {
    position: fixed;
    right: 18px;
    bottom: 18px;
    max-width: 360px;
    padding: 12px 14px;
    border-radius: 6px;
    background: var(--accent-dark);
    color: #ffffff;
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
    transition: opacity 150ms ease, transform 150ms ease;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.error {
    background: var(--danger);
}

@media (max-width: 1180px) {
    .workspace,
    .dashboard-grid,
    .split {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 700px) {
    .topbar {
        display: grid;
        padding: 16px;
    }

    .workspace {
        padding: 12px;
    }

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

    .section-head {
        align-items: flex-start;
        flex-direction: column;
    }

    th,
    td {
        font-size: 13px;
        padding: 8px 6px;
    }
}
