@font-face { font-family: 'Montserrat'; src: url('../fonts/Montserrat-cyrillic-300.woff2') format('woff2'), url('../fonts/Montserrat-latin-300.woff2') format('woff2'); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: 'Montserrat'; src: url('../fonts/Montserrat-cyrillic-400.woff2') format('woff2'), url('../fonts/Montserrat-latin-400.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Montserrat'; src: url('../fonts/Montserrat-cyrillic-500.woff2') format('woff2'), url('../fonts/Montserrat-latin-500.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Montserrat'; src: url('../fonts/Montserrat-cyrillic-600.woff2') format('woff2'), url('../fonts/Montserrat-latin-600.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'nbrb'; src: url('../fonts/nbrb.woff2') format('woff2'), url('../fonts/nbrb.woff') format('woff'), url('../fonts/nbrb.ttf') format('truetype'); unicode-range: U+E901, U+42, U+59, U+4E; }
:root {
    --primary: #16a34a;
    --primary-hover: #15803d;
    --primary-light: #dcfce7;
    --bg-body: #f5f7f9;
    --bg-surface: #fff;
    --bg-surface-hover: #f8fafc;
    --bg-surface-border: #e5e7eb;
    --bg-hover: #f0f2f5;
    --text-primary: #1d1d1f;
    --text-secondary: #6b7280;
    --text-tertiary: #9ca3af;
    --border: #e5e7eb;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
    --cta-shadow: rgba(22, 163, 74, 0.3);
    --radius: 10px;
    --radius-sm: 6px;
    --success: #22c55e;
    --success-light: #dcfce7;
    --danger: #dc2626;
    --danger-light: #fee2e2;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --usd-color: #3b82f6;
    --eur-color: #22c55e;
    --rub-color: #f59e0b;
    --cny-color: #8b5cf6;
}
[data-theme="dark"] {
    --primary: #ef4444;
    --primary-hover: #dc2626;
    --primary-light: rgba(239,68,68,0.15);
    --bg-body: #000000;
    --bg-surface: #111111;
    --bg-surface-hover: #1a1a1a;
    --bg-surface-border: #262626;
    --bg-hover: #1a1a1a;
    --text-primary: #f3f4f6;
    --text-secondary: #a1a1a1;
    --text-tertiary: #737373;
    --border: #262626;
    --shadow: 0 1px 3px rgba(0,0,0,0.5);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.3);
    --cta-shadow: rgba(239, 68, 68, 0.3);
    --success-light: rgba(34,197,94,0.2);
    --danger-light: rgba(239,68,68,0.2);
    --warning-light: rgba(245,158,11,0.2);
}
* { box-sizing: border-box; margin: 0; padding: 0; outline: none; }
html {
    height: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}
body {
    font-family: 'Montserrat', system-ui, -apple-system, sans-serif;
    background: var(--bg-body);
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 300;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    max-width: 100vw;
    overflow-x: hidden;
}
.dashboard-container {
    flex: 1;
    -webkit-overflow-scrolling: touch;
}
.content-container {
    flex: 1;
    -webkit-overflow-scrolling: touch;
}
.admin-container {
    flex: 1;
    -webkit-overflow-scrolling: touch;
}
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-body); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-tertiary); }
@media (max-width: 768px) {
    ::-webkit-scrollbar { display: none; }
    .header-logo-text { font-size: 14px !important; }
    .header-logo img { height: 28px !important; }
}
.header {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
    height: 56px;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
    max-width: 100%;
    box-sizing: border-box;
    position: relative;
    z-index: 101;
}
.header-logo {
    display: flex;
    align-items: center;
    gap: 16px;
}
.header-logo img {
    height: 32px;
    width: auto;
}
.header-logo-divider {
    color: var(--text-tertiary);
    font-size: 20px;
    font-weight: 300;
    margin-left: 8px;
}
.header-logo-text {
    color: var(--text-primary);
    font-size: 24px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
    letter-spacing: 1.5px;
    margin-top: 1px;
}
.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}
.header-search {
    flex: 1;
}
.header-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    outline: none;
    background: var(--bg-body);
    color: var(--text-primary);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.header-search input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}
.header-search input::placeholder {
    color: var(--text-tertiary);
}
.theme-toggle {
    width: 44px;
    height: 28px;
    border-radius: 14px;
    background: var(--bg-hover);
    border: none;
    cursor: pointer;
    position: relative;
    padding: 0;
}
.theme-toggle::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--primary);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
[data-theme="dark"] .theme-toggle::after {
    transform: translateX(16px);
}
.theme-toggle svg {
    position: absolute;
    top: 50%;
    left: 8px;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    color: white;
    transition: opacity 0.25s ease;
    display: block;
}
.theme-toggle svg:last-child {
    left: auto;
    right: 8px;
    opacity: 0;
}
[data-theme="dark"] .theme-toggle svg:first-child {
    opacity: 0;
}
[data-theme="dark"] .theme-toggle svg:last-child {
    opacity: 1;
}
.btn {
    padding: 9px 16px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.15s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 7px;
    font-family: 'Montserrat', system-ui, -apple-system, sans-serif;
    white-space: nowrap;
}
.btn:hover:not(:disabled) {
    transform: translateY(-1px);
}
.btn:active:not(:disabled) {
    transform: translateY(0);
}
.btn:disabled {
    background: var(--bg-hover) !important;
    color: var(--text-tertiary);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}
.btn-primary {
    background: #22c55e;
    color: #fff;
}
.btn-primary:hover:not(:disabled) {
    background: #16a34a;
    box-shadow: 0 4px 12px rgba(34,197,94,0.35);
}
[data-theme="dark"] .btn-primary:hover:not(:disabled) {
    background: #dc2626;
    box-shadow: 0 4px 12px rgba(220,38,38,0.35);
}
[data-theme="dark"] .btn-lg:hover:not(:disabled) {
    box-shadow: 0 8px 20px rgba(220,38,38,0.4);
}
[data-theme="dark"] .result-main {
    box-shadow: 0 8px 24px rgba(239,68,68,0.3);
}
[data-theme="dark"] .debt-item:hover,
[data-theme="dark"] .repayment-item:hover {
    box-shadow: 0 4px 12px rgba(239,68,68,0.1);
}
.btn-secondary {
    background: var(--bg-hover);
    color: var(--text-primary);
    border: 1px solid var(--border);
}
.btn-secondary:hover:not(:disabled) {
    background: var(--border);
}
.btn-danger {
    background: #dc2626;
    color: #fff;
}
.btn-danger:hover:not(:disabled) {
    background: #b91c1c;
}
.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    justify-content: center;
    border-radius: 8px;
    border: 1px solid var(--border);
}
.btn-icon.btn-secondary {
    background: var(--bg-hover);
}
.btn-icon.btn-secondary:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}
.btn-block {
    width: 100%;
    justify-content: center;
}
.btn-share {
    width: 24px;
    height: 24px;
    padding: 0;
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.btn-share:hover {
    color: var(--primary);
    transform: scale(1.1);
}
.print-btn, .egr-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-hover);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: var(--text-secondary);
    transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.15s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Montserrat', system-ui, -apple-system, sans-serif;
}
.print-btn:hover, .egr-btn:hover {
    transform: translateY(-1px);
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.form-group {
    margin-bottom: 20px;
}
.form-group label {
    display: block;
    font-size: 10px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 8px;
    font-family: 'Montserrat', sans-serif;
    background: linear-gradient(135deg, var(--text-secondary) 0%, var(--text-tertiary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    background: var(--bg-body);
    color: var(--text-primary);
    font-family: 'Montserrat', sans-serif;
    transition: all 0.2s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
    outline: none;
}
.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-tertiary);
    font-size: 12px;
}
.form-group textarea {
    min-height: 80px;
    resize: vertical;
}
input[type="date"] {
    color-scheme: light dark;
}
input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 1;
    transition: opacity 0.2s, filter 0.2s;
    filter: brightness(0);
}
input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 0.8;
}
[data-theme="dark"] input[type="date"] {
    background-color: #111111;
    color: #f3f4f6;
}
[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator {
    filter: brightness(100);
}
.form-group input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    min-height: 20px !important;
    max-width: 20px !important;
    max-height: 20px !important;
    border: 2px solid var(--border);
    border-radius: 6px !important;
    background: var(--bg-surface);
    cursor: pointer;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    margin-right: 12px !important;
}
.form-group input[type="checkbox"]:hover {
    border-color: var(--primary);
    transform: scale(1.05);
}
.form-group input[type="checkbox"]:checked {
    background: var(--primary);
    border-color: var(--primary);
}
.form-group input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}
.form-group input[type="checkbox"]:focus {
    outline: none;
    box-shadow: 0 0 0 4px var(--primary-light);
}
.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
}
.checkbox-group input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}
.checkbox-group label {
    font-size: 13px;
    color: var(--text-primary);
    cursor: pointer;
    margin: 0;
    text-transform: none;
}
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-row .form-group {
    margin-bottom: 0;
}

