:root {
    --brand-blue: #3B5998;
    --brand-orange: #E67E22;
    --brand-white: #FFFFFF;
    --gray-light: #f5f5f5;
    --gray-medium: #e0e0e0;
    --gray-dark: #666;
    --text-primary: #333;
    --success: #27ae60;
    --error: #e74c3c;
    --warning: #f39c12;
    --info: #3498db;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--gray-light);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    background: var(--brand-white);
    padding: 30px 20px;
    text-align: center;
    border-bottom: 3px solid var(--brand-orange);
    margin-bottom: 30px;
}

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

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

.btn-quote {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    background: var(--brand-blue);
    color: var(--brand-white);
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.95rem;
    transition: background 0.2s ease, transform 0.2s ease;
}

.btn-quote:hover {
    background: #2d4373;
    transform: translateY(-1px);
}

.logo {
    max-width: 200px;
    height: auto;
    display: block;
    margin: 0 auto 20px;
}

.logo-small {
    max-width: 80px;
    height: auto;
}

h1 {
    color: var(--brand-blue);
    font-size: 2.5rem;
    margin-bottom: 10px;
}

h2 {
    color: var(--brand-blue);
    font-size: 2rem;
    margin-bottom: 20px;
}

h3 {
    color: var(--brand-blue);
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.subtitle {
    color: var(--gray-dark);
    font-size: 1.1rem;
}

.hidden-login-link {
    display: inline-block;
    margin-top: 6px;
    color: var(--brand-blue);
    font-family: 'Montserrat', 'Segoe UI', sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    text-decoration: none;
    transition: color 0.2s ease, transform 0.2s ease;
}

.hidden-login-link:hover,
.hidden-login-link:focus {
    color: #2d4373;
    transform: translateY(-1px);
}

.welcome-section {
    text-align: center;
    padding: 40px;
    background: var(--brand-white);
    border-radius: 10px;
    margin-bottom: 40px;
}

.buttons-container {
    display: flex;
    gap: 30px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 0.85em 1.6em;
    font-size: 1rem;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn:disabled,
.btn[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.btn-primary {
    background: var(--brand-blue);
    color: var(--brand-white);
}

.btn-primary:hover {
    background: #2d4373;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(59, 89, 152, 0.3);
}

.btn-nomenclature {
    background: #4f8fd8;
    border-color: #4f8fd8;
    color: #fff;
}
.btn-nomenclature:hover {
    background: #3c79c2;
    border-color: #3c79c2;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(63, 116, 194, 0.3);
}

.btn-info {
    background: #4f8fd8;
    border: 1px solid #4f8fd8;
    color: #fff;
}
.btn-info:hover {
    background: #3c79c2;
    border-color: #3c79c2;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(63, 116, 194, 0.25);
}

.btn-secondary {
    background: var(--brand-orange);
    color: var(--brand-white);
}

.btn-secondary:hover {
    background: #d35400;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(230, 126, 34, 0.3);
}

/* Danger buttons (global) */
.btn-danger {
    background: var(--error);
    color: var(--brand-white);
}
.btn-danger:hover {
    background: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(231, 76, 60, 0.3);
}
.btn-link.btn-danger {
    background: none;
    color: var(--error);
}
.btn-link.btn-danger:hover {
    text-decoration: underline;
    background: none;
}

.btn-back, .btn-logout {
    padding: 8px 16px;
    background: var(--gray-medium);
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 5px;
    font-size: 0.9rem;
    transition: background 0.3s;
}

.btn-back:hover, .btn-logout:hover {
    background: var(--gray-dark);
    color: var(--brand-white);
}

.icon {
    width: 24px;
    height: 24px;
}

.table-container {
    background: var(--brand-white);
    border-radius: 10px;
    padding: 20px;
    overflow-x: auto;
    margin-bottom: 30px;
}

/* Fulfillment briefs */
.container.ff-container,
.ff-container {
    max-width: 100%;
    width: 100%;
    margin: 0 auto 24px;
    padding: 0 24px;
}

.ff-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--brand-white);
    padding: 8px 16px;
    border-radius: 8px;
    border-bottom: 1px solid var(--brand-orange);
    margin: 8px auto 12px;
    gap: 16px;
}

.ff-header h1 {
    margin-bottom: 2px;
    font-size: 1.65rem;
}

.ff-back-link {
    display: inline-flex;
    align-items: center;
    margin-bottom: 4px;
    color: var(--brand-blue);
    font-weight: 500;
    text-decoration: none;
    font-size: 0.95rem;
}

.ff-back-link:hover,
.ff-back-link:focus {
    text-decoration: underline;
}

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

.ff-card {
    background: var(--brand-white);
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 16px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.ff-card-slim {
    padding: 12px 16px;
}

.ff-card-title {
    margin: 0 0 12px;
    font-size: 1.4rem;
}

.ff-tooltip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    margin-left: 6px;
    font-size: 11px;
    font-weight: 600;
    font-style: normal;
    color: #6b7280;
    background: #e5e7eb;
    border-radius: 50%;
    cursor: help;
    vertical-align: middle;
}
.ff-tooltip-icon:hover {
    background: #d1d5db;
    color: #374151;
}

.ff-grid {
    display: grid;
}

.ff-grid-compact {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 12px 20px;
}

.ff-supply-field {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ff-supply-top {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.ff-supply-number {
    flex: 1 1 420px;
}

.ff-supply-date {
    flex: 0 0 220px;
}

.ff-supply-date input {
    width: 100%;
}

.ff-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.ff-sheet-header {
    gap: 16px;
    flex-wrap: wrap;
}

.ff-sheet-summary {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.ff-summary-counter {
    border: 1px solid var(--gray-medium);
    background: var(--brand-white);
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.9rem;
    cursor: pointer;
}

.ff-summary-counter:disabled {
    opacity: 0.4;
    cursor: default;
}

.ff-sheet-wrapper {
    overflow-x: auto;
}

.ff-sheet-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 1100px;
    font-size: 0.95rem;
}

.ff-sheet-table thead th {
    position: sticky;
    top: 0;
    background: var(--gray-light);
    border-bottom: 2px solid var(--gray-medium);
    padding: 10px;
    text-align: left;
    z-index: 2;
}

.ff-sheet-table tbody td {
    border-right: 1px solid var(--gray-medium);
    border-bottom: 1px solid var(--gray-medium);
    padding: 10px;
    vertical-align: top;
}

.col-distribution {
    min-width: 210px;
}

.col-volume {
    width: 110px;
}

.ff-cell-distribution {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ff-cell-work-notes {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ff-autocomplete-field {
    position: relative;
    display: flex;
    flex-direction: column;
}

.ff-autocomplete-field input,
.ff-autocomplete-field textarea {
    width: 100%;
}

.ff-autocomplete-field textarea {
    resize: vertical;
}

.ff-autocomplete-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--brand-white);
    border: 1px solid var(--gray-medium);
    border-radius: 6px;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.15);
    z-index: 30;
    max-height: 200px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 4px 0;
}

.ff-autocomplete-dropdown[hidden] {
    display: none;
}

.ff-input-error {
    border-color: #f04438 !important;
    background-color: #ffecec !important;
}

.ff-autocomplete-option {
    text-align: left;
    background: transparent;
    border: none;
    padding: 6px 12px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.15s ease;
}

.ff-autocomplete-option:hover,
.ff-autocomplete-option:focus {
    background: rgba(59, 89, 152, 0.12);
    outline: none;
}

.ff-services-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.ff-services-tags {
    display: inline-block;
    background: rgba(59, 89, 152, 0.08);
    color: var(--brand-blue);
    border-radius: 999px;
    padding: 4px 10px;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    max-width: 100%;
}

.ff-services-modal,
.ff-services-help-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 60px 24px;
    z-index: 130;
}

.ff-services-modal[hidden],
.ff-services-help-modal[hidden] {
    display: none;
}

.ff-services-modal__content,
.ff-services-help-modal__content {
    position: relative;
    background: var(--brand-white);
    border-radius: 12px;
    padding: 28px;
    width: min(820px, 95vw);
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.ff-services-modal__close,
.ff-services-help-modal__close {
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 1.8rem;
    background: none;
    border: none;
    cursor: pointer;
}

.ff-services-modal__controls {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.ff-services-search {
    flex: 1;
    min-width: 220px;
    padding: 8px 12px;
    border: 1px solid var(--gray-medium);
    border-radius: 6px;
}

.ff-services-selected-info {
    font-size: 0.9rem;
    color: var(--gray-dark);
}

.ff-services-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 4px;
}

.ff-services-category h4 {
    margin-bottom: 8px;
    color: var(--brand-blue);
}

.ff-services-category__list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ff-service-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border: 1px solid transparent;
    border-radius: 8px;
    transition: border-color 0.2s ease, background 0.2s ease;
    cursor: pointer;
}

.ff-service-option input {
    margin-right: 4px;
}

.ff-service-option__name {
    flex: 1;
}

.ff-service-option__price {
    color: var(--gray-dark);
    font-size: 0.8rem;
}

.ff-service-option:hover,
.ff-service-option--checked {
    border-color: var(--brand-blue);
    background: rgba(59, 89, 152, 0.08);
}

.ff-services-modal__actions,
.ff-services-help-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.ff-services-empty {
    text-align: center;
    color: var(--gray-dark);
    font-size: 0.85rem;
}

.ff-services-help-section ul {
    margin: 8px 0 16px;
    padding-left: 20px;
    list-style: disc;
}

.ff-services-help-category {
    margin-bottom: 18px;
}

.ff-services-help-category ul {
    margin: 6px 0 0;
    padding-left: 18px;
    list-style: circle;
}

.ff-distribution-preview {
    font-size: 0.9rem;
    color: var(--text-primary);
}

.ff-distribution-badge {
    display: inline-block;
    background: rgba(59, 89, 152, 0.08);
    color: var(--brand-blue);
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 0.85rem;
    line-height: 1.2;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ff-sheet-table tbody td:first-child,
.ff-sheet-table thead th:first-child {
    border-left: 1px solid var(--gray-medium);
}

.ff-sheet-table input,
.ff-sheet-table textarea,
.ff-sheet-table select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--gray-medium);
    border-radius: 6px;
    font-size: 0.9rem;
    background: var(--brand-white);
}

