/* RADKON TT Commons Classic */

@font-face {
    font-family: "TT Commons Classic";
    src: url("./fonts/TT_Commons_Classic_Regular.woff2") format("woff2");
    font-style: normal;
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: "TT Commons Classic";
    src: url("./fonts/TT_Commons_Classic_Medium.woff2") format("woff2");
    font-style: normal;
    font-weight: 500;
    font-display: swap;
}

@font-face {
    font-family: "TT Commons Classic";
    src: url("./fonts/TT_Commons_Classic_DemiBold.woff2") format("woff2");
    font-style: normal;
    font-weight: 600;
    font-display: swap;
}

@font-face {
    font-family: "TT Commons Classic";
    src: url("./fonts/TT_Commons_Classic_Bold.woff2") format("woff2");
    font-style: normal;
    font-weight: 700;
    font-display: swap;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f5f6f8;
    color: #1c1c1c;
}

.sidebar {
    position: fixed;
    width: 240px;
    height: 100vh;
    background: #111827;
    padding: 32px 20px;
}

.logo {
    color: white;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 45px;
}

nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

nav a {
    text-decoration: none;
    color: #9ca3af;
    padding: 12px 14px;
    border-radius: 8px;
}

nav a:hover,
nav a.active {
    background: #1f2937;
    color: white;
}

main {
    margin-left: 240px;
    padding: 40px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

h1 {
    margin: 0;
    font-size: 32px;
}

header p {
    color: #6b7280;
    margin-top: 8px;
}

button {
    border: 0;
    background: #111827;
    color: white;
    padding: 13px 18px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
}

.cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-top: 35px;
}

.card {
    background: white;
    padding: 24px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

.card span {
    color: #6b7280;
    display: block;
    margin-bottom: 16px;
}

.card strong {
    font-size: 30px;
}

.table-block {
    background: white;
    margin-top: 30px;
    padding: 25px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

th,
td {
    padding: 16px 10px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

th {
    color: #6b7280;
    font-size: 13px;
}

.status {
    background: #dcfce7;
    color: #166534;
    padding: 6px 10px;
    border-radius: 20px;
    font-size: 13px;
}
.add-button {
    text-decoration: none;
    border: 0;
    background: #111827;
    color: white;
    padding: 13px 18px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
}

.form-page {
    max-width: 750px;
}

.form-header p {
    color: #6b7280;
    margin-top: 8px;
}

.counterparty-form {
    margin-top: 35px;
    background: white;
    padding: 30px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

.form-field {
    margin-bottom: 22px;
}

.form-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
}

.form-field input,
.form-field select,
.form-field textarea {
    width: 100%;
    padding: 13px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 15px;
    margin-top: 30px;
}

.cancel-button {
    text-decoration: none;
    color: #6b7280;
}
.search-form {
    display: flex;
    gap: 12px;
    margin-bottom: 25px;
}

.search-form input {
    flex: 1;
    padding: 13px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 15px;
}
.company-link {
    color: #111827;
    font-weight: 600;
    text-decoration: none;
}

.company-link:hover {
    text-decoration: underline;
}

.detail-top {
    margin-bottom: 30px;
}

.detail-top h1 {
    margin-top: 15px;
    margin-bottom: 15px;
}

.back-link {
    color: #6b7280;
    text-decoration: none;
    font-size: 14px;
}

.back-link:hover {
    color: #111827;
}

.company-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 28px;
    margin-bottom: 24px;
}

.company-card h2 {
    margin-top: 0;
    margin-bottom: 25px;
}

.company-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 28px;
}

.info-item span {
    display: block;
    color: #6b7280;
    font-size: 13px;
    margin-bottom: 7px;
}

.info-item strong {
    font-size: 16px;
}

.empty-section {
    color: #6b7280;
    padding: 20px 0;
}
.detail-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.edit-button {
    text-decoration: none;
    background: white;
    color: #111827;
    border: 1px solid #d1d5db;
    padding: 11px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
}

.edit-button:hover {
    background: #f9fafb;
}
.timeline-item {
    position: relative;
    padding: 0 0 28px 24px;
    border-left: 2px solid #e5e7eb;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -6px;
    top: 4px;
    width: 10px;
    height: 10px;
    background: #111827;
    border-radius: 50%;
}

.timeline-date {
    color: #9ca3af;
    font-size: 12px;
    margin-bottom: 6px;
}

.timeline-title {
    font-weight: 700;
    margin-bottom: 8px;
}

.timeline-status {
    color: #374151;
    margin-bottom: 10px;
}

.timeline-arrow {
    margin: 0 8px;
    color: #9ca3af;
}

.timeline-comment {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 14px;
    margin-top: 10px;
    line-height: 1.5;
}
.detail-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}
.check-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.check-card {
    display: block;
    text-decoration: none;
    color: #111827;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 18px;
}

.check-card:hover {
    border-color: #9ca3af;
}

.check-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 12px;
}

.check-result {
    display: inline-block;
    padding: 5px 9px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.check-not_checked {
    background: #e5e7eb;
    color: #4b5563;
}

.check-clear {
    background: #dcfce7;
    color: #166534;
}

.check-attention {
    background: #fef3c7;
    color: #92400e;
}

.check-risk {
    background: #fee2e2;
    color: #991b1b;
}

.check-comment {
    margin-top: 14px;
    color: #4b5563;
    line-height: 1.4;
    font-size: 14px;
}

.check-date {
    margin-top: 14px;
    color: #9ca3af;
    font-size: 11px;
}

.check-summary-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}

.check-summary-header h2 {
    margin-bottom: 12px;
}

.check-progress-number {
    font-size: 28px;
    font-weight: 700;
    color: #111827;
}

.summary-badge {
    display: inline-block;
    padding: 7px 11px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.summary-progress {
    background: #e5e7eb;
    color: #4b5563;
}

.summary-clear {
    background: #dcfce7;
    color: #166534;
}

.summary-attention {
    background: #fef3c7;
    color: #92400e;
}

.summary-risk {
    background: #fee2e2;
    color: #991b1b;
}

.progress-track {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 20px;
    overflow: hidden;
    margin-top: 24px;
}

.progress-fill {
    height: 100%;
    background: #111827;
    border-radius: 20px;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-top: 24px;
}

.summary-item {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 17px;
}

.summary-item span {
    display: block;
    color: #6b7280;
    font-size: 12px;
    margin-bottom: 9px;
}

.summary-item strong {
    font-size: 24px;
}

.progress-0 {
    width: 0%;
}

.progress-1 {
    width: 20%;
}

.progress-2 {
    width: 40%;
}

.progress-3 {
    width: 60%;
}

.progress-4 {
    width: 80%;
}

.progress-5 {
    width: 100%;
}

.pending-total {
    display: flex;
    align-items: center;
    gap: 12px;
    background: white;
    border: 1px solid #e5e7eb;
    padding: 11px 16px;
    border-radius: 10px;
}

.pending-total span {
    color: #6b7280;
    font-size: 13px;
}

.pending-total strong {
    font-size: 22px;
}

.pending-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 35px;
}

.pending-card {
    display: block;
    text-decoration: none;
    color: #111827;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
}

.pending-card:hover {
    border-color: #9ca3af;
}

.pending-company {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}

.pending-company h2 {
    margin: 0;
    font-size: 19px;
}

.pending-meta {
    color: #6b7280;
    font-size: 13px;
    margin-top: 7px;
}

.pending-info-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 18px;
    margin-top: 25px;
}

.pending-info span {
    display: block;
    color: #9ca3af;
    font-size: 12px;
    margin-bottom: 6px;
}

.pending-info strong {
    font-size: 14px;
}

.pending-progress {
    margin-top: 22px;
}

.empty-pending {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 50px;
    text-align: center;
}

.empty-pending h2 {
    margin-top: 0;
}

.empty-pending p {
    color: #6b7280;
}

.logisticians-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 24px;
    margin-top: 35px;
    align-items: start;
}

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

.checkbox-field input {
    width: auto;
}

.checkbox-field label {
    margin: 0;
}

.sidebar-user {
    position: absolute;
    left: 20px;
    right: 20px;
    bottom: 24px;
    padding-top: 18px;
    border-top: 1px solid #374151;
}

.sidebar-organization {
    color: #9ca3af;
    font-size: 11px;
    margin-bottom: 7px;
}

.sidebar-username {
    color: white;
    font-size: 14px;
    font-weight: 600;
}

.sidebar-role {
    color: #9ca3af;
    font-size: 12px;
    margin-top: 4px;
}

.logout-button {
    width: 100%;
    margin-top: 14px;
    background: #1f2937;
    color: white;
    border: 0;
    padding: 9px 12px;
    border-radius: 7px;
    cursor: pointer;
}

.logout-button:hover {
    background: #374151;
}


.login-body {
    margin: 0;
    min-height: 100vh;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 30px;
}

.login-logo {
    text-align: center;
    font-size: 30px;
    font-weight: 800;
    margin-bottom: 28px;
}

.login-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 32px;
}

.login-card h1 {
    font-size: 25px;
    margin-bottom: 8px;
}

.login-organization {
    color: #6b7280;
    margin-bottom: 28px;
}

.login-error {
    background: #fee2e2;
    color: #991b1b;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 20px;
    font-size: 14px;
}

.login-button {
    width: 100%;
    margin-top: 8px;
}

.users-layout {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 24px;
    margin-top: 35px;
    align-items: start;
}

.system-message {
    margin-top: 20px;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 13px 16px;
}