.form-row input[type="date"] {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 14px;
    background: var(--bg-surface);
    color: var(--text-primary);
    font-family: 'Montserrat', sans-serif;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-row input[type="date"]:hover {
    border-color: var(--text-tertiary);
}

.form-row input[type="date"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
    transform: translateY(-1px);
}
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}
.modal-overlay.active {
    opacity: 1;
    visibility: visible;
    display: flex;
}
.modal {
    background: var(--bg-surface);
    padding: 28px;
    border-radius: var(--radius);
    max-width: 600px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    transform: scale(0.95) translateY(10px);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
}
.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
    pointer-events: auto;
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}
.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-hover);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.2s;
}
.modal-close:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.modal-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-hover);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.15s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
}
.modal-close-btn:hover {
    transform: scale(1.05);
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.modal-close-btn:active {
    transform: scale(0.95);
}
.modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 24px;
}
.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 24px;
    justify-content: flex-end;
}
.modal-actions .btn {
    flex: 0 0 auto;
    justify-content: center;
    padding: 11px 20px;
    min-width: 120px;
}
.info-modal .modal {
    max-width: 465px;
}
.info-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}
.info-row {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}
.info-row:last-child {
    border-bottom: none;
}
.info-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    display: block;
}
.info-value {
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
    display: block;
}
.info-section-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 20px;
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border);
}
.egr-modal .modal {
    max-width: 600px;
    width: 92%;
    padding: 20px 16px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.egr-modal .modal::-webkit-scrollbar {
    display: none;
}
.egr-card {
    background: var(--bg-body);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 14px;
}
.egr-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 16px !important;
    height: 52px !important;
    margin-bottom: 12px;
}
.egr-card-header svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: var(--primary);
}
.egr-card-header h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 !important;
    line-height: 1;
}
.egr-card-body {
    padding: 16px;
    background: var(--bg-surface);
    border-radius: var(--radius-sm);
}
.egr-info-row {
    display: flex;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}
.egr-info-row:last-child {
    border-bottom: none;
}
.egr-info-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    display: block;
}
.egr-info-value {
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
    display: block;
}
.egr-section-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 18px;
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border);
}
.egr-director-item,
.egr-jur-name-item,
.egr-ved-item,
.egr-event-item {
    padding: 14px;
    margin-bottom: 14px;
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    border: 1px solid var(--border);
}
.progress-modal .modal {
    max-width: 450px;
}
.progress-box {
    padding: 28px 24px;
    text-align: center;
}
.progress-box h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
}
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-hover);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 14px;
}
.progress-bar-fill {
    height: 100%;
    background: var(--primary);
    transition: width 0.3s ease;
    width: 0;
}
.progress-text {
    font-size: 13px;
    color: var(--text-secondary);
}
.confirm-modal .modal {
    max-width: 400px;
    text-align: center;
}
.confirm-modal h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}
.confirm-modal-message {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 16px 0 24px;
}
.confirm-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}
.print-modal .modal {
    max-width: 500px;
}
.template-modal .modal {
    max-width: 700px;
}
.settings-modal .modal {
    max-width: 650px;
}
@media (max-width: 768px) {
    .modal {
        width: 95%;
        max-width: none;
        padding: 20px 16px;
    }
    .info-modal .modal,
    .egr-modal .modal {
        max-width: 600px;
    }
    .modal-header h3 {
        font-size: 16px;
    }
    .info-grid {
        gap: 12px;
    }
    .info-row {
        flex-direction: column;
        gap: 6px;
        padding: 10px 0;
    }
    .info-label {
        font-size: 10px;
        margin-bottom: 2px;
    }
    .info-value {
        font-size: 13px;
    }
    .egr-modal .modal {
        max-width: 600px;
        width: 95%;
        padding: 16px 12px;
    }
    .egr-card {
        margin-bottom: 12px;
    }
    .egr-card-header {
        height: 48px !important;
        margin-bottom: 10px;
    }
    .egr-card-header h3 {
        font-size: 14px;
    }
    .egr-card-body {
        padding: 12px;
    }
    .egr-info-row {
        flex-direction: column;
        gap: 6px;
        padding: 8px 0;
    }
    .egr-info-label {
        font-size: 10px;
    }
    .egr-info-value {
        font-size: 13px;
    }
    .progress-box {
        padding: 24px 20px;
    }
    .progress-box h4 {
        font-size: 15px;
    }
}
input[type="date"] {
    color-scheme: light dark;
}
input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 1;
    transition: opacity 0.2s, filter 0.2s;
    filter: brightness(0);
}
input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 0.8;
}
[data-theme="dark"] input[type="date"] {
    background-color: #111111;
    color: #f3f4f6;
}
[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator {
    filter: brightness(100);
}
.header-search {
    flex: 1;
}
.header-search input {
    width: 100%;
    padding: 10px 14px 10px 40px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    outline: none;
    background: var(--bg-body) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E") no-repeat 12px center;
    color: var(--text-primary);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.header-search input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}
.header-search input::placeholder {
    color: var(--text-tertiary);
}
.table-panel {
    background: var(--bg-surface);
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    margin: 16px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.table-header {
    padding: 16px 20px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}
.table-count {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}
.table-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}
.table-controls label {
    font-size: 12px;
    color: var(--text-secondary);
}
.table-controls select {
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 12px;
    background: var(--bg-body);
    color: var(--text-primary);
    cursor: pointer;
    outline: none;
}
.table-controls select:focus {
    border-color: var(--primary);
}
.table-wrapper {
    overflow: auto;
    flex: 1;
}
.org-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1000px;
}
.org-table thead {
    background: var(--bg-body);
    position: sticky;
    top: 0;
    z-index: 10;
}
.org-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.org-table th:first-child {
    width: 40px;
    text-align: center;
}
.org-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    vertical-align: middle;
}
.org-table tbody tr {
    transition: background-color 0.1s ease;
    cursor: pointer;
}
.org-table tbody tr:hover {
    background: var(--bg-hover);
}
.org-table tbody tr.selected {
    background: var(--primary-light);
}
.org-table input[type="checkbox"] {
    width: 17px;
    height: 17px;
    accent-color: var(--primary);
    cursor: pointer;
}
.table-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}
.code-badge {
    font-weight: 600;
    color: var(--primary);
    font-size: 11px;
    background: var(--primary-light);
    padding: 4px 9px;
    border-radius: 5px;
}
.org-name {
    font-weight: 500;
    color: var(--text-primary);
}
.org-director {
    color: var(--text-secondary);
    font-size: 12px;
    margin-top: 3px;
}
.meta-text {
    color: var(--text-secondary);
    font-size: 12px;
}
.org-unp {
    color: var(--text-secondary);
    font-size: 12px;
}
.pagination {
    padding: 8px 20px 10px 20px;
    background: var(--bg-surface);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.table-panel .pagination {
    padding: 6px 20px 8px 20px;
}
.pagination-info,
#pageInfo {
    font-size: 13px;
    color: var(--text-secondary);
}
.pagination-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}
.pagination-controls button {
    padding: 7px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 13px;
    transition: transform 0.1s ease, background-color 0.15s ease, border-color 0.15s ease;
}
.pagination-controls button:hover:not(:disabled) {
    background: var(--bg-hover);
    border-color: var(--primary);
}
.pagination-controls button:active:not(:disabled) {
    transform: translateY(-1px);
}
.pagination-controls button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
#selectionInfo .count {
    font-weight: 600;
    font-size: 13px;
}
.selected-list {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 20px;
}
.selected-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    transition: transform 0.1s ease, background-color 0.15s ease, border-color 0.15s ease;
    min-width: 0;
    max-width: 100%;
}
.selected-item:hover {
    transform: translateX(2px);
    background: var(--bg-hover);
    border-color: var(--primary);
}
.selected-item-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}
.selected-item-code {
    font-weight: 600;
    color: var(--primary);
    font-size: 11px;
    background: var(--primary-light);
    padding: 4px 8px;
    border-radius: 4px;
    min-width: 50px;
    text-align: center;
    flex-shrink: 0;
}
.selected-item-name {
    font-size: 13px;
    color: var(--text-primary);
    word-break: break-word;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}