.ff-sheet-table textarea {
    resize: vertical;
}

.ff-cell-error input,
.ff-cell-error textarea,
.ff-cell-error select {
    border-color: var(--error);
    background: rgba(231, 76, 60, 0.1);
}

.ff-cell-warning input,
.ff-cell-warning textarea,
.ff-cell-warning select {
    border-color: var(--warning);
    background: rgba(243, 156, 18, 0.12);
}

.ff-sheet-table tbody tr.status-error {
    background: rgba(231, 76, 60, 0.05);
}

.ff-sheet-table tbody tr.status-warning {
    background: rgba(243, 156, 18, 0.05);
}

.ff-cell-status {
    text-align: center;
    width: 70px;
}

.ff-cell-actions {
    text-align: center;
    width: 120px; /* больше места под подпись «Удалить» */
}

/* Small action icon next to label */
.ff-action-icon {
    display: inline-block;
    vertical-align: middle;
}
.ff-action-label {
    vertical-align: middle;
}

.ff-sheet-hint {
    margin-top: 12px;
    color: var(--gray-dark);
    font-size: 0.85rem;
}

.ff-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

.ff-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ff-field-inline {
    display: flex;
    gap: 6px;
    align-items: center;
    width: 100%;
}

.ff-field-inline input {
    flex: 1;
    min-width: 0;
}

