/* ==========================================================================
   ТОВ "НАШ ВУЙКО" — Інтерфейс та друковані стилі A4
   UI: Segoe UI | Документи: Montserrat
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400&display=swap');

:root {
    --primary: #1e40af;
    --primary-hover: #1d4ed8;
    --primary-light: #eff6ff;
    --primary-border: #93c5fd;
    --dark: #0f172a;
    --slate: #334155;
    --slate-light: #64748b;
    --border: #e2e8f0;
    --border-dark: #cbd5e1;
    --bg-page: #f1f5f9;
    --bg-card: #ffffff;
    --bg-input: #ffffff;
    --accent: #2563eb;
    --success: #16a34a;
    --warning: #f59e0b;
    --danger: #ef4444;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
}

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

/* Сам інтерфейс програми — Segoe UI */
body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, "Roboto", sans-serif;
    background-color: var(--bg-page);
    color: var(--dark);
    font-size: 13.5px;
    line-height: 1.45;
    min-height: 100vh;
}

/* ==========================================================================
   ВЕРХНЯ ШАПКА
   ========================================================================== */
.app-header {
    background-color: #0b1329;
    color: #ffffff;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    position: sticky;
    top: 0;
    z-index: 100;
}

.brand-block {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo-img {
    height: 32px;
    max-width: 160px;
    object-fit: contain;
    background: #ffffff;
    padding: 2px 6px;
    border-radius: 4px;
}

.brand-text .app-subtitle {
    font-size: 13px; /* збільшено на 1px */
    font-weight: 600;
    color: #e2e8f0;
    letter-spacing: 0.2px;
    display: block;
}

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

/* Кнопки */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 7px 13px;
    font-size: 13px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
    text-decoration: none;
    font-family: inherit;
}

.btn-primary {
    background-color: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}
.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-download {
    background-color: #0284c7;
    color: #ffffff;
    border-color: #0284c7;
}
.btn-download:hover {
    background-color: #0369a1;
}

.btn-success {
    background-color: #15803d;
    color: #ffffff;
}
.btn-success:hover {
    background-color: #166534;
}

.btn-secondary {
    background-color: #1e293b;
    color: #f8fafc;
    border-color: #334155;
}
.btn-secondary:hover {
    background-color: #334155;
}

.btn-light {
    background-color: #ffffff;
    color: var(--slate);
    border-color: var(--border-dark);
}
.btn-light:hover {
    background-color: #f8fafc;
    color: var(--dark);
}

.btn-danger-outline {
    background: transparent;
    color: #dc2626;
    border-color: #fecaca;
}
.btn-danger-outline:hover {
    background: #fee2e2;
}

.btn-sm {
    padding: 5px 9px;
    font-size: 12px;
}

/* ==========================================================================
   СІТКА ДОДАТКА (АДАПТИВНА: ДЕСКТОП + МОБІЛЬНІ)
   ========================================================================== */
.app-container {
    display: grid;
    grid-template-columns: 460px 1fr;
    gap: 20px;
    padding: 16px 20px;
    max-width: 1720px;
    margin: 0 auto;
}

/* Адаптація під мобільний додаток / планшети: зверху ввід, знизу документ */
@media (max-width: 1024px) {
    .app-container {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 12px;
    }

    .form-panel {
        max-height: none !important;
        position: static !important;
    }

    .app-header {
        padding: 10px 12px;
    }
    .brand-text .app-subtitle {
        font-size: 11.5px;
    }
    
    .sheet-viewport {
        justify-content: flex-start !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 20px;
    }
}

/* Ліва панель введення даних */
.form-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 78px);
    position: sticky;
    top: 66px;
}

.form-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.form-header h2 {
    font-size: 14.5px;
    font-weight: 700;
    color: var(--dark);
}

.form-body {
    padding: 14px 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Картки секцій */
.form-section {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 11px 13px;
}

.section-title {
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--slate);
    margin-bottom: 9px;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.input-group {
    margin-bottom: 9px;
}
.input-group:last-child {
    margin-bottom: 0;
}

.input-label {
    display: block;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--slate);
    margin-bottom: 3px;
}