.selected-item-remove {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-hover);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.15s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}
.selected-item-remove:hover {
    transform: scale(1.05);
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.selected-item-remove:active {
    transform: scale(0.95);
}
.selected-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
    font-size: 14px;
}
.progress-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}
.progress-modal.active {
    display: flex;
}
.progress-box {
    background: var(--bg-surface);
    padding: 36px;
    border-radius: var(--radius);
    max-width: 420px;
    width: 90%;
    text-align: center;
}
.progress-box h4 {
    margin-bottom: 24px;
    font-size: 16px;
    font-weight: 600;
}
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-hover);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 14px;
}
.progress-bar-fill {
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-hover));
    transition: width 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 4px;
}
.progress-text {
    font-size: 13px;
    color: var(--text-secondary);
}
.modal-overlay {
    backface-visibility: hidden;
    perspective: 1000px;
}
.modal {
    transform: translateZ(0);
}
#textInput {
    display: none;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
.loading-spinner {
    animation: spin 1s linear infinite;
}
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-secondary);
    text-align: center;
    padding: 60px 20px;
}
.empty-state-icon {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bg-hover) 0%, var(--bg-surface) 100%);
    border-radius: 50%;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    border: 1px solid var(--border);
}
.empty-state-icon svg {
    width: 40px;
    height: 40px;
    color: var(--text-tertiary);
    opacity: 0.6;
}
.empty-state svg {
    width: 40px;
    height: 40px;
    color: var(--text-tertiary);
    opacity: 0.5;
}
.empty-state p {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
}
.empty-state-hint {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 4px;
}
.main-container {
    display: flex;
    flex-direction: column;
    -webkit-overflow-scrolling: touch;
    padding: 20px;
    gap: 16px;
}

.main-container:has(.template-panel),
body.form-page .main-container {
    display: flex;
    flex-direction: row;
    padding: 16px;
    gap: 16px;
    overflow: hidden;
    background: linear-gradient(135deg, var(--bg-body) 0%, var(--bg-surface) 100%);
}
body.form-page {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    overflow-x: hidden;
    max-width: 100vw;
}
body.form-page .header {
    flex-shrink: 0;
}
body.form-page .main-container {
    flex: 1;
    overflow: hidden;
}
body.form-page .dashboard-footer {
    flex-shrink: 0;
}
.toolbar {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}
.file-input-wrapper {
    position: relative;
}
.file-input-wrapper input[type="file"] {
    position: absolute;
    left: 0;
    top: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}
.content-panel {
    background: var(--bg-surface);
    border-radius: var(--radius);
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
    border: 1px solid var(--border);
    overflow: visible;
    display: flex;
    flex: 1;
    flex-direction: column;
    margin: 0;
    max-width: 100%;
    box-sizing: border-box;
}

body.form-page .content-panel,
.main-container:has(.template-panel) .content-panel {
    border-radius: var(--radius);
    flex: 1 !important;
    height: 100%;
}
.sidebar {
    width: 320px;
    border-right: 1px solid var(--border);
    overflow-y: auto;
    background: var(--bg-body);
}
.workspace {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
    background: var(--bg-surface);
}
.package-item {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.15s ease;
}
.package-item:hover {
    background: var(--bg-surface-hover);
}
.package-item.active {
    background: var(--primary-light);
    border-left: 3px solid var(--primary);
    padding-left: 17px;
}
[data-theme="dark"] .package-item.active {
    background: rgba(239,68,68,0.15);
}
.package-item-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 4px;
}
.package-item-meta {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.form-section {
    margin-bottom: 32px;
}
.form-section-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border);
}
.file-list {
    margin-top: 8px;
}
.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-body);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    font-size: 13px;
    transition: background 0.15s;
}
.file-item:hover {
    background: var(--bg-surface-hover);
}
.file-item-name {
    font-family: 'Montserrat', sans-serif;
    color: var(--text-secondary);
    font-size: 12px;
}
.file-item-remove {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: none;
    background: var(--bg-hover);
    cursor: pointer;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.file-item-remove:hover {
    background: var(--primary);
    color: #fff;
}
.field-list {
    margin-top: 8px;
}
.field-item {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    align-items: center;
}
.field-item input {
    flex: 1;
}
.field-item button {
    width: 36px;
    height: 42px;
    border-radius: var(--radius-sm);
    border: none;
    background: var(--bg-hover);
    cursor: pointer;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.field-item button:hover {
    background: var(--primary);
    color: #fff;
}
.add-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--bg-body);
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}
.add-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}
.panel-header {
    padding: 24px 28px;
    background: linear-gradient(135deg, var(--bg-surface) 0%, var(--bg-body) 100%);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
    backdrop-filter: blur(10px);
    max-width: 100%;
    box-sizing: border-box;
    border-radius: var(--radius) var(--radius) 0 0;
}
body.form-page .panel-header,
.main-container:has(.template-panel) .panel-header {
    flex-shrink: 0;
}
.panel-header-content {
    display: flex;
    align-items: center;
    gap: 14px;
}
.panel-header-icon {
    width: 28px;
    height: 28px;
    color: var(--primary);
    flex-shrink: 0;
    filter: drop-shadow(0 2px 8px var(--cta-shadow));
}
.panel-header-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.panel-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.3px;
}
.panel-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.4;
}
.btn-generate {
    padding: 11px 20px;
    font-size: 14px;
    font-weight: 600;
    gap: 10px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 14px var(--cta-shadow);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    border: none;
    position: relative;
    overflow: hidden;
}
.btn-generate::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}
.btn-generate:hover:not(:disabled)::before {
    left: 100%;
}
.btn-generate:hover:not(:disabled) {
    box-shadow: 0 6px 20px var(--cta-shadow);
    transform: translateY(-2px);
    background: linear-gradient(135deg, var(--primary-hover) 0%, var(--primary) 100%);
}
.btn-generate:active:not(:disabled) {
    transform: translateY(0);
}
.btn-generate:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    background: var(--bg-hover);
}
.panel-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
    background: var(--bg-surface);
    max-width: 100%;
    box-sizing: border-box;
    border-radius: 0 0 var(--radius) var(--radius);
}