.ff-field-hint {
    margin-top: 4px;
    font-size: 0.85rem;
    color: var(--gray-dark);
}

.ff-field-hint--success {
    color: var(--success);
}

.ff-field-hint--error {
    color: var(--error);
}

.ff-wb-supplies-hint {
    margin-top: 6px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.9rem;
}

.ff-wb-supplies-hint[hidden] {
    display: none;
}

.ff-wb-supplies-meta {
    color: var(--gray-dark);
    line-height: 1.3;
}

.ff-wb-supplies-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.ff-wb-supplies-actions .btn-link,
.ff-wb-supplies-actions .btn-link:focus,
.ff-wb-supplies-actions .btn-link:hover {
    padding: 0;
}

.ff-wb-supplies-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.ff-wb-supplies-list[hidden] {
    display: none;
}

.ff-wb-supply-option {
    padding: 4px 8px;
    border: 1px solid var(--gray-medium);
    border-radius: 6px;
    background: var(--brand-white);
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.ff-wb-supplies-btn {
    flex: none;
    padding: 4px 10px;
    font-size: 0.85rem;
    line-height: 1.2;
    min-width: 42px;
}

.ff-wb-supply-option:hover,
.ff-wb-supply-option:focus {
    background: var(--gray-light);
    border-color: var(--brand-blue);
    outline: none;
}

.ff-field input,
.ff-field select,
.ff-field textarea,
.ff-input,
.ff-textarea {
    padding: 10px 12px;
    border: 1px solid var(--gray-medium);
    border-radius: 6px;
    font-size: 0.95rem;
}

.ff-wb-supply-input {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}

.ff-wb-supply-input > input {
    flex: 1 1 auto;
    min-width: 0;
}

.ff-field textarea,
.ff-textarea {
    resize: vertical;
}

.ff-import-trigger-btn {
    white-space: normal;
    text-align: left;
}

.ff-import-actions {
    margin-top: 8px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.ff-import-actions .btn,
.ff-import-actions select {
    flex: 0 0 auto;
}

.ff-import-actions select {
    min-width: 140px;
}

.btn.is-loading {
    opacity: 0.6;
    pointer-events: none;
}

.ff-field-full {
    grid-column: 1 / -1;
}

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

.btn-small {
    padding: 0.4em 1em;
    font-size: 0.85rem;
}

.btn-link {
    background: none;
    color: var(--brand-blue);
    padding: 0;
    font-size: 0.9rem;
}

.btn-link:hover {
    text-decoration: underline;
    background: none;
}

.ff-help {
    background: var(--brand-white);
    border-radius: 10px;
    padding: 18px 24px;
    margin-bottom: 24px;
    border-left: 4px solid var(--brand-blue);
}

.ff-help ul {
    list-style: disc;
    padding-left: 20px;
}

.ff-extras-list,
.ff-item-extras {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ff-extra-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.ff-extra-row input {
    flex: 1;
}

.ff-table-wrapper {
    overflow-x: auto;
}

.ff-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.ff-table th,
.ff-table td {
    border: 1px solid var(--gray-medium);
    padding: 10px;
    vertical-align: top;
}

.ff-table th {
    background: var(--gray-light);
    text-align: left;
}

.text-right {
    text-align: right;
}

.empty-block {
    text-align: center;
    padding: 30px;
    color: var(--gray-dark);
}

.ff-tag {
    display: inline-block;
    background: var(--gray-light);
    color: var(--gray-dark);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.8rem;
    margin: 2px;
}

.ff-tag-accent {
    background: rgba(67, 160, 71, 0.15);
    color: #2b8a3e;
    font-weight: 600;
}

.ff-distribution-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.ff-distribution-summary--empty {
    color: var(--gray-dark);
    font-style: italic;
}

.ff-distribution-summary-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 12px;
}

.ff-distribution-available {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.ff-distribution-available__label {
    font-weight: 600;
    color: var(--gray-dark);
}

.ff-distribution-available__list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ff-distribution-chip {
    border: 1px dashed var(--brand-blue);
    background: rgba(59, 89, 152, 0.08);
    color: var(--brand-blue);
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.ff-distribution-chip:hover,
.ff-distribution-chip:focus {
    background: rgba(59, 89, 152, 0.18);
    color: var(--brand-blue);
    outline: none;
}

.ff-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.ff-muted {
    color: var(--gray-dark);
    font-size: 0.85rem;
}

.ff-photo-preview img {
    max-width: 120px;
    border-radius: 6px;
    display: block;
}

.ff-photo-stack {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ff-photo-placeholder {
    display: inline-block;
    padding: 8px 12px;
    border: 1px dashed var(--gray-medium);
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--gray-dark);
}

.ff-photo-upload {
    position: relative;
    display: inline-block;
    margin-top: 6px;
}

.ff-photo-thumb {
    border: none;
    background: transparent;
    padding: 0;
    cursor: pointer;
}

.ff-photo-thumb img {
    width: 180px;
    height: 180px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--gray-medium);
}

.ff-photo-thumb--external img {
    width: 140px;
    height: 140px;
}

.ff-brief-form .btn-secondary {
    background: var(--brand-blue);
    color: var(--brand-white);
    border: none;
}

.ff-brief-form .btn-secondary:hover {
    background: #2d4373;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(59, 89, 152, 0.3);
}

.help-steps {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 10px;
}

.help-step-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
}

.help-step-header h3 {
    margin: 0 0 6px 0;
}

.help-step-desc {
    margin: 0;
    color: #475569;
}

.help-step-image-link {
    display: block;
    margin-top: 12px;
    position: relative;
}

.help-step-image-link img {
    width: 100%;
    max-height: 720px;
    object-fit: contain;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
}

.help-step-hint {
    display: inline-block;
    margin-top: 6px;
    color: #1d4ed8;
    font-size: 13px;
}

.help-next {
    margin-top: 24px;
    padding: 16px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
}

.help-missing {
    margin: 8px 0 0 0;
    color: #c0392b;
}

.ff-tag-custom {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.ff-tag-custom button {
    border: none;
    background: none;
    color: inherit;
    cursor: pointer;
    font-size: 0.85rem;
}

.ff-photo-buttons {
    margin-top: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ff-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
}

.ff-checkbox-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
}

.ff-info {
    color: var(--gray-dark);
}

.ff-table .ff-input,
.ff-table .ff-textarea {
    width: 100%;
}

.ff-summary {
    background: var(--brand-white);
    border-radius: 10px;
    padding: 24px;
    margin-bottom: 24px;
}

.ff-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.ff-comment {
    border-top: 1px solid var(--gray-medium);
    padding-top: 16px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: var(--gray-medium);
    color: var(--text-primary);
}

/* Крупнее для значков статусов в ТЗ */
.ff-status-badge {
    font-size: 1.15rem;
    line-height: 1.1;
    padding: 6px 12px;
}

.status-ok {
    background: rgba(39, 174, 96, 0.15);
    color: #1e8449;
}

.status-warning {
    background: rgba(243, 156, 18, 0.18);
    color: #b9770e;
}

.status-error {
    background: rgba(231, 76, 60, 0.18);
    color: #c0392b;
}

.ff-row-highlight {
    animation: ff-row-glow 1.2s ease-in-out;
}

@keyframes ff-row-glow {
    0% { box-shadow: inset 0 0 0 0 rgba(52, 152, 219, 0.4); }
    50% { box-shadow: inset 0 0 0 260px rgba(52, 152, 219, 0.18); }
    100% { box-shadow: inset 0 0 0 0 rgba(52, 152, 219, 0); }
}

.ff-photo-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.ff-photo-modal[hidden] {
    display: none;
}

.ff-photo-modal__content {
    position: relative;
    background: var(--brand-white);
    padding: 18px;
    border-radius: 10px;
    max-width: 80vw;
    max-height: 80vh;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
}

.ff-photo-modal__content img {
    max-width: 70vw;
    max-height: 70vh;
}

.ff-photo-modal__close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    font-size: 1.6rem;
    cursor: pointer;
}

.ff-distribution-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 60px 24px;
    z-index: 120;
}