.input-control {
    width: 100%;
    padding: 7px 9px;
    font-size: 12.5px;
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-sm);
    background-color: var(--bg-input);
    color: var(--dark);
    font-family: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.input-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

/* Перемикач CPT / EXW */
.delivery-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: #e2e8f0;
    padding: 3px;
    border-radius: var(--radius-sm);
    gap: 4px;
    margin-bottom: 9px;
}

.delivery-toggle label {
    padding: 6px 8px;
    text-align: center;
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.15s;
    user-select: none;
}

.delivery-toggle input[type="radio"] {
    display: none;
}

.delivery-toggle input[type="radio"]:checked + label {
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

/* Smart Text Paste Drawer */
.smart-paste-box {
    background: #eff6ff;
    border: 1px dashed var(--primary-border);
    border-radius: var(--radius-sm);
    padding: 9px 11px;
}

.smart-paste-textarea {
    width: 100%;
    height: 65px;
    font-family: monospace;
    font-size: 11.5px;
    padding: 7px;
    border: 1px solid var(--primary-border);
    border-radius: 4px;
    resize: vertical;
    background: #ffffff;
}

/* Товарні позиції */
.items-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 9px;
}

.item-row-card {
    background: #ffffff;
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-sm);
    padding: 9px;
    display: flex;
    flex-direction: column;
    gap: 7px;
    position: relative;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.item-row-header {
    display: flex;
    align-items: center;
    gap: 7px;
}

.item-badge-num {
    background: #e2e8f0;
    color: var(--slate);
    font-size: 11px;
    font-weight: 700;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
}

.item-name-input-wrapper {
    position: relative;
    flex: 1;
}

.item-row-grid {
    display: grid;
    grid-template-columns: 75px 60px 1fr auto;
    gap: 7px;
    align-items: flex-end;
}

/* Автокомпліт випадайка */
.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-sm);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.15);
    z-index: 50;
    max-height: 220px;
    overflow-y: auto;
    margin-top: 2px;
    display: none;
}
.autocomplete-dropdown.active {
    display: block;
}

.autocomplete-item {
    padding: 7px 9px;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    font-size: 11.5px;
    display: flex;
    flex-direction: column;
}
.autocomplete-item:hover {
    background-color: var(--primary-light);
}
.autocomplete-item .ac-mark {
    font-weight: 700;
    color: var(--primary);
}
.autocomplete-item .ac-name {
    color: var(--dark);
    font-size: 11px;
}
.autocomplete-item .ac-dims {
    color: var(--slate-light);
    font-size: 10px;
}

/* ==========================================================================
   ПРАВА ПАНЕЛЬ: ПОПЕРЕДНІЙ ПЕРЕГЛЯД ДОКУМЕНТА (A4)
   ========================================================================== */
.preview-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.preview-toolbar {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 8px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    flex-wrap: wrap;
    gap: 8px;
}

.doc-type-tabs {
    display: flex;
    gap: 3px;
    background: #f1f5f9;
    padding: 3px;
    border-radius: var(--radius-sm);
}

.tab-btn {
    padding: 6px 14px;
    font-size: 12.5px;
    font-weight: 700;
    border: none;
    background: transparent;
    border-radius: 4px;
    cursor: pointer;
    color: var(--slate);
    transition: all 0.15s;
    font-family: inherit;
}

.tab-btn.active {
    background: #ffffff;
    color: var(--primary);
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}

.preview-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

/* Обгортка аркуша A4 */
.sheet-viewport {
    display: flex;
    justify-content: center;
    overflow-x: auto;
    padding-bottom: 30px;
}

/* ==========================================================================
   ДОКУМЕНТ (ШРИФТ MONTSERRAT, ТОЧНИЙ РОЗМІР A4)
   ========================================================================== */
.a4-sheet {
    background: #ffffff;
    width: 210mm;
    min-height: 297mm;
    padding: 7mm 10mm 7mm 10mm;
    margin: 0 auto;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    border-radius: 2px;
    color: #334155;
    font-size: 7.3pt;
    line-height: 1.25;
    font-family: 'Montserrat', Arial, sans-serif !important;
    position: relative;
    box-sizing: border-box;
}