body.form-page .panel-body,
.main-container:has(.template-panel) .panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    min-height: 0;
}
.panel-body::-webkit-scrollbar {
    width: 6px;
}
.panel-body::-webkit-scrollbar-track {
    background: var(--bg-body);
}
.panel-body::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 3px;
}
.card {
    background: var(--bg-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
}
.code-badge {
    font-weight: 600;
    color: var(--primary);
    font-size: 11px;
    background: var(--primary-light);
    padding: 4px 9px;
    border-radius: 5px;
}
.org-code-badge {
    font-weight: 600;
    color: var(--primary);
    font-size: 11px;
    background: var(--primary-light);
    padding: 4px 8px;
    border-radius: 6px;
}
.status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}
.status-active {
    background: #dcfce7;
    color: #166534;
}
.status-inactive {
    background: #fee2e2;
    color: #991b1b;
}
.org-name {
    font-weight: 500;
    color: var(--text-primary);
}
.org-director {
    color: var(--text-secondary);
    font-size: 12px;
    margin-top: 3px;
}
.meta-text {
    color: var(--text-secondary);
    font-size: 12px;
}
.org-unp {
    color: var(--text-secondary);
    font-size: 12px;
}
.table-panel {
    background: var(--bg-surface);
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.table-header {
    padding: 16px 20px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}
.table-count {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}
.table-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}
.table-controls label {
    font-size: 12px;
    color: var(--text-secondary);
}
.table-controls select {
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 12px;
    background: var(--bg-body);
    color: var(--text-primary);
    cursor: pointer;
    outline: none;
}
.table-controls select:focus {
    border-color: var(--primary);
}
.table-wrapper {
    overflow: auto;
    flex: 1;
}
.org-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1000px;
}
.org-table thead {
    background: var(--bg-body);
    position: sticky;
    top: 0;
    z-index: 10;
}
.org-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.org-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    vertical-align: middle;
    white-space: normal;
}
.org-table tbody tr {
    transition: background-color 0.1s ease;
    cursor: pointer;
}
.org-table tbody tr:hover {
    background: var(--bg-hover);
}
.org-table tbody tr.selected {
    background: var(--primary-light);
}
.org-table input[type="checkbox"] {
    width: 17px;
    height: 17px;
    accent-color: var(--primary);
    cursor: pointer;
}
.table-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}
.data-table th,
.data-table td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.data-table th {
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 11px;
    background: var(--bg-hover);
}
.data-table td.number {
    text-align: right;
    font-family: 'Montserrat', sans-serif;
}
.pagination {
    padding: 8px 20px 10px 20px;
    background: var(--bg-surface);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.pagination-info,
#pageInfo {
    font-size: 13px;
    color: var(--text-secondary);
}
.pagination-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}
.pagination-controls button {
    padding: 7px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 13px;
    transition: transform 0.1s ease, background-color 0.15s ease, border-color 0.15s ease;
}
.pagination-controls button:hover:not(:disabled) {
    background: var(--bg-hover);
    border-color: var(--primary);
}
.pagination-controls button:active:not(:disabled) {
    transform: translateY(-1px);
}
.pagination-controls button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.progress-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}
.progress-modal.active {
    display: flex;
}
.progress-box {
    background: var(--bg-surface);
    padding: 36px;
    border-radius: var(--radius);
    max-width: 420px;
    width: 90%;
    text-align: center;
}
.progress-box h4 {
    margin-bottom: 24px;
    font-size: 16px;
    font-weight: 600;
}
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-hover);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 14px;
}
.progress-bar-fill {
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-hover));
    transition: width 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 4px;
}
.progress-text {
    font-size: 13px;
    color: var(--text-secondary);
}
.preloader {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}
.preloader.hidden {
    opacity: 0;
    pointer-events: none;
    display: none !important;
}
.preloader-content {
    background: var(--bg-surface);
    padding: 40px 60px;
    border-radius: var(--radius);
    text-align: center;
}
.preloader-spinner {
    width: 56px;
    height: 56px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 20px;
}
.preloader-text {
    font-size: 15px;
    color: var(--text-secondary);
    font-weight: 500;
}
.nbrb-icon {
    font-family: "nbrb" !important;
    speak-as: none;
    font-style: normal;
    font-weight: normal;
    font-variant: normal;
    text-transform: none;
    line-height: 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    letter-spacing: normal;
    -webkit-font-feature-settings: "liga";
    -moz-font-feature-settings: "liga";
    -ms-font-feature-settings: "liga" 1;
    font-feature-settings: "liga";
    -webkit-font-variant-ligatures: discretionary-ligatures;
    font-variant-ligatures: discretionary-ligatures;
}
.nbrb-icon-byn:before {
    content: "\e901";
}
.modal-overlay {
    backface-visibility: hidden;
    perspective: 1000px;
}
.modal {
    transform: translateZ(0);
}
svg {
    display: inline-block;
    vertical-align: middle;
}
.btn-icon svg,
.print-btn svg,
.egr-btn svg,
.theme-toggle svg,
.modal-close-btn svg,
.btn svg {
    display: block;
}
#textInput {
    display: none;
}
@supports (-webkit-touch-callout: none) {
    html, body {
        height: 100%;
        -webkit-overflow-scrolling: touch;
    }
    .header-search input,
    .form-group input,
    .table-controls select {
        font-size: 16px;
    }
    .table-wrapper {
        -webkit-overflow-scrolling: touch;
    }
}
@media print {
    .header,
    .footer,
    .theme-toggle,
    .btn,
    .debt-item-delete,
    .repayment-delete,
    .modal-overlay,
    .left-panel {
        display: none !important;
    }
    body {
        background: white;
        overflow: visible;
    }
    .form-section,
    .result-section {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    .main-content {
        overflow: visible;
    }
}
input[type="date"] {
    background-color: var(--bg-body);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
}
input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 1;
    transition: opacity 0.2s, filter 0.2s;
    filter: brightness(0);
}
input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 0.8;
}
input[type="date"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
    outline: none;
}
[data-theme="dark"] input[type="date"] {
    background-color: #111111;
    color: #f3f4f6;
}
[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator {
    filter: brightness(100);
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
.loading-spinner {
    animation: spin 0.8s linear infinite;
}
.main-left {
    flex: 1;
    min-width: 320px;
    max-width: 450px;
    overflow: hidden;
    background: var(--bg-body);
    display: flex;
    flex-direction: column;
    max-width: 100%;
    box-sizing: border-box;
}
.main-right {
    flex: 2;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

body.form-page .main-left,
.main-container:has(.template-panel) .main-left {
    flex: 0 0 380px !important;
    min-width: 320px;
    max-width: 450px;
    height: 100%;
    box-sizing: border-box;
}
body.form-page .main-right,
.main-container:has(.template-panel) .main-right {
    flex: 1 !important;
    min-width: 0;
    height: 100%;
    box-sizing: border-box;
}
.workspace-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.workspace-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}
.workspace-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-secondary);
}
.workspace-empty svg {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
    opacity: 0.2;
}
.template-panel {
    background: var(--bg-surface);
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border-radius: var(--radius);
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
    border: 1px solid var(--border);
    margin: 0;
    max-width: 100%;
    box-sizing: border-box;
}