.ff-distribution-modal[hidden] {
    display: none;
}

.ff-distribution-modal__content {
    position: relative;
    background: var(--brand-white);
    border-radius: 12px;
    padding: 28px;
    width: min(760px, 95vw);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.ff-distribution-modal__title {
    font-size: 1.3rem;
    color: var(--brand-blue);
}

.ff-distribution-modal__summary {
    font-size: 0.95rem;
    color: var(--gray-dark);
    display: flex;
    gap: 12px;
}

.ff-dist-remaining--negative {
    color: var(--error);
    font-weight: 600;
}

.ff-dist-remaining--positive {
    color: var(--warning);
    font-weight: 600;
}

.ff-distribution-modal__close {
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 1.8rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gray-dark);
}

.ff-distribution-tools {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.ff-distribution-table-wrapper {
    border: 1px solid var(--gray-medium);
    border-radius: 8px;
    overflow: hidden;
    max-height: min(65vh, 620px);
    overflow-y: auto;
}

.ff-distribution-table {
    width: 100%;
    border-collapse: collapse;
}

.ff-distribution-table thead th {
    background: var(--gray-light);
    padding: 10px;
    font-weight: 600;
    font-size: 0.9rem;
}

.ff-distribution-table tbody td {
    padding: 10px;
    border-top: 1px solid var(--gray-medium);
}

.ff-distribution-table input[type="number"] {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid var(--gray-medium);
    border-radius: 6px;
    font-size: 0.9rem;
    text-align: right;
}

.ff-distribution-table__actions,
.ff-distribution-table tbody td.ff-distribution-table__actions {
    text-align: right;
    width: 120px;
    white-space: nowrap;
}

.ff-distribution-table tbody td.ff-distribution-table__actions {
    vertical-align: middle;
}

.ff-dist-remove {
    padding: 0;
    font-size: 0.85rem;
}

.ff-distribution-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.ff-distribution-empty td {
    text-align: center;
    padding: 18px;
}

.ff-wb-modal {
    position: fixed;
    inset: 0;
    z-index: 140;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    background: rgba(0, 0, 0, 0.55);
}

.ff-wb-modal[hidden] {
    display: none;
}

.ff-wb-modal__content {
    position: relative;
    background: var(--brand-white);
    border-radius: 14px;
    width: min(1050px, 96vw);
    max-height: 82vh;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ff-wb-modal__close {
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 1.8rem;
    border: none;
    background: transparent;
    color: var(--gray-dark);
    cursor: pointer;
}

.ff-wb-modal__header {
    padding: 24px 28px 12px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ff-wb-modal__title {
    font-size: 1.35rem;
    color: var(--brand-blue);
    margin: 0;
}

.ff-wb-search-form {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ff-wb-search-input {
    flex: 1;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid var(--gray-medium);
    font-size: 1rem;
}

.ff-wb-search-submit {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
}

.ff-wb-modal__body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0 28px 20px;
    gap: 12px;
    min-height: 0;
}

.ff-wb-loader {
    font-size: 0.95rem;
    color: var(--gray-dark);
}

.ff-wb-message {
    padding: 18px;
    border-radius: 10px;
    background: var(--gray-light);
    color: var(--gray-dark);
    font-size: 0.95rem;
    text-align: center;
}

.ff-wb-results-wrap {
    flex: 1;
    border: 1px solid var(--gray-medium);
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.ff-wb-results-scroll {
    flex: 1;
    overflow: auto;
    min-height: 0;
}

.ff-wb-results-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
}

.ff-wb-results-table thead th {
    position: sticky;
    top: 0;
    background: var(--gray-light);
    padding: 12px;
    font-weight: 600;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--gray-medium);
    text-align: left;
}

.ff-wb-results-table tbody td {
    padding: 12px;
    border-bottom: 1px solid var(--gray-light);
    vertical-align: middle;
    font-size: 0.92rem;
}

.ff-wb-results-table tbody tr:hover {
    background: rgba(148, 187, 233, 0.15);
}

.ff-wb-photo {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--gray-medium);
}

.ff-wb-photo--placeholder {
    width: 64px;
    height: 64px;
    border-radius: 8px;
    border: 1px dashed var(--gray-medium);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-medium);
    font-size: 0.85rem;
}