.user-active {
    display: inline-block;
    background: #dcfce7;
    color: #166534;
    padding: 5px 9px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.user-disabled {
    display: inline-block;
    background: #fee2e2;
    color: #991b1b;
    padding: 5px 9px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.user-action-button {
    background: white;
    color: #111827;
    border: 1px solid #d1d5db;
    padding: 7px 10px;
    border-radius: 7px;
    cursor: pointer;
}

.user-action-button:hover {
    background: #f9fafb;
}

.current-user {
    color: #9ca3af;
    font-size: 12px;
}

.errorlist {
    margin: 7px 0 0;
    padding: 0;
    list-style: none;
    color: #b91c1c;
    font-size: 12px;
}

.timeline-actor {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 8px;
}

.timeline-actor strong {
    color: #374151;
    font-size: 13px;
}

.timeline-actor span {
    color: #9ca3af;
}

.documents-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.section-description {
    color: #6b7280;
    margin-top: -12px;
    margin-bottom: 0;
    font-size: 13px;
}

.document-upload-form {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 20px;
    margin: 24px 0;
}

.document-form-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 2fr;
    gap: 16px;
}

.document-file-info {
    margin-top: 7px;
    font-size: 12px;
    line-height: 1.45;
    color: #6b7280;
    white-space: pre-line;
    overflow-wrap: anywhere;
}

.document-file-info.warning {
    color: #b45309;
}

.document-file-info.error {
    color: #b91c1c;
}

.document-storage {
    margin: 18px 0;
    padding: 14px 16px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 9px;
}

.document-storage-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 9px;
    color: #374151;
    font-size: 13px;
    font-weight: 600;
}

.document-storage-bar {
    width: 100%;
    height: 7px;
    overflow: hidden;
    background: #e5e7eb;
    border-radius: 999px;
}

.document-storage-bar-fill {
    height: 100%;
    background: #374151;
    border-radius: 999px;
}

.document-storage-footer {
    margin-top: 7px;
    color: #6b7280;
    font-size: 12px;
}

.documents-list {
    display: flex;
    flex-direction: column;
}

.document-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 16px 0;
    border-bottom: 1px solid #e5e7eb;
}

.document-row-deleted {
    background: #f9fafb;
    padding-left: 12px;
    padding-right: 12px;
    border-radius: 8px;
}

.document-row-deleted td {
    color: #9ca3af;
}

.document-row-deleted .document-title,
.document-row-deleted .document-filename,
.document-row-deleted .document-meta,
.document-row-deleted .document-table-title,
.document-row-deleted .document-table-filename,
.document-row-deleted .company-link {
    color: #9ca3af;
}

.document-deleted-info {
    margin-top: 8px;
    font-size: 12px;
    line-height: 1.5;
    color: #6b7280;
}

.document-restore {
    border: 1px solid #111827;
    background: #111827;
    color: #ffffff;
    border-radius: 7px;
    padding: 8px 11px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.document-restore:hover {
    background: #374151;
    border-color: #374151;
}

.document-row:last-child {
    border-bottom: 0;
}

.document-title {
    font-weight: 600;
    color: #111827;
}

.document-meta {
    margin-top: 6px;
    color: #9ca3af;
    font-size: 12px;
}

.document-download {
    text-decoration: none;
    color: #111827;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    padding: 8px 11px;
    font-size: 13px;
}

.document-download:hover {
    background: #f9fafb;
}

.documents-filter {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) 240px auto auto;
    gap: 12px;
    align-items: center;
    margin-bottom: 25px;
}

.documents-filter input,
.documents-filter select {
    width: 100%;
    padding: 12px 13px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    background: white;
}

.reset-filter {
    text-decoration: none;
    color: #6b7280;
    font-size: 13px;
}

.reset-filter:hover {
    color: #111827;
}

.document-table-title {
    font-weight: 600;
    color: #111827;
}

.document-table-filename,
.document-filename {
    margin-top: 5px;
    color: #9ca3af;
    font-size: 12px;
}

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

.document-actions form {
    margin: 0;
}

.document-delete {
    background: white;
    color: #b91c1c;
    border: 1px solid #fecaca;
    border-radius: 7px;
    padding: 8px 11px;
    font-size: 13px;
    cursor: pointer;
}

.document-delete:hover {
    background: #fef2f2;
}

.conclusion-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}

.conclusion-decision {
    margin-top: 26px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 20px;
}

.conclusion-decision span {
    display: block;
    color: #6b7280;
    font-size: 12px;
    margin-bottom: 7px;
}

.conclusion-decision strong {
    font-size: 22px;
}

.conclusion-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-top: 24px;
}

.conclusion-role {
    margin-top: 5px;
    color: #9ca3af;
    font-size: 12px;
}

.conclusion-text {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.conclusion-text span {
    display: block;
    color: #6b7280;
    font-size: 12px;
    margin-bottom: 8px;
}

.conclusion-text p {
    margin: 0;
    line-height: 1.6;
}

.conclusion-history {
    margin-top: 25px;
    border-top: 1px solid #e5e7eb;
    padding-top: 18px;
}

.conclusion-history summary {
    cursor: pointer;
    font-weight: 600;
}

.old-conclusion {
    padding: 13px 0;
    border-bottom: 1px solid #e5e7eb;
}

.old-conclusion span {
    margin-left: 8px;
    color: #9ca3af;
    font-size: 12px;
}

.review-cycle-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}

.review-cycle-info {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-top: 24px;
}

.inn-check-result {
    margin-top: 8px;
    font-size: 13px;
}

.inn-free {
    padding: 10px 12px;
    border-radius: 8px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.inn-duplicate,
.duplicate-warning {
    margin-top: 10px;
    padding: 14px;
    border-radius: 9px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    color: #9a3412;
}

.inn-company-name {
    margin: 6px 0;
    font-weight: 600;
    font-size: 15px;
}

.inn-duplicate div {
    margin-top: 4px;
}

.inn-duplicate a,
.duplicate-warning a {
    display: inline-block;
    margin-top: 9px;
    color: #9a3412;
    font-weight: 600;
    text-decoration: none;
}

.inn-duplicate a:hover,
.duplicate-warning a:hover {
    text-decoration: underline;
}

.organization-settings-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-top: 24px;
}

.license-status {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 600;
}

.license-active {
    background: #f0fdf4;
    color: #166534;
}

.license-inactive {
    background: #fef2f2;
    color: #991b1b;
}

.license-note {
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid #e5e7eb;
    color: #9ca3af;
    font-size: 12px;
}

.user-license-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.user-license-summary>div {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 18px;
}

.user-license-summary span {
    display: block;
    color: #6b7280;
    font-size: 12px;
    margin-bottom: 7px;
}

.user-license-summary strong {
    font-size: 18px;
    color: #111827;
}

.license-limit-warning {
    margin-bottom: 24px;
    padding: 14px 16px;
    border-radius: 9px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    color: #9a3412;
    line-height: 1.5;
}

.platform-layout {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 250px 1fr;
    background: #f4f6f8;
}

.platform-sidebar {
    position: fixed;
    width: 250px;
    height: 100vh;
    box-sizing: border-box;
    padding: 32px 22px;
    background: #0b1220;
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.platform-logo {
    font-size: 28px;
    font-weight: 800;
}

.platform-label {
    margin-top: 7px;
    color: #64748b;
    font-size: 11px;
    letter-spacing: 1.5px;
}

.platform-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    margin-top: 45px;
}

.platform-nav a {
    padding: 12px 14px;
    border-radius: 8px;
    color: #cbd5e1;
    text-decoration: none;
}

.platform-nav a:hover {
    background: #1e293b;
    color: white;
}

.platform-user {
    display: flex;
    flex-direction: column;
    gap: 4px;
    border-top: 1px solid #263244;
    padding-top: 18px;
}

.platform-user span {
    color: #94a3b8;
    font-size: 12px;
}

.platform-content {
    grid-column: 2;
    padding: 44px;
    max-width: 1400px;
}

.platform-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 28px;
}

.platform-page-header h1 {
    margin-bottom: 5px;
}

.platform-page-header p {
    margin: 0;
    color: #6b7280;
}

.platform-primary-button {
    background: #111827;
    color: white;
    text-decoration: none;
    padding: 11px 15px;
    border-radius: 8px;
    font-weight: 600;
}

.platform-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.platform-stats>div {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 18px;
}

.platform-stats span {
    display: block;
    color: #6b7280;
    font-size: 12px;
    margin-bottom: 7px;
}

.platform-stats strong {
    font-size: 20px;
}

.platform-subtext {
    color: #9ca3af;
    font-size: 12px;
    margin-top: 5px;
}

.platform-form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.license-block-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f4f6f8;
    padding: 30px;
}

.license-block-card {
    width: 100%;
    max-width: 620px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 40px;
}

.license-block-logo {
    font-size: 25px;
    font-weight: 800;
    color: #111827;
    margin-bottom: 35px;
}

.license-block-card h1 {
    font-size: 30px;
    line-height: 1.25;
    margin-bottom: 12px;
}

.license-block-org {
    color: #6b7280;
    font-size: 17px;
    margin-bottom: 30px;
}

.license-block-info {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 14px 0;
    border-top: 1px solid #e5e7eb;
}

.license-block-info span {
    color: #6b7280;
}

.license-block-text {
    margin: 30px 0;
    color: #6b7280;
    line-height: 1.6;
}


/* === RADKON WORKSPACE V2 === */