.a4-sheet * {
    font-family: 'Montserrat', Arial, sans-serif !important;
}

.a4-sheet .table-layout { 
    display: table; 
    width: 100%; 
    table-layout: fixed; 
}
.a4-sheet .table-row { 
    display: table-row; 
}
.a4-sheet .table-cell { 
    display: table-cell; 
    vertical-align: top; 
}

/* Шапка документа з логотипом замість тексту ТОВ "НАШ ВУЙКО" */
.a4-sheet .header { 
    border-bottom: 2px solid #0f172a; 
    padding-bottom: 5px; 
    margin-bottom: 7px; 
}

.a4-sheet .company-logo-container {
    margin-bottom: 3px;
    margin-left: -3px; /* оптичне вирівнювання лівого краю точно над текстом 'Виробництво...' */
}

.a4-sheet .doc-header-logo {
    height: 32px; /* збільшено на 15% (було 28px) */
    max-width: 280px;
    object-fit: contain;
    display: block;
}

.a4-sheet .company-subtitle { 
    color: #334155; 
    font-size: 7.3pt; 
    font-weight: 600; 
    margin-top: 2px; 
}
.a4-sheet .company-website { 
    color: #1e40af; 
    font-size: 7.3pt; 
    text-decoration: none; 
    margin-top: 1px; 
    display: block; 
}

.a4-sheet .offer-title { 
    text-align: right; 
    font-size: 12pt; 
    font-weight: bold; 
    color: #1e40af; 
}
.a4-sheet .offer-details { 
    text-align: right; 
    font-size: 7.3pt; 
    color: #475569; 
    margin-top: 2px; 
}
.a4-sheet .validity-text { 
    font-size: 7.3pt; 
    color: #0f172a; 
    font-weight: bold; 
}

/* Рахунок шапка */
.a4-sheet .doc-title-block { 
    text-align: right; 
}
.a4-sheet .doc-title { 
    font-size: 13pt; 
    font-weight: bold; 
    color: #1e40af; 
    text-transform: uppercase; 
}
.a4-sheet .doc-meta { 
    font-size: 8pt; 
    color: #334155; 
    font-weight: bold; 
    margin-top: 2px; 
}
.a4-sheet .validity-alert { 
    color: #1e40af; 
    font-weight: bold; 
    font-size: 7.4pt; 
    margin-top: 1px; 
}

/* Реквізити (збільшено на 1px для значень) */
.a4-sheet .requisites-section { 
    margin-bottom: 8px; 
    background-color: #f8fafc; 
    border: 1px solid #cbd5e1; 
    border-radius: 4px; 
    padding: 6px 8px; 
}
.a4-sheet .req-table { 
    width: 100%; 
    border-collapse: collapse; 
}
.a4-sheet .req-table td { 
    padding: 2.5px 4px; 
    vertical-align: top; 
}
.a4-sheet .req-label { 
    width: 17%; 
    font-weight: bold; 
    color: #64748b; 
    text-transform: uppercase; 
    font-size: 6.8pt; /* залишаємо такого ж розміру */
}
.a4-sheet .req-val { 
    width: 83%; 
    color: #0f172a; 
    font-size: 7.8pt; /* зменшено на 0.5px */
    line-height: 1.34;
}
.a4-sheet .bank-highlight { 
    background-color: #eff6ff; 
    border-left: 3px solid #1e40af; 
    padding: 3px 6px; 
    margin-top: 2px; 
    font-size: 7.8pt; /* зменшено на 0.5px */
}

/* Сторони для КП */
.a4-sheet .parties-section { 
    margin-bottom: 7px; 
}
.a4-sheet .party-box { 
    padding-right: 6px; 
}
.a4-sheet .party-box-right { 
    padding-left: 6px; 
}
.a4-sheet .section-heading { 
    font-size: 6.8pt; /* такого ж розміру */
    font-weight: bold; 
    text-transform: uppercase; 
    color: #1e40af; 
    border-bottom: 1px solid #cbd5e1; 
    padding-bottom: 1px; 
    margin-bottom: 3px; 
}
.a4-sheet .party-name { 
    font-weight: bold; 
    font-size: 8.5pt; 
    color: #0f172a; 
    margin-bottom: 1px; 
}
.a4-sheet .party-text { 
    font-size: 7.8pt; /* зменшено на 0.5px */
    color: #334155; 
    line-height: 1.34;
}