.ff-wb-stock-badge {
    display: inline-flex;
    padding: 4px 8px;
    border-radius: 999px;
    background: var(--gray-light);
    font-size: 0.85rem;
    color: var(--gray-dark);
}

.ff-wb-modal__footer {
    padding: 16px 28px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.ff-wb-meta {
    font-size: 0.88rem;
    color: var(--gray-dark);
}

.ff-wb-actions {
    display: flex;
    gap: 12px;
}

.ff-article-field {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ff-article-field input[type="text"] {
    flex: 1;
}

.ff-article-search-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid var(--gray-medium);
    background: var(--gray-light);
    color: var(--gray-dark);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.ff-article-search-btn:hover,
.ff-article-search-btn:focus-visible {
    background: var(--brand-blue);
    color: #fff;
    border-color: var(--brand-blue);
}

.ff-article-search-btn svg {
    width: 16px;
    height: 16px;
}

.status-draft {
    background: rgba(156, 163, 175, 0.18);
    color: #374151;
}

.status-submitted,
.status-approved {
    background: rgba(253, 224, 71, 0.28);
    color: #854d0e;
}

.status-needs_revision {
    background: #ef4444;
    color: #ffffff;
}

.status-arrived_ff,
.status-acceptance,
.status-processing,
.status-acceptance_closed {
    background: rgba(134, 239, 172, 0.24);
    color: #166534;
}

.status-returned_goods {
    background: rgba(248, 113, 113, 0.2);
    color: #9f1239;
}

.status-partially_shipped {
    background: rgba(56, 189, 248, 0.2);
    color: #0f766e;
}

.status-shipped_to_wb {
    background: rgba(96, 165, 250, 0.2);
    color: #1d4ed8;
}

.status-cancelled {
    background: rgba(231, 76, 60, 0.15);
    color: #c0392b;
}

.status-completed {
    background: rgba(34, 197, 94, 0.18);
    color: #15803d;
}

.status-payment {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.status-invoice_sent,
.status-payment_hold {
    background: rgba(196, 181, 253, 0.28);
    color: #5b21b6;
}

.status-paid {
    background: rgba(110, 231, 183, 0.28);
    color: #047857;
}

.alert {
    margin-bottom: 16px;
    padding: 12px 16px;
    border-radius: 6px;
}

.alert-error {
    background: rgba(231, 76, 60, 0.12);
    color: #c0392b;
}

.alert-security {
    background: rgba(59, 130, 246, 0.12);
    color: #1d4ed8;
    border: 1px solid rgba(59, 130, 246, 0.25);
}

.flash-messages {
    margin-bottom: 16px;
}

.ff-status-line {
    font-size: 0.95rem;
    color: var(--gray-dark);
}

.ff-table td textarea {
    min-width: 160px;
}

.price-table, .admin-table {
    width: 100%;
    border-collapse: collapse;
}

.price-table th, .admin-table th {
    background: var(--brand-blue);
    color: var(--brand-white);
    padding: 12px;
    text-align: left;
    font-weight: 600;
}

.price-table td, .admin-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--gray-medium);
}

.price-table tr:hover, .admin-table tr:hover {
    background: var(--gray-light);
}

.category {
    color: var(--brand-blue);
    font-weight: 600;
}

.price {
    color: var(--brand-orange);
    font-weight: bold;
}

.btn-details {
    padding: 5px 15px;
    background: var(--brand-orange);
    color: var(--brand-white);
    text-decoration: none;
    border-radius: 5px;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.btn-details:hover {
    background: #d35400;
    transform: scale(1.05);
}

.btn-details.btn-disabled {
    background: var(--gray-medium);
    color: var(--gray-dark);
    cursor: not-allowed;
    pointer-events: none;
    transform: none;
}

.btn-details.btn-disabled:hover {
    background: var(--gray-medium);
}

.contacts-section {
    background: var(--brand-white);
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 30px;
}

.contacts-section p {
    margin-bottom: 10px;
}

.contacts-section a {
    color: var(--brand-orange);
    text-decoration: none;
}

.contacts-section a:hover {
    text-decoration: underline;
}

footer {
    text-align: center;
    padding: 20px;
    color: var(--gray-dark);
    margin-top: 50px;
}

.alert {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 5px;
    font-weight: 500;
}

.alert-success {
    background: var(--success);
    color: var(--brand-white);
}

.alert-error {
    background: var(--error);
    color: var(--brand-white);
}

.alert-warning {
    background: var(--warning);
    color: var(--brand-white);
}

.alert-info {
    background: var(--info);
    color: var(--brand-white);
}

.alert-security {
    background: rgba(59, 130, 246, 0.16);
    color: #0f172a;
}

.login-container {
    max-width: 400px;
    margin: 100px auto;
    background: var(--brand-white);
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.login-form {
    margin-top: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--brand-blue);
    font-weight: 600;
}

.form-group input, .form-group textarea, .form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--gray-medium);
    border-radius: 5px;
    font-size: 1rem;
}