.workspace-body {
    --graphite-header: #101114;
    --graphite-sidebar: #36383C;
    --graphite-workspace: #404247;
    --graphite-surface: #4A4D52;
    --graphite-control: #3C3E42;
    --graphite-hover: #57595E;
    --graphite-active: #4B4E53;
    --graphite-border: #5B5E64;
    --graphite-border-strong: #73777E;
    --graphite-text: #F7F7F8;
    --graphite-muted: #DDDDDF;
    --graphite-subtle: #C5C5C8;
    --graphite-accent: #5794F7;
    --graphite-link: #AECFFF;
    --graphite-link-hover: #D5E5FF;
    --graphite-focus: #AECFFF;
    --graphite-primary: #F7F7F8;
    --graphite-primary-hover: #DDDDDF;
    --graphite-primary-text: #101114;
    --graphite-success: #BCEDCC;
    --graphite-success-bg: rgb(100 196 145 / .12);
    --graphite-success-border: rgb(100 196 145 / .3);
    --graphite-warning: #FFE0A3;
    --graphite-warning-bg: rgb(225 175 83 / .12);
    --graphite-warning-border: rgb(225 175 83 / .3);
    --graphite-risk: #FFC0C0;
    --graphite-risk-bg: rgb(231 113 113 / .12);
    --graphite-risk-border: rgb(231 113 113 / .3);
    --graphite-risk-solid: #A52323;
    --graphite-risk-solid-hover: #B82B2B;
    --graphite-review: #DDD2FF;
    --graphite-review-bg: rgb(162 132 255 / .12);
    --graphite-info-bg: rgb(87 148 247 / .12);
    --graphite-overlay: rgb(0 0 0 / .72);
    --graphite-shadow: rgb(0 0 0 / .22);
    --graphite-highlight: rgb(255 255 255 / .05);
    --workspace-header-height: 76px;
    margin: 0;
    min-height: 100vh;
    background: var(--graphite-workspace);
    color: var(--graphite-text);
    color-scheme: dark;
    font-family: "TT Commons Classic", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 15px;
    line-height: 1.5;
}
.workspace-body * { box-sizing: border-box; }
.workspace-body [hidden] { display: none !important; }
.workspace-body :is(a, button, summary, input, select, textarea):focus-visible {
    outline: 2px solid var(--graphite-focus);
    outline-offset: 3px;
}
.workspace-body :is(input, select, textarea, button) { font-family: inherit; }
.workspace-body :is(input, select, textarea) { min-width: 0; max-width: 100%; }
.workspace-body :is(input, select, textarea):disabled { opacity: .65; cursor: not-allowed; }
.workspace-body input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--graphite-accent); }
.workspace-body :is(a, button) { -webkit-tap-highlight-color: transparent; }
.workspace-body :is(h1, h2, h3, p, strong, dd) { overflow-wrap: anywhere; }
.workspace-body :where(a) { color: var(--graphite-link); }
.workspace-body :where(a:hover) { color: var(--graphite-link-hover); }
.workspace-body .visually-hidden {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
.workspace-skip-link { position: fixed; top: -80px; left: 12px; z-index: 11000; padding: 10px 16px; background: var(--graphite-header); border-radius: 8px; }
.workspace-skip-link:focus { top: 8px; }
.workspace-shell { min-height: 100vh; padding-top: var(--workspace-header-height); background: var(--graphite-workspace); }
.workspace-stage { grid-column: 2; min-width: 0; min-height: calc(100vh - var(--workspace-header-height)); background: var(--graphite-workspace); }
.workspace-main { width: min(1600px, 100%); min-width: 0; margin: 0 auto; padding: 52px 44px 64px; }
.workspace-body .workspace-topbar {
    position: fixed; inset: 0 0 auto; z-index: 100;
    display: flex; align-items: center; justify-content: flex-end;
    height: var(--workspace-header-height); min-height: 0; padding: 0 24px;
    background: var(--graphite-header); border-bottom: 1px solid var(--graphite-border);
}
.workspace-topbar .workspace-brand {
    position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
    display: block; width: 240px; max-width: calc(100vw - 144px); height: 56px; margin: 0;
}
.workspace-topbar .workspace-brand img { display: block; width: 100%; height: 100%; object-fit: contain; }
.workspace-account { position: relative; height: 100%; min-width: 0; max-width: calc(50vw - 120px); }
.workspace-account-trigger {
    display: flex; align-items: center; gap: 12px; height: 100%; min-height: 48px; padding: 4px 8px;
    border-radius: 10px; color: var(--graphite-text); cursor: pointer; list-style: none;
}
.workspace-account-trigger::-webkit-details-marker { display: none; }
.workspace-account-trigger:hover, .workspace-account[open] .workspace-account-trigger { background: var(--graphite-highlight); }
.workspace-avatar { display: grid; place-items: center; flex: 0 0 40px; width: 40px; height: 40px; border-radius: 50%; background: var(--graphite-hover); color: var(--graphite-text); }
.workspace-topbar svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.workspace-account-caption { min-width: 0; }
.workspace-account-name { display: block; max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; font-weight: 500; }
.workspace-account-role { display: block; margin-top: 1px; color: var(--graphite-subtle); font-size: 12px; }
.workspace-account-chevron { flex: 0 0 16px; width: 16px !important; height: 16px !important; transition: transform 180ms ease; }
.workspace-account[open] .workspace-account-chevron { transform: rotate(180deg); }
.workspace-account[open]::after { content: ""; position: absolute; top: 100%; right: 0; width: min(310px, calc(100vw - 24px)); height: 8px; }
.workspace-account-panel {
    position: absolute; top: calc(100% + 8px); right: 0; width: min(310px, calc(100vw - 24px));
    max-height: calc(100dvh - var(--workspace-header-height) - 12px); overflow-y: auto;
    padding: 10px; border: 1px solid var(--graphite-border-strong); border-radius: 12px;
    background: var(--graphite-sidebar); box-shadow: 0 16px 40px var(--graphite-shadow);
}
.workspace-account-divider { margin: 8px 4px; border: 0; border-top: 1px solid var(--graphite-border); }
.account-profile { max-width: 980px; }
.account-profile-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin: 28px 0 0; }
.account-profile-grid dt { margin-bottom: 6px; color: var(--graphite-subtle); }
.account-profile-grid dd { margin: 0; color: var(--graphite-text); }
.employee-permissions-note { margin: 0 0 24px; max-width: 850px; }
.workspace-account-panel form { margin: 0; }
.workspace-account .workspace-account-action {
    display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px;
    padding: 10px 12px; border: 0; border-radius: 8px; background: transparent;
    color: var(--graphite-text); font: inherit; font-size: 14px; text-align: left; text-decoration: none;
}
.workspace-account .workspace-account-action:hover { background: var(--graphite-hover); color: var(--graphite-text); }
.workspace-account-action svg { flex: 0 0 20px; }

.dashboard-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 32px;
    margin-bottom: 44px;
}

.dashboard-eyebrow {
    margin-bottom: 12px;
    color: var(--graphite-subtle);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.16em;
}

.dashboard-hero h1 {
    margin: 0;
    color: var(--graphite-text);
    font-size: clamp(36px, 5vw, 64px);
    font-weight: 430;
    line-height: 0.98;
    letter-spacing: -0.045em;
}

.dashboard-hero p {
    max-width: 540px;
    margin: 18px 0 0;
    color: var(--graphite-subtle);
    font-size: 16px;
    line-height: 1.55;
}

.workspace-primary-action {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 0 18px;
    border: 1px solid var(--graphite-border-strong);
    border-radius: 11px;
    background: var(--graphite-primary);
    color: var(--graphite-primary-text);
    font-size: 14px;
    font-weight: 550;
    text-decoration: none;
    white-space: nowrap;
    transition:
        transform 170ms ease,
        background 170ms ease;
}

.workspace-primary-action:hover {
    background: var(--graphite-primary-hover);
    transform: translateY(-1px);
    color: var(--graphite-primary-text);
}

.workspace-primary-action:active {
    transform: translateY(0);
}

.workspace-primary-action span {
    font-size: 17px;
    font-weight: 400;
}

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

.dashboard-metric {
    min-height: 146px;
    padding: 21px 22px 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border: 1px solid var(--graphite-border);
    border-radius: 16px;
    background: var(--graphite-surface);
}

.dashboard-metric-label {
    color: var(--graphite-subtle);
    font-size: 14px;
    line-height: 1.35;
}

.dashboard-metric-value {
    color: var(--graphite-text);
    font-size: 42px;
    font-weight: 420;
    line-height: 1;
    letter-spacing: -0.04em;
}

.dashboard-panel {
    overflow: hidden;
    border: 1px solid var(--graphite-border);
    border-radius: 18px;
    background: var(--graphite-surface);
}

.dashboard-panel-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    padding: 23px 25px 20px;
    border-bottom: 1px solid var(--graphite-border);
}

