/* PWA Signature Capture — модал подписи клиента */
.erpds-signature-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: stretch;
    justify-content: center;
}
.erpds-signature-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
}
.erpds-signature-modal__panel {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: min(720px, 100%);
    margin: auto;
    max-height: 100dvh;
    background: var(--erpds-surface, #ffffff);
    color: var(--erpds-text, #111111);
    border-radius: 12px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.35);
    border: 1px solid var(--erpds-border, #e5e7eb);
    overflow: hidden;
}
@media (max-width: 720px) {
    .erpds-signature-modal__panel {
        border-radius: 0;
        width: 100%;
        height: 100dvh;
        max-height: 100dvh;
    }
}
.erpds-signature-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    font-weight: 600;
    font-size: 16px;
    border-bottom: 1px solid var(--erpds-border, #e5e7eb);
}
.erpds-signature-modal__close {
    background: transparent;
    border: 0;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 10px;
    color: inherit;
    min-width: 44px;
    min-height: 44px;
}
.erpds-signature-modal__body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px 16px;
    flex: 1 1 auto;
    min-height: 0;
}
.erpds-signature-modal__label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 14px;
}
.erpds-signature-modal__signer {
    padding: 10px 12px;
    font-size: 16px;
    border: 1px solid var(--erpds-border, #d1d5db);
    border-radius: 6px;
    background: var(--erpds-surface-2, #ffffff);
    color: inherit;
}
.erpds-signature-modal__signer::placeholder {
    color: var(--erpds-text-faint, #6b7280);
}
.erpds-signature-modal__canvas-wrap {
    position: relative;
    flex: 1 1 auto;
    min-height: 220px;
    border: 1px dashed var(--erpds-border, #9ca3af);
    border-radius: 8px;
    background: #ffffff;
    overflow: hidden;
}
.erpds-signature-modal__canvas {
    display: block;
    width: 100%;
    height: 100%;
    touch-action: none;
    cursor: crosshair;
}
.erpds-signature-modal__hint {
    position: absolute;
    inset: auto 0 8px 0;
    text-align: center;
    font-size: 12px;
    color: var(--erpds-text-faint, #6b7280);
    pointer-events: none;
}
.erpds-signature-modal__error {
    min-height: 18px;
    color: var(--erpds-bad, #b91c1c);
    font-size: 13px;
}
.erpds-signature-modal__footer {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    padding: 12px 16px;
    border-top: 1px solid var(--erpds-border, #e5e7eb);
    flex-wrap: wrap;
}
.erpds-signature-modal__footer button {
    min-height: 44px;
    padding: 10px 18px;
    border-radius: 6px;
    border: 1px solid var(--erpds-border, #d1d5db);
    background: var(--erpds-surface-2, #ffffff);
    color: inherit;
    font-size: 15px;
    cursor: pointer;
}
.erpds-signature-modal__footer button:hover,
.erpds-signature-modal__footer button:focus-visible,
.erpds-signature-modal__close:hover,
.erpds-signature-modal__close:focus-visible {
    background: var(--erpds-accent-soft, rgba(24, 113, 165, 0.12));
    outline: none;
}
.erpds-signature-modal__save {
    background: var(--erpds-ok, #2E8540) !important;
    color: var(--erpds-on-accent, #ffffff) !important;
    border-color: var(--erpds-ok, #2E8540) !important;
}
.erpds-signature-modal__clear {
    background: transparent !important;
}

.erpds-signature-queue-status {
    position: fixed;
    right: max(12px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
    z-index: 9998;
    display: inline-flex;
    align-items: center;
    max-width: min(340px, calc(100vw - 24px));
    min-height: 40px;
    padding: 8px 12px;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    background: #eff6ff;
    color: #1e3a8a;
    box-shadow: 0 6px 24px rgba(15, 23, 42, 0.18);
    font: 600 13px/1.25 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    text-align: left;
    cursor: pointer;
}
.erpds-signature-queue-status:hover,
.erpds-signature-queue-status:focus-visible {
    outline: none;
    border-color: #2563eb;
    background: #dbeafe;
}
.erpds-signature-queue-status--offline {
    border-color: #fde68a;
    background: #fffbeb;
    color: #92400e;
}
.erpds-signature-queue-status--failed {
    border-color: #fecaca;
    background: #fef2f2;
    color: #991b1b;
}
.erpds-signature-queue-status--syncing {
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: #166534;
}
@media (max-width: 720px) {
    .erpds-signature-queue-status {
        right: max(8px, env(safe-area-inset-right));
        bottom: max(8px, env(safe-area-inset-bottom));
        max-width: calc(100vw - 16px);
        min-height: 38px;
        font-size: 12px;
    }
}