.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--brand-orange);
}

.login-footer {
    margin-top: 20px;
    text-align: center;
}

.link-back {
    color: var(--brand-blue);
    text-decoration: none;
}

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

.service-details {
    background: var(--brand-white);
    padding: 30px;
    border-radius: 10px;
}

.details-info {
    margin: 30px 0;
}

.info-row {
    display: flex;
    padding: 10px 0;
    border-bottom: 1px solid var(--gray-medium);
}

.info-row .label {
    font-weight: 600;
    color: var(--brand-blue);
    width: 150px;
}

.price-large {
    font-size: 1.5rem;
    color: var(--brand-orange);
    font-weight: bold;
}

.description-section, .video-section {
    margin-top: 30px;
}

.description-content {
    background: var(--gray-light);
    padding: 20px;
    border-radius: 5px;
    line-height: 1.8;
}

.video-placeholder {
    background: var(--gray-light);
    padding: 40px;
    border-radius: 10px;
    text-align: center;
}

.video-link {
    display: inline-flex;
    align-items: center;
    gap: 15px;
    color: var(--brand-orange);
    text-decoration: none;
    font-size: 1.2rem;
    transition: transform 0.3s;
}

.video-link:hover {
    transform: scale(1.1);
}

.action-buttons {
    margin-top: 40px;
    text-align: center;
}

.admin-panel .header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.admin-name {
    color: var(--brand-blue);
    font-weight: 600;
}

.admin-actions {
    margin-bottom: 20px;
}

