﻿:root {
    color-scheme: light;
    --bg: #f6f7f9;
    --panel: #ffffff;
    --text: #17202a;
    --muted: #667085;
    --line: #d9dee7;
    --accent: #2563eb;
    --ready: #0f766e;
    --warning: #b45309;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-width: 320px;
    background: var(--bg);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
}

.page {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 32px 0;
}

.topbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}

h1 {
    margin: 0 0 8px;
    font-size: 32px;
    line-height: 1.1;
}

p {
    margin: 0;
}

.topbar p,
.summary span,
.source,
small {
    color: var(--muted);
}

.mode,
.status {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.mode {
    color: var(--accent);
    background: #dbeafe;
}

.message-form {
    display: grid;
    gap: 14px;
    margin-bottom: 18px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

.form-row {
    display: grid;
    grid-template-columns: minmax(220px, 360px);
    gap: 12px;
}

label {
    display: grid;
    gap: 7px;
    font-weight: 700;
}

label span {
    font-size: 14px;
}

select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #ffffff;
    color: var(--text);
    font: inherit;
}

select {
    min-height: 40px;
    padding: 8px 10px;
}

textarea {
    min-height: 150px;
    padding: 10px;
    resize: vertical;
}

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

button,
.form-actions a {
    min-height: 38px;
    padding: 9px 14px;
    border-radius: 6px;
    font: inherit;
    font-weight: 700;
}

button {
    border: 0;
    background: var(--accent);
    color: #ffffff;
    cursor: pointer;
}

.form-actions a {
    display: inline-flex;
    align-items: center;
    color: var(--muted);
    text-decoration: none;
}

.mode-note {
    margin-bottom: 18px;
    padding: 12px 14px;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    background: #eff6ff;
    color: #1d4ed8;
    font-weight: 700;
}

.summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

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

.summary strong {
    display: block;
    margin-bottom: 4px;
    font-size: 26px;
}

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

table {
    width: 100%;
    min-width: 980px;
    border-collapse: collapse;
}

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

th {
    color: #344054;
    background: #eef2f7;
    font-size: 13px;
}

th[colspan],
th[rowspan] {
    text-align: center;
}

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

td p {
    margin: 4px 0 0;
    line-height: 1.45;
}

small {
    display: block;
    margin-top: 8px;
}

.ready {
    color: var(--ready);
    background: #ccfbf1;
}

.warning {
    color: var(--warning);
    background: #fef3c7;
}

.section-head {
    margin: 24px 0 10px;
}

.section-head h2 {
    margin: 0 0 4px;
    font-size: 20px;
}

.section-head p {
    color: var(--muted);
}

.empty {
    margin-bottom: 18px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    color: var(--muted);
}

.ready-list {
    margin-top: 22px;
}

.ready-list > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    cursor: pointer;
    font-weight: 700;
}

.ready-list > summary strong {
    color: var(--ready);
}

.message-details summary {
    color: var(--accent);
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
}

.message-details p {
    margin-top: 8px;
    white-space: pre-wrap;
}

@media (max-width: 720px) {
    .page {
        width: min(100% - 20px, 1180px);
        padding: 20px 0;
    }

    .topbar,
    .summary {
        grid-template-columns: 1fr;
        flex-direction: column;
    }

    h1 {
        font-size: 26px;
    }
}

.small-button {
    min-height: 32px;
    margin: 2px 0;
    padding: 6px 10px;
    border: 0;
    border-radius: 6px;
    background: var(--accent);
    color: #ffffff;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
}

.save-button {
    background: var(--ready);
}

.muted-button {
    background: #e5e7eb;
    color: var(--text);
}

.edit-input {
    width: 100%;
    min-height: 34px;
    padding: 6px 8px;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--text);
    font: inherit;
}

.number-input {
    max-width: 76px;
}

.position-input {
    min-width: 180px;
}

.draft-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
}

#save-draft-button {
    min-height: 38px;
    padding: 9px 14px;
    border: 0;
    border-radius: 6px;
    background: var(--ready);
    color: #ffffff;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
}

#save-draft-button:disabled {
    cursor: wait;
    opacity: 0.7;
}

#save-draft-status {
    color: var(--muted);
    font-weight: 700;
}

.saved-drafts {
    display: grid;
    gap: 10px;
}

.saved-draft {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

.saved-draft > summary {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    cursor: pointer;
    font-weight: 700;
}

.saved-draft em {
    padding: 5px 8px;
    border-radius: 6px;
    background: #fef3c7;
    color: var(--warning);
    font-style: normal;
    font-size: 13px;
}

.saved-meta {
    padding: 0 16px 12px;
    color: var(--muted);
    font-weight: 700;
}

.saved-table {
    margin: 0 16px 16px;
}

.confirm-button {
    background: var(--ready);
}

.confirmed-note,
.confirmed-status {
    color: var(--ready);
    font-weight: 700;
}

.saved-status-title {
    margin: 18px 0 4px;
    color: #344054;
    font-size: 16px;
}

.saved-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.reject-button {
    background: #b42318;
}

.delete-button {
    background: #b42318;
}

.vector-preview-button {
    background: #475467;
}

.vector-publish-button {
    background: var(--ready);
}

.vector-preview {
    margin: 0 16px 12px;
    padding: 12px;
    overflow-x: auto;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    background: #eff6ff;
    color: #1e3a8a;
    white-space: pre-wrap;
    font: 13px/1.5 Consolas, "Courier New", monospace;
}

.rejected-note {
    color: #b42318;
    font-weight: 700;
}

.published-note {
    color: var(--ready);
    font-weight: 700;
}

.status-отклонён {
    opacity: 0.72;
}

.workflow-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

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

.workflow-summary strong {
    display: block;
    margin-bottom: 4px;
    font-size: 26px;
}

.workflow-summary span {
    color: var(--muted);
}

.main-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin-top: 10px;
}

.clear-working-drafts-button {
    flex: 0 0 auto;
}

.main-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.bulk-vector-preview {
    margin: 0 0 18px;
}

.publication-history {
    margin-top: 32px;
}

.manual-check {
    margin-top: 28px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

.manual-check > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    cursor: pointer;
    font-weight: 700;
}

.manual-check > summary strong {
    color: var(--muted);
    font-size: 13px;
}

.manual-check .message-form,
.manual-check .mode-note,
.manual-check .manual-grid,
.manual-check .ready-list {
    margin-left: 18px;
    margin-right: 18px;
}

.manual-grid {
    display: grid;
    gap: 18px;
    padding-bottom: 18px;
}

@media (max-width: 720px) {
    .workflow-summary {
        grid-template-columns: 1fr;
    }

    .manual-check > summary {
        align-items: flex-start;
        flex-direction: column;
    }

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