/* Проверка ЭЦП - Public Styles */

.sdv-doc-link-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
}

.sdv-doc-link-wrapper a {
    flex: 1;
    display: flex;
    align-items: center;
}

.sdv-doc-link-wrapper a .sdv-sig-icon {
    margin-left: auto;
    flex-shrink: 0;
}

/* Signature Icon — только SVG-значок (стиль vesna .dl) */
.sdv-sig-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 12px;
    border-radius: 22px;
    border: 1.5px solid #d3ddd7;
    color: #2f7d5b;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
    font-size: 0.82rem;
    font-weight: 500;
    white-space: nowrap;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: transparent;
    opacity: 0.85;
    transition: all 0.2s ease;
}

/* SVG-иконка (по умолчанию или из настройки «Код иконки svg») */
.sdv-sig-icon svg {
    display: block;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.sdv-sig-icon:hover,
.sdv-sig-icon:focus {
    opacity: 1;
    background: #2f7d5b;
    color: #ffffff;
    border-color: #2f7d5b;
    transform: none;
}

.sdv-sig-icon:hover svg,
.sdv-sig-icon:focus svg {
    /* На зелёном фоне любая иконка (в т.ч. пользовательская) становится белой */
    filter: brightness(0) invert(1);
}

/* Tooltip — цвета vesna */
.sdv-tooltip {
    position: fixed;
    z-index: 999999;
    background: #ffffff;
    border: 1px solid #e4ece7;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    padding: 16px;
    min-width: 320px;
    max-width: 400px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #47524c;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.sdv-tooltip-header {
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    color: #1a231f;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e4ece7;
    letter-spacing: 0.3px;
}

.sdv-tooltip-row {
    margin-bottom: 8px;
    display: flex;
    flex-direction: column;
    border-bottom: 1px solid #e4ece7;
}

.sdv-tooltip-label {
    font-weight: 600;
    color: #748079;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.sdv-tooltip-value {
    color: #1a231f;
    word-break: break-word;
    font-size: 13px;
}

.sdv-tooltip-actions {
    display: none;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e4ece7;
    flex-wrap: wrap;
}

.sdv-tooltip-actions.sdv-show {
    display: flex;
}

.sdv-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    line-height: 1.4;
}

.sdv-btn-primary {
    background: #2f7d5b;
    color: #fff;
}

.sdv-btn-primary:hover {
    background: #1e5a41;
    color: #fff;
}

.sdv-btn-secondary {
    background: #fafcfb;
    color: #47524c;
    border: 1px solid #d3ddd7;
}

.sdv-btn-secondary:hover {
    background: #2f7d5b;
    color: #fff;
    border-color: #2f7d5b;
}

.sdv-btn-group {
    position: relative;
    display: inline-block;
}

.sdv-btn-group .sdv-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #ffffff;
    border: 1px solid #e4ece7;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    min-width: 160px;
    z-index: 10000;
    margin-top: 4px;
    overflow: hidden;
}

.sdv-btn-group.open .sdv-dropdown {
    display: block;
}
.sdv-dropdown a {
    display: block;
    padding: 8px 12px;
    color: #1a231f;
    text-decoration: none;
    font-size: 12px;
    border-bottom: 1px solid #e4ece7;
}

.sdv-dropdown a:last-child {
    border-bottom: none;
}

.sdv-dropdown a:hover {
    text-decoration: underline;
    color: #2f7d5b;
}

/* Modal / Popup — цвета vesna */
.sdv-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(26,35,31,0.55);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s;
    padding: 20px;
    backdrop-filter: blur(4px);
}

.sdv-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.sdv-modal {
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    max-width: 480px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
    scrollbar-width: none;
}

.sdv-modal::-webkit-scrollbar {
    display: none;
}

.sdv-modal-body {
    padding: 24px;
    background: #fafcfb;
    overflow-y: auto;
    max-height: 60vh;
    scrollbar-width: thin;
    scrollbar-color: #d3ddd7 #fafcfb;
}

.sdv-modal-body::-webkit-scrollbar {
    width: 8px;
}

.sdv-modal-body::-webkit-scrollbar-track {
    background: #fafcfb;
    border-radius: 4px;
}

.sdv-modal-body::-webkit-scrollbar-thumb {
    background: #d3ddd7;
    border-radius: 4px;
    border: 2px solid #fafcfb;
}

.sdv-modal-body::-webkit-scrollbar-thumb:hover {
    background: #c5d0c9;
}

.sdv-modal-overlay.active .sdv-modal {
    transform: scale(1) translateY(0);
}

.sdv-modal-header {
    background: linear-gradient(135deg, #1e5a41, #2f7d5b);
    color: #ffffff;
    padding: 20px 24px;
    border-radius: 18px 18px 0 0;
    position: relative;
}

.sdv-modal-header h3 {
    margin: 0;
    font-size: var(--sdv-title-size, 15px);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.4;
    padding-right: 30px;
    color: #ffffff;
}

.sdv-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 28px;
    height: 28px;
    background: rgba(255,255,255,0.2);
    border: none;
    border-radius: 50%;
    color: #ffffff;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease;
}

.sdv-modal-close:hover {
    background: rgba(255,255,255,0.35);
    transform: rotate(90deg);
}

.sdv-modal-row {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e4ece7;
}

.sdv-modal-row:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.sdv-modal-label {
    font-weight: 700;
    color: #1a231f;
    font-size: var(--sdv-label-size, 12px);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.sdv-modal-value {
    color: #1a231f;
    font-size: var(--sdv-content-size, 15px);
    word-break: break-word;
    font-family: 'Courier New', monospace;
    background: #e8f3ec;
    padding: 8px 12px;
    border-radius: 4px;
    border-left: 3px solid #2f7d5b;
}

.sdv-modal-actions {
    display: none;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.sdv-modal-actions.sdv-show {
    display: flex;
}

.sdv-modal-actions .sdv-btn {
    flex: 1;
    min-width: 140px;
    padding: 10px 16px;
    font-size: 13px;
}

/* Responsive */
@media (max-width: 480px) {
    .sdv-tooltip {
        min-width: 280px;
        margin-left: -140px;
    }
    .sdv-modal-actions .sdv-btn {
        flex: 1 1 100%;
    }
}

/* Print styles */
@media print {
    .sdv-sig-icon,
    .sdv-tooltip,
    .sdv-modal-overlay {
        display: none !important;
    }
}