/* Вступ КП */
.a4-sheet .letter-body { 
    margin-bottom: 7px; 
    font-size: 7.8pt; 
    color: #0f172a; 
    line-height: 1.3; 
}
.a4-sheet .letter-greeting { 
    font-weight: bold; 
    margin-bottom: 2px; 
}

/* Таблиця товарів */
.a4-sheet .items-table { 
    width: 100%; 
    border-collapse: collapse; 
    margin-bottom: 6px; 
}
.a4-sheet .items-table th { 
    background-color: #0f172a; 
    color: #ffffff; 
    font-weight: bold; 
    padding: 4px 6px; 
    font-size: 6.5pt; 
    text-transform: uppercase; 
    white-space: nowrap; 
}
.a4-sheet .items-table td { 
    padding: 4.5px 6px; 
    border-bottom: 1px solid #e2e8f0; 
    font-size: 7.4pt; 
}
.a4-sheet .items-table tr:nth-child(even) td { 
    background-color: #f8fafc; 
}
.a4-sheet .text-center { text-align: center; }
.a4-sheet .text-right { text-align: right; }
.a4-sheet .nowrap { white-space: nowrap; }

/* Підсумки та блок ваги */
.a4-sheet .totals-section { 
    margin-bottom: 8px; 
}
.a4-sheet .words-box { 
    font-size: 7.4pt; 
    color: #334155; 
    padding-right: 10px; 
}
.a4-sheet .weight-highlight-box {
    display: inline-block;
    background-color: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 3px;
    padding: 2px 7px;
    margin-top: 3px;
}
.a4-sheet .weight-highlight-box .weight-label {
    font-size: 6.8pt;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    margin-right: 4px;
}
.a4-sheet .weight-highlight-box .weight-val {
    font-size: 8.5pt;
    color: #1e40af;
    font-weight: 800;
}

.a4-sheet .totals-table { 
    width: 100%; 
    border-collapse: collapse; 
}
.a4-sheet .totals-table td { 
    padding: 2px 0; 
    font-size: 7.3pt; 
}
.a4-sheet .totals-table .label { 
    text-align: right; 
    padding-right: 8px; 
    color: #475569; 
}
.a4-sheet .totals-table .value { 
    text-align: right; 
    font-weight: bold; 
    width: 145px; 
    color: #0f172a; 
    white-space: nowrap; 
}
.a4-sheet .totals-table .grand-total .label { 
    font-size: 8.5pt; 
    font-weight: bold; 
    color: #0f172a; 
}
.a4-sheet .totals-table .grand-total .value { 
    font-size: 9.5pt; 
    font-weight: bold; 
    color: #1e40af; 
    border-bottom: 2px double #1e40af; 
}

/* Умови співпраці (зменшено на 0.5px для звичайного тексту) */
.a4-sheet .conditions-section { 
    background-color: #f8fafc; 
    border: 1px solid #e2e8f0; 
    border-radius: 4px; 
    padding: 6px 8px; 
    margin-bottom: 8px; 
}
.a4-sheet .conditions-title { 
    font-weight: bold; 
    color: #1e40af; 
    text-transform: uppercase; 
    font-size: 8.3pt; 
    margin-bottom: 3px; 
    border-bottom: 1px solid #e2e8f0; 
    padding-bottom: 1px; 
}
.a4-sheet .conditions-grid { 
    display: table; 
    width: 100%; 
}
.a4-sheet .conditions-row { 
    display: table-row; 
}
.a4-sheet .conditions-cell-label { 
    display: table-cell; 
    width: 22%; 
    font-weight: bold; 
    color: #475569; 
    padding: 2.5px 0; 
    font-size: 8.3pt; 
}
.a4-sheet .conditions-cell-value { 
    display: table-cell; 
    width: 78%; 
    color: #0f172a; 
    padding: 2.5px 0; 
    font-size: 7.8pt; /* зменшено на 0.5px для тексту без жирного */
    line-height: 1.34;
}
.a4-sheet .conditions-cell-value strong { 
    font-size: 8.3pt; 
}