.service-form {
    background: var(--brand-white);
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 30px;
    border: 2px solid var(--brand-orange);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.inline-edit {
    padding: 5px;
    border: 1px solid var(--gray-medium);
    border-radius: 3px;
    width: 100%;
}

.inline-edit.small {
    width: 80px;
}

.btn-save {
    padding: 5px 10px;
    background: var(--success);
    color: var(--brand-white);
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.9rem;
}

.btn-save:hover {
    background: #229954;
}

/* Table of Contents */
.toc {
    background: var(--gray-light);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    border-left: 4px solid var(--brand-orange);
}

.toc h3 {
    margin-bottom: 15px;
    color: var(--brand-blue);
    font-size: 1.2rem;
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 10px;
}

.toc-list li {
    margin: 0;
}

.toc a {
    display: block;
    padding: 8px 12px;
    background: var(--brand-white);
    color: var(--brand-blue);
    text-decoration: none;
    border-radius: 5px;
    transition: all 0.3s ease;
    border: 1px solid var(--gray-medium);
}

.toc a:hover {
    background: var(--brand-blue);
    color: var(--brand-white);
    transform: translateX(5px);
}

/* Price Sections */
.price-sections {
    margin-bottom: 40px;
}

.price-section {
    margin-bottom: 40px;
}

.price-section:last-child {
    margin-bottom: 0;
}

.price-section__header{
  background: var(--brand-blue);
  padding: 10px 14px;
  border-radius: 8px 8px 0 0;
}


.price-section__title{
  margin: 0;
  color: var(--brand-white);
  font-weight: 600;
  line-height: 1.3;
  display: flex;
  align-items: center;
  min-height: 36px; /* исключаем схлопывание */
  word-break: break-word;
  white-space: normal;
}

.price-section .table-container {
    margin-top: 0;
    border-radius: 0 0 8px 8px;
    border-top: none;
}

.price-section .price-table {
    margin-top: 0;
}

.price-section .price-table thead th {
    background: var(--brand-blue);
    border-top: none;
}

/* Reset zebra stripes within each section */
.price-section .price-table tbody tr:nth-child(odd) {
    background: var(--brand-white);
}

.price-section .price-table tbody tr:nth-child(even) {
    background: var(--gray-light);
}

.price-section .price-table tbody tr:hover {
    background: #e8f4fd;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--brand-orange);
    color: var(--brand-white);
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: #d35400;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

/* Mobile-specific table wrapper */
.price-table-wrap {
    overflow: hidden;
}

/* Base column classes for targeting */
.col-name, .col-price, .col-unit, .col-actions {
    /* Base styles - can be used for future enhancements */
}

/* Button details unified */
.btn-details {
    display: inline-block;
    padding: 10px 14px;
    border-radius: 8px;
    text-decoration: none;
    line-height: 1.2;
}

/* Table columns */
.price-table .col-name { width: auto; }
.price-table .col-price { white-space: nowrap; }
.price-table .col-unit { white-space: nowrap; }
.price-table .col-actions { text-align: right; }

/* Table of Contents mobile optimization */
.toc {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    padding-bottom: 6px;
}

.toc a {
    flex: 0 0 auto;
    scroll-snap-align: start;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .price-section__title { font-size: 18px; }
    .btn-details { padding: 10px 12px; }

    h1 {
        font-size: 2rem;
    }

    .buttons-container {
        flex-direction: column;
    }

    .table-container {
        overflow-x: scroll;
    }

    .header-content {
        flex-direction: column;
        gap: 15px;
    }

    .price-actions {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .toc-list {
        grid-template-columns: 1fr;
    }

    .price-section__header {
        padding: 12px 16px;
    }

    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
        font-size: 1.3rem;
    }
}

@media (max-width: 576px) {
    /* Карточная раскладка строк: шапку убираем, строки делаем block */
    .price-table thead { display: none; }
    .price-table, .price-table tbody, .price-table tr, .price-table td {
        display: block;
        width: 100%;
    }
    .price-table tr {
        background: #fff;
        border: 1px solid rgba(0,0,0,0.06);
        border-radius: 10px;
        padding: 12px 12px 10px;
        margin-bottom: 12px;
    }
    .price-table td {
        padding: 4px 0;
    }

    /* Имя услуги — на всю ширину, жирнее */
    .price-table .col-name {
        font-weight: 600;
        margin-bottom: 6px;
    }

    /* Цена и единица в одну строку, если помещаются */
    .price-table .col-price,
    .price-table .col-unit {
        display: inline-block;
        margin-right: 12px;
    }

    /* Кнопка — во всю ширину, отдельной строкой внизу карточки */
    .price-table .col-actions {
        margin-top: 10px;
    }
    .price-table .col-actions .btn-details {
        display: block;
        width: 100%;
        text-align: center;
        min-height: 44px; /* комфортный тап-таргет */
    }
}

.ff-import-modal h5 {
    margin: 0 0 8px;
    font-size: 1rem;
}

.ff-import-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.ff-import-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

.ff-import-list {
    margin: 0;
    padding-left: 18px;
    max-height: 140px;
    overflow: auto;
}

.ff-import-preview {
    border: 1px solid var(--gray-light);
    border-radius: 8px;
    padding: 12px;
}

.ff-import-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 10px;
    gap: 10px;
}

.ff-import-preview-table {
    max-height: 280px;
    overflow: auto;
}

.ff-import-preview-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.ff-import-preview-table th,
.ff-import-preview-table td {
    border: 1px solid var(--gray-light);
    padding: 6px 8px;
    vertical-align: top;
}

.ff-import-preview-table th {
    background: var(--gray-lighter);
    position: sticky;
    top: 0;
    z-index: 1;
}

.ff-import-footer {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.ff-import-footer-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Telegram login styles */
.telegram-login-section {
    margin: 30px 0;
    text-align: center;
}

.divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--gray-medium);
}

.divider span {
    padding: 0 15px;
    color: var(--gray-dark);
    font-size: 14px;
}

.ff-kiz-panel {
    border: 1px dashed #d0d5dd;
    border-radius: 10px;
    padding: 12px;
    background: #f8fafc;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.ff-kiz-panel.is-dragover {
    border-color: #2563eb;
    background: #eff6ff;
}

.ff-kiz-topline {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
}

.ff-kiz-uploader {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.ff-kiz-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-width: 460px;
    font-size: 13px;
    color: #475569;
}

.ff-kiz-feedback {
    margin-top: 8px;
    font-size: 13px;
    color: #475467;
}

.ff-kiz-feedback.is-error {
    color: #d92d20;
}