body.form-page .template-panel,
.main-container:has(.template-panel) .template-panel {
    margin: 0;
    border-radius: var(--radius);
    height: 100%;
}
.template-panel-body {
    padding: 0;
    overflow-y: auto;
}
.template-panel-body::-webkit-scrollbar {
    width: 6px;
}
.template-panel-body::-webkit-scrollbar-track {
    background: var(--bg-body);
}
.template-panel-body::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 3px;
}
.template-panel-body::-webkit-scrollbar-thumb:hover {
    background: var(--primary-hover);
}
.template-panel-header {
    padding: 20px 24px;
    background: linear-gradient(135deg, var(--bg-surface) 0%, var(--bg-body) 100%);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    backdrop-filter: blur(10px);
}
.template-panel-header-content {
    display: flex;
    align-items: center;
    gap: 12px;
}
.template-panel-icon {
    width: 22px;
    height: 22px;
    color: var(--primary);
    flex-shrink: 0;
    filter: drop-shadow(0 2px 6px var(--cta-shadow));
}
.template-panel-title {
    font-weight: 600;
    font-size: 15px;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.3px;
}
.template-count {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
    background: linear-gradient(135deg, var(--bg-hover) 0%, var(--bg-surface) 100%);
    padding: 5px 11px;
    border-radius: 8px;
    min-width: 32px;
    text-align: center;
    transition: all 0.2s ease;
    border: 1px solid var(--border);
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}
.template-groups {
    display: flex;
    flex-direction: column;
}
.template-group {
    display: flex;
    flex-direction: column;
}
.group-templates {
    transition: max-height 0.3s ease, opacity 0.3s ease;
    overflow: hidden;
}
.group-templates.collapsed {
    max-height: 0 !important;
    opacity: 0;
}
.group-templates:not(.collapsed) {
    max-height: 2000px;
    opacity: 1;
}
.template-grid {
    padding: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
}
.template-card {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--bg-surface);
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}
.template-card:last-child {
    border-bottom: none;
}
.template-card:hover {
    background: var(--bg-hover);
}
.template-card.active {
    background: var(--bg-hover);
    border-left: 3px solid var(--primary);
    padding-left: 14px;
}
.template-card-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--bg-body);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.template-card-icon svg {
    width: 18px;
    height: 18px;
    color: var(--primary);
}
.template-card.active .template-card-icon {
    background: var(--primary);
}
.template-card.active .template-card-icon svg {
    color: #fff;
}
.template-card:hover .template-card-icon {
    transform: none;
    box-shadow: none;
}