/* Примітки для рахунку (зменшено на 0.5px для звичайного тексту) */
.a4-sheet .notes-section { 
    background-color: #f8fafc; 
    border: 1px solid #e2e8f0; 
    border-radius: 4px; 
    padding: 6px 8px; 
    margin-bottom: 10px; 
    font-size: 7.7pt; /* зменшено на 0.5px */
    color: #334155; 
    line-height: 1.36; 
}
.a4-sheet .notes-title { 
    font-weight: bold; 
    color: #0f172a; 
    margin-bottom: 3px; 
    text-transform: uppercase; 
    font-size: 8.2pt; 
}
.a4-sheet .notes-section strong {
    font-size: 8.2pt;
}

/* Підписи */
.a4-sheet .signatures-section { 
    margin-top: 10px; 
}
.a4-sheet .sig-row { 
    font-size: 7.8pt; 
    color: #0f172a; 
}
.a4-sheet .sig-label { 
    color: #64748b; 
    text-transform: uppercase; 
    font-weight: bold; 
    display: inline-block; 
    margin-right: 5px; 
}
.a4-sheet .sig-name-underline { 
    border-bottom: 1px solid #94a3b8; 
    padding-bottom: 1px; 
    display: inline-block; 
    width: 210px; 
    text-align: center; 
    font-weight: bold; 
    color: #0f172a; 
}

/* ==========================================================================
   МОДАЛЬНІ ВІКНА
   ========================================================================= */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}
.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    background: #ffffff;
    border-radius: var(--radius-md);
    width: 90%;
    max-width: 580px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.modal-header h3 {
    font-size: 15px;
    font-weight: 700;
}
.modal-close-btn {
    background: transparent;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--slate-light);
}

.modal-body {
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.modal-footer {
    padding: 12px 18px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* ==========================================================================
   НАДІЙНИЙ РЕНДЕР ДРУКУ A4 (ВИПРАВЛЕННЯ ПОРОЖНЬОЇ СТОРІНКИ)
   ========================================================================== */
@page {
    size: A4 portrait;
    margin: 7mm 10mm 7mm 10mm;
}

@media print {
    html, body {
        background: #ffffff !important;
        color: #000000 !important;
        margin: 0 !important;
        padding: 0 !important;
        height: auto !important;
        overflow: visible !important;
        font-family: 'Montserrat', Arial, sans-serif !important;
    }

    /* Приховуємо всі елементи UI */
    .app-header,
    .form-panel,
    .preview-toolbar,
    .modal-overlay {
        display: none !important;
    }

    .app-container {
        display: block !important;
        padding: 0 !important;
        margin: 0 !important;
        max-width: none !important;
    }

    .preview-panel {
        display: block !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .sheet-viewport {
        display: block !important;
        padding: 0 !important;
        margin: 0 !important;
        overflow: visible !important;
    }

    #preview-document-container {
        display: block !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .a4-sheet {
        box-shadow: none !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        min-height: auto !important;
        border: none !important;
        page-break-after: avoid;
        page-break-inside: avoid;
    }
}

/* ==========================================================================
   МОДАЛЬНЕ ВІКНО «ПОДІЛИТИСЯ»
   ========================================================================== */
.modal-share-card {
    max-width: 520px;
}

.share-doc-info {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary);
    background: #f0f9ff;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid #bae6fd;
    margin-bottom: 12px;
}

.share-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 14px;
}

.share-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 12px 6px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: #ffffff;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
}
.share-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
.share-icon {
    font-size: 22px;
}
.share-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--dark);
}

.share-viber:hover { border-color: #7360f2; background: #faf8ff; }
.share-tg:hover { border-color: #229ed9; background: #f0f9ff; }
.share-wa:hover { border-color: #25d366; background: #f0fdf4; }
.share-email:hover { border-color: #ea4335; background: #fef2f2; }

.share-link-box {
    margin-bottom: 12px;
}
.share-input-row {
    display: flex;
    gap: 6px;
}
.share-text-box {
    margin-bottom: 6px;
}