.dashboard-panel-kicker {
    margin-bottom: 6px;
    color: var(--graphite-subtle);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.dashboard-panel h2 {
    margin: 0;
    color: var(--graphite-text);
    font-size: 17px;
    font-weight: 480;
    letter-spacing: -0.015em;
}

.dashboard-panel-link {
    color: var(--graphite-link);
    font-size: 14px;
    text-decoration: none;
    transition: color 180ms ease;
}

.dashboard-panel-link:hover {
    color: var(--graphite-text);
}

.dashboard-table-wrap {
    overflow-x: auto;
}

.dashboard-table {
    width: 100%;
    border-collapse: collapse;
    background: transparent;
}

.dashboard-table th {
    padding: 14px 25px;
    border: 0;
    border-bottom: 1px solid var(--graphite-border);
    background: transparent;
    color: var(--graphite-subtle);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.10em;
    text-align: left;
    text-transform: uppercase;
}

.dashboard-table td {
    padding: 17px 25px;
    border: 0;
    border-bottom: 1px solid var(--graphite-border);
    background: transparent;
    color: var(--graphite-muted);
    font-size: 14px;
}

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

.dashboard-table tbody tr {
    transition: background 170ms ease;
}

.dashboard-table tbody tr:hover {
    background: var(--graphite-hover);
}

.dashboard-company-link {
    color: var(--graphite-text);
    font-weight: 500;
    text-decoration: none;
}

.dashboard-company-link:hover {
    color: var(--graphite-text);
}

.dashboard-status {
    display: inline-flex;
    padding: 5px 8px;
    border: 1px solid var(--graphite-border);
    border-radius: 999px;
    color: var(--graphite-muted);
    font-size: 12px;
}

.dashboard-empty {
    padding: 30px 25px !important;
    color: var(--graphite-subtle) !important;
}

/*
 * Transitional support for the remaining existing pages.
 * We will redesign them one by one.
 */
.workspace-main > header {
    color: var(--graphite-text);
}

.workspace-main > header h1 {
    color: var(--graphite-text);
}

.workspace-main > header p {
    color: var(--graphite-subtle);
}

@media (max-width: 1100px) {

    .workspace-shell {
        grid-template-columns: 200px minmax(0, 1fr);
    }

    .workspace-sidebar {
        width: 200px;
        padding-left: 14px;
        padding-right: 14px;
    }

    .workspace-stage {
        grid-column: 2;
    }

    .workspace-main {
        padding-left: 32px;
        padding-right: 32px;
    }

    .workspace-topbar {
        padding-left: 32px;
        padding-right: 32px;
    }

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

@media (max-width: 760px) {

    .workspace-shell {
        display: block;
    }

    .workspace-sidebar {
        position: static;
        width: 100%;
        min-height: auto;
        padding: 18px;
        border-right: 0;
        border-bottom: 1px solid var(--graphite-border);
    }

    .workspace-brand {
        width: 120px;
        margin: 0 0 20px;
    }

    .workspace-nav {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .workspace-nav-caption,
    .workspace-sidebar-footer {
        display: none;
    }

    .workspace-stage {
        min-height: auto;
    }

    .workspace-topbar {
        min-height: 70px;
        padding: 0 20px;
    }

    .workspace-main {
        padding: 38px 20px 52px;
    }

    .dashboard-hero {
        align-items: flex-start;
        flex-direction: column;
    }

    .dashboard-metrics {
        grid-template-columns: 1fr;
    }

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

/* === END RADKON WORKSPACE V2 === */


/* === RADKON COUNTERPARTIES V2 === */

.counterparties-page {
    width: 100%;
}

.counterparties-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 32px;
    margin-bottom: 42px;
}

.counterparties-eyebrow {
    margin-bottom: 12px;
    color: var(--graphite-subtle);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.16em;
}

.counterparties-header h1 {
    margin: 0;
    color: var(--graphite-text);
    font-size: clamp(36px, 4vw, 54px);
    font-weight: 430;
    line-height: 1;
    letter-spacing: -0.04em;
}

.counterparties-header p {
    margin: 15px 0 0;
    color: var(--graphite-subtle);
    font-size: 13px;
    line-height: 1.5;
}

.counterparties-add {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 48px;
    padding: 0 18px;
    border: 1px solid var(--graphite-border-strong);
    border-radius: 11px;
    background: var(--graphite-primary);
    color: var(--graphite-primary-text);
    font-size: 14px;
    font-weight: 550;
    text-decoration: none;
    white-space: nowrap;
    transition:
        background 170ms ease,
        transform 170ms ease;
}

.counterparties-add:hover {
    background: var(--graphite-primary-hover);
    transform: translateY(-1px);
    color: var(--graphite-primary-text);
}

.counterparties-add:active {
    transform: translateY(0);
}

.counterparties-add span {
    font-size: 17px;
    font-weight: 400;
}

.counterparties-panel {
    overflow: hidden;
    border: 1px solid var(--graphite-border);
    border-radius: 18px;
    background: var(--graphite-surface);
}

.counterparties-search {
    display: flex;
    gap: 10px;
    margin: 0;
    padding: 18px;
    border-bottom: 1px solid var(--graphite-border);
}

.counterparties-search input {
    flex: 1;
    min-width: 0;
    height: 43px;
    padding: 0 14px;
    border: 1px solid var(--graphite-border);
    border-radius: 10px;
    outline: none;
    background: var(--graphite-control);
    color: var(--graphite-text);
    font-family: inherit;
    font-size: 12px;
    transition:
        border-color 180ms ease,
        background 180ms ease;
}

.counterparties-search input::placeholder {
    color: var(--graphite-subtle);
}

.counterparties-search input:focus {
    border-color: var(--graphite-border-strong);
    background: var(--graphite-control);
}

.counterparties-search button {
    height: 43px;
    padding: 0 17px;
    border: 1px solid var(--graphite-border);
    border-radius: 10px;
    background: var(--graphite-surface);
    color: var(--graphite-text);
    font-family: inherit;
    font-size: 12px;
    cursor: pointer;
    transition:
        background 180ms ease,
        color 180ms ease;
}

.counterparties-search button:hover {
    background: var(--graphite-hover);
    color: var(--graphite-text);
}

.counterparties-table-wrap {
    overflow-x: auto;
}

.counterparties-table {
    width: 100%;
    margin: 0;
    border-collapse: collapse;
    background: transparent;
}

.counterparties-table th {
    padding: 14px 18px;
    border: 0;
    border-bottom: 1px solid var(--graphite-border);
    background: transparent;
    color: var(--graphite-subtle);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.09em;
    text-align: left;
    text-transform: uppercase;
}

.counterparties-table td {
    padding: 17px 18px;
    border: 0;
    border-bottom: 1px solid var(--graphite-border);
    background: transparent;
    color: var(--graphite-muted);
    font-size: 14px;
    line-height: 1.4;
}

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

.counterparties-table tbody tr {
    transition: background 170ms ease;
}

.counterparties-table tbody tr:hover {
    background: var(--graphite-hover);
}

.counterparties-company {
    color: var(--graphite-text);
    font-weight: 520;
    text-decoration: none;
    transition: color 170ms ease;
}

.counterparties-company:hover {
    color: var(--graphite-text);
}

.counterparties-muted {
    color: var(--graphite-subtle) !important;
}

.counterparties-status {
    display: inline-flex;
    align-items: center;
    min-height: 25px;
    padding: 0 9px;
    border: 1px solid var(--graphite-border);
    border-radius: 999px;
    background: var(--graphite-surface);
    color: var(--graphite-muted);
    font-size: 12px;
    white-space: nowrap;
}

/* Договор */
.counterparties-status.status-contract {
    border-color: var(--graphite-success-border);
    background: var(--graphite-success-bg);
    color: var(--graphite-success);
}

/* На проверке */
.counterparties-status.status-review {
    border-color: var(--graphite-warning-border);
    background: var(--graphite-warning-bg);
    color: var(--graphite-warning);
}

/* Не прошёл проверку */
.counterparties-status.status-rejected {
    border-color: var(--graphite-risk-border);
    background: var(--graphite-risk-bg);
    color: var(--graphite-risk);
}

.counterparties-empty {
    padding: 34px 18px !important;
    color: var(--graphite-subtle) !important;
    text-align: center !important;
}

@media (max-width: 900px) {

    .counterparties-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .counterparties-search {
        flex-direction: column;
    }

    .counterparties-search button {
        width: 100%;
    }
}

/* === END RADKON COUNTERPARTIES V2 === */


/* === RADKON WORKSPACE DARK PASS V2 === */

/* Общая оболочка */

.workspace-brand {
    width: 150px;
    margin-bottom: 34px;
}

.workspace-nav a.active {
    background: var(--graphite-surface);
}

.workspace-main > header {
    align-items: flex-end;
    margin-bottom: 40px;
}

.workspace-main > header h1 {
    margin: 0;
    color: var(--graphite-text);
    font-size: clamp(38px, 4vw, 54px);
    font-weight: 430;
    line-height: 1;
    letter-spacing: -0.04em;
}

.workspace-main > header p {
    margin-top: 14px;
    color: var(--graphite-subtle);
    font-size: 13px;
    line-height: 1.55;
}

.workspace-body .add-button {
    border: 1px solid var(--graphite-border-strong);
    border-radius: 11px;
    background: var(--graphite-primary);
    color: var(--graphite-primary-text);
    font-size: 12px;
    font-weight: 550;
}

.workspace-body .add-button:hover {
    background: var(--graphite-primary-hover);
    color: var(--graphite-primary-text);
}


/* На проверке / На перепроверку */

.workspace-body .pending-total {
    min-width: 108px;
    padding: 13px 15px;
    border: 1px solid var(--graphite-border);
    border-radius: 13px;
    background: var(--graphite-surface);
    color: var(--graphite-text);
}

.workspace-body .pending-total span {
    color: var(--graphite-subtle);
    font-size: 9px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.workspace-body .pending-total strong {
    color: var(--graphite-text);
    font-size: 24px;
    font-weight: 430;
}

.workspace-body .pending-list {
    display: grid;
    gap: 12px;
}

.workspace-body .pending-card {
    padding: 22px 24px 18px;
    border: 1px solid var(--graphite-border);
    border-radius: 17px;
    background: var(--graphite-surface);
    color: var(--graphite-muted);
    box-shadow: none;
    text-decoration: none;
    transition:
        border-color 170ms ease,
        background 170ms ease,
        transform 170ms ease;
}

.workspace-body .pending-card:hover {
    border-color: var(--graphite-border-strong);
    background: var(--graphite-surface);
    transform: translateY(-1px);
}

.workspace-body .pending-company h2 {
    color: var(--graphite-text);
    font-size: 17px;
    font-weight: 520;
}

.workspace-body .pending-meta,
.workspace-body .pending-info span {
    color: var(--graphite-subtle);
}

.workspace-body .pending-info strong {
    color: var(--graphite-muted);
    font-weight: 520;
}

.workspace-body .pending-progress {
    background: var(--graphite-surface);
}

.workspace-body .pending-progress .progress-fill {
    background: var(--graphite-accent);
}

.workspace-body .empty-pending {
    min-height: 190px;
    padding: 34px;
    border: 1px solid var(--graphite-border);
    border-radius: 18px;
    background: var(--graphite-surface);
    color: var(--graphite-muted);
    box-shadow: none;
    text-align: center;
}

.workspace-body .empty-pending h2 {
    color: var(--graphite-muted);
}

.workspace-body .empty-pending p {
    color: var(--graphite-subtle);
}


/* Общие тёмные панели старых страниц */

.workspace-body .table-block,
.workspace-body .company-card {
    border: 1px solid var(--graphite-border);
    border-radius: 18px;
    background: var(--graphite-surface);
    color: var(--graphite-muted);
    box-shadow: none;
}

.workspace-body .company-card h2 {
    color: var(--graphite-text);
    font-size: 17px;
    font-weight: 480;
}

.workspace-body .company-link {
    color: var(--graphite-text);
}

.workspace-body .company-link:hover {
    color: var(--graphite-text);
    text-decoration: none;
}

.workspace-body .table-block table,
.workspace-body .company-card table {
    background: transparent;
}

.workspace-body .table-block th,
.workspace-body .company-card th {
    border-bottom: 1px solid var(--graphite-border);
    color: var(--graphite-subtle);
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.workspace-body .table-block td,
.workspace-body .company-card td {
    border-bottom: 1px solid var(--graphite-border);
    color: var(--graphite-muted);
    font-size: 14px;
}

.workspace-body .table-block tbody tr:last-child td,
.workspace-body .company-card tbody tr:last-child td {
    border-bottom: 0;
}


/* Формы, поиск, select */

.workspace-body .documents-filter input,
.workspace-body .documents-filter select,
.workspace-body .company-card input:not([type="checkbox"]),
.workspace-body .company-card select,
.workspace-body .organization-settings-grid input,
.workspace-body .organization-settings-grid select {
    border: 1px solid var(--graphite-border);
    border-radius: 10px;
    outline: none;
    background: var(--graphite-control);
    color: var(--graphite-text);
    font-family: inherit;
    color-scheme: dark;
}

.workspace-body .documents-filter input::placeholder,
.workspace-body .company-card input::placeholder {
    color: var(--graphite-subtle);
}

.workspace-body .documents-filter input:focus,
.workspace-body .documents-filter select:focus,
.workspace-body .company-card input:focus,
.workspace-body .company-card select:focus {
    border-color: var(--graphite-border-strong);
    background: var(--graphite-control);
}

.workspace-body .documents-filter button,
.workspace-body .company-card button:not(.document-delete) {
    border: 1px solid var(--graphite-border);
    border-radius: 10px;
    background: var(--graphite-surface);
    color: var(--graphite-text);
    font-family: inherit;
}

.workspace-body .documents-filter button:hover,
.workspace-body .company-card button:not(.document-delete):hover {
    background: var(--graphite-hover);
    color: var(--graphite-text);
}

.workspace-body .reset-filter {
    color: var(--graphite-subtle);
}

.workspace-body .reset-filter:hover {
    color: var(--graphite-text);
}

.workspace-body .form-field label {
    color: var(--graphite-subtle);
}


/* Форма добавления / редактирования контрагента */

.workspace-body .counterparty-form {
    background: var(--graphite-surface);
    border: 1px solid var(--graphite-border);
    border-radius: 14px;
    box-shadow:
        inset 0 1px 0 var(--graphite-highlight),
        0 18px 45px var(--graphite-shadow);
}

.workspace-body .counterparty-form .form-field label {
    color: var(--graphite-muted);
}

.workspace-body .counterparty-form .form-field input,
.workspace-body .counterparty-form .form-field select,
.workspace-body .counterparty-form .form-field textarea {
    background: var(--graphite-control);
    border: 1px solid var(--graphite-border);
    color: var(--graphite-text);
    caret-color: var(--graphite-text);
}

.workspace-body .counterparty-form .form-field input::placeholder,
.workspace-body .counterparty-form .form-field textarea::placeholder {
    color: var(--graphite-subtle);
}

.workspace-body .counterparty-form .form-field input:hover,
.workspace-body .counterparty-form .form-field select:hover,
.workspace-body .counterparty-form .form-field textarea:hover {
    border-color: var(--graphite-border-strong);
}

.workspace-body .counterparty-form .form-field input:focus,
.workspace-body .counterparty-form .form-field select:focus,
.workspace-body .counterparty-form .form-field textarea:focus {
    outline: none;
    border-color: var(--graphite-border-strong);
    background: var(--graphite-control);
    box-shadow: 0 0 0 3px var(--graphite-highlight);
}

.workspace-body .counterparty-form .form-field select option {
    background: var(--graphite-control);
    color: var(--graphite-text);
}

.workspace-body .counterparty-form .form-actions {
    padding-top: 8px;
}

.workspace-body .counterparty-form .cancel-button {
    color: var(--graphite-subtle);
}

.workspace-body .counterparty-form .cancel-button:hover {
    color: var(--graphite-text);
}

.workspace-body .counterparty-form .form-actions button {
    border: 1px solid var(--graphite-border);
    background: var(--graphite-surface);
    color: var(--graphite-text);
}

.workspace-body .counterparty-form .form-actions button:hover {
    border-color: var(--graphite-border-strong);
    background: var(--graphite-hover);
    color: var(--graphite-text);
}

.workspace-body .counterparty-form .inn-free {
    background: var(--graphite-success-bg);
    border: 1px solid var(--graphite-success-border);
    color: var(--graphite-success);
}

.workspace-body .counterparty-form .inn-duplicate,
.workspace-body .counterparty-form .duplicate-warning {
    background: var(--graphite-warning-bg);
    border: 1px solid var(--graphite-warning-border);
    color: var(--graphite-warning);
}

.workspace-body .counterparty-form .inn-duplicate a,
.workspace-body .counterparty-form .duplicate-warning a {
    color: var(--graphite-warning);
}

.workspace-body .checkbox-field label {
    color: var(--graphite-muted);
}


/* Документы */

.workspace-body .document-table-title {
    color: var(--graphite-text);
}

.workspace-body .document-table-filename,
.workspace-body .document-deleted-info {
    color: var(--graphite-subtle);
}

.workspace-body .document-download,
.workspace-body .document-restore,
.workspace-body .user-action-button {
    border: 1px solid var(--graphite-border);
    border-radius: 8px;
    background: var(--graphite-surface);
    color: var(--graphite-muted);
}

.workspace-body .document-delete {
    border: 1px solid var(--graphite-risk-border);
    border-radius: 8px;
    background: var(--graphite-risk-bg);
    color: var(--graphite-risk);
}


/* Пользователи */

.workspace-body .user-license-summary {
    gap: 12px;
}

.workspace-body .user-license-summary > div {
    min-height: 112px;
    padding: 18px 20px;
    border: 1px solid var(--graphite-border);
    border-radius: 15px;
    background: var(--graphite-surface);
    box-shadow: none;
}

.workspace-body .user-license-summary span {
    color: var(--graphite-subtle);
    font-size: 10px;
}

.workspace-body .user-license-summary strong {
    color: var(--graphite-text);
    font-weight: 430;
}

.workspace-body .license-limit-warning {
    border: 1px solid var(--graphite-warning-border);
    border-radius: 11px;
    background: var(--graphite-warning-bg);
    color: var(--graphite-warning);
}

.workspace-body .user-active {
    background: var(--graphite-success-bg);
    color: var(--graphite-success);
}

.workspace-body .user-disabled {
    background: var(--graphite-risk-bg);
    color: var(--graphite-risk);
}

.workspace-body .current-user {
    color: var(--graphite-subtle);
}


/* Сообщения */

.workspace-body .system-message {
    border: 1px solid var(--graphite-border);
    border-radius: 11px;
    background: var(--graphite-surface);
    color: var(--graphite-muted);
}


/* Настройки */

.workspace-body .organization-settings-grid {
    color: var(--graphite-muted);
}

.workspace-body .info-item {
    border-color: var(--graphite-border);
}

.workspace-body .info-item span {
    color: var(--graphite-subtle);
}

.workspace-body .info-item strong {
    color: var(--graphite-muted);
}

.workspace-body .license-note {
    border-color: var(--graphite-border);
    color: var(--graphite-subtle);
}

.workspace-body .license-active {
    background: var(--graphite-success-bg);
    color: var(--graphite-success);
}

.workspace-body .license-inactive {
    background: var(--graphite-risk-bg);
    color: var(--graphite-risk);
}


/* Журнал действий — общий Graphite layout */
.workspace-body .rk-journal { max-width: none; margin: 0; }
.workspace-body .rk-journal h1 { margin: 0 0 12px; font-size: clamp(30px, 4vw, 54px); line-height: 1.1; font-weight: 500; letter-spacing: -.035em; }
.workspace-body .rk-journal .muted { color: var(--graphite-subtle); font-size: 14px; line-height: 1.6; }
.workspace-body .rk-journal .panel { padding: 24px; margin: 24px 0; border: 1px solid var(--graphite-border); border-radius: 16px; background: var(--graphite-surface); }
.workspace-body .rk-journal .filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.workspace-body .rk-journal label { display: block; margin-bottom: 8px; color: var(--graphite-muted); font-size: 13px; }
.workspace-body .rk-journal :is(input, select) { width: 100%; min-height: 44px; padding: 9px 12px; border: 1px solid var(--graphite-border-strong); border-radius: 8px; background: var(--graphite-control); color: var(--graphite-text); }
.workspace-body .rk-journal .actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-top: 20px; }
.workspace-body .rk-journal button { min-height: 44px; padding: 10px 16px; background: var(--graphite-text); color: var(--graphite-primary-text); }
.workspace-body .rk-journal .table-wrap { overflow-x: auto; }
.workspace-body .rk-journal table { width: 100%; margin: 0; font-size: 14px; }
.workspace-body .rk-journal th { padding: 14px; border-bottom: 1px solid var(--graphite-border); color: var(--graphite-subtle); font-size: 11px; text-transform: uppercase; letter-spacing: .07em; }
.workspace-body .rk-journal td { padding: 18px 14px; border-bottom: 1px solid var(--graphite-border); vertical-align: top; overflow-wrap: anywhere; color: var(--graphite-muted); }
.workspace-body .rk-journal .stamp { min-width: 110px; white-space: nowrap; }
.workspace-body .rk-journal .badge { display: inline-block; margin-top: 8px; padding: 4px 8px; border-radius: 5px; background: var(--graphite-control); color: var(--graphite-muted); font-size: 12px; }
.workspace-body .rk-journal .change { margin-top: 8px; min-width: 220px; max-width: 480px; }
.workspace-body .rk-journal .history-note { white-space: pre-wrap; overflow-wrap: anywhere; }
.workspace-body .rk-journal .change-values { display: grid; grid-template-columns: minmax(0,1fr) 22px minmax(0,1fr); gap: 8px; margin-top: 5px; }
.workspace-body .rk-journal .value { padding: 8px; border-radius: 5px; background: var(--graphite-control); color: var(--graphite-text); white-space: pre-wrap; }
.workspace-body .rk-journal .pager { display: flex; flex-wrap: wrap; flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; padding-top: 20px; }
.workspace-body .rk-journal .empty { padding: 32px; text-align: center; }

/* Мобильная адаптация */

@media (max-width: 900px) {

    .workspace-main > header {
        align-items: flex-start;
        flex-direction: column;
    }

    .workspace-body .documents-filter {
        align-items: stretch;
        flex-direction: column;
    }

    .workspace-body .documents-filter input,
    .workspace-body .documents-filter select,
    .workspace-body .documents-filter button {
        width: 100%;
    }
}

/* === END RADKON WORKSPACE DARK PASS V2 === */

/* === RADKON WORKSPACE POLISH V2 === */

/* Немного повышаем читаемость вторичного текста */
.workspace-main > header p,
.dashboard-hero p,
.counterparties-header p {
    color: var(--graphite-muted);
}

.workspace-body .pending-meta,
.workspace-body .pending-info span {
    color: var(--graphite-subtle);
}

.workspace-body .pending-info strong {
    color: var(--graphite-text);
}


/* Статус "В работе" не должен выглядеть основной кнопкой */
.workspace-body .summary-badge {
    border: 1px solid var(--graphite-border);
    background: var(--graphite-surface);
    color: var(--graphite-muted);
}

.workspace-body .summary-badge.summary-risk {
    border-color: var(--graphite-risk-border);
    background: var(--graphite-risk-bg);
    color: var(--graphite-risk);
}


/* Лицензия — компактный статус, а не полоса */
.workspace-body .license-status {
    width: max-content;
    max-width: 100%;
    display: inline-flex;
    align-items: center;
    padding: 5px 9px;
}


/* Общие таблицы */
.workspace-body .table-block td,
.workspace-body .company-card td {
    color: var(--graphite-muted);
}

/* === END RADKON WORKSPACE POLISH V2 === */

/* === RADKON DETAIL DARK PASS V1 === */

/* Карточка проверки */
.workspace-body .check-progress-number {
    color: var(--graphite-text);
}

.workspace-body .progress-track:not(.pending-progress) {
    background: var(--graphite-surface);
}

.workspace-body .progress-track:not(.pending-progress) .progress-fill {
    background: var(--graphite-accent);
}

.workspace-body .summary-item {
    background: var(--graphite-surface);
    border: 1px solid var(--graphite-border);
    border-radius: 14px;
    color: var(--graphite-text);
    box-shadow: none;
}

.workspace-body .summary-item span {
    color: var(--graphite-subtle);
}

.workspace-body .summary-item strong {
    color: var(--graphite-text);
}

/* Проверка по источникам */
.workspace-body .check-card {
    color: var(--graphite-text);
    background: var(--graphite-surface);
    border: 1px solid var(--graphite-border);
    border-radius: 14px;
    box-shadow: none;
    transition: background 160ms ease, border-color 160ms ease;
}

.workspace-body a.check-card:hover {
    background: var(--graphite-hover);
    border-color: var(--graphite-border-strong);
}

.workspace-body .check-title {
    color: var(--graphite-text);
}

.workspace-body .check-comment {
    color: var(--graphite-muted);
}

.workspace-body .check-date {
    color: var(--graphite-subtle);
}

.workspace-body .check-result {
    border: 1px solid var(--graphite-border);
}

.workspace-body .check-not_checked {
    background: var(--graphite-surface);
    color: var(--graphite-muted);
}

.workspace-body .check-clear {
    background: var(--graphite-success-bg);
    border-color: var(--graphite-success-border);
    color: var(--graphite-success);
}

.workspace-body .check-attention {
    background: var(--graphite-warning-bg);
    border-color: var(--graphite-warning-border);
    color: var(--graphite-warning);
}

.workspace-body .check-risk {
    background: var(--graphite-risk-bg);
    border-color: var(--graphite-risk-border);
    color: var(--graphite-risk);
}

/* Документы внутри карточки контрагента */
.workspace-body .document-upload-form {
    background: var(--graphite-surface);
    border: 1px solid var(--graphite-border);
    border-radius: 14px;
    box-shadow: none;
}

.workspace-body .document-upload-form label {
    color: var(--graphite-subtle);
}

.workspace-body .document-upload-form input[type="text"],
.workspace-body .document-upload-form select,
.workspace-body .document-upload-form input[type="file"] {
    background: var(--graphite-control);
    border-color: var(--graphite-border);
    color: var(--graphite-text);
}

.workspace-body .document-upload-form input[type="file"]::file-selector-button,
.workspace-body .document-upload-form input[type="file"]::-webkit-file-upload-button {
    border: 1px solid var(--graphite-border);
    border-radius: 8px;
    background: var(--graphite-control);
    color: var(--graphite-text);
    padding: 8px 11px;
    margin-right: 10px;
    cursor: pointer;
}

.workspace-body .document-file-info {
    color: var(--graphite-subtle);
}

.workspace-body .document-storage {
    background: var(--graphite-surface);
    border: 1px solid var(--graphite-border);
    color: var(--graphite-muted);
}

.workspace-body .document-storage-header {
    color: var(--graphite-muted);
}

.workspace-body .document-storage-bar {
    background: var(--graphite-surface);
}

.workspace-body .document-storage-bar-fill {
    background: var(--graphite-accent);
}

.workspace-body .document-storage-footer {
    color: var(--graphite-subtle);
}

.workspace-body .document-upload-form button {
    border: 1px solid var(--graphite-border);
    border-radius: 9px;
    background: var(--graphite-surface);
    color: var(--graphite-text);
}

.workspace-body .document-upload-form button:hover {
    background: var(--graphite-hover);
    color: var(--graphite-text);
}

/* Список документов в карточке */
.workspace-body .documents-list .document-row {
    border-color: var(--graphite-border);
}

.workspace-body .documents-list .document-title {
    color: var(--graphite-text);
}

.workspace-body .documents-list .document-filename,
.workspace-body .documents-list .document-meta {
    color: var(--graphite-subtle);
}

.workspace-body .documents-list .document-row-deleted {
    padding: 14px 16px;
    background: var(--graphite-risk-bg);
    border: 1px solid var(--graphite-risk-border);
    border-radius: 12px;
}

.workspace-body .documents-list .document-row-deleted .document-title {
    color: var(--graphite-muted);
}

.workspace-body .documents-list .document-row-deleted .document-filename,
.workspace-body .documents-list .document-row-deleted .document-meta,
.workspace-body .documents-list .document-row-deleted .document-deleted-info {
    color: var(--graphite-subtle);
}

/* Удалённые документы в общем разделе */
.workspace-body .table-block tr.document-row-deleted {
    background: transparent;
}

.workspace-body .table-block tr.document-row-deleted td {
    background: var(--graphite-risk-bg) !important;
    color: var(--graphite-subtle) !important;
    border-top-color: var(--graphite-risk-bg);
    border-bottom-color: var(--graphite-risk-bg);
}

.workspace-body .table-block tr.document-row-deleted td:first-child {
    box-shadow: inset 2px 0 0 var(--graphite-risk-border);
}

.workspace-body .table-block tr.document-row-deleted .document-table-title,
.workspace-body .table-block tr.document-row-deleted .document-table-filename,
.workspace-body .table-block tr.document-row-deleted .company-link,
.workspace-body .table-block tr.document-row-deleted .document-deleted-info {
    color: var(--graphite-subtle) !important;
}

.workspace-body .document-restore {
    border-color: var(--graphite-border);
    background: var(--graphite-surface);
    color: var(--graphite-text);
}

.workspace-body .document-restore:hover {
    border-color: var(--graphite-border-strong);
    background: var(--graphite-hover);
    color: var(--graphite-text);
}

/* === RADKON DETAIL DARK PASS V2 === */

/* Итоговое юридическое заключение */

.workspace-body .conclusion-decision {
    background: var(--graphite-surface);
    border: 1px solid var(--graphite-border);
    border-radius: 14px;
    color: var(--graphite-text);
    box-shadow: none;
}

.workspace-body .conclusion-decision span {
    color: var(--graphite-subtle);
}

.workspace-body .conclusion-decision strong {
    color: var(--graphite-text);
}

.workspace-body .conclusion-role {
    color: var(--graphite-subtle);
}

.workspace-body .conclusion-text {
    border-top-color: var(--graphite-subtle);
}

.workspace-body .conclusion-text span {
    color: var(--graphite-subtle);
}

.workspace-body .conclusion-text p {
    color: var(--graphite-muted);
}

.workspace-body .conclusion-history {
    border-top-color: var(--graphite-subtle);
}

.workspace-body .conclusion-history summary {
    color: var(--graphite-muted);
}

.workspace-body .old-conclusion {
    border-bottom-color: var(--graphite-subtle);
}

.workspace-body .old-conclusion strong {
    color: var(--graphite-muted);
}

.workspace-body .old-conclusion span {
    color: var(--graphite-subtle);
}


/* История проверки */

.workspace-body .timeline-item {
    border-left-color: var(--graphite-subtle);
}

.workspace-body .timeline-item::before {
    background: var(--graphite-surface);
    box-shadow: 0 0 0 3px var(--graphite-surface);
}

.workspace-body .timeline-date {
    color: var(--graphite-subtle);
}

.workspace-body .timeline-actor {
    color: var(--graphite-subtle);
}

.workspace-body .timeline-actor strong {
    color: var(--graphite-muted);
}

.workspace-body .timeline-actor span {
    color: var(--graphite-subtle);
}

.workspace-body .timeline-title {
    color: var(--graphite-muted);
}

.workspace-body .timeline-status {
    color: var(--graphite-muted);
}

.workspace-body .timeline-status strong {
    color: var(--graphite-muted);
}

.workspace-body .timeline-arrow {
    color: var(--graphite-subtle);
}

.workspace-body .timeline-comment {
    background: var(--graphite-surface);
    border: 1px solid var(--graphite-border);
    border-radius: 10px;
    color: var(--graphite-muted);
    box-shadow: none;
}

.workspace-body .timeline-comment strong {
    color: var(--graphite-muted);
}


/* === RADKON ORGANIZATION DOCUMENTS V1 === */

.workspace-body .document-tabs {
    display: flex;
    gap: 6px;
    width: max-content;
    max-width: 100%;
    margin: 0 0 28px;
    padding: 5px;
    border: 1px solid var(--graphite-border);
    border-radius: 12px;
    background: var(--graphite-surface);
}

.workspace-body .document-tabs a {
    padding: 9px 14px;
    border-radius: 8px;
    color: var(--graphite-subtle);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
}

.workspace-body .document-tabs a:hover {
    color: var(--graphite-muted);
}

.workspace-body .document-tabs a.active {
    background: var(--graphite-surface);
    color: var(--graphite-text);
}

.workspace-body .organization-document-upload {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    margin-bottom: 20px;
    padding: 22px 24px;
    border: 1px solid var(--graphite-border);
    border-radius: 16px;
    background: var(--graphite-surface);
}

.workspace-body .organization-document-upload h2 {
    margin: 0 0 6px;
    color: var(--graphite-text);
}

.workspace-body .organization-document-upload p {
    margin: 0;
    color: var(--graphite-subtle);
    font-size: 13px;
}

.workspace-body .organization-document-upload form {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.workspace-body .organization-document-upload input[type="file"] {
    max-width: 370px;
    padding: 7px;
    border: 1px solid var(--graphite-border);
    border-radius: 9px;
    background: var(--graphite-control);
    color: var(--graphite-muted);
}

.workspace-body .organization-document-upload input[type="file"]::file-selector-button {
    margin-right: 10px;
    padding: 8px 11px;
    border: 1px solid var(--graphite-border);
    border-radius: 7px;
    background: var(--graphite-control);
    color: var(--graphite-muted);
    cursor: pointer;
}

.workspace-body .organization-document-upload button {
    padding: 10px 14px;
    border: 1px solid var(--graphite-border);
    border-radius: 9px;
    background: var(--graphite-surface);
    color: var(--graphite-text);
    cursor: pointer;
}

.workspace-body .organization-document-upload button:hover {
    background: var(--graphite-hover);
    color: var(--graphite-text);
}

.workspace-body .organization-documents-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}

.workspace-body .organization-documents-heading h2 {
    margin: 0 0 6px;
}

.workspace-body .organization-documents-heading p {
    margin: 0;
    color: var(--graphite-subtle);
    font-size: 13px;
}

.workspace-body .organization-documents-heading > span {
    min-width: 34px;
    padding: 6px 9px;
    border: 1px solid var(--graphite-border);
    border-radius: 999px;
    color: var(--graphite-muted);
    text-align: center;
    font-size: 12px;
}

.workspace-body .document-preview-button {
    padding: 8px 11px;
    border: 1px solid var(--graphite-border);
    border-radius: 8px;
    background: var(--graphite-surface);
    color: var(--graphite-muted);
    font-family: inherit;
    font-size: 13px;
    cursor: pointer;
}

.workspace-body .document-preview-button:hover {
    background: var(--graphite-hover);
    color: var(--graphite-text);
}

.document-preview-dialog {
    width: min(1180px, calc(100vw - 48px));
    height: min(860px, calc(100vh - 48px));
    padding: 0;
    border: 1px solid var(--graphite-border);
    border-radius: 16px;
    background: var(--graphite-control);
    color: var(--graphite-text);
    overflow: hidden;
}

.document-preview-dialog::backdrop {
    background: var(--graphite-overlay);
    backdrop-filter: blur(4px);
}

.document-preview-shell {
    display: grid;
    grid-template-rows: auto 1fr;
    width: 100%;
    height: 100%;
}

.document-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 14px 16px 14px 18px;
    border-bottom: 1px solid var(--graphite-border);
}

.document-preview-header strong {
    min-width: 0;
    overflow: hidden;
    color: var(--graphite-text);
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
}

.document-preview-close {
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid var(--graphite-border);
    border-radius: 9px;
    background: var(--graphite-surface);
    color: var(--graphite-muted);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.document-preview-close:hover {
    background: var(--graphite-hover);
    color: var(--graphite-text);
}

.document-preview-frame {
    width: 100%;
    height: 100%;
    border: 0;
    background: var(--graphite-control);
}

@media (max-width: 760px) {
    .workspace-body .organization-document-upload {
        align-items: stretch;
        flex-direction: column;
    }

    .workspace-body .organization-document-upload form {
        align-items: stretch;
        flex-direction: column;
    }

    .workspace-body .organization-document-upload input[type="file"] {
        max-width: none;
        width: 100%;
    }

    .document-preview-dialog {
        width: calc(100vw - 20px);
        height: calc(100vh - 20px);
    }
}


/* === RADKON DOCUMENT RETENTION V2 === */

.workspace-body .document-tabs {
    flex-direction: row;
    flex-wrap: nowrap;
}

.workspace-body .document-tabs a {
    display: inline-flex;
    width: auto;
    flex: 0 0 auto;
    align-items: center;
}


/* RADKON hard delete */
.danger-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 16px;
    border: 1px solid var(--graphite-risk-border);
    border-radius: 10px;
    background: var(--graphite-risk-border);
    color: var(--graphite-risk);
    text-decoration: none;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.danger-button:hover {
    border-color: var(--graphite-risk-solid-hover);
    background: var(--graphite-risk-border);
    color: var(--graphite-risk);
}

.danger-button-solid {
    background: var(--graphite-risk-solid);
    border-color: var(--graphite-risk-solid);
    color: var(--graphite-text);
}

.danger-button-solid:hover {
    background: var(--graphite-risk-solid);
    color: var(--graphite-text);
}

.danger-link {
    margin-left: 16px;
    color: var(--graphite-risk);
    text-decoration: none;
}

.danger-link:hover {
    color: var(--graphite-risk);
}

.draft-actions {
    white-space: nowrap;
}

.delete-confirm-page {
    display: flex;
    justify-content: center;
    padding: 40px 0;
}

.delete-confirm-card {
    width: min(100%, 680px);
    padding: 32px;
    border: 1px solid var(--graphite-risk-border);
    border-radius: 18px;
    background: var(--graphite-surface);
}

.delete-confirm-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    margin-bottom: 20px;
    border-radius: 50%;
    background: var(--graphite-risk-border);
    color: var(--graphite-risk);
    font-size: 24px;
    font-weight: 800;
}

.delete-confirm-card h1 {
    margin-top: 0;
}

.delete-confirm-company {
    margin-top: 24px;
    font-size: 18px;
}

.delete-warning {
    margin-top: 24px;
    padding: 16px;
    border: 1px solid var(--graphite-risk-border);
    border-radius: 12px;
    background: var(--graphite-risk-bg);
    color: var(--graphite-risk);
    line-height: 1.55;
}

.delete-document-count,
.delete-no-restore {
    color: var(--graphite-muted);
}

.delete-no-restore {
    font-weight: 700;
}

.delete-confirm-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 28px;
}

.delete-confirm-actions form {
    margin: 0;
}


/* RADKON delete UI polish */

/* Черновики: превращаем ссылки действий в аккуратные кнопки */
.draft-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.draft-actions a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 9px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition:
        background 0.18s ease,
        border-color 0.18s ease,
        color 0.18s ease,
        transform 0.18s ease;
}

.draft-actions a:first-child {
    border: 1px solid var(--graphite-highlight);
    background: var(--graphite-highlight);
    color: var(--graphite-muted);
}

.draft-actions a:first-child:hover {
    border-color: var(--graphite-highlight);
    background: var(--graphite-highlight);
    color: var(--graphite-text);
}

.draft-actions .danger-link {
    margin-left: 0;
    border: 1px solid var(--graphite-risk-border);
    background: var(--graphite-risk-bg);
    color: var(--graphite-muted);
}

.draft-actions .danger-link:hover {
    border-color: var(--graphite-risk-border);
    background: var(--graphite-risk-bg);
    color: var(--graphite-text);
}


/* Общая delete-кнопка: спокойнее в обычных карточках */
.danger-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 16px;
    border: 1px solid var(--graphite-highlight);
    border-radius: 10px;
    background: var(--graphite-highlight);
    color: var(--graphite-muted);
    text-decoration: none;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition:
        background 0.18s ease,
        border-color 0.18s ease,
        color 0.18s ease,
        transform 0.18s ease;
}