[data-theme="dark"] .template-card:hover .template-card-icon,
[data-theme="dark"] .template-card.active .template-card-icon {
    box-shadow: none;
}
.template-card-content {
    flex: 1;
    min-width: 0;
}
.template-card-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 4px;
    letter-spacing: -0.2px;
}
.template-card-meta {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.group-header {
    padding: 14px 20px;
    background: linear-gradient(90deg, var(--bg-body) 0%, var(--bg-surface) 100%);
    border-bottom: 1px solid var(--border);
    font-weight: 700;
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.group-header:hover {
    background: linear-gradient(90deg, var(--bg-hover) 0%, var(--bg-body) 100%);
    color: var(--text-primary);
}
.group-header-title {
    display: flex;
    align-items: center;
    gap: 8px;
}
.group-header-title svg {
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
}
.group-header.collapsed .group-header-title svg {
    transform: rotate(-90deg);
}
.group-header.collapsed {
    background: var(--bg-hover);
}
.btn-share {
    width: 24px;
    height: 24px;
    padding: 0;
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.btn-share:hover {
    color: var(--primary);
    transform: scale(1.1);
}
.preloader {
    position: fixed;
    inset: 0;
    background: var(--bg-body);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}
.preloader.active {
    display: flex;
}
.preloader-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
.progress-modal {
    text-align: center;
}
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-hover);
    border-radius: 4px;
    overflow: hidden;
    margin: 20px 0;
}
.progress-bar-fill {
    height: 100%;
    background: var(--primary);
    transition: width 0.3s ease;
    width: 0;
}
.progress-text {
    font-size: 14px;
    color: var(--text-secondary);
}
.selected-list {
    margin-top: 16px;
    max-height: 300px;
    overflow-y: auto;
}
.selected-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--bg-body);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    font-size: 13px;
}
.selected-item-name {
    font-family: 'Montserrat', sans-serif;
    color: var(--text-secondary);
    font-size: 12px;
}
.selected-item-remove {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: none;
    background: var(--bg-hover);
    cursor: pointer;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.selected-item-remove:hover {
    background: var(--primary);
    color: #fff;
}
.egr-card {
    background: var(--bg-body);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-bottom: 12px;
}
.egr-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.egr-card-title {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
}
.egr-card-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.egr-card-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.egr-card-label {
    font-size: 11px;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.egr-card-value {
    font-size: 13px;
    color: var(--text-primary);
    font-weight: 500;
}
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px;
    border-top: 1px solid var(--border);
    background: var(--bg-surface);
}
.pagination-btn {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-hover);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.2s;
}
.pagination-btn:hover:not(:disabled) {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.pagination-info {
    font-size: 13px;
    color: var(--text-secondary);
    padding: 0 12px;
}
.code-badge {
    font-weight: 600;
    color: var(--primary);
    font-size: 11px;
    background: var(--primary-light);
    padding: 4px 9px;
    border-radius: 5px;
}
.org-code-badge {
    font-weight: 600;
    color: var(--primary);
    font-size: 11px;
    background: var(--primary-light);
    padding: 4px 8px;
    border-radius: 6px;
}
.data-stats {
    display: flex;
    gap: 20px;
    padding: 12px 20px;
    background: var(--bg-body);
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
}
.stat-item {
    font-size: 13px;
    color: var(--text-secondary);
}
.confirm-modal .modal {
    max-width: 400px;
}
.confirm-modal-message {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 16px 0;
}
.result-section {
    background: var(--bg-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-top: 20px;
}
.result-section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border);
}
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.data-table th,
.data-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.data-table th {
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
    background: var(--bg-body);
}
.data-table tr:hover {
    background: var(--bg-hover);
}
.calculator-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
@media (max-width: 1024px) {
    .calculator-layout {
        grid-template-columns: 1fr;
    }
}
.debt-item,
.repayment-item {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
}
.debt-item-header,
.repayment-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.debt-item-title,
.repayment-item-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}
.debt-item-delete,
.repayment-delete {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: none;
    background: var(--bg-hover);
    cursor: pointer;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.debt-item-delete:hover,
.repayment-delete:hover {
    background: var(--primary);
    color: #fff;
}
.currency-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}
.currency-card {
    background: var(--bg-surface);
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: all 0.2s ease;
    border: none;
}
.currency-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}
.currency-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
}
.currency-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
}
.currency-icon.usd { background: rgba(59,130,246,0.1); color: #3b82f6; }
.currency-icon.eur { background: rgba(34,197,94,0.1); color: #22c55e; }
.currency-icon.rub { background: rgba(245,158,11,0.1); color: #f59e0b; }
.currency-icon.cny { background: rgba(139,92,246,0.1); color: #8b5cf6; }
.currency-icon.byn { background: rgba(220,38,38,0.1); color: #dc2626; }
.currency-card-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}
.currency-card-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
}
.currency-card-date {
    font-size: 10px;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.chart-card {
    background: var(--bg-surface);
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    padding: 24px;
    margin-bottom: 20px;
    border: none;
}
.chart-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}
.chart-card-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
}
.chart-period-btns {
    display: flex;
    gap: 8px;
}
.period-btn {
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-hover);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}
.period-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.period-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.calc-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    background: var(--bg-body);
    color: var(--text-primary);
    font-family: 'Montserrat', sans-serif;
    transition: all 0.2s;
}
.calc-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
    outline: none;
}
.org-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.org-table th,
.org-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.org-table th {
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
    background: var(--bg-body);
    position: sticky;
    top: 0;
    z-index: 10;
}
.org-table tr:hover {
    background: var(--bg-hover);
}
.org-name {
    font-weight: 600;
    color: var(--text-primary);
}
.org-unp {
    font-size: 11px;
    color: var(--text-tertiary);
    font-family: 'Montserrat', sans-serif;
}
.table-panel {
    background: var(--bg-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.table-controls {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-surface);
}
.table-controls input,
.table-controls select {
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    background: var(--bg-body);
    color: var(--text-primary);
    font-family: 'Montserrat', sans-serif;
    outline: none;
    transition: all 0.2s;
}
.table-controls input:focus,
.table-controls select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}
.table-wrapper {
    overflow-x: auto;
    overflow-y: auto;
    flex: 1;
    max-height: calc(100vh - 300px);
}
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
    padding: 20px;
}
.info-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.info-label {
    font-size: 11px;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.info-value {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
}
.employee-card {
    background: var(--bg-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px;
    margin-bottom: 12px;
}
.employee-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.employee-card-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}
.employee-card-delete {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-hover);
    cursor: pointer;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.employee-card-delete:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin-bottom: 20px;
}
.calendar-day {
    aspect-ratio: 1;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-body);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 60px;
}
.calendar-day:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}
.calendar-day.selected {
    background: var(--primary);
    border-color: var(--primary);
}
.calendar-day.selected .calendar-day-number,
.calendar-day.selected .calendar-day-label {
    color: #fff;
}
.calendar-day-number {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}
.calendar-day-label {
    font-size: 10px;
    color: var(--text-tertiary);
    text-transform: uppercase;
}
.calendar-day-weekend {
    color: var(--primary);
}
.shift-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.shift-badge-day {
    background: rgba(59,130,246,0.1);
    color: #3b82f6;
}
.shift-badge-night {
    background: rgba(139,92,246,0.1);
    color: #8b5cf6;
}
.shift-badge-off {
    background: rgba(34,197,94,0.1);
    color: #22c55e;
}
.schedule-section {
    background: var(--bg-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 20px;
}
.schedule-section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border);
}
.schedule-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
}
.schedule-day {
    background: var(--bg-body);
    border-radius: var(--radius-sm);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.schedule-day-date {
    font-size: 12px;
    color: var(--text-tertiary);
}
.schedule-day-shift {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}
.content-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
}
.content-section {
    background: var(--bg-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 32px;
    margin-bottom: 24px;
}
.content-section:last-child {
    margin-bottom: 0;
}
.content-section-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}
.content-section-text {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 16px;
}
.content-list {
    margin-left: 20px;
    margin-bottom: 16px;
}
.content-list li {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 8px;
}
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--bg-hover);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
    margin-bottom: 20px;
}
.back-link:hover {
    background: var(--primary);
    color: #fff;
}
.warning-box,
.info-box,
.highlight-box {
    background: var(--warning-light);
    border-left: 4px solid var(--warning);
    padding: 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
}
.info-box {
    background: var(--primary-light);
    border-left-color: var(--primary);
}
.highlight-box {
    background: var(--bg-hover);
    border-left-color: var(--border);
}
.warning-box-title,
.info-box-title,
.highlight-box-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}
.warning-box-text,
.info-box-text,
.highlight-box-text {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
}


.docs-page {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    background: transparent;
}

.docs-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
}


.docs-structure-sidebar {
    width: 364px;
    background: transparent;
    border-right: 2px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.docs-structure-header {
    padding: 20px 16px;
    background: transparent;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.docs-structure-header span {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.docs-structure-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px 16px 16px 26px;
}

.docs-structure-content::-webkit-scrollbar {
    width: 6px;
}

.docs-structure-content::-webkit-scrollbar-track {
    background: transparent;
}

.docs-structure-content::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}


.docs-structure-group {
    margin-bottom: 8px;
}

.docs-structure-group-header {
    padding: 12px 16px 10px 0;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    margin: 4px 12px 4px 0;
    position: relative;
    text-decoration: none !important;
    border-bottom: none !important;
}

.docs-structure-group-header::after {
    display: none;
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--text-tertiary) 0%, var(--border) 100%);
    border-radius: 1px;
}

.docs-structure-group-header:hover {
    color: var(--text-primary);
}

.docs-structure-items {
    padding: 4px 0 4px 8px;
    max-height: 1000px;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease, padding 0.2s ease;
    opacity: 1;
}

.docs-structure-items.collapsed {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
}

.docs-structure-item {
    display: flex;
    align-items: center;
    padding: 12px 14px;
    margin: 4px 8px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
    position: relative;
    overflow: hidden;
}

.docs-structure-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10px;
    width: 3px;
    height: calc(100% - 20px);
    background: var(--primary);
    opacity: 0;
    transition: opacity 0.2s;
    border-radius: 0;
}

.docs-structure-item:hover {
    background: var(--bg-hover);
    transform: translateX(4px);
}

.docs-structure-item:hover::before {
    opacity: 0.35;
}

.docs-structure-item.active {
    background: transparent;
    border-color: transparent;
    box-shadow: none;
}

.docs-structure-item.active::before {
    opacity: 1;
}

[data-theme="dark"] .docs-structure-item.active {
    background: transparent;
    border-color: transparent;
    box-shadow: none;
}

[data-theme="dark"] .docs-page {
    background: #000;
}

.docs-structure-item-title {
    flex: 1;
    font-size: 13px;
    font-weight: 400;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.2s;
}