.ff-kiz-status-row {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.ff-kiz-legacy {
    font-size: 12px;
    color: #d97706;
    display: flex;
    gap: 6px;
    align-items: center;
}

.ff-kiz-empty {
    color: #94a3b8;
    font-size: 13px;
}

.ff-kiz-list {
    list-style: none;
    margin: 8px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ff-kiz-item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
}

.ff-kiz-item-info {
    flex: 1;
    min-width: 0;
}

.ff-kiz-item-info strong {
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ff-kiz-meta {
    margin-top: 4px;
    font-size: 12px;
    color: #64748b;
}

.ff-kiz-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
    align-items: center;
}

.ff-kiz-actions .btn {
    white-space: nowrap;
}

/* ===== Номенклатура кабинета ===== */
.cabinet-nomenclature .cabinet-header {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 24px;
}

.cabinet-nomenclature h1 {
    margin: 4px 0 6px;
}

.cabinet-badge {
    display: inline-block;
    padding: 4px 8px;
    background: #f1f5f9;
    border-radius: 12px;
    font-size: 12px;
    color: #475569;
    margin: 0;
}

.cabinet-subtitle {
    margin: 0;
    color: #475569;
}

.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.tab-btn {
    border: 1px solid #cbd5e1;
    background: #fff;
    padding: 10px 14px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.tab-btn.active {
    background: #0f172a;
    color: #fff;
    border-color: #0f172a;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

.cabinet-nomenclature .card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
}

.card-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.card-header h2 {
    margin: 0 0 6px;
}

.muted {
    color: #475569;
    margin: 0;
}

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

.inline-field {
    display: flex;
    flex-direction: column;
    font-size: 12px;
    color: #475569;
}

.inline-field select {
    min-width: 240px;
}

.status-row {
    display: flex;
    justify-content: space-between;
    margin: 12px 0;
    gap: 12px;
    align-items: center;
}

.status-text {
    color: #0f172a;
}

.status-text.error {
    color: #dc2626;
}

.status-warning {
    color: #b45309;
    background: #fffbeb;
    border: 1px solid #fbbf24;
    padding: 8px 10px;
    border-radius: 8px;
}

.nomenclature-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.nomenclature-table th,
.nomenclature-table td {
    border: 1px solid #e2e8f0;
    padding: 8px 10px;
    text-align: left;
}

.nomenclature-table th {
    background: #f8fafc;
    font-weight: 600;
}

.nomenclature-table .col-photo {
    width: 90px;
}

.photo-hover {
    position: relative;
    display: inline-block;
}

.photo-thumb {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
    background: #fafafa;
}

.photo-hover__large {
    display: none;
    position: absolute;
    top: 0;
    left: 60px;
    z-index: 20;
    padding: 6px;
    background: #fff;
    border: 1px solid #d0d0d0;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.16);
}

.photo-hover__large img {
    width: 240px;
    height: 240px;
    object-fit: contain;
    display: block;
}

.photo-hover:hover .photo-hover__large {
    display: block;
}

.table-empty {
    text-align: center;
    color: #475569;
}

.pager {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 10px;
}

.pager-info {
    color: #475569;
}

.col-select {
    width: 40px;
    text-align: center;
}

.bulk-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin: 8px 0;
    flex-wrap: wrap;
}

.bulk-actions select {
    min-width: 200px;
}

.table-meta {
    color: #475569;
    font-size: 14px;
}

.filter-toggle {
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 12px;
    color: #475569;
    margin-left: 4px;
}

.filter-menu {
    position: absolute;
    z-index: 11000;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
    width: 240px;
    padding: 10px;
}

.filter-menu.hidden {
    display: none;
}

.filter-menu__header {
    margin-bottom: 6px;
    font-size: 13px;
    color: #0f172a;
}

.filter-menu__actions {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.filter-menu__actions button {
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    border-radius: 6px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 12px;
}

.filter-menu__list {
    max-height: 180px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 8px;
}

.filter-menu__list label {
    display: flex;
    gap: 6px;
    align-items: center;
    font-size: 13px;
    color: #0f172a;
}

.filter-menu__footer {
    text-align: right;
}

.filter-menu__footer button {
    border: 1px solid #cbd5e1;
    background: #0f172a;
    color: #fff;
    border-radius: 6px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 12px;
}

.filter-empty {
    color: #94a3b8;
    font-size: 13px;
}

.row-dirty {
    background: #fffbeb;
}

.cell-editor {
    width: 100%;
    min-height: 28px;
    font-size: 14px;
    padding: 4px 6px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    box-sizing: border-box;
}

/* Modal styles */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

.modal-overlay[hidden] {
    display: none;
}

.modal {
    background: var(--brand-white);
    border-radius: 12px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-medium);
}

.modal__header h2 {
    font-size: 1.25rem;
    color: var(--text-primary);
    margin: 0;
}

.modal__close {
    background: none;
    border: none;
    font-size: 1.75rem;
    color: var(--gray-dark);
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: background 0.2s ease;
}

.modal__close:hover {
    background: var(--gray-light);
}

.modal__body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.modal__footer {
    padding: 16px 24px;
    border-top: 1px solid var(--gray-medium);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.help-block {
    margin-bottom: 20px;
}

.help-block:last-child {
    margin-bottom: 0;
}

.help-block h3 {
    font-size: 1rem;
    color: var(--brand-blue);
    margin-bottom: 8px;
}

.help-block p {
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.help-block p:last-child {
    margin-bottom: 0;
}

.help-block ol {
    margin: 12px 0 12px 20px;
    font-size: 0.95rem;
}

.help-block ol li {
    margin-bottom: 4px;
}

.help-block code {
    background: var(--gray-light);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.9em;
}

/* Compact page header (reusable) */
.ff-page-header--compact .ff-page-header-line {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #0f172a;
}

.ff-page-header--compact .ff-page-header-title {
    font-weight: 700;
}

.ff-page-header--compact .ff-page-header-meta {
    font-weight: 500;
    color: #475569;
}

.ff-page-header-details {
    font-size: 13px;
    color: #475569;
}

.ff-page-header-details summary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    color: #2563eb;
    font-weight: 600;
    user-select: none;
    list-style: none;
}

.ff-page-header-details summary::-webkit-details-marker {
    display: none;
}