.danger-button:hover {
    border-color: var(--graphite-risk-border);
    background: var(--graphite-risk-bg);
    color: var(--graphite-text);
}


/* Финальная destructive-кнопка только на подтверждении */
.danger-button-solid {
    background: var(--graphite-risk-solid-hover);
    border-color: var(--graphite-risk-border);
    color: var(--graphite-text);
}

.danger-button-solid:hover {
    background: var(--graphite-risk-solid-hover);
    border-color: var(--graphite-risk-border);
    color: var(--graphite-text);
}


/* Спокойнее оформляем экран подтверждения удаления */
.delete-confirm-page {
    display: flex;
    justify-content: center;
    padding: 52px 0;
}

.delete-confirm-card {
    width: min(100%, 680px);
    padding: 34px;
    border: 1px solid var(--graphite-border);
    border-radius: 20px;
    background: var(--graphite-surface);
    box-shadow: 0 24px 60px var(--graphite-shadow);
}

.delete-confirm-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin-bottom: 20px;
    border-radius: 50%;
    background: var(--graphite-risk-bg);
    color: var(--graphite-risk);
    font-size: 22px;
    font-weight: 800;
}

.delete-confirm-card h1 {
    margin: 0 0 22px;
    font-size: 30px;
    line-height: 1.15;
}