.docs-structure-item.active .docs-structure-item-title {
    font-weight: 500;
    color: var(--text-primary);
}


.docs-main-area {
    flex: 1;
    display: flex;
    overflow: hidden;
}


.docs-scroll-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    background: transparent;
    scroll-behavior: smooth;
}

.docs-scroll-content::-webkit-scrollbar {
    width: 0;
    height: 0;
}

.docs-scroll-content::-webkit-scrollbar-track {
    background: transparent;
}

.docs-scroll-content::-webkit-scrollbar-thumb {
    background: transparent;
}

.docs-article {
    max-width: 840px;
    margin: 0 auto;
    padding: 48px 64px;
    min-height: calc(100vh - 56px - 400px);
}

.docs-nav-group {
    margin-bottom: 24px;
}

.docs-nav-group-title {
    padding: 6px 16px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.docs-nav-item {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    cursor: pointer;
    transition: all 0.15s ease;
    border-left: 3px solid transparent;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: 0 8px 8px 0;
    margin-right: 8px;
}

.docs-nav-item:hover {
    background: var(--bg-hover);
    border-left-color: var(--text-tertiary);
}

.docs-nav-item.active {
    background: linear-gradient(90deg, var(--primary-light) 0%, transparent 100%);
    border-left-color: var(--primary);
    color: var(--primary);
}

[data-theme="dark"] .docs-nav-item.active {
    background: linear-gradient(90deg, rgba(239,68,68,0.15) 0%, transparent 100%);
}

.docs-nav-item svg {
    width: 18px;
    height: 18px;
    margin-right: 12px;
    flex-shrink: 0;
    color: var(--text-tertiary);
    transition: color 0.15s ease;
}

.docs-nav-item.active svg {
    color: var(--primary);
}

.docs-nav-item:hover svg {
    color: var(--text-secondary);
}

.docs-nav-item-label {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


.docs-nav-subitems {
    margin-left: 16px;
    padding-left: 16px;
    border-left: 2px solid var(--border);
    margin-top: 8px;
    margin-bottom: 8px;
}

.docs-nav-subitem {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.15s ease;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    border-radius: var(--radius-sm);
    margin-bottom: 4px;
}

.docs-nav-subitem:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.docs-nav-subitem.active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 500;
}

[data-theme="dark"] .docs-nav-subitem.active {
    background: rgba(239, 68, 68, 0.15);
}

.docs-nav-subitem svg {
    width: 14px;
    height: 14px;
    margin-right: 8px;
    flex-shrink: 0;
    color: var(--text-tertiary);
}

.docs-nav-subitem.active svg {
    color: var(--primary);
}


.docs-sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border);
    background: var(--bg-body);
    flex-shrink: 0;
}

.docs-footer-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
}

.docs-footer-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: var(--text-secondary);
}

.docs-footer-item svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    color: var(--text-tertiary);
}

.docs-footer-copyright {
    font-size: 11px;
    color: var(--text-tertiary);
    text-align: center;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}


.docs-content-footer {
    margin-top: 48px;
    padding-top: 32px;
}

.docs-footer-divider {
    height: 1px;
    background: var(--border);
    margin-bottom: 24px;
}

.docs-footer-links {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.docs-footer-link {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.15s ease;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    border: 1px solid var(--border);
}

.docs-footer-link:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: var(--primary-light);
    transform: translateY(-2px);
}

.docs-footer-link svg {
    width: 16px;
    height: 16px;
}

.docs-footer-copyright-mobile {
    display: none;
    font-size: 12px;
    color: var(--text-tertiary);
    text-align: center;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}


.docs-toc-sidebar {
    width: 286px;
    flex-shrink: 0;
    background: transparent;
    border-left: none;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 56px;
    height: calc(100vh - 56px);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.docs-toc-header {
    padding: 24px 20px;
    background: transparent;
    border-bottom: none;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.docs-toc-header span {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.docs-toc-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px 16px;
}

.docs-toc-content::-webkit-scrollbar {
    width: 4px;
}

.docs-toc-content::-webkit-scrollbar-track {
    background: transparent;
}

.docs-toc-content::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 2px;
}

.docs-toc-item {
    display: block;
    padding: 10px 14px;
    font-size: 13px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 3px solid transparent;
    margin-left: -12px;
    padding-left: 12px;
    margin-bottom: 6px;
    border-radius: 0 8px 8px 0;
    font-weight: 400;
}

.docs-toc-item:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
    border-left-color: var(--text-tertiary);
    transform: translateX(4px);
}

.docs-toc-item.active {
    color: var(--text-primary);
    border-left-color: transparent;
    background: transparent;
    font-weight: 500;
    box-shadow: none;
}

[data-theme="dark"] .docs-toc-item.active {
    color: var(--text-primary);
    border-left-color: transparent;
    background: transparent;
    box-shadow: none;
}

.docs-toc-item-sub {
    padding-left: 26px;
    font-size: 12px;
    opacity: 0.85;
}

.docs-toc-spacer {
    padding: 20px;
    flex-shrink: 0;
    border-top: none;
}


.docs-page-footer {
    max-width: 840px;
    margin: 0 auto;
    padding: 0 64px 48px;
}

.docs-footer-divider {
    height: 2px;
    background: linear-gradient(90deg, var(--primary) 0%, transparent 100%);
    margin-bottom: 40px;
    border-radius: 1px;
}

.docs-footer-content {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 40px;
    margin-bottom: 40px;
}

.docs-footer-section h4 {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.docs-footer-section p {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-secondary);
    font-weight: 400;
}

.docs-footer-contact {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.docs-footer-contact span {
    font-size: 14px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 10px;
    transition: color 0.2s;
}

.docs-footer-contact span:hover {
    color: var(--primary);
}

.docs-footer-nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.docs-footer-nav a {
    font-size: 14px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 6px 0;
    position: relative;
    padding-left: 12px;
}

.docs-footer-nav a::before {
    content: '→';
    position: absolute;
    left: 0;
    opacity: 0;
    transform: translateX(-4px);
    transition: all 0.2s;
    color: var(--primary);
}

.docs-footer-nav a:hover {
    color: var(--primary);
    padding-left: 20px;
}

.docs-footer-nav a:hover::before {
    opacity: 1;
    transform: translateX(0);
}

.docs-footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 32px;
    border-top: 1px solid var(--border);
    gap: 20px;
}

.docs-footer-bottom span {
    font-size: 13px;
    color: var(--text-tertiary);
    font-weight: 500;
}

.docs-footer-links {
    display: flex;
    gap: 24px;
}

.docs-footer-links a {
    font-size: 13px;
    color: var(--text-tertiary);
    text-decoration: none;
    transition: all 0.2s;
    position: relative;
}

.docs-footer-links a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--primary);
    transition: width 0.2s;
}

.docs-footer-links a:hover {
    color: var(--text-primary);
}

.docs-footer-links a:hover::after {
    width: 100%;
}


.docs-content {
    flex: 1;
    overflow-y: auto;
    background: var(--bg-body);
    padding: 32px 48px;
}

.docs-content-wrapper {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    gap: 32px;
}

.docs-article {
    flex: 1;
    min-width: 0;
}


.docs-welcome {
    text-align: center;
    padding: 60px 20px;
}

.docs-welcome-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}

.docs-welcome-text {
    font-size: 14px;
    color: var(--text-secondary);
    max-width: 500px;
    margin: 0 auto;
    line-height: 1.6;
}