.delete-confirm-company {
    margin-top: 8px;
    font-size: 18px;
    color: var(--graphite-text);
}

.delete-warning {
    margin-top: 22px;
    padding: 16px 18px;
    border: 1px solid var(--graphite-risk-border);
    border-radius: 12px;
    background: var(--graphite-risk-bg);
    color: var(--graphite-muted);
    line-height: 1.55;
}

.delete-document-count,
.delete-no-restore {
    color: var(--graphite-muted);
}

.delete-no-restore {
    margin-top: 18px;
    font-weight: 600;
    color: var(--graphite-muted);
}

.delete-confirm-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 28px;
}

.delete-confirm-actions form {
    margin: 0;
}

.delete-confirm-actions .cancel-button {
    color: var(--graphite-muted);
    text-decoration: none;
}

.delete-confirm-actions .cancel-button:hover {
    color: var(--graphite-text);
}


/* RADKON delete final polish */

/* Чуть спокойнее hover удаления в карточке */
.danger-button:hover {
    border-color: var(--graphite-risk-border);
    background: var(--graphite-risk-bg);
    color: var(--graphite-muted);
}

/* Отмена не выглядит отключённой */
.delete-confirm-actions .cancel-button {
    color: var(--graphite-muted);
}

.delete-confirm-actions .cancel-button:hover {
    color: var(--graphite-text);
}