.docs-article h1 {
    font-size: 36px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 24px;
    letter-spacing: -1px;
    padding-bottom: 0;
    border-bottom: none;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.docs-article h2 {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 48px 0 20px;
    letter-spacing: -0.5px;
    padding-bottom: 14px;
    border-bottom: 2px solid var(--border);
}

.docs-article h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 36px 0 16px;
    letter-spacing: -0.3px;
}

.docs-article h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 28px 0 12px;
}

.docs-article p {
    font-size: 14px;
    line-height: 1.8;
    color: var(--text-primary);
    margin-bottom: 20px;
    font-weight: 400;
}

.docs-article[data-file="education-safety-rules"] p {
    line-height: 2;
}

.docs-article ul + p,
.docs-article ol + p {
    margin-top: 20px;
}

.docs-article ul,
.docs-article ol {
    margin: 20px 0;
    padding-left: 28px;
}

.docs-article li {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-primary);
    margin-bottom: 12px;
    position: relative;
}

.docs-article ul li::marker {
    color: var(--primary);
}

.docs-article ul li a,
.docs-article ol li a {
    padding: 0;
    background: none;
    line-height: inherit;
}

.docs-article ol {
    counter-reset: item;
    list-style: none;
    padding-left: 0;
}

.docs-article ol li {
    padding-left: 32px;
}

.docs-article ol li::before {
    content: counter(item) '.';
    counter-increment: item;
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: 600;
}

.docs-article a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
    position: relative;
    background: linear-gradient(to bottom, transparent 60%, var(--primary-light) 60%);
    padding: 2px 4px;
    border-radius: 4px;
}

.docs-article a:hover {
    background: var(--primary);
    color: white;
}

[data-theme="dark"] .docs-article a:hover {
    background: var(--primary-hover);
}

.docs-article code {
    background: var(--bg-hover);
    padding: 4px 10px;
    border-radius: 8px;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    color: var(--primary);
    border: 1px solid var(--border);
    font-weight: 500;
}

.docs-article pre {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    overflow-x: auto;
    margin: 24px 0;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.docs-article pre code {
    background: none;
    padding: 0;
    border: none;
    font-size: 13px;
    line-height: 1.7;
    color: var(--text-primary);
}

.docs-article blockquote {
    border-left: 3px solid var(--primary);
    padding-left: 16px;
    margin: 20px 0;
    color: var(--text-secondary);
    font-style: italic;
}

.docs-article hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 32px 0;
}

.docs-article table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 14px;
}

.docs-article th,
.docs-article td {
    padding: 12px 16px;
    border: 1px solid var(--border);
    text-align: left;
}

.docs-article th {
    background: var(--bg-hover);
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
}

.docs-article tr:nth-child(even) {
    background: var(--bg-body);
}

.docs-article img {
    max-width: 100%;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    margin: 20px 0;
}

.docs-article strong {
    font-weight: 600;
    color: var(--text-primary);
}

.docs-article em {
    font-style: italic;
    color: var(--text-secondary);
}


.docs-callout {
    padding: 16px 20px;
    border-radius: var(--radius);
    margin: 20px 0;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.docs-callout-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-top: 2px;
}

.docs-callout-info {
    background: var(--primary-light);
    border-left: 3px solid var(--primary);
}

.docs-callout-warning {
    background: var(--warning-light);
    border-left: 3px solid var(--warning);
}

.docs-callout-danger {
    background: var(--danger-light);
    border-left: 3px solid var(--danger);
}

.docs-callout-content {
    flex: 1;
}

.docs-callout-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.docs-callout-text {
    font-size: 14px;
    line-height: 1.8;
    color: var(--text-secondary);
}


.docs-toc {
    width: 220px;
    flex-shrink: 0;
    position: sticky;
    top: 88px;
    height: fit-content;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

.docs-toc-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

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

.docs-toc-item {
    font-size: 13px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.15s ease;
    padding: 6px 0;
    display: block;
    border-left: 2px solid transparent;
    padding-left: 12px;
    margin-left: -12px;
}

.docs-toc-item:hover {
    color: var(--text-primary);
}

.docs-toc-item.active {
    color: var(--text-primary);
    border-left-color: transparent;
    background: transparent;
    border-radius: 0;
    font-weight: 500;
}

.docs-toc-item-sub {
    padding-left: 24px;
    font-size: 12px;
}


.docs-empty {
    text-align: center;
    padding: 80px 20px;
}

.docs-empty-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-hover);
    border-radius: 50%;
}

.docs-empty-icon svg {
    width: 40px;
    height: 40px;
    color: var(--text-tertiary);
}

.docs-empty-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.docs-empty-text {
    font-size: 14px;
    color: var(--text-secondary);
}


@media (max-width: 1200px) {
    .docs-structure-sidebar {
        width: 325px;
    }

    .docs-toc-sidebar {
        width: 260px;
    }

    .docs-article {
        padding: 40px 48px;
    }

    .docs-page-footer {
        padding: 0 48px 40px;
    }
}

@media (max-width: 1024px) {
    .docs-toc-sidebar {
        display: none;
    }

    .docs-article {
        padding: 40px 48px;
    }

    .docs-footer-content {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .docs-footer-bottom {
        flex-direction: column;
        gap: 16px;
        text-align: left;
    }
}

@media (max-width: 768px) {
    .docs-layout {
        flex-direction: column;
    }

    .docs-structure-sidebar {
        position: fixed;
        left: -300px;
        top: 56px;
        height: calc(100vh - 56px);
        z-index: 100;
        transition: left 0.3s ease;
        box-shadow: var(--shadow-lg);
        width: 300px;
        background: var(--bg-surface);
    }

    .docs-structure-sidebar.open {
        left: 0;
    }

    .docs-structure-header {
        background: var(--bg-surface);
    }

    .docs-article {
        padding: 32px 24px;
    }

    .docs-article h1 {
        font-size: 28px;
    }

    .docs-article h2 {
        font-size: 22px;
    }

    .docs-quick-start {
        grid-template-columns: 1fr;
    }

    .docs-welcome-title {
        font-size: 24px;
    }

    .docs-page-footer {
        padding: 0 24px 32px;
    }

    .docs-footer-content {
        gap: 20px;
    }

    .docs-footer-nav {
        gap: 6px;
    }

    .docs-footer-links {
        flex-direction: column;
        gap: 12px;
    }
}


.docs-menu-toggle {
    display: none;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--bg-hover);
    border: 1px solid var(--border);
    color: var(--text-primary);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.docs-menu-toggle svg {
    width: 20px;
    height: 20px;
}

.docs-menu-toggle:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

@media (max-width: 768px) {
    .docs-menu-toggle {
        display: flex;
    }

    .header-logo-divider,
    .header-logo-text {
        display: none;
    }
}


.docs-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

@media (max-width: 768px) {
    .docs-overlay.active {
        display: block;
        opacity: 1;
        visibility: visible;
    }
}


.docs-toc-toggle {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    box-shadow: 0 4px 12px var(--cta-shadow);
    cursor: pointer;
    z-index: 100;
    align-items: center;
    justify-content: center;
}

.docs-toc-toggle svg {
    width: 24px;
    height: 24px;
}

@media (max-width: 768px) {
    .docs-toc-toggle {
        display: flex;
    }
}