/* Финальная кнопка чуть компактнее */
.delete-confirm-actions .danger-button-solid {
    padding-left: 18px;
    padding-right: 18px;
}


/* RADKON fixed detail actions */

/*
 * Левая колонка отдаёт место длинному названию.
 * Блок действий всегда остаётся справа.
 */
.detail-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) max-content;
    align-items: start;
    column-gap: 32px;
}

.detail-top > div:first-child {
    min-width: 0;
}

/*
 * Длинное название переносится,
 * но не выталкивает действия.
 */
.detail-top h1 {
    max-width: 100%;
    overflow-wrap: break-word;
}

/*
 * Кнопки всегда одним рядом
 * и никогда не ломают текст внутри себя.
 */
.detail-actions {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 12px;
    margin-left: 0;
}

.detail-actions a {
    flex: 0 0 auto;
    white-space: nowrap;
}


/* RADKON primary typeface */
html,
body,
button,
input,
select,
textarea {
    font-family:
        "TT Commons Classic",
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
}


/* RADKON single-session realtime */
.session-security-modal[hidden] {
    display: none;
}

.session-security-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.session-security-backdrop {
    position: absolute;
    inset: 0;
    background: var(--graphite-overlay);
    backdrop-filter: blur(5px);
}

.session-security-card {
    position: relative;
    z-index: 1;
    width: min(100%, 520px);
    padding: 30px;
    border: 1px solid var(--graphite-border);
    border-radius: 18px;
    background: var(--graphite-control);
    box-shadow: 0 30px 80px var(--graphite-shadow);
}

.session-security-mark {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    margin-bottom: 18px;
    border-radius: 50%;
    background: var(--graphite-surface);
    color: var(--graphite-text);
    font-size: 20px;
    font-weight: 700;
}

.session-security-card h2 {
    margin: 0 0 12px;
    color: var(--graphite-text);
    font-size: 25px;
}

.session-security-card p {
    margin: 0;
    color: var(--graphite-muted);
    font-size: 15px;
    line-height: 1.6;
}

.session-security-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 26px;
}

.session-security-actions .add-button {
    min-width: 120px;
    text-align: center;
}


/* RADKON employee action layout v1 */
.workspace-body .employee-actions {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 8px;
}

.workspace-body .employee-actions > form {
    display: inline-flex;
    flex: 0 0 auto;
    width: auto;
    margin: 0;
    padding: 0;
}

.workspace-body .employee-actions .user-action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: auto;
    margin: 0;
    white-space: nowrap;
    vertical-align: middle;
}

.workspace-body .employee-actions .current-user {
    display: inline-flex;
    align-items: center;
    margin: 0;
    white-space: nowrap;
}


/* RADKON employee edit layout v1 */
.workspace-body .employee-edit-form {
    width: 100%;
    max-width: 520px;
}

.workspace-body .employee-edit-form input:not([type="hidden"]),
.workspace-body .employee-edit-form select {
    display: block;
    width: 100%;
    max-width: 100%;
    min-height: 44px;
    box-sizing: border-box;
    padding: 10px 14px;
    border: 1px solid var(--graphite-border-strong);
    border-radius: 10px;
    background: var(--graphite-control);
    color: var(--graphite-text);
    font-size: 14px;
}

.workspace-body .employee-edit-form input:focus-visible,
.workspace-body .employee-edit-form select:focus-visible {
    outline: 2px solid var(--graphite-focus);
    outline-offset: 2px;
}

.workspace-body .employee-edit-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 18px;
    margin-top: 24px;
}

.workspace-body .employee-edit-actions .user-action-button {
    min-height: 42px;
    padding: 10px 18px;
}

.workspace-body .employee-edit-actions a {
    margin: 0;
    color: var(--graphite-muted);
    text-decoration: none;
}

.workspace-body .employee-edit-actions a:hover {
    color: var(--graphite-text);
}

.workspace-body .employee-actions a.user-action-button {
    text-decoration: none;
}

/* Graphite shared controls and responsive geometry. */
.workspace-body :is(.empty-section, .section-description, .back-link) { color: var(--graphite-subtle); }
.workspace-body .errorlist { color: var(--graphite-risk); }
.workspace-body :is(.edit-button, .search-form button) { border: 1px solid var(--graphite-border-strong); background: var(--graphite-hover); color: var(--graphite-text); }
.workspace-body .search-form input, .workspace-body .form-field textarea { border: 1px solid var(--graphite-border-strong); background: var(--graphite-control); color: var(--graphite-text); }
.workspace-body :is(.table-block, .company-card, .counterparty-form, .counterparties-panel, .dashboard-panel) { min-width: 0; }
.workspace-body :is(.table-block, .company-card) { overflow-x: auto; }
.workspace-body :is(.company-grid, .check-grid, .summary-grid, .conclusion-grid, .review-cycle-info, .organization-settings-grid, .document-form-grid) > * { min-width: 0; }
.workspace-body .company-grid, .workspace-body .check-grid, .workspace-body .review-cycle-info, .workspace-body .organization-settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.workspace-body .document-form-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.workspace-body .users-layout { grid-template-columns: minmax(240px, .8fr) minmax(0, 1.4fr); }
.workspace-body .users-layout > * { min-width: 0; }
.workspace-body .document-tabs { width: 100%; overflow-x: auto; }
.workspace-body :is(.status, .summary-badge.summary-clear, .dashboard-status.status-approved, .dashboard-status.status-contract, .counterparties-status.status-approved) { color: var(--graphite-success); background: var(--graphite-success-bg); border-color: var(--graphite-success-border); }
.workspace-body :is(.status.status-review, .status.status-court, .summary-badge.summary-attention, .dashboard-status.status-review, .dashboard-status.status-court, .counterparties-status.status-court) { color: var(--graphite-warning); background: var(--graphite-warning-bg); border-color: var(--graphite-warning-border); }
.workspace-body :is(.status.status-rejected, .dashboard-status.status-rejected) { color: var(--graphite-risk); background: var(--graphite-risk-bg); border-color: var(--graphite-risk-border); }
.workspace-body .delete-confirm-card { background: var(--graphite-surface); }
.workspace-body .document-preview-frame { background: var(--graphite-control); }
.workspace-body .document-file-info.warning { color: var(--graphite-warning); }
.workspace-body .document-file-info.error { color: var(--graphite-risk); }
.workspace-body .employee-field-error { color: var(--graphite-risk); margin-top: 5px; }
.workspace-body .dashboard-metric { min-height: 166px; gap: 18px; }
.dashboard-metric-heading { display: flex; align-items: center; gap: 16px; }
.dashboard-metric-icon { display: grid; place-items: center; flex: 0 0 44px; width: 44px; height: 44px; border-radius: 12px; color: var(--graphite-link); background: var(--graphite-info-bg); }
.dashboard-metric-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.dashboard-metric-icon.metric-contract { color: var(--graphite-success); background: var(--graphite-success-bg); }
.dashboard-metric-icon.metric-risk { color: var(--graphite-warning); background: var(--graphite-warning-bg); }
.dashboard-metric-icon.metric-review { color: var(--graphite-review); background: var(--graphite-review-bg); }
.workspace-body .dashboard-empty { height: 190px; text-align: center; color: var(--graphite-muted) !important; }
.dashboard-empty svg { display: block; width: 40px; height: 40px; margin: 0 auto 16px; fill: none; stroke: var(--graphite-border-strong); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.dashboard-empty strong { display: block; font-size: 15px; font-weight: 500; }
.dashboard-empty span { display: block; margin-top: 6px; color: var(--graphite-subtle); font-size: 14px; }
@media (max-width: 1100px) {
    .workspace-main { padding: 36px 28px 52px; }
    .workspace-body .detail-top { grid-template-columns: minmax(0,1fr); row-gap: 20px; }
    .workspace-body .detail-actions { flex-wrap: wrap; min-width: 0; max-width: 100%; }
    .workspace-body .documents-filter { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
    .workspace-body .pending-info-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
    .workspace-body .rk-journal .filters { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .workspace-body :is(.users-layout, .logisticians-layout) { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 900px) {
    .workspace-account-caption, .workspace-account-chevron { display: none; }
    .workspace-account { max-width: 56px; }
    .workspace-account-trigger { padding: 4px; }
    .workspace-body .summary-grid, .workspace-body .conclusion-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 760px) {
    .workspace-body { --workspace-header-height: 64px; }
    .workspace-body .workspace-topbar { padding-inline: 12px; }
    .workspace-main { padding: 28px 20px 40px; }
    .workspace-body :is(.detail-top, .detail-actions, .pending-company, .check-summary-header, .document-row, .review-cycle-header, .conclusion-header, .document-storage-header) { flex-wrap: wrap; }
    .workspace-body :is(.detail-actions, .detail-top > div) { min-width: 0; max-width: 100%; }
    .workspace-body .document-actions { flex-wrap: wrap; justify-content: flex-start; }
    .workspace-body .company-card, .workspace-body .counterparty-form, .workspace-body .rk-journal .panel { padding: 20px; }
    .workspace-body .document-form-grid, .workspace-body .user-license-summary { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 520px) {
    .account-profile-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
    .workspace-main { padding: 24px 16px 36px; }
    .workspace-body :is(.company-grid, .check-grid, .summary-grid, .conclusion-grid, .review-cycle-info, .organization-settings-grid, .pending-info-grid, .documents-filter, .rk-journal .filters) { grid-template-columns: minmax(0,1fr); }
    .workspace-body :is(.workspace-main > header h1, .dashboard-hero h1, .counterparties-header h1, .rk-journal h1) { font-size: 30px; line-height: 1.1; }
    .workspace-body .dashboard-metrics { gap: 12px; margin-bottom: 28px; }
    .workspace-body :is(.company-card, .counterparty-form, .rk-journal .panel, .delete-confirm-card) { padding: 16px; }
    .workspace-body .dashboard-panel-head { padding: 20px; }
    .workspace-body :is(.workspace-primary-action, .counterparties-add, .add-button, .employee-actions .user-action-button) { max-width: 100%; white-space: normal; text-align: left; }
    .workspace-body .employee-actions > form { max-width: 100%; }
    .workspace-body .detail-actions a { flex: 0 1 auto; max-width: 100%; white-space: normal; }
    .workspace-body :is(.form-actions, .employee-edit-actions, .search-form) { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
    .workspace-body *, .workspace-body *::before, .workspace-body *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
