@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;
    --primary-dark: #15803d;
    --primary-rgb: 22, 163, 74;
    --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);
    --primary-dark: #b91c1c;
    --primary-rgb: 239, 68, 68;
    --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;
}
.admin-container {
    flex: 1;
    -webkit-overflow-scrolling: touch;
    padding: 40px 24px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}
.admin-header {
    text-align: center;
    margin-bottom: 48px;
}
.admin-title {
    font-size: 32px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}
.admin-subtitle {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 600px;
    margin: 0 auto;
}
.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
}
.admin-card {
    background: var(--bg-surface);
    border: 1px solid var(--bg-surface-border);
    border-radius: var(--radius);
    padding: 28px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-shadow: var(--shadow);
}
.admin-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}
.admin-card-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}
.admin-card-icon svg {
    width: 28px;
    height: 28px;
}
.admin-card-content {
    flex: 1;
}
.admin-card-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}
.admin-card-description {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}
.admin-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    margin-top: auto;
}
.admin-card-badge {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-hover);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
}
.admin-card-link {
    font-size: 14px;
    font-weight: 500;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 6px;
}
.admin-card-link svg {
    width: 16px;
    height: 16px;
    transition: transform 0.2s ease;
}
.admin-card:hover .admin-card-link svg {
    transform: translateX(4px);
}
@media (max-width: 768px) {
    .admin-container {
        padding: 24px 16px;
    }
    .admin-title {
        font-size: 24px;
    }
    .admin-subtitle {
        font-size: 14px;
    }
    .admin-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .admin-card {
        padding: 20px;
    }
    .admin-card-icon {
        width: 48px;
        height: 48px;
    }
    .admin-card-icon svg {
        width: 24px;
        height: 24px;
    }
    .admin-card-title {
        font-size: 18px;
    }
}

.dashboard-container {
    flex: 1;
    -webkit-overflow-scrolling: touch;
}
.content-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;
}
.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:not([type="checkbox"]),
.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);
}

input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    min-width: 20px;
    min-height: 20px;
    border: 2px solid var(--border);
    border-radius: 6px;
    background: var(--bg-surface);
    cursor: pointer;
    position: relative;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}
input[type="checkbox"]:hover {
    border-color: var(--primary);
    transform: scale(1.05);
}
input[type="checkbox"]:checked {
    background: var(--primary);
    border-color: var(--primary);
}
input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    line-height: 1;
}
input[type="checkbox"]:focus {
    outline: none;
    box-shadow: 0 0 0 3px var(--primary-light);
}
.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
}
.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);
}
.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;
}


.field-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    margin-bottom: 12px;
    transition: border-color 0.2s;
}
.field-card:hover {
    border-color: var(--text-tertiary);
}
.field-card-row {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 10px;
}
.field-card-row:last-child {
    margin-bottom: 0;
}
.field-key {
    flex: 2;
    font-family: 'Montserrat', monospace;
    font-size: 13px;
    font-weight: 600;
}
.field-label {
    flex: 1.5;
    font-size: 13px;
}
.field-type {
    flex: 0 0 160px;
    height: 42px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-body);
    color: var(--text-primary);
    font-size: 13px;
    padding: 0 12px;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s;
}
.field-type:focus {
    border-color: var(--primary);
}
.field-placeholder {
    flex: 1.5;
    font-size: 13px;
}
.field-remove {
    width: 36px;
    height: 36px;
    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;
    flex-shrink: 0;
}
.field-remove:hover {
    background: var(--danger, #e74c3c);
    color: #fff;
}
.field-required-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}
.field-required {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

.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;
    min-width: 0;
    flex: 1;
}
.panel-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.panel-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.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);
}
.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', monospace;
}
.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 (max-width: 768px) {
    .field-card-row {
        flex-direction: column;
        align-items: stretch;
    }
    .field-key,
    .field-label,
    .field-placeholder {
        flex: 1;
    }
    .field-type {
        flex: 1;
        width: 100%;
    }
    .field-remove {
        align-self: flex-end;
    }
}

@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-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);
}
.workspace-empty-icon svg {
    width: 40px;
    height: 40px;
    color: var(--text-tertiary);
    opacity: 0.6;
}
.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;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.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;
}
.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;
}


.dashboard-header {
    margin-bottom: 24px;
}

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

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


.quick-actions-banner {
    width: 100%;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    padding: 20px 0;
    margin-bottom: 32px;
}

.quick-actions-banner-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

.quick-actions-banner-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.quick-actions-banner-header svg {
    width: 24px;
    height: 24px;
    color: var(--primary);
}

.quick-actions-banner-header h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: 0.5px;
}

.quick-actions-banner-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.quick-action-banner-btn {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    background: var(--bg-body);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    position: relative;
    overflow: hidden;
}

.quick-action-banner-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--primary) 0%, var(--primary-hover) 100%);
    transform: scaleY(0);
    transition: transform 0.2s ease;
}

.quick-action-banner-btn:hover::before {
    transform: scaleY(1);
}

.quick-action-banner-btn:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.quick-action-banner-btn:active {
    transform: translateY(0);
}

.quick-action-banner-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-light);
    flex-shrink: 0;
}

.quick-action-banner-icon svg {
    width: 24px;
    height: 24px;
    color: var(--primary);
}

.quick-action-banner-text {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.3px;
}

[data-theme="dark"] .quick-action-banner-btn:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.hero-banner {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 50%, var(--primary) 100%);
    border-radius: var(--radius);
    padding: 48px 48px;
    margin: 0 auto 40px;
    max-width: 1600px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
    box-shadow: 0 20px 60px rgba(34, 197, 94, 0.4), 0 0 40px rgba(34, 197, 94, 0.2);
    position: relative;
    overflow: hidden;
    min-height: 280px;
}

[data-theme="dark"] .hero-banner {
    background: linear-gradient(135deg, #dc2626 0%, #ef4444 50%, #b91c1c 100%);
    box-shadow: 0 20px 60px rgba(220, 38, 38, 0.4), 0 0 40px rgba(220, 38, 38, 0.2);
}

.hero-banner::before {
    content: '';
    position: absolute;
    top: -100px;
    right: -100px;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 70%);
    border-radius: 50%;
    animation: pulse 4s ease-in-out infinite;
}

.hero-banner::after {
    content: '';
    position: absolute;
    bottom: -80px;
    right: 10%;
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    border-radius: 50%;
    animation: pulse 6s ease-in-out infinite reverse;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.hero-banner-content {
    flex: 1;
    z-index: 1;
    max-width: 650px;
}

.hero-banner-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
    padding: 8px 16px;
    border-radius: 20px;
    margin-bottom: 20px;
    border: 1px solid rgba(255,255,255,0.3);
}

.hero-banner-badge svg {
    width: 18px;
    height: 18px;
    color: #fff;
}

.hero-banner-badge span {
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.hero-banner-title {
    font-size: 42px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 16px;
    line-height: 1.2;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.hero-banner-subtitle {
    font-size: 18px;
    color: rgba(255,255,255,0.95);
    line-height: 1.6;
    margin-bottom: 28px;
    font-weight: 400;
}

.hero-banner-features {
    display: flex;
    gap: 20px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.hero-banner-feature {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(10px);
    padding: 10px 16px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.2);
}

.hero-banner-feature svg {
    width: 20px;
    height: 20px;
    color: #fff;
    flex-shrink: 0;
}

.hero-banner-feature span {
    font-size: 13px;
    font-weight: 500;
    color: #fff;
}

.hero-banner-action {
    display: flex;
    gap: 14px;
    z-index: 1;
    flex-wrap: wrap;
}

.hero-banner-btn {
    padding: 16px 32px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Montserrat', sans-serif;
    text-decoration: none;
}

.hero-banner-btn-primary {
    background: #fff;
    color: var(--primary);
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.hero-banner-btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.3);
}

.hero-banner-btn-secondary {
    background: rgba(255,255,255,0.15);
    color: #fff;
    border: 2px solid rgba(255,255,255,0.4);
    backdrop-filter: blur(10px);
}

.hero-banner-btn-secondary:hover {
    background: rgba(255,255,255,0.25);
    border-color: rgba(255,255,255,0.6);
    transform: translateY(-3px);
}

.hero-banner-visual {
    flex-shrink: 0;
    width: 320px;
    height: 280px;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.hero-banner-illustration {
    width: 100%;
    height: 100%;
    position: relative;
}

.hero-banner-illustration svg {
    width: 100%;
    height: 100%;
    color: rgba(255,255,255,0.95);
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.3));
}

.hero-banner-floating-icon {
    position: absolute;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 12px;
    animation: float 3s ease-in-out infinite;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.hero-banner-floating-icon-1 {
    top: 20px;
    right: 0;
    animation-delay: 0s;
}

.hero-banner-floating-icon-2 {
    bottom: 40px;
    left: -20px;
    animation-delay: 1s;
}

.hero-banner-floating-icon-3 {
    top: 50%;
    right: -30px;
    animation-delay: 0.5s;
}

.hero-banner-floating-icon svg {
    width: 28px;
    height: 28px;
    color: #fff;
}

.hero-banner-floating-icon-3 span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}


.info-banner-section {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin: 0 auto 40px;
    max-width: 1200px;
}

.info-banner {
    background: var(--bg-surface);
    border-radius: var(--radius);
    padding: 24px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.info-banner:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    border-color: var(--primary);
}

.info-banner-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.info-banner-icon svg {
    width: 24px;
    height: 24px;
    color: var(--primary);
}

.info-banner-content h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.info-banner-content p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}


.two-column-text-section {
    margin: 0 24px 40px;
    display: flex;
    justify-content: center;
}

.two-column-text-block {
    display: grid;
    grid-template-columns: 700px 700px;
    gap: 32px;
    max-width: 1432px;
}

.text-column-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.text-column-text {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}


.apps-section {
    margin: 0 auto 60px;
    max-width: 1600px;
}

.apps-section-header {
    text-align: center;
    margin-bottom: 32px;
    padding: 0 24px;
}

.apps-section-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.apps-section-subtitle {
    font-size: 15px;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}


.apps-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin: 0 24px 40px;
}

.app-card {
    background: var(--bg-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
    overflow: hidden;
    min-height: 200px;
}

.app-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.app-card:hover::before {
    transform: scaleX(1);
}

.app-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.15);
    border-color: var(--primary);
}

.app-card-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.app-card-icon svg {
    width: 28px;
    height: 28px;
}

.app-card-icon.blue { background: rgba(59,130,246,0.1); color: #3b82f6; }
.app-card-icon.green { background: rgba(34,197,94,0.1); color: #22c55e; }
.app-card-icon.red { background: var(--primary-light); color: var(--primary); }
.app-card-icon.purple { background: rgba(139,92,246,0.1); color: #8b5cf6; }
.app-card-icon.orange { background: rgba(245,158,11,0.1); color: #f59e0b; }

[data-theme="dark"] .app-card-icon.blue { background: rgba(59,130,246,0.2); }
[data-theme="dark"] .app-card-icon.green { background: rgba(34,197,94,0.2); }
[data-theme="dark"] .app-card-icon.red { background: rgba(239,68,68,0.2); }
[data-theme="dark"] .app-card-icon.purple { background: rgba(139,92,246,0.2); }
[data-theme="dark"] .app-card-icon.orange { background: rgba(245,158,11,0.2); }

.app-card-content {
    flex: 1;
}

.app-card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.app-card-description {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.app-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
}

.app-card-link {
    font-size: 13px;
    font-weight: 500;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.app-card-link svg {
    width: 16px;
    height: 16px;
    transition: transform 0.2s;
}

.app-card:hover .app-card-link svg {
    transform: translateX(4px);
}

.app-card-badge {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 8px;
    border-radius: 4px;
    background: var(--bg-hover);
    color: var(--text-secondary);
}


.quick-actions {
    background: var(--bg-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    margin: 0 auto 32px;
    max-width: 1600px;
    border: 1px solid var(--border);
}

.quick-actions-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.quick-actions-title svg {
    width: 20px;
    height: 20px;
    color: var(--primary);
}

.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.quick-action-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-body);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
    position: relative;
    overflow: hidden;
}

.quick-action-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary);
    transform: scaleY(0);
    transition: transform 0.2s ease;
}

.quick-action-btn:hover::before {
    transform: scaleY(1);
}

.quick-action-btn:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
    transform: translateX(4px);
}

.quick-action-btn svg {
    width: 20px;
    height: 20px;
    color: var(--primary);
    flex-shrink: 0;
}

.quick-action-btn-text {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}


.footer-info-section {
    background: var(--bg-surface);
    border-top: 1px solid var(--border);
    padding: 48px 24px;
}

.footer-info-container {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
}

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

.footer-info-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

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

.footer-info-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: var(--primary);
}

.footer-info-link {
    font-size: 14px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s ease;
    padding: 4px 0;
}

.footer-info-link:hover {
    color: var(--primary);
}


.dashboard-footer {
    background: var(--bg-surface);
    border-top: 1px solid var(--border);
    padding: 24px;
    flex-shrink: 0;
    margin-top: auto;
}

.footer-content {
    margin: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 24px;
}

.footer-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dashboard-footer-text {
    font-size: 13px;
    color: var(--text-secondary);
}

.footer-tagline {
    font-size: 12px;
    color: var(--text-tertiary);
    margin: 0;
}

.dashboard-footer-links {
    display: flex;
    gap: 32px;
}

.dashboard-footer-links a {
    font-size: 13px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s ease;
}

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


.features-section {
    margin: 0 auto 60px;
    max-width: 1200px;
}

.features-header {
    text-align: center;
    margin-bottom: 40px;
}

.features-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.features-subtitle {
    font-size: 15px;
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.feature-item {
    background: var(--bg-surface);
    border-radius: var(--radius);
    padding: 28px;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.feature-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    border-color: var(--primary-light);
}

.feature-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.feature-icon svg {
    width: 28px;
    height: 28px;
    color: var(--primary);
}

.feature-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.feature-description {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}


.how-it-works-section {
    margin: 0 auto 60px;
    max-width: 1200px;
}

.how-it-works-header {
    text-align: center;
    margin-bottom: 40px;
}

.how-it-works-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.how-it-works-subtitle {
    font-size: 15px;
    color: var(--text-secondary);
    max-width: 500px;
    margin: 0 auto;
}

.how-it-works-steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.how-it-works-step {
    display: flex;
    gap: 16px;
    padding: 24px;
    background: var(--bg-surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.how-it-works-step:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    border-color: var(--primary-light);
}

.step-number {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.step-content h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.step-content p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}


.info-cards-section {
    margin: 0 24px 60px;
}

.info-cards-header {
    text-align: center;
    margin-bottom: 40px;
}

.info-cards-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.info-cards-subtitle {
    font-size: 15px;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

.info-cards-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.info-card {
    background: var(--bg-surface);
    border-radius: var(--radius);
    padding: 28px;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.info-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    border-color: var(--primary-light);
}

.info-card-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.info-card-icon.red {
    background: #fee2e2;
}

.info-card-icon.blue {
    background: #dbeafe;
}

.info-card-icon.green {
    background: #dcfce7;
}

.info-card-icon.purple {
    background: #f3e8ff;
}

[data-theme="dark"] .info-card-icon.red {
    background: rgba(239,68,68,0.2);
}

[data-theme="dark"] .info-card-icon.blue {
    background: rgba(59,130,246,0.2);
}

[data-theme="dark"] .info-card-icon.green {
    background: rgba(34,197,94,0.2);
}

[data-theme="dark"] .info-card-icon.purple {
    background: rgba(168,85,247,0.2);
}

.info-card-icon svg {
    width: 28px;
    height: 28px;
}

.info-card-icon.red svg {
    color: #dc2626;
}

.info-card-icon.blue svg {
    color: #2563eb;
}

.info-card-icon.green svg {
    color: #16a34a;
}

.info-card-icon.purple svg {
    color: #9333ea;
}

.info-card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.info-card-text {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 16px;
}

.info-card-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.info-card-list li {
    font-size: 13px;
    color: var(--text-secondary);
    padding: 8px 0;
    padding-left: 24px;
    position: relative;
    border-bottom: 1px solid var(--border);
}

.info-card-list li:last-child {
    border-bottom: none;
}

.info-card-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: 700;
}


.cta-banner {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    border-radius: var(--radius);
    padding: 32px 40px;
    margin: 0 auto 24px;
    max-width: 1600px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    box-shadow: 0 8px 24px var(--cta-shadow);
}

.cta-banner-content h3 {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
}

.cta-banner-content p {
    font-size: 14px;
    color: rgba(255,255,255,0.9);
    margin: 0;
}

.cta-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 24px;
    background: #fff;
    color: var(--primary);
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Montserrat', sans-serif;
    white-space: nowrap;
}

.cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

.cta-btn svg {
    width: 18px;
    height: 18px;
}


.dashboard-container {
    flex: 1;
    -webkit-overflow-scrolling: touch;
    padding: 24px;
    margin-bottom: 0;
}


@media (max-width: 1024px) {
    .hero-banner {
        padding: 36px 32px;
        min-height: auto;
    }

    .hero-banner-visual {
        width: 260px;
        height: 220px;
    }

    .hero-banner-title {
        font-size: 32px;
    }

    .hero-banner-subtitle {
        font-size: 16px;
    }

    .info-banner-section {
        grid-template-columns: 1fr;
    }

    .apps-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .cta-banner {
        flex-direction: column;
        text-align: center;
        padding: 24px 20px;
    }

    .cta-btn {
        width: 100%;
        justify-content: center;
    }

    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .how-it-works-steps {
        grid-template-columns: repeat(2, 1fr);
    }

    .info-cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .quick-actions-banner {
        padding: 16px 0;
        margin-bottom: 24px;
    }

    .quick-actions-banner-container {
        padding: 0 16px;
    }

    .quick-actions-banner-header {
        margin-bottom: 16px;
    }

    .quick-actions-banner-header h2 {
        font-size: 16px;
    }

    .quick-actions-banner-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .quick-action-banner-btn {
        padding: 16px 18px;
    }

    .quick-action-banner-icon {
        width: 42px;
        height: 42px;
    }

    .quick-action-banner-icon svg {
        width: 20px;
        height: 20px;
    }

    .quick-action-banner-text {
        font-size: 14px;
    }

    .hero-banner {
        flex-direction: column;
        padding: 24px 20px;
        text-align: center;
        gap: 24px;
    }

    .hero-banner-content {
        max-width: 100%;
    }

    .hero-banner-visual {
        width: 180px;
        height: 160px;
        order: -1;
    }

    .hero-banner-title {
        font-size: 24px;
    }

    .hero-banner-subtitle {
        font-size: 14px;
    }

    .hero-banner-features {
        justify-content: center;
    }

    .hero-banner-feature {
        padding: 0;
    }

    .hero-banner-action {
        justify-content: center;
        flex-direction: column;
        width: 100%;
    }

    .hero-banner-btn {
        justify-content: center;
        width: 100%;
        padding: 14px 24px;
    }

    .hero-banner-floating-icon {
        display: none;
    }

    .dashboard-container {
        padding: 16px;
    }

    .apps-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .info-banner-section {
        grid-template-columns: 1fr;
        padding: 0 16px;
    }

    .info-banner {
        padding: 20px;
    }

    .two-column-text-block {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .apps-section-title {
        font-size: 22px;
    }

    .apps-section-subtitle {
        font-size: 14px;
    }

    .cta-banner {
        padding: 20px 16px;
    }

    .cta-banner-content h3 {
        font-size: 18px;
    }

    .footer-info-section {
        padding: 32px 16px;
    }

    .footer-info-container {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .footer-info {
        align-items: center;
    }

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

    .features-grid {
        grid-template-columns: 1fr;
    }

    .how-it-works-steps {
        grid-template-columns: 1fr;
    }

    .how-it-works-step {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .info-cards-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-footer {
        flex-direction: column;
        gap: 16px;
        text-align: center;
        padding: 16px;
    }

    .dashboard-footer-links {
        display: flex;
        flex-direction: column;
        gap: 12px;
        align-items: center;
    }

    .dashboard-title {
        font-size: 22px;
    }
}

@media (max-width: 480px) {
    .hero-banner {
        padding: 20px 16px;
    }

    .hero-banner-title {
        font-size: 20px;
    }

    .hero-banner-subtitle {
        font-size: 13px;
    }

    .hero-banner-visual {
        width: 140px;
        height: 120px;
    }

    .app-card {
        padding: 20px;
        min-height: 180px;
    }

    .app-card-icon {
        width: 48px;
        height: 48px;
    }

    .app-card-icon svg {
        width: 24px;
        height: 24px;
    }

    .app-card-title {
        font-size: 15px;
    }

    .app-card-description {
        font-size: 12px;
    }
}


.calculator-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 1024px) {
    .calculator-layout {
        grid-template-columns: 1fr;
    }
}


.form-section {
    background: var(--bg-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 24px;
}

.form-section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.type-select {
    width: 240px;
}

.type-select select {
    width: 100%;
    padding: 10px 32px 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    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%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 12px center;
    appearance: none;
    cursor: pointer;
    color: var(--text-primary);
}

[data-theme="dark"] .type-select select {
    color: var(--text-primary);
    -webkit-text-fill-color: var(--text-primary);
}

[data-theme="dark"] .type-select select option {
    background-color: var(--bg-surface);
    color: var(--text-primary);
}

[data-theme="dark"] .field-type {
    color: var(--text-primary);
}

[data-theme="dark"] .field-type option {
    background-color: var(--bg-surface);
    color: var(--text-primary);
}

.section-divider {
    margin: 24px 0;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

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

.section-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 12px;
}


.debt-item {
    background: var(--bg-hover);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-bottom: 16px;
    border-left: 3px solid var(--primary);
    position: relative;
}

.debt-item-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.debt-item-title input {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    background: transparent;
    border: 1px solid transparent;
    padding: 4px 8px;
    border-radius: 4px;
    width: 220px;
}

.debt-item-title input:focus {
    background: var(--bg-surface);
    border-color: var(--primary);
    outline: none;
}

.debt-item .form-group {
    margin-bottom: 12px;
}

.repayment-item {
    background: var(--bg-hover);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-bottom: 16px;
    border-left: 3px solid #22c55e;
    position: relative;
}

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

.repayment-title input {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    background: transparent;
    border: 1px solid transparent;
    padding: 4px 8px;
    border-radius: 4px;
    width: 220px;
}

.repayment-title input:focus {
    background: var(--bg-surface);
    border-color: var(--primary);
    outline: none;
}

.repayment-item .form-group {
    margin-bottom: 12px;
}

.debt-item-delete,
.repayment-delete {
    position: absolute;
    top: 12px;
    right: 12px;
    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;
}


.result-section {
    background: var(--bg-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}

.result-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.result-main {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    border-radius: 16px;
    padding: 24px 20px;
    text-align: center;
    margin-bottom: 20px;
    box-shadow: 0 8px 24px rgba(34, 197, 94, 0.3);
    max-width: 100%;
    box-sizing: border-box;
}

.result-main-value {
    font-size: 32px;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    line-height: 1.2;
}

.result-main-label {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
    margin-top: 6px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.result-details {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.result-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

.result-row:last-child {
    border-bottom: none;
}

.result-label {
    color: var(--text-secondary);
}

.result-value {
    font-weight: 600;
    color: var(--text-primary);
}


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


.result-table-panel {
    display: flex;
    flex-direction: column;
    background: var(--bg-surface);
    border-radius: 12px;
    border: 1px solid var(--border);
    overflow: hidden;
    min-height: 280px;
    margin-top: 16px;
}

.result-table-info {
    padding: 12px 16px;
    background: var(--bg-body);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.result-table-count {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 600;
}

.result-table-wrapper {
    overflow: auto;
    flex: 1;
    min-height: 200px;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.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: 10px;
    background: var(--bg-hover);
    letter-spacing: 0.3px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.data-table td.number {
    text-align: right;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
}

.data-table tbody tr:hover {
    background: var(--bg-hover);
}


.footer {
    background: var(--bg-surface);
    border-top: 1px solid var(--border);
    padding: 12px 24px;
    font-size: 11px;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
    flex-shrink: 0;
}


.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;
}


.preloader {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.preloader.active,
.preloader:not(.hidden) {
    display: flex;
}

.preloader.hidden {
    display: none;
}

.preloader-content {
    background: var(--bg-surface);
    padding: 40px 60px;
    border-radius: var(--radius);
    text-align: center;
}

.preloader-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.preloader-text {
    font-size: 15px;
    color: var(--text-secondary);
    font-weight: 500;
    margin-top: 16px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}


@media print {
    .header,
    .footer,
    .theme-toggle,
    .btn,
    .debt-item-delete,
    .repayment-delete {
        display: none !important;
    }

    body {
        background: white;
        overflow: visible;
    }

    .form-section,
    .result-section {
        box-shadow: none;
        border: 1px solid #ddd;
    }

    .main-content {
        overflow: visible;
    }
}


.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";
}


:root {
    --usd-color: #3b82f6;
    --eur-color: #22c55e;
    --rub-color: #f59e0b;
    --cny-color: #8b5cf6;
}


.preloader-content {
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.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;
}


body.loading .header {
    visibility: hidden;
}

.header-title {
    flex: 1;
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
}

.main-content {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    transition: opacity 0.3s ease;
    opacity: 1;
}


.calculation-page .main-content {
    padding: 0;
    max-width: 100vw;
    overflow-x: hidden;
}

.calculation-page .main-content > .calc-wrapper {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}


.currency-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.currency-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.currency-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 600;
    color: white;
}

.currency-icon svg {
    width: 100%;
    height: 100%;
    color: white;
}

.currency-icon .nbrb-icon {
    font-size: 22px;
    color: white;
}

.currency-icon.usd {
    background: var(--usd-color);
}

.currency-icon.eur {
    background: var(--eur-color);
}

.currency-icon.rub {
    background: var(--rub-color);
}

.currency-icon.cny {
    background: var(--cny-color);
}

.currency-icon.byn {
    background: var(--primary);
}

.currency-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.currency-code {
    font-size: 12px;
    color: var(--text-secondary);
}

.currency-rates {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 8px;
}

.currency-rate-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.currency-rate-label {
    font-size: 11px;
    color: var(--text-tertiary);
    text-transform: uppercase;
    font-weight: 600;
    min-width: 70px;
}

.currency-rate {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.currency-rate-tomorrow {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary);
}

.currency-rate-tomorrow.positive {
    color: #22c55e;
}

.currency-rate-tomorrow.negative {
    color: #dc2626;
}

.currency-rate-tomorrow.neutral {
    color: var(--text-secondary);
}

.currency-change {
    font-size: 12px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

.currency-change.positive {
    color: #22c55e;
}

.currency-change.negative {
    color: #dc2626;
}

.currency-change.neutral {
    color: var(--text-secondary);
}


.controls-card {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-surface);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    border: none;
}

.period-selector {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.period-btn {
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-surface);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
    font-family: 'Montserrat', sans-serif;
}

.period-btn:hover:not(:disabled) {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    transform: translateY(-1px);
}

.period-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.period-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.date-range {
    display: flex;
    align-items: center;
    gap: 12px;
}

.date-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.date-input-group label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 600;
}

.date-input-group input {
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
    background: var(--bg-body);
    color: var(--text-primary);
    outline: none;
    transition: all 0.2s;
}

.date-input-group input[type="date"] {
    color-scheme: light dark;
}

.date-input-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.date-input-group input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 1;
    transition: opacity 0.2s, filter 0.2s;
    filter: brightness(0);
}

.date-input-group input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 0.8;
}

[data-theme="dark"] .date-input-group input[type="date"] {
    background-color: #111111;
    color: #f3f4f6;
}

[data-theme="dark"] .date-input-group input[type="date"]::-webkit-calendar-picker-indicator {
    filter: brightness(100);
}

.currency-selector {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.currency-check {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 13px;
    font-weight: 500;
}

.currency-check:hover {
    background: var(--bg-hover);
}

.currency-check.active {
    background: var(--primary-light);
    border-color: var(--primary);
}

.currency-check input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    min-width: 20px;
    min-height: 20px;
    border: 2px solid var(--border);
    border-radius: 6px;
    background: var(--bg-surface);
    cursor: pointer;
    position: relative;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    margin: 0;
}

.currency-check input[type="checkbox"]:hover {
    border-color: var(--primary);
    transform: scale(1.05);
}

.currency-check input[type="checkbox"]:checked {
    background: var(--primary);
    border-color: var(--primary);
}

.currency-check input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    line-height: 1;
}

.currency-check input[type="checkbox"]:focus {
    outline: none;
    box-shadow: 0 0 0 3px var(--primary-light);
}

.btn-add-currency {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    background: var(--bg-hover);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    transition: all 0.15s;
    min-width: 32px;
    height: 32px;
}

.btn-add-currency:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}


.chart-card {
    background: var(--bg-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    flex: 1;
    min-height: 500px;
    display: flex;
    flex-direction: column;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.chart-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 12px;
}

.chart-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}


.toggle-switch {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    background: var(--bg-hover);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.toggle-switch:hover {
    background: var(--border);
}

.toggle-switch.active {
    background: var(--primary-light);
}

.toggle-switch input {
    display: none;
}

.toggle-slider {
    width: 44px;
    height: 24px;
    background: var(--border);
    border-radius: 12px;
    position: relative;
    transition: background 0.2s;
}

.toggle-slider::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.toggle-switch.active .toggle-slider {
    background: var(--primary);
}

.toggle-switch.active .toggle-slider::after {
    transform: translateX(20px);
}

.toggle-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.chart-legend {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

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

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.legend-remove {
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s;
}

.legend-item:hover .legend-remove {
    opacity: 1;
}

.legend-remove:hover {
    color: var(--primary);
}

.chart-wrapper {
    flex: 1;
    position: relative;
    min-height: 400px;
}


.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 {
    display: flex;
    opacity: 1;
    visibility: visible;
}

.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 {
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: 600;
}

.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: #dc2626;
    border-color: #dc2626;
    color: #fff;
}

.modal-footer {
    display: flex;
    gap: 10px;
    margin-top: 24px;
    justify-content: flex-end;
}

.modal-list {
    flex: 1;
    overflow-y: auto;
    max-height: 400px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.currency-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.15s;
}

.currency-item:hover {
    background: var(--bg-hover);
}

.currency-item:last-child {
    border-bottom: none;
}

.currency-item-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.currency-item-code {
    font-weight: 600;
    color: var(--primary);
    font-size: 13px;
    min-width: 24px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.currency-item-code svg {
    width: 100%;
    height: 100%;
    color: var(--primary);
}

.currency-item-code .nbrb-icon {
    font-size: 16px;
    color: var(--primary);
}

.currency-item-name {
    font-size: 13px;
    color: var(--text-primary);
}

.currency-item-add {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    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.15s;
}

.currency-item-add:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    justify-content: flex-end;
}


.calculator-card {
    background: var(--bg-surface);
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    padding: 20px;
    border: none;
}

.calculator-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.calculator-title svg {
    color: var(--primary);
}

.calculator-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.calc-input-group {
    position: relative;
}

.calc-input-group label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
    display: block;
}

.calc-input {
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    background: var(--bg-body);
    color: var(--text-primary);
    outline: none;
    transition: all 0.2s;
    width: 100%;
}

.calc-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.calc-input::placeholder {
    color: var(--text-tertiary);
}

.calc-input[type="number"]::-webkit-inner-spin-button,
.calc-input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    margin: 0;
}

.calc-input[type="number"] {
    -moz-appearance: textfield;
}

.calc-input[type="date"] {
    padding: 11px 14px;
}

.calc-input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 1;
    transition: opacity 0.2s, filter 0.2s;
    filter: brightness(0);
}

.calc-input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 0.8;
}

[data-theme="dark"] .calc-input[type="date"] {
    background-color: #111111;
    color: #f3f4f6;
}

[data-theme="dark"] .calc-input[type="date"]::-webkit-calendar-picker-indicator {
    filter: brightness(100);
}

.calc-select {
    padding: 10px 32px 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    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%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 10px center;
    color: var(--text-primary);
    outline: none;
    cursor: pointer;
    width: 100%;
    appearance: none;
}

.calc-select:focus {
    border-color: var(--primary);
}


.calc-currency-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.15s;
    font-size: 14px;
    font-weight: 500;
}

.calc-currency-btn:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
}

.calc-currency-btn.active {
    background: var(--primary-light);
    border-color: var(--primary);
}

.calc-currency-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.calc-currency-icon svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

.calc-currency-icon .nbrb-icon {
    font-size: 18px;
    color: var(--text-primary);
}

.calc-result-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
    word-break: break-word;
}

.calc-result-words {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 8px;
    line-height: 1.4;
}

.btn-copy {
    padding: 8px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    width: auto;
}

.btn-copy:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.btn-copy.copied {
    background: #22c55e;
    border-color: #22c55e;
    color: white;
}


.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 16px;
}

.error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #dc2626;
    text-align: center;
}

.error-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.error-message {
    font-size: 14px;
    margin-bottom: 12px;
}

.error-retry {
    padding: 10px 20px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
}


.footer-source {
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-update {
    font-size: 11px;
}


@media (max-width: 768px) {
    .header {
        padding: 0 16px;
    }

    .header-title {
        font-size: 14px;
    }

    .controls-card {
        flex-direction: column;
        align-items: stretch;
    }

    .preloader-content {
        padding: 30px 40px;
    }


    .main-content > div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
        display: flex;
        flex-direction: column-reverse;
    }


    .modal {
        max-height: 90vh;
        overflow: hidden;
    }

    .modal-list {
        max-height: 60vh;
        -ms-overflow-style: none;
        scrollbar-width: none;
    }

    .modal-list::-webkit-scrollbar {
        display: none;
    }
}


#workspaceGenerateBtn span {
    display: none;
}

@media (min-width: 768px) {
    #workspaceGenerateBtn span {
        display: inline;
    }
}


.template-card:hover {
    background: var(--bg-surface-hover);
}

.template-card.active {
    background: var(--primary-light);
    border-left: 3px solid var(--primary);
    padding-left: 17px;
}

.template-card-content {
    flex: 1;
    min-width: 0;
}

.template-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 0;
}

.template-card-icon {
    width: 36px;
    height: 36px;
    background: var(--primary-light);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.template-card-icon svg {
    width: 18px;
    height: 18px;
    color: var(--primary);
}

.template-card-name {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
    margin-bottom: 4px;
    line-height: 1.3;
}

.template-card-group {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.template-card-footer {
    display: none;
}


.group-header {
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

[data-theme="dark"] .group-header {
    background: linear-gradient(135deg, #1a1a1a, #262626);
}

.group-header:hover {
    background: linear-gradient(135deg, #f0f2f5, #e5e7eb);
}

[data-theme="dark"] .group-header:hover {
    background: linear-gradient(135deg, #262626, #333333);
}

.group-header-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 12px;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.group-header-title svg {
    width: 14px;
    height: 14px;
    color: var(--text-secondary);
    transition: transform 0.2s ease;
}

.group-header.collapsed svg {
    transform: rotate(-90deg);
}

.group-count {
    font-size: 10px;
    color: var(--text-secondary);
    background: var(--border);
    padding: 3px 10px;
    border-radius: 10px;
    font-weight: 700;
    text-transform: uppercase;
    margin-left: auto;
}

.group-templates {
    display: block;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.group-templates.collapsed {
    max-height: 0 !important;
}


.form-wrapper {
    padding: 24px;
    display: flex;
    flex-direction: column;
    width: 100%;
}

.form-group {
    margin-bottom: 28px;
    width: 100%;
}

.form-group-label-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
}

.form-group-label-row input[type="checkbox"] {
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    min-height: 20px !important;
    flex-shrink: 0 !important;
    margin: 0 !important;
}

.form-group-label-row .required-mark {
    color: #dc2626;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    flex-shrink: 0;
    margin-left: 4px;
    margin-top: -13px;
}

.form-group-label-row label {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    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[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    min-height: 20px !important;
    border: 2px solid var(--border);
    border-radius: 6px !important;
    background: var(--bg-surface);
    cursor: pointer;
    position: relative;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    margin: 0 !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: 13px;
    font-weight: 700;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    line-height: 1;
}

.form-group input[type="checkbox"]:focus {
    outline: none;
    box-shadow: 0 0 0 3px var(--primary-light);
}

[data-theme="dark"] .form-group label {
    background: linear-gradient(135deg, #a1a1a1 0%, #737373 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

[data-theme="dark"] .form-group-label-row label {
    background: linear-gradient(135deg, #a1a1a1 0%, #737373 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.form-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin: 0;
}

.form-group .form-group-label-row label {
    display: inline;
    text-transform: none;
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 400;
    letter-spacing: normal;
}

.form-group input:not([type="checkbox"]),
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 13px 16px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
    background: var(--bg-body);
    color: var(--text-primary);
    outline: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Montserrat', sans-serif;
}

.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover {
    border-color: var(--text-secondary);
    background: var(--bg-surface);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light), 0 2px 8px var(--cta-shadow);
    transform: translateY(-1px);
    background: var(--bg-surface);
}

.form-group input::placeholder {
    color: var(--text-tertiary);
    transition: color 0.2s ease;
}

.form-group input:focus::placeholder,
.form-group textarea:focus::placeholder {
    color: var(--text-secondary);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}


.workspace-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-secondary);
    padding: 60px 40px;
    text-align: center;
}

.workspace-empty-visual {
    position: relative;
    margin-bottom: 32px;
}

.workspace-empty-illustration {
    width: 200px;
    height: 180px;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 8px 24px var(--cta-shadow));
    animation: pulse-glow 3s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { filter: drop-shadow(0 8px 24px var(--cta-shadow)); }
    50% { filter: drop-shadow(0 12px 32px var(--cta-shadow)); }
}

.workspace-empty-illustration svg {
    width: 100%;
    height: 100%;
}

.workspace-empty-floating-icon {
    position: absolute;
    bottom: -10px;
    right: -10px;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px var(--cta-shadow), 0 0 0 4px var(--primary-light);
    animation: float 3s ease-in-out infinite;
}
[data-theme="dark"] .workspace-empty-floating-icon {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    box-shadow: 0 8px 24px var(--cta-shadow), 0 0 0 4px var(--primary-light);
}

.workspace-empty-floating-icon svg {
    width: 24px;
    height: 24px;
    color: #fff;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(5deg); }
}

.workspace-empty-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.workspace-empty-description {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 32px;
}

.workspace-empty svg {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
    opacity: 0.2;
}

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


.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    display: flex;
    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;
}

.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 {
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: 600;
}

.modal-close-btn {
    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-btn:hover {
    background: #dc2626;
    border-color: #dc2626;
    color: #fff;
}

.modal-footer {
    display: flex;
    gap: 10px;
    margin-top: 24px;
    justify-content: flex-end;
}


.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}


.loading-spinner {
    animation: spin 1s linear infinite;
}


@media (max-width: 768px) {
    body.form-page {
        height: auto !important;
        overflow: visible !important;
        min-height: 100vh;
    }

    .main-container {
        display: flex !important;
        flex-direction: column !important;
        padding: 12px !important;
        gap: 12px !important;
        height: auto !important;
        max-width: 100vw !important;
        overflow-x: hidden !important;
        box-sizing: border-box !important;
    }

    .main-left {
        width: 100% !important;
        max-width: 100% !important;
        min-width: auto !important;
        flex: none !important;
        height: auto !important;
        box-sizing: border-box;
    }

    .main-right {
        width: 100% !important;
        flex: none !important;
        height: auto !important;
        min-width: 0 !important;
        box-sizing: border-box;
    }

    .template-panel {
        margin: 0 !important;
        max-height: none !important;
        height: auto !important;
    }

    .template-panel-body {
        max-height: none !important;
        height: auto !important;
    }

    .template-panel-header {
        padding: 12px 16px !important;
    }

    .content-panel {
        margin: 0 !important;
        min-height: auto !important;
        height: auto !important;
        flex: none !important;
        overflow: hidden !important;
    }

    .panel-header {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
        padding: 16px !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        border-radius: var(--radius) var(--radius) 0 0 !important;
    }

    .panel-header-content {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        text-align: center;
        width: 100% !important;
    }

    .panel-header-text {
        display: flex;
        flex-direction: column;
        gap: 4px;
        width: 100%;
    }

    .panel-header .btn {
        width: 100%;
        justify-content: center;
    }

    .panel-body {
        padding: 16px !important;
        height: auto !important;
        overflow: visible !important;
        flex: none !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        border-radius: 0 0 var(--radius) var(--radius) !important;
    }

    .workspace-empty {
        padding: 40px 20px;
        text-align: center;
    }

    .workspace-empty-illustration {
        width: 160px;
        height: 140px;
        margin: 0 auto 24px;
    }

    .workspace-empty-title {
        font-size: 16px;
        margin-bottom: 8px;
    }

    .workspace-empty-description {
        font-size: 13px;
        line-height: 1.5;
    }

    .template-panel-header {
        padding: 14px 16px;
    }

    .template-panel-title {
        font-size: 15px;
    }
}


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

[data-theme="dark"] .template-card-icon {
    background: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.02) 100%);
}

[data-theme="dark"] .template-card.active .template-card-icon {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
}

[data-theme="dark"] .template-count {
    background: linear-gradient(135deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.03) 100%);
}

[data-theme="dark"] .workspace-empty-illustration {
    color: var(--primary);
}

[data-theme="dark"] .workspace-empty-icon {
    background: linear-gradient(135deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.03) 100%);
    border-color: var(--border);
}

[data-theme="dark"] .main-container {
    background: linear-gradient(135deg, #0a0a0a 0%, #111111 100%);
}

[data-theme="dark"] .panel-header {
    background: linear-gradient(135deg, #111111 0%, #0a0a0a 100%);
}

[data-theme="dark"] .template-panel-header {
    background: linear-gradient(135deg, #111111 0%, #0a0a0a 100%);
}


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);
}

.header-search-label,
.header-search-mobile,
.header-search-mobile-wrapper,
.header-actions-mobile {
    display: none !important;
}


.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: #dc2626;
    border-color: #dc2626;
    color: #fff;
}

.print-btn:active:not(:disabled),
.egr-btn:active:not(:disabled) {
    transform: translateY(0);
}


.main-container:has(.table-panel) {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.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: 0 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: 80px;
    text-align: center;
}

.org-table th:nth-child(2) {
    width: 30%;
}

.org-table th:nth-child(3) {
    width: 10%;
}

.org-table th:nth-child(4) {
    width: 40%;
}

.org-table th:nth-child(5) {
    width: 10%;
}

.org-table th:nth-child(6) {
    width: 10%;
}

.org-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    vertical-align: middle;
    white-space: normal;
}

.org-table td:nth-child(4) {
    max-width: none;
}

.org-table tbody tr {
    transition: background-color 0.1s ease;
    cursor: pointer;
}

.org-table tbody tr:hover {
    background: var(--bg-hover);
}

.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-code-badge {
    font-weight: 600;
    color: var(--primary);
    font-size: 11px;
    background: var(--primary-light);
    padding: 4px 8px;
    border-radius: 6px;
}

.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;
}


@media (min-width: 769px) {
    .org-code-mobile {
        display: none !important;
    }
}


.pagination {
    padding: 14px 20px 0;
    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;
}


#selectionInfo .count {
    font-weight: 600;
    font-size: 13px;
}


.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;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--bg-surface);
    padding: 28px;
    border-radius: var(--radius);
    max-width: 900px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
}

.modal h3 {
    margin-bottom: 22px;
    font-size: 17px;
    font-weight: 600;
    padding-right: 40px;
}

.modal-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    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 ease;
    z-index: 10;
    flex-shrink: 0;
}

.modal-close-btn:hover {
    background: #dc2626;
    border-color: #dc2626;
    color: #fff;
    transform: scale(1.05);
}

.modal-close-btn:active {
    transform: scale(0.95);
}

.modal-close-btn svg {
    width: 18px;
    height: 18px;
}

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

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.form-group input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    outline: none;
    background: var(--bg-body);
    color: var(--text-primary);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.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;
}

.file-status {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 6px;
}


.info-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.info-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    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;
    display: block;
}

.info-value {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.5;
    word-break: break-word;
    font-weight: 400;
    display: block;
}

.info-value.full {
    grid-column: auto;
}

.info-section {
    margin-top: 8px;
}

.info-section-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary-light);
}


.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);
}


#egrModal .modal {
    max-width: 800px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    background: var(--bg-surface);
    position: relative;
}

.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: #dc2626;
    border-color: #dc2626;
    color: #fff;
}

.modal-close-btn:active {
    transform: scale(0.95);
}

.egr-card {
    background: var(--bg-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 16px;
    transition: box-shadow 0.2s ease;
}

.egr-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.egr-card-header {
    padding: 0 20px;
    background: linear-gradient(135deg, var(--bg-hover), var(--bg-surface));
    border-bottom: 1px solid var(--border);
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 12px;
    height: 56px;
    box-sizing: border-box;
}

.egr-card-header svg {
    width: 20px;
    height: 20px;
    color: var(--primary);
    flex-shrink: 0;
    display: block;
    line-height: 0;
}

.egr-card-header h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    line-height: 1;
    display: block;
}

.egr-card-body {
    padding: 20px;
}

.egr-info-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 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;
    display: block;
}

.egr-info-value {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.6;
    word-break: break-word;
    display: block;
}

.egr-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.egr-status-active {
    background: rgba(34,197,94,0.15);
    color: #22c55e;
}

.egr-status-inactive {
    background: rgba(220,38,38,0.15);
    color: #dc2626;
}

[data-theme="dark"] .egr-status-active {
    background: rgba(34,197,94,0.2);
}

[data-theme="dark"] .egr-status-inactive {
    background: rgba(239,68,68,0.2);
}

.egr-section-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary-light);
    margin-top: 24px;
    margin-bottom: 16px;
}

.egr-director-item,
.egr-jur-name-item,
.egr-ved-item,
.egr-event-item {
    padding: 16px;
    margin-bottom: 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-body);
}

.egr-modal-content {
    background: var(--bg-surface);
}


@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-spinner {
    animation: spin 0.8s linear infinite;
}


.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 {
    display: block;
}


#textInput {
    display: none;
}


@media (max-width: 1024px) {
    .org-table th:nth-child(1) {
        width: 70px;
    }
    .org-table th:nth-child(2) {
        width: 40%;
    }
    .org-table th:nth-child(3) {
        width: 15%;
    }
    .org-table th:nth-child(4),
    .org-table th:nth-child(5) {
        display: none;
    }
    .org-table th:nth-child(6) {
        width: 140px;
    }
    .org-table td:nth-child(1),
    .org-table td:nth-child(4),
    .org-table td:nth-child(5) {
        display: none;
    }
}

@media (max-width: 768px) {

    html {
        min-height: 100%;
    }

    body {
        -webkit-overflow-scrolling: touch;
        background: var(--bg-body);
        min-height: 100vh;
        height: auto;
    }


    ::-webkit-scrollbar {
        display: none;
    }

    .table-wrapper {
        scrollbar-width: none;
        -ms-overflow-style: none;
    }


    .header {
        padding: 12px max(12px, env(safe-area-inset-right)) 12px max(12px, env(safe-area-inset-left));
        height: auto;
        min-height: max(56px, calc(56px + env(safe-area-inset-top)));
        padding-top: max(12px, env(safe-area-inset-top));
        position: sticky;
        top: 0;
        z-index: 100;
        flex-wrap: wrap;
        gap: 0;
        flex-shrink: 0;
        background: var(--bg-surface);
        border-bottom: 1px solid var(--border);
    }

    .header-logo {
        display: flex;
        align-items: center;
        gap: 16px;
        width: auto;
    }

    .header-logo img {
        height: 32px;
    }

    .header-logo-text {
        font-size: 14px;
        font-weight: 500;
        letter-spacing: 1.5px;
        font-family: 'Montserrat', sans-serif;
        margin-top: 5px;
        white-space: nowrap;
    }

    .header-logo-divider {
        color: var(--text-tertiary);
        font-size: 20px;
        font-weight: 300;
        margin-left: 8px;
    }


    .header-search-desktop,
    .header-actions-desktop {
        display: none !important;
    }


    .header-actions-mobile {
        display: flex !important;
        gap: 8px;
        flex-shrink: 0;
        margin-left: auto;
    }

    .theme-toggle {
        width: 44px;
        height: 28px;
        flex-shrink: 0;
    }

    .theme-toggle::after {
        width: 22px;
        height: 22px;
        top: 3px;
        left: 3px;
    }

    [data-theme="dark"] .theme-toggle::after {
        transform: translateX(16px);
    }


    .header-search-mobile-wrapper {
        order: 3;
        width: 100%;
        padding: 40px 0 0 0;
        box-sizing: border-box;
        display: block !important;
    }

    .header-search-label {
        display: block !important;
        font-size: 12px;
        font-weight: 600;
        color: var(--text-secondary);
        margin-bottom: 20px;
        margin-top: 0;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .header-search-mobile-field {
        width: 100%;
        margin: 0;
        padding: 0;
    }

    .header-search-mobile-field input {
        padding: 12px 16px 12px 40px;
        font-size: 14px;
        height: 44px;
        border-radius: 12px;
        width: 100%;
        box-sizing: border-box;
    }

    .header-search-bottom-spacer {
        display: block;
        height: 10px;
    }


    .main-container {
        margin: 0;
        display: flex;
        flex-direction: column;
        -webkit-overflow-scrolling: touch;
        background: var(--bg-body);
    }

    .table-panel {
        margin: 0;
        border-radius: 0;
        box-shadow: none;
        background: var(--bg-body);
        display: flex;
        flex-direction: column;
        overflow: auto;
    }

    .table-header {
        padding: 14px 16px;
        flex-direction: row;
        align-items: center;
        gap: 12px;
        background: var(--bg-body);
        border-radius: 0;
        border-bottom: none;
        flex-shrink: 0;
    }

    .table-count {
        font-size: 14px;
        font-weight: 700;
        text-align: left;
    }

    .table-controls {
        display: none;
    }

    .table-controls select {
        padding: 8px 12px;
        font-size: 16px;
        min-height: 44px;
        display: none;
    }

    .table-controls label {
        display: none;
    }


    .table-wrapper {
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        flex: 1;
        min-height: 0;
        position: relative;
    }

    .table-wrapper::after {
        display: none;
    }

    .org-table {
        min-width: auto;
        display: block;
        background: var(--bg-body);
    }

    .org-table thead {
        display: none;
    }

    .org-table tbody {
        display: block;
    }

    .org-table tbody tr {
        display: block;
        background: var(--bg-surface);
        border-radius: 14px;
        margin: 10px 12px;
        padding: 18px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.06);
        border: 1px solid var(--border);
    }

    .org-table tbody tr:active {
        background: var(--bg-hover);
    }

    .org-table tbody td {
        padding: 0;
        font-size: 14px;
        border: none;
        display: block;
    }

    .org-table tbody td:first-child {
        display: none;
    }

    .org-table tbody td:nth-child(2) {
        margin-bottom: 12px;
    }

    .org-table tbody td:nth-child(3) {
        display: none;
    }

    .org-table tbody td:nth-child(4),
    .org-table tbody td:nth-child(5) {
        display: none;
    }

    .org-table tbody td:nth-child(6) {
        display: flex;
        gap: 10px;
        justify-content: flex-start;
        margin-top: 12px;
        padding-top: 12px;
        border-top: 1px solid var(--border);
    }

    .org-name {
        font-size: 15px;
        font-weight: 700;
        line-height: 1.3;
        color: var(--text-primary);
    }

    .org-code-mobile {
        display: block;
        margin-top: 8px;
        margin-bottom: 8px;
        font-size: 12px;
        color: var(--text-secondary);
    }

    .org-code-mobile .code-badge {
        margin-right: 8px;
    }

    .org-unp {
        font-size: 12px;
        color: var(--text-secondary);
    }

    .meta-text {
        font-size: 12px;
        color: var(--text-secondary);
    }


    .btn-icon,
    .print-btn,
    .egr-btn {
        width: 40px;
        height: 40px;
        border-radius: 10px;
        flex-shrink: 0;
    }

    .btn-icon svg,
    .print-btn svg,
    .egr-btn svg {
        width: 18px;
        height: 18px;
    }

    .table-actions {
        gap: 6px;
    }


    .pagination {
        padding: 16px 16px 20px 16px;
        background: var(--bg-surface);
        border-radius: 0;
        border-top: 1px solid var(--border);
        flex-shrink: 0;
    }

    .pagination-info,
    #pageInfo {
        font-size: 12px;
        font-weight: 500;
    }

    .pagination-controls button {
        padding: 8px 12px;
        font-size: 13px;
        min-width: 40px;
        min-height: 36px;
        border-radius: 8px;
    }

    .pagination-controls {
        gap: 6px;
    }


    .modal-overlay .modal {
        position: relative;
    }

    .modal {
        padding: max(24px, calc(24px + env(safe-area-inset-top))) max(20px, env(safe-area-inset-right)) max(24px, calc(24px + env(safe-area-inset-bottom))) max(20px, env(safe-area-inset-left));
        width: 92%;
        max-height: 88vh;
        border-radius: 16px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .modal::-webkit-scrollbar {
        display: none;
    }

    .modal h3 {
        font-size: 17px;
        margin-bottom: 18px;
        font-weight: 700;
        padding-right: 44px;
        display: flex;
        align-items: flex-start;
        min-height: 28px;
        line-height: 1.3;
        margin-top: 0;
    }

    .modal-close-btn {
        position: absolute;
        top: 20px;
        right: 14px;
        width: 40px;
        height: 40px;
        border-radius: 10px;
    }

    .modal-close-btn svg {
        width: 20px;
        height: 20px;
        display: block;
    }

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

    .form-group label {
        display: block;
        font-size: 12px;
        font-weight: 700;
        margin-bottom: 6px;
    }

    .form-group input {
        padding: 12px 14px;
        font-size: 16px;
        min-height: 44px;
    }

    .modal-actions .btn {
        padding: 14px 18px;
        font-size: 14px;
        min-height: 48px;
    }

    #egrModal .modal {
        padding: 18px 14px;
    }

    .egr-card-header {
        padding: 12px 14px;
    }

    .egr-card-header h3 {
        font-size: 14px;
    }

    .egr-card-body {
        padding: 14px;
    }

    .egr-info-label {
        font-size: 10px;
        display: block;
        margin-bottom: 4px;
    }

    .egr-info-value {
        font-size: 13px;
        display: block;
    }

    .egr-director-item,
    .egr-jur-name-item,
    .egr-ved-item,
    .egr-event-item {
        padding: 12px;
        font-size: 12px;
    }

    .print-modal-grid {
        grid-template-columns: 1fr !important;
    }

    .print-modal-buttons {
        grid-template-columns: 1fr !important;
    }
}

@media (hover: none) {
    .btn:hover:not(:disabled),
    .print-btn:hover,
    .egr-btn:hover {
        transform: none;
    }

    .pagination-controls button:hover:not(:disabled) {
        transform: none;
    }

    .org-table tbody tr:hover {
        background: transparent;
    }

    .org-table tbody tr:active {
        background: var(--bg-hover);
    }
}

@supports (padding: max(0px)) {
    @media (max-width: 768px) {
        .header {
            padding-left: max(12px, env(safe-area-inset-left));
            padding-right: max(12px, env(safe-area-inset-right));
        }

        .modal {
            padding-left: max(20px, env(safe-area-inset-left));
            padding-right: max(20px, env(safe-area-inset-right));
        }
    }
}

@media (max-width: 768px) and (orientation: portrait) {
    .table-wrapper {
        max-height: calc(100vh - 190px);
    }
}

@media (max-width: 768px) and (orientation: landscape) {
    .table-wrapper {
        max-height: calc(100vh - 150px);
    }

    .modal {
        max-height: 90vh;
    }

    .header-search input {
        max-width: 400px;
    }
}


.main-layout {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 16px;
    padding: 16px;
    flex: 1;
    min-height: 0;
}

@media (max-width: 1400px) {
    .main-layout {
        grid-template-columns: 350px 1fr;
    }
}

@media (max-width: 1200px) {
    .main-layout {
        grid-template-columns: 300px 1fr;
    }
}

@media (max-width: 900px) {
    .main-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr 1fr;
    }
}


.left-panel {
    background: var(--bg-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 14px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

.panel-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.panel-title svg {
    color: var(--primary);
    width: 18px;
    height: 18px;
}


.employee-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.employee-form input,
.employee-form select {
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 12px;
    background: var(--bg-hover);
    color: var(--text-primary);
    outline: none;
    transition: all 0.15s;
    font-family: 'Montserrat', sans-serif;
}

.employee-form input:focus,
.employee-form select:focus {
    border-color: var(--primary);
}

.employee-form input[type="number"]::-webkit-inner-spin-button,
.employee-form input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    margin: 0;
}

.employee-form input[type="number"] {
    -moz-appearance: textfield;
}


.employee-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: all 0.2s;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

.employee-card:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

[data-theme="dark"] .employee-card:hover {
    box-shadow: 0 2px 8px rgba(239,68,68,0.15);
}

.employee-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    min-width: 0;
    cursor: pointer;
    user-select: none;
}

.employee-card-header:hover .employee-card-name {
    color: var(--primary);
}

.employee-card-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.employee-name-input {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
    min-width: 0;
    padding: 5px 8px;
    border: 1px solid transparent;
    border-radius: 4px;
    background: transparent;
    transition: all 0.2s;
    width: 100%;
    box-sizing: border-box;
}

.employee-name-input:hover {
    background: var(--bg-hover);
}

.employee-name-input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-surface);
    box-shadow: 0 0 0 2px var(--primary-light);
}

.employee-card-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.employee-card-delete {
    width: 26px;
    height: 26px;
    border-radius: 5px;
    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;
    flex-shrink: 0;
}

.employee-card-delete:hover {
    background: var(--danger);
    border-color: var(--danger);
    color: #fff;
}

.employee-card-settings {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
    transition: all 0.2s ease;
    max-height: 500px;
    opacity: 1;
    overflow: hidden;
}

.employee-card-settings.collapsed {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
}

.employee-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.setting-row {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    min-width: 0;
}

.setting-row label {
    font-size: 9px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
    flex-shrink: 0;
}

.setting-row select,
.setting-row input[type="date"],
.setting-row input[type="number"],
.setting-row input[type="text"] {
    padding: 5px 7px;
    font-size: 11px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg-body);
    color: var(--text-primary);
    transition: all 0.2s;
    box-sizing: border-box;
    min-width: 0;
}

.setting-row select {
    flex: 1;
    min-width: 0;
    cursor: pointer;
}

.setting-row input[type="date"] {
    width: 90px;
    font-size: 11px;
    padding: 4px 6px;
    flex-shrink: 0;
}

.setting-row input[type="number"] {
    width: 50px;
    font-size: 11px;
    text-align: center;
    flex-shrink: 0;
}

.setting-row input[type="number"]::-webkit-inner-spin-button,
.setting-row input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.setting-row input[type="number"] {
    -moz-appearance: textfield;
}

.setting-row select:focus,
.setting-row input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-light);
}

[data-theme="dark"] .setting-row select,
[data-theme="dark"] .setting-row input {
    background: var(--bg-surface);
}


.schedule-panel {
    background: var(--bg-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    overflow: auto;
    min-height: 0;
}

.schedule-panel .panel-header {
    padding-left: 0;
}

.schedule-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.schedule-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.schedule-actions {
    display: flex;
    gap: 10px;
}


.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-selector {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.shift-option {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-hover);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.shift-option:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.shift-option.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.shift-option-day {
    background: rgba(59,130,246,0.1);
    color: #3b82f6;
}

.shift-option-night {
    background: rgba(139,92,246,0.1);
    color: #8b5cf6;
}

.shift-option-off {
    background: rgba(34,197,94,0.1);
    color: #22c55e;
}

.shift-option-day.active {
    background: #3b82f6;
    color: #fff;
}

.shift-option-night.active {
    background: #8b5cf6;
    color: #fff;
}

.shift-option-off.active {
    background: #22c55e;
    color: #fff;
}


.schedule-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

.schedule-table th,
.schedule-table td {
    padding: 10px 12px;
    text-align: center;
    border: 1px solid var(--border);
    font-size: 13px;
}

.schedule-table th {
    background: var(--bg-body);
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 11px;
}

.schedule-table .day-number {
    font-weight: 600;
    color: var(--text-primary);
}

.schedule-table .day-weekend {
    color: var(--primary);
}

.schedule-table .shift-cell {
    cursor: pointer;
    transition: all 0.2s;
}

.schedule-table .shift-cell:hover {
    background: var(--bg-hover);
}

.schedule-table .shift-day {
    background: rgba(59,130,246,0.1);
    color: #3b82f6;
    font-weight: 600;
}

.schedule-table .shift-night {
    background: rgba(139,92,246,0.1);
    color: #8b5cf6;
    font-weight: 600;
}

.schedule-table .shift-off {
    background: rgba(34,197,94,0.1);
    color: #22c55e;
    font-weight: 600;
}


.employee-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.employee-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.employee-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3px;
    font-size: 11px;
    color: var(--text-secondary);
}

.employee-detail {
    display: flex;
    justify-content: space-between;
}

.employee-detail-label {
    color: var(--text-tertiary);
}

.employee-detail-value {
    font-weight: 500;
    white-space: nowrap;
}


.stats-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 10px;
    flex-shrink: 0;
}


.right-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    min-height: 0;
}

@media (max-width: 1200px) {
    .right-panel {
        grid-template-columns: 1fr;
    }

    .calendar-section {
        min-height: 400px;
    }
}

@media (max-width: 900px) {
    .main-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr 1fr;
    }

    .left-panel {
        max-height: 300px;
    }
}

@media (max-width: 768px) {
    .calendar-grid {
        gap: 1px;
    }

    .calendar-day {
        min-height: 50px;
    }

    .calendar-shift-name {
        display: none;
    }

    .calendar-shift-item {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .calendar-day {
        min-height: 40px;
        padding: 2px;
    }

    .calendar-day-number {
        font-size: 10px;
    }

    .calendar-shift-item {
        padding: 0;
    }

    .calendar-shift-dot {
        width: 4px;
        height: 4px;
    }
}


.schedule-section,
.calendar-section {
    background: var(--bg-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.section-header,
.calendar-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-shrink: 0;
}

.section-title,
.calendar-month {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.section-actions,
.calendar-nav {
    display: flex;
    gap: 8px;
    align-items: center;
}


.schedule-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    flex-shrink: 0;
}

.schedule-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.schedule-nav-btn {
    width: 28px;
    height: 28px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.schedule-nav-btn:hover:not(:disabled) {
    background: var(--bg-hover);
    border-color: var(--primary);
}

.schedule-nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.schedule-current {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    min-width: 120px;
    text-align: center;
}


.table-container {
    flex: 1;
    overflow: auto;
    min-height: 0;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.data-table th,
.data-table td {
    padding: 6px 8px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.data-table th {
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 10px;
    background: var(--bg-hover);
    position: sticky;
    top: 0;
    z-index: 10;
}

.data-table th small {
    display: block;
    font-size: 9px;
    font-weight: 400;
}

.data-table tr:hover {
    background: var(--bg-hover);
}

.data-table td.date-col {
    font-weight: 500;
    color: var(--text-primary);
    position: sticky;
    left: 0;
    background: var(--bg-surface);
    z-index: 5;
}

.data-table td.weekend {
    background: var(--danger-light);
}

[data-theme="dark"] .data-table td.weekend {
    background: rgba(239,68,68,0.1);
}

.shift-cell {
    min-width: 50px;
    text-align: center;
}

.shift-badge {
    display: inline-block;
    padding: 3px 6px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 500;
    min-width: 36px;
}

.shift-day {
    background: var(--success-light);
    color: var(--success);
}

.shift-night {
    background: var(--primary-light);
    color: var(--primary);
}

.shift-off {
    background: var(--bg-hover);
    color: var(--text-tertiary);
}

[data-theme="dark"] .shift-day {
    background: rgba(22,163,74,0.2);
}

[data-theme="dark"] .shift-night {
    background: rgba(59,130,246,0.2);
}


.calendar-section {
    background: var(--bg-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 14px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.calendar-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    flex-shrink: 0;
}

.calendar-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.calendar-month {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    min-width: 140px;
    text-align: center;
}


.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    flex: 1;
    min-height: 0;
}

.calendar-day-header {
    text-align: center;
    font-size: 9px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    padding: 4px 2px;
}

.calendar-day-header.weekend {
    color: var(--danger);
}

.calendar-day {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 3px;
    display: flex;
    flex-direction: column;
    gap: 1px;
    transition: all 0.15s;
    position: relative;
    min-height: 0;
}

.calendar-day:hover {
    border-color: var(--primary);
    background: var(--bg-hover);
}

.calendar-day.other-month {
    opacity: 0.3;
}

.calendar-day.today {
    border-color: var(--primary);
    border-width: 2px;
}

.calendar-day.weekend {
    background: var(--danger-light);
}

[data-theme="dark"] .calendar-day.weekend {
    background: rgba(239,68,68,0.1);
}

.calendar-day.non-working {
    background: rgba(239,68,68,0.15);
    border-color: var(--danger);
}

[data-theme="dark"] .calendar-day.non-working {
    background: rgba(239,68,68,0.2);
}

.calendar-day-number {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1;
}

.calendar-day.weekend .calendar-day-number {
    color: var(--danger);
}

.calendar-day.non-working .calendar-day-number {
    color: var(--danger);
    font-weight: 700;
}

.calendar-shifts {
    display: flex;
    flex-direction: column;
    gap: 1px;
    overflow: hidden;
}

.calendar-shift-item {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 8px;
    padding: 1px 2px;
    border-radius: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.calendar-shift-item.day {
    background: var(--success-light);
    color: var(--success);
}

.calendar-shift-item.night {
    background: var(--primary-light);
    color: var(--primary);
}

[data-theme="dark"] .calendar-shift-item.day {
    background: rgba(22,163,74,0.2);
}

[data-theme="dark"] .calendar-shift-item.night {
    background: rgba(59,130,246,0.2);
}

.calendar-shift-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    flex-shrink: 0;
}

.calendar-shift-dot.day {
    background: var(--success);
}

.calendar-shift-dot.night {
    background: var(--primary);
}

.calendar-shift-time {
    font-size: 7px;
    opacity: 0.8;
    flex-shrink: 0;
}

.calendar-shift-name {
    font-weight: 500;
    flex-shrink: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.calendar-shift-warning {
    background: var(--danger-light);
    color: var(--danger);
    font-size: 7px;
    padding: 2px;
    text-align: center;
    border-radius: 2px;
}

[data-theme="dark"] .calendar-shift-warning {
    background: rgba(239,68,68,0.2);
}


.calendar-legend {
    display: flex;
    gap: 10px;
    margin-top: 8px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

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

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.legend-dot.day {
    background: var(--success);
}

.legend-dot.night {
    background: var(--primary);
}

.legend-dot.weekend {
    background: var(--danger);
}


.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;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--bg-surface);
    padding: 28px;
    border-radius: var(--radius);
    max-width: 500px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
}

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

.modal-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-hover);
    cursor: pointer;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-close:hover {
    background: #dc2626;
    border-color: #dc2626;
    color: #fff;
}

.modal-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}


@media print {
    .header,
    .theme-toggle,
    .btn,
    .modal-overlay,
    .left-panel {
        display: none !important;
    }

    .main-layout {
        display: block;
    }

    .right-panel {
        display: block;
    }

    .schedule-section,
    .calendar-section {
        break-inside: avoid;
    }
}


.content-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 24px;
}

.content-header {
    margin-bottom: 40px;
}

.content-title {
    font-size: 36px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.content-subtitle {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.content-section {
    margin-bottom: 32px;
}

.content-section-title {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary);
}

.content-section-text {
    font-size: 15px;
    color: var(--text-primary);
    line-height: 1.7;
    margin-bottom: 16px;
}

.content-list {
    list-style: none;
    padding-left: 0;
    margin-bottom: 16px;
}

.content-list-item {
    font-size: 15px;
    color: var(--text-primary);
    line-height: 1.7;
    padding: 8px 0;
    padding-left: 24px;
    position: relative;
}

.content-list-item::before {
    content: '•';
    color: var(--primary);
    font-weight: bold;
    position: absolute;
    left: 8px;
}

.content-list-numbered {
    counter-reset: item;
    list-style: none;
    padding-left: 0;
    margin-bottom: 16px;
}

.content-list-numbered > li {
    font-size: 15px;
    color: var(--text-primary);
    line-height: 1.7;
    padding: 8px 0;
    padding-left: 32px;
    position: relative;
    counter-increment: item;
}

.content-list-numbered > li::before {
    content: counter(item) '.';
    color: var(--primary);
    font-weight: 600;
    position: absolute;
    left: 0;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 24px;
    transition: gap 0.2s;
}

.back-link:hover {
    gap: 12px;
}

.back-link svg {
    width: 18px;
    height: 18px;
}


.warning-box,
.info-box,
.highlight-box {
    background: var(--bg-hover);
    border-left: 4px solid var(--border);
    padding: 16px 20px;
    border-radius: var(--radius-sm);
    margin: 20px 0;
}

.warning-box {
    background: rgba(220, 38, 38, 0.1);
    border-left-color: var(--primary);
}

.warning-box-text {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.6;
    margin: 0;
}

.info-box {
    background: var(--bg-hover);
    border-left-color: #3b82f6;
}

.info-box-text {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

.highlight-box {
    background: var(--bg-hover);
    border-left-color: var(--border);
}

.highlight-box-text {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}


@media (max-width: 768px) {
    .content-container {
        padding: 24px 16px;
    }

    .content-title {
        font-size: 28px;
    }

    .content-section-title {
        font-size: 18px;
    }

    .dashboard-footer {
        flex-direction: column;
        gap: 16px;
        padding: 16px;
        text-align: center;
    }

    .dashboard-footer div {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 16px;
    }
}


.error-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.error-content {
    text-align: center;
    max-width: 500px;
}

.error-code {
    font-size: 120px;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
    margin-bottom: 16px;
    text-shadow: 0 4px 20px rgba(220, 38, 38, 0.3);
}

.error-title {
    font-size: 28px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.error-message {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 32px;
    line-height: 1.6;
}

.error-icon {
    width: 120px;
    height: 120px;
    margin: 0 auto 32px;
    background: var(--primary-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.8; }
}

.error-icon svg {
    width: 60px;
    height: 60px;
    color: var(--primary);
}

.error-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.error-btn {
    padding: 14px 28px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Montserrat', sans-serif;
    text-decoration: none;
}

.error-btn-primary {
    background: var(--primary);
    color: #fff;
}

.error-btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 38, 38, 0.4);
}

.error-btn-secondary {
    background: var(--bg-hover);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.error-btn-secondary:hover {
    background: var(--border);
    transform: translateY(-2px);
}

.error-btn svg {
    width: 18px;
    height: 18px;
}


@media (max-width: 768px) {
    .error-code {
        font-size: 80px;
    }

    .error-title {
        font-size: 22px;
    }

    .error-message {
        font-size: 14px;
    }

    .error-icon {
        width: 100px;
        height: 100px;
    }

    .error-icon svg {
        width: 50px;
        height: 50px;
    }

    .error-actions {
        flex-direction: column;
    }

    .error-btn {
        justify-content: center;
    }
}


.pwa-install-prompt {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    padding: 14px 18px;
    z-index: 1000;
    animation: slideUp 0.3s ease-out;
    max-width: 340px;
    width: calc(100% - 32px);
}

@keyframes slideUp {
    from {
        transform: translate(-50%, 100%);
        opacity: 0;
    }
    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

.pwa-install-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pwa-install-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-sm);
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.pwa-install-icon svg {
    width: 24px;
    height: 24px;
}

.pwa-install-text {
    text-align: center;
}

.pwa-install-text h4 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 6px 0;
    font-family: 'Montserrat', sans-serif;
}

.pwa-install-text p {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.4;
}

.pwa-install-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.pwa-install-btn {
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Montserrat', sans-serif;
    border: none;
    flex: 1;
    max-width: 120px;
}

.pwa-install-btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.pwa-install-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

.pwa-install-btn-cancel {
    background: #e5e7eb;
    color: #374151;
    border: 1px solid #d1d5db;
}

.pwa-install-btn-cancel:hover {
    background: #d1d5db;
    transform: translateY(-1px);
}

@media (max-width: 600px) {
    .pwa-install-prompt {
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        bottom: 16px;
        padding: 16px 18px;
        width: calc(100% - 32px);
        max-width: 340px;
    }

    .pwa-install-actions {
        flex-direction: column;
    }

    .pwa-install-btn {
        max-width: none;
    }
}


.header-logo[onclick] {
    cursor: pointer;
}


#headerLogo {
    display: none;
}


.nbrb-font-icon {
    font-family: 'nbrb';
    font-size: 24px;
    color: #fff;
}


.flex-row-end {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.flex-full {
    flex: 1;
    margin: 0;
}


.mt-20 {
    margin-top: 20px;
}


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

.text-secondary {
    color: var(--text-secondary);
}


.p-60-20 {
    padding: 60px 20px;
}


.opacity-50 {
    opacity: 0.5;
}


.mb-16 {
    margin-bottom: 16px;
}


.hidden {
    display: none;
}


.result-row-indented {
    padding-left: 20px;
    font-size: 12px;
}


.finance-grid {
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 24px;
    align-items: start;
    width: 100%;
}

.currency-grid-section {
    margin: 0;
    min-height: 200px;
}

.calculator-card-sticky {
    margin: 0;
    top: 88px;
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    height: 100%;
}

.calc-input-wrapper {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 20px;
}

.calc-row {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.calc-row:last-child {
    align-items: center;
    margin-top: auto;
    gap: 8px;
}

.calc-input-col {
    flex: 1;
    min-width: 100px;
}

.calc-input-col-date {
    flex: 1;
    min-width: 120px;
}

.calc-input-full {
    width: 100%;
}

.calc-currency-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
}

.calc-currency-btn-fixed {
    width: 40px;
    height: 40px;
    padding: 8px;
    flex: none;
    border-radius: 8px;
}

.calc-currency-btn-swap {
    width: 36px;
    height: 40px;
    padding: 8px;
    flex: none;
    border-radius: 8px;
}

.calc-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
}

.calc-result-wrapper {
    flex: 1;
    min-width: 150px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.calc-result-value {
    margin: 0;
    flex: 1;
    word-break: break-word;
    font-size: 18px;
}

.btn-copy-small {
    padding: 6px;
    width: 32px;
    height: 32px;
    flex: none;
}

.calc-result-words {
    margin-top: 8px;
}

.chart-wrapper-mt {
    margin-top: 16px;
}


.label-small {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    margin-bottom: 6px;
    display: block;
}


.offline-indicator {
    display: none;
}


.dashboard-footer {
    background: var(--bg-surface);
    border-top: 1px solid var(--border);
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    margin-top: auto;
    max-width: 100%;
    box-sizing: border-box;
}

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

.dashboard-footer-link {
    font-size: 13px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.dashboard-footer-link:hover {
    color: var(--primary);
}

.dashboard-footer-mt {
    margin-top: 40px;
}


.checkbox-wrapper {
    display: flex;
    align-items: center;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

.checkbox-label .checkbox-text {
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.4;
}

@media (max-width: 768px) {
    .finance-grid {
        grid-template-columns: 1fr;
        display: flex;
        flex-direction: column;
        gap: 16px;
    }

    .calculator-card-sticky {
        position: static;
        order: -1;
    }


    .main-content {
        padding: 0 16px;
        gap: 16px;
    }


    .calculator-card {
        padding: 16px !important;
        margin: 24px auto 16px !important;
        border-radius: 10px !important;
        border: none !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .calc-input-wrapper {
        gap: 14px;
        padding: 0;
    }

    .calc-row {
        gap: 10px;
        flex-wrap: wrap;
    }

    .calc-row:first-child {
        flex-wrap: nowrap;
    }

    .calc-input-col {
        min-width: calc(50% - 5px);
        flex: 1;
    }

    .calc-input {
        padding: 10px 12px;
        font-size: 14px;
        border-radius: 8px;
        border: 1px solid var(--border);
        width: 100%;
    }

    .calc-input:focus {
        border-color: var(--primary);
        box-shadow: 0 0 0 3px var(--primary-light);
    }

    .label-small {
        font-size: 11px;
        margin-bottom: 5px;
    }

    .calc-currency-btn-fixed {
        width: 40px;
        height: 40px;
        flex: 0 0 40px;
        border-radius: 8px;
        border: 1px solid var(--border);
    }

    .calc-currency-btn-swap {
        width: 36px;
        height: 40px;
        flex: 0 0 36px;
        padding: 6px;
        border-radius: 8px;
        border: 1px solid var(--border);
    }

    .calc-currency-icon {
        width: 22px;
        height: 22px;
        font-size: 13px;
    }

    .calc-result-value {
        font-size: 18px;
        min-width: 100px;
        text-align: right;
        font-weight: 700;
    }

    .btn-copy-small {
        width: 40px;
        height: 40px;
        flex: 0 0 40px;
        border-radius: 8px;
        border: 1px solid var(--border);
    }

    .calc-row:last-child {
        gap: 8px;
        width: 100%;
    }


    .currency-grid-section {
        margin-bottom: 16px;
    }

    .currency-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        width: 100%;
        padding: 0;
    }

    .currency-card {
        padding: 16px;
        border-radius: 10px;
        width: 100%;
        border: none;
        margin: 0;
    }

    .currency-icon {
        width: 40px;
        height: 40px;
        font-size: 20px;
        border-radius: 50%;
    }

    .currency-card-name {
        font-size: 14px;
    }

    .currency-card-value {
        font-size: 22px;
    }


    .controls-card {
        padding: 16px;
        border-radius: 10px;
        border: none;
        width: 100%;
        margin: 0 auto 16px;
    }

    .period-selector {
        gap: 6px;
        margin-bottom: 12px;
    }

    .period-btn {
        padding: 9px 14px;
        font-size: 12px;
        flex: 1 1 auto;
        justify-content: center;
        min-width: fit-content;
        border-radius: 8px;
        border: 1px solid var(--border);
    }

    .date-range {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        margin-bottom: 12px;
    }

    .date-input-group {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .date-input-group label {
        font-size: 11px;
        white-space: nowrap;
    }

    .date-input-group input {
        flex: 1;
        padding: 9px 11px;
        font-size: 13px;
        border-radius: 8px;
        border: 1px solid var(--border);
        width: 100%;
    }

    #applyCustomPeriod {
        width: 100%;
        margin-top: 4px;
        border-radius: 8px;
    }

    .currency-selector {
        gap: 6px;
    }

    .currency-check {
        padding: 8px 12px;
        font-size: 12px;
        flex: 1 1 auto;
        justify-content: center;
        border-radius: 8px;
        border: 1px solid var(--border);
    }

    .currency-check input[type="checkbox"] {
        width: 18px;
        height: 18px;
        min-width: 18px;
        min-height: 18px;
    }

    .btn-add-currency {
        min-width: 40px;
        height: 40px;
        padding: 6px;
        border-radius: 8px;
        border: 1px solid var(--border);
    }


    .chart-card {
        padding: 16px;
        min-height: auto;
        border-radius: 10px;
        border: none;
        width: 100%;
        margin: 0 auto;
    }

    .chart-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        margin-bottom: 16px;
    }

    .chart-title {
        font-size: 15px;
    }

    .chart-controls {
        width: 100%;
    }

    .toggle-switch {
        transform: scale(0.9);
        transform-origin: left center;
    }

    .toggle-label {
        font-size: 12px;
    }

    .chart-legend {
        gap: 10px;
        margin-bottom: 12px;
    }

    .legend-item {
        font-size: 11px;
        gap: 4px;
    }

    .legend-dot {
        width: 8px;
        height: 8px;
    }

    .chart-wrapper {
        min-height: 300px;
    }

    .chart-wrapper-mt {
        margin-top: 12px;
    }


    .preloader-content {
        padding: 24px 20px;
    }

    .preloader-spinner {
        width: 32px;
        height: 32px;
    }

    .preloader-text {
        font-size: 13px;
    }


    .header-logo-text {
        font-size: 16px !important;
        letter-spacing: 1px;
    }

    .header-logo-divider {
        font-size: 16px !important;
    }


    .dashboard-footer {
        padding: 16px 12px;
    }

    .footer-content {
        margin: 0;
        flex-direction: column;
        gap: 12px;
    }

    .dashboard-footer-text {
        font-size: 12px;
        text-align: center;
    }

    .dashboard-footer-links {
        flex-direction: column;
        gap: 8px;
    }

    .dashboard-footer-links a {
        font-size: 12px;
    }


    .modal {
        padding: 20px 16px;
        border-radius: 4px;
    }

    .modal-list {
        max-height: 55vh;
    }
}


@media (max-width: 380px) {
    .calc-row:first-child {
        flex-direction: column;
    }

    .calc-input-col {
        min-width: 100%;
    }

    .period-btn {
        font-size: 11px;
        padding: 7px 10px;
    }

    .currency-check {
        font-size: 11px;
        padding: 6px 9px;
    }

    .chart-wrapper {
        min-height: 240px;
    }
}


.result-table-info {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
}

.result-table-count {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.data-table td small {
    font-size: 11px;
    color: var(--text-tertiary);
    display: block;
    margin-top: 2px;
}

.data-table tr:hover td small {
    color: var(--text-secondary);
}


.calc-layout-full {
    display: grid;
    grid-template-columns: 1fr 580px;
    gap: 16px;
    padding: 16px;
    max-width: 100%;
    margin: 0;
    width: 100%;
    box-sizing: border-box;
}

.calc-input-column {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

.calc-results-column {
    min-width: 0;
}


.calc-results-column .calc-block {
    position: sticky;
    top: 16px;
}


.calc-block {
    background: var(--bg-surface);
    border-radius: 10px;
    border: 1px solid var(--border);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    transition: all 0.2s ease;
}

.calc-block:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}


.calc-block-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
}

.calc-block-header h2 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.calc-block-header .btn {
    flex-shrink: 0;
}

.calc-results-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.calc-results-actions .btn-primary {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    font-size: 13px;
}


.calc-block-content {
    padding: 14px;
}


.params-grid {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.param-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.param-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 6px;
}

.param-label + .input-row {
    margin-top: 0;
}

#penaltySection .param-label,
#article366Section .param-label {
    margin-bottom: 6px;
}

.date-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
}

.date-inputs input[type="date"] {
    flex: 1;
    padding: 9px 11px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: var(--bg-surface);
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
}

.date-inputs input[type="date"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-light);
}

.date-separator {
    color: var(--text-tertiary);
    font-weight: 500;
}


.calculation-type-selector {
    display: flex;
    gap: 6px;
}

.calc-type-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 9px 11px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: var(--bg-surface);
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.calc-type-btn:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.calc-type-btn.active {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
}

.calc-type-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}


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

.input-row input[type="number"],
.input-row input[type="text"],
.input-row select {
    flex: 1;
    padding: 9px 11px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: var(--bg-surface);
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    -moz-appearance: textfield;
}

.input-row input[type="number"]::-webkit-outer-spin-button,
.input-row input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.input-row input[type="number"] {
    -moz-appearance: textfield;
}

.input-row input:focus,
.input-row select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-light);
}

.input-suffix {
    font-size: 12px;
    color: var(--text-tertiary);
    white-space: nowrap;
    min-width: 60px;
}

.type-select-full {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-surface);
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
}


.data-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.data-column {
    background: var(--bg-body);
    border-radius: 8px;
    padding: 12px;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

.data-column .items-container {
    flex: 1;
    margin-bottom: 10px;
}

.data-column:last-child .items-container {
    margin-bottom: 0;
    order: 2;
}

.data-column:last-child .btn-add {
    order: 1;
    margin-bottom: 10px;
    margin-top: 0;
}

.data-column:first-child .btn-add {
    margin-top: auto;
}

.data-column-title {
    display: flex;
    align-items: center;
    gap: 0;
    margin: 0 0 10px 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.data-column-title svg {
    color: var(--text-secondary);
}

.items-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 50px;
}

.btn-add {
    width: 100%;
    justify-content: center;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 11px;
    border-radius: 7px;
    font-weight: 500;
    font-size: 12px;
    transition: all 0.2s ease;
    border: 1px dashed var(--border);
    background: transparent;
    color: var(--text-secondary);
}

.btn-add:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}


.result-placeholder {
    text-align: center;
    padding: 40px 16px;
    color: var(--text-secondary);
}

.result-placeholder svg {
    opacity: 0.5;
    margin-bottom: 12px;
}

.result-placeholder p {
    margin: 0;
    font-size: 13px;
}

.result-main {
    text-align: center;
    padding: 14px 12px;
    background: var(--primary);
    border-radius: 9px;
    color: white;
    margin-bottom: 12px;
}

.result-main-value {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 4px;
}

.result-main-label {
    font-size: 11px;
    opacity: 0.9;
    font-weight: 400;
}


.result-summary {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.summary-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 8px;
    background: var(--bg-body);
    border-radius: 7px;
    border: 1px solid var(--border);
}

.summary-label {
    font-size: 9px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 4px;
}

.summary-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}


.result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 12px;
    background: var(--bg-body);
    border-radius: 7px;
    margin-bottom: 12px;
    border: 1px solid var(--border);
}

#resultPenaltyRow[style*="display: none"] {
    display: none !important;
}

#article366DetailItem[style*="display: none"] {
    display: none !important;
}

#remainingDebtRow[style*="display: none"] {
    display: none !important;
}

.result-row[style*="display: none"] {
    display: none !important;
}

.result-row-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.result-row-value {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
}

.result-info-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    margin-bottom: 12px;
    font-size: 12px;
}

.result-label {
    color: var(--text-secondary);
}

.result-value {
    font-weight: 600;
    color: var(--text-primary);
}


.result-table-panel {
    background: var(--bg-body);
    border-radius: 8px;
    padding: 10px;
    border: 1px solid var(--border);
}

.result-table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.result-table-count {
    font-size: 10px;
    color: var(--text-secondary);
    font-weight: 500;
}

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

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
}

.data-table th {
    text-align: left;
    padding: 7px 9px;
    background: var(--bg-surface);
    border-bottom: 2px solid var(--border);
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 9px;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.data-table th.number {
    text-align: right;
}

.data-table td {
    padding: 7px 9px;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
}

.data-table td.number {
    text-align: right;
    font-weight: 500;
}

.data-table tbody tr:hover {
    background: var(--bg-hover);
}

.data-table td small {
    font-size: 9px;
    color: var(--text-tertiary);
    display: block;
    margin-top: 2px;
}

.data-table td.empty-table {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
    font-size: 13px;
}


@media (max-width: 1024px) {
    .calc-layout-full {
        grid-template-columns: 1fr;
    }

    .calc-results-column {
        order: -1;
    }

    .calc-results-column .calc-block {
        position: static;
    }
}

@media (max-width: 768px) {
    .calc-layout-full {
        padding: 12px;
        gap: 12px;
    }

    .calc-block-content {
        padding: 12px;
    }

    .data-columns {
        grid-template-columns: 1fr;
    }

    .result-summary {
        flex-wrap: wrap;
    }

    .summary-item {
        flex: 0 0 calc(50% - 6px);
    }
}

@media (max-width: 576px) {
    .calc-block-header {
        flex-wrap: wrap;
        gap: 8px;
    }

    .calc-block-header .btn {
        margin-left: 0;
        width: 100%;
    }

    /* Results header has two actions; keep both visible on narrow screens */
    .calc-block--results .calc-results-actions {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .calc-block--results .calc-results-actions .btn {
        width: 100%;
    }

    /* Long calc type labels should wrap on mobile */
    .calculation-type-selector {
        flex-direction: column;
    }

    .calc-type-btn {
        justify-content: flex-start;
        text-align: left;
    }

    .calc-type-btn span {
        white-space: normal;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .result-main-value {
        font-size: 24px;
    }

    .summary-item {
        flex: 0 0 100%;
    }
}


.debt-item,
.repayment-item {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 11px 12px;
    position: relative;
    transition: all 0.2s ease;
}

.debt-item:hover,
.repayment-item:hover {
    border-color: var(--primary);
    background: var(--bg-surface-hover);
}

.debt-item-header,
.repayment-item-header {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 9px;
}

.debt-item-title,
.repayment-item-title {
    flex: 1;
    border: 1px solid transparent;
    background: var(--bg-body);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    padding: 7px 9px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.debt-item-title:focus,
.repayment-item-title:focus {
    background: var(--bg-surface);
    border-color: var(--primary);
    outline: none;
}

.btn-icon-delete {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 1px;
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    flex-shrink: 0;
    transition: all 0.2s ease;
    transform: translateY(-5px);
}

.btn-icon-delete:hover {
    background: var(--danger-light);
    color: var(--danger);
    transform: translateY(-5px) scale(1.1);
}

.btn-icon-delete svg {
    width: 16px;
    height: 16px;
}

.debt-item-inputs,
.repayment-item-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
}

.input-with-label {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.input-with-action {
    position: relative;
}

.input-action-group {
    display: flex;
    gap: 6px;
    align-items: center;
}

.input-action-group input {
    flex: 1;
    width: 100%;
}

.input-label-small {
    font-size: 9px;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.input-with-label input {
    padding: 7px 9px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 12px;
    background: var(--bg-surface);
    color: var(--text-primary);
    transition: all 0.2s ease;
    -moz-appearance: textfield;
}

.input-with-label input:hover {
    border-color: var(--primary);
}

.input-with-label input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-light);
    outline: none;
}

.input-with-label input[type="number"]::-webkit-outer-spin-button,
.input-with-label input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.input-with-label input[type="number"] {
    -moz-appearance: textfield;
}


.checkbox-label-small {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 12px;
}

.checkbox-label-small input[type="checkbox"] {
    width: 14px;
    height: 14px;
    cursor: pointer;
}


.calc-wrapper,
.calc-input-panel,
.calc-results-panel,
.results-sticky,
.calc-section {
    display: none;
}

.calc-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 16px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--bg-body);
}

.calc-section-title svg {
    color: var(--primary);
    width: 20px;
    height: 20px;
}

.items-container {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 14px;
}

.btn-add {
    width: 100%;
    justify-content: center;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-add:hover {
    transform: translateY(-1px);
}

.input-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.input-row:last-child {
    margin-bottom: 0;
}

.type-select-full {
    flex: 1;
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-surface);
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    max-width: 100%;
    box-sizing: border-box;
}

.type-select-full:hover {
    border-color: var(--primary);
}

.type-select-full:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.input-row input[type="number"],
.input-row input[type="text"] {
    flex: 1;
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-surface);
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.2s ease;
}

.input-row input[type="number"]:focus,
.input-row input[type="text"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.input-suffix {
    font-size: 13px;
    color: var(--text-tertiary);
    white-space: nowrap;
    min-width: 70px;
    font-weight: 500;
}


.calculation-type-selector {
    display: flex;
    gap: 10px;
    margin-top: 8px;
}

.calc-type-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 8px;
    background: var(--bg-surface);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.calc-type-btn:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.calc-type-btn.active {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
}

.calc-type-btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.calc-type-btn span {
    white-space: nowrap;
}

.btn-lg {
    padding: 14px 20px;
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border-radius: 10px;
    transition: all 0.2s ease;
    max-width: 100%;
    box-sizing: border-box;
}

.btn-lg:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(34, 197, 94, 0.4);
}


.results-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 20px;
}

.summary-card {
    flex: 1;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 18px;
    background: linear-gradient(135deg, var(--bg-body) 0%, var(--bg-surface) 100%);
    border-radius: 10px;
    border: none;
    transition: all 0.2s ease;
    max-width: 100%;
    box-sizing: border-box;
}

.summary-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.summary-icon {
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    flex-shrink: 0;
}

.penalty-card .summary-icon {
    background: linear-gradient(135deg, var(--primary-light) 0%, rgba(34, 197, 94, 0.08) 100%);
    color: var(--primary);
}

.article366-card .summary-icon {
    background: linear-gradient(135deg, var(--warning-light) 0%, rgba(245, 158, 11, 0.08) 100%);
    color: var(--warning);
}

.summary-content {
    flex: 1;
    min-width: 0;
}

.summary-label {
    font-size: 11px;
    color: var(--text-tertiary);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.summary-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.summary-sub {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 6px;
    font-weight: 500;
}


.result-details-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin: 16px 0;
    padding: 16px;
    background: var(--bg-body);
    border-radius: 12px;
    max-width: 100%;
    box-sizing: border-box;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px;
    background: var(--bg-surface);
    border-radius: 10px;
    border: 1px solid var(--border);
    transition: all 0.2s ease;
    max-width: 100%;
    box-sizing: border-box;
}

.detail-item:hover {
    background: var(--bg-hover);
    border-color: var(--primary-light);
}

.detail-label {
    font-size: 10px;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
    line-height: 1.3;
}

.detail-value {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}


.result-breakdown {
    margin: 16px 0;
    padding: 16px;
    background: linear-gradient(135deg, var(--bg-body) 0%, var(--primary-light) 100%);
    border-radius: 12px;
    border: 1px solid var(--primary-light);
    max-width: 100%;
    box-sizing: border-box;
}

.breakdown-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.breakdown-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 13px;
    border-bottom: 1px solid var(--border);
}

.breakdown-row:last-child {
    border-bottom: none;
}

.breakdown-row span:first-child {
    color: var(--text-secondary);
}

.breakdown-row span:last-child {
    font-weight: 700;
    color: var(--text-primary);
}

.result-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-top: 1px solid var(--border);
    font-size: 13px;
}

.result-info-row .result-value {
    font-weight: 600;
    color: var(--text-primary);
}

.result-table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.result-table-count {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 600;
}

.checkbox-label-small {
    font-size: 12px !important;
    font-weight: 500;
}

.checkbox-label-small .checkbox-text {
    font-size: 12px !important;
}

@media (max-width: 768px) {
    .calc-wrapper {
        padding: 0;
        gap: 14px;
    }

    .results-summary {
        grid-template-columns: 1fr;
    }

    .result-details-grid {
        grid-template-columns: 1fr;
    }

    .summary-card {
        flex-direction: row;
    }

    .result-table-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}


.debt-item,
.repayment-item {
    background: var(--bg-body);
    border: none;
    border-radius: 10px;
    padding: 14px;
    transition: all 0.2s ease;
}

.debt-item:hover,
.repayment-item:hover {
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.1);
}

.debt-item-header,
.repayment-item-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.debt-item-title,
.repayment-item-title {
    flex: 1;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-surface);
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.debt-item-title:focus,
.repayment-item-title:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.btn-icon-delete {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    flex-shrink: 0;
    transform: translateY(-5px);
}

.btn-icon-delete:hover {
    color: var(--danger);
}

.debt-item-inputs,
.repayment-item-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.input-with-label {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.input-label-small {
    font-size: 10px;
    color: var(--text-tertiary);
    text-transform: uppercase;
    font-weight: 600;
}

.input-with-label input[type="number"],
.input-with-label input[type="date"],
.input-with-label input[type="text"] {
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    color: var(--text-primary);
    font-size: 13px;
}

.empty-state {
    padding: 16px;
    text-align: center;
    font-size: 12px;
    color: var(--text-secondary);
    background: var(--bg-body);
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
}

@media (max-width: 576px) {
    .debt-item-inputs,
    .repayment-item-inputs {
        grid-template-columns: 1fr;
    }
}


.install-banner {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin: 16px 24px;
    box-shadow: var(--shadow);
}
.install-banner-content {
    display: flex;
    align-items: center;
    gap: 16px;
}
.install-banner-icon {
    width: 40px;
    height: 40px;
    color: var(--primary);
    flex-shrink: 0;
}
.install-banner-text {
    flex: 1;
    min-width: 0;
}
.install-banner-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}
.install-banner-description {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
}
.install-banner-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    flex-shrink: 0;
}
.install-banner-btn:hover {
    background: var(--primary-hover);
}
.install-banner-btn svg {
    width: 18px;
    height: 18px;
}
.install-banner-close {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--text-tertiary);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}
.install-banner-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}
.install-banner-close svg {
    width: 18px;
    height: 18px;
}
@media (max-width: 768px) {
    .install-banner {
        margin: 16px auto;
        max-width: calc(100% - 32px);
    }
    .install-banner-content {
        flex-wrap: wrap;
        justify-content: center;
        text-align: center;
        position: relative;
    }
    .install-banner-icon {
        width: 36px;
        height: 36px;
    }
    .install-banner-text {
        width: 100%;
        margin-bottom: 12px;
    }
    .install-banner-btn {
        width: 100%;
        justify-content: center;
    }
    .install-banner-close {
        position: absolute;
        top: 0;
        right: 0;
        padding: 8px;
    }
}


@media (max-width: 768px) {
    .calc-wrapper {
        padding: 0;
        gap: 14px;
        grid-template-columns: 1fr !important;
        max-width: 100vw;
        overflow-x: hidden;
    }

    .calc-input-panel {
        padding: 16px;
        max-width: 100%;
        box-sizing: border-box;
    }

    .calc-results-panel {
        position: static !important;
        align-self: auto;
        min-height: auto;
        padding: 0;
    }

    .results-sticky {
        padding: 16px;
    }

    .calc-section {
        padding: 16px 14px;
        border-radius: 10px;
        max-width: 100%;
        box-sizing: border-box;
    }

    .calc-section-title {
        font-size: 15px;
        gap: 8px;
        margin-bottom: 14px;
        padding-bottom: 8px;
    }

    .calc-section-title svg {
        width: 18px;
        height: 18px;
    }

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

    .input-row {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        max-width: 100%;
    }

    .input-row input[type="number"],
    .input-row input[type="text"] {
        max-width: 100%;
        box-sizing: border-box;
    }

    .input-suffix {
        min-width: auto;
        text-align: left;
    }

    .results-sticky {
        padding: 20px 16px;
        border-radius: 12px;
        max-width: 100%;
        box-sizing: border-box;
    }

    .result-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        margin-bottom: 18px;
        padding-bottom: 12px;
        max-width: 100%;
        overflow-wrap: break-word;
    }

    .result-title {
        font-size: 18px;
        word-break: break-word;
    }

    .result-main {
        padding: 20px 16px;
        border-radius: 14px;
        max-width: 100%;
        box-sizing: border-box;
    }

    .result-main-value {
        font-size: 26px;
        word-break: break-word;
    }

    .result-main-label {
        font-size: 11px;
    }

    .results-summary {
        grid-template-columns: 1fr;
        gap: 10px;
        margin-bottom: 18px;
    }

    .summary-card {
        padding: 14px;
        gap: 10px;
        max-width: 100%;
        box-sizing: border-box;
    }

    .summary-icon {
        width: 40px;
        height: 40px;
        border-radius: 8px;
    }

    .summary-value {
        font-size: 18px;
    }

    .result-details-grid {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 14px;
        margin: 14px 0;
        border-radius: 12px;
        max-width: 100%;
        box-sizing: border-box;
    }

    .detail-item {
        padding: 10px;
        max-width: 100%;
        box-sizing: border-box;
    }

    .detail-value {
        font-size: 15px;
    }

    .result-breakdown {
        padding: 14px;
        margin: 14px 0;
        border-radius: 12px;
        max-width: 100%;
        box-sizing: border-box;
    }

    .breakdown-title {
        font-size: 12px;
        margin-bottom: 10px;
    }

    .breakdown-row {
        font-size: 12px;
        padding: 6px 0;
    }

    .btn-lg {
        padding: 13px 18px;
        font-size: 14px;
        border-radius: 10px;
    }

    .btn-add {
        padding: 11px 13px;
        font-size: 13px;
        border-radius: 8px;
    }

    .debt-item,
    .repayment-item {
        padding: 12px 10px;
        border-radius: 10px;
    }

    .debt-item-title,
    .repayment-item-title {
        padding: 9px 11px;
        font-size: 13px;
        border-radius: 8px;
    }

    .btn-icon-delete {
        width: 30px;
        height: 30px;
    }

    .result-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        max-width: 100%;
        box-sizing: border-box;
    }

    .data-table {
        min-width: 500px;
        font-size: 12px;
        max-width: 100%;
    }

    .result-table-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding-bottom: 8px;
        margin-bottom: 10px;
    }
}

@media (max-width: 480px) {
    .calc-wrapper {
        gap: 12px;
        max-width: 100vw;
        overflow-x: hidden;
    }

    .calc-input-panel {
        padding: 14px;
        max-width: 100%;
        box-sizing: border-box;
    }

    .calc-section {
        padding: 14px 12px;
        border-radius: 8px;
        max-width: 100%;
        box-sizing: border-box;
    }

    .results-sticky {
        padding: 16px 12px;
        border-radius: 10px;
        max-width: 100%;
        box-sizing: border-box;
    }

    .result-main {
        padding: 18px 14px;
        max-width: 100%;
        box-sizing: border-box;
    }

    .result-main-value {
        font-size: 22px;
        word-break: break-word;
    }

    .summary-card {
        padding: 12px 10px;
        max-width: 100%;
        box-sizing: border-box;
    }

    .summary-icon {
        width: 36px;
        height: 36px;
    }

    .summary-label {
        font-size: 10px;
    }

    .summary-value {
        font-size: 17px;
    }

    .summary-sub {
        font-size: 11px;
    }

    .btn-lg {
        padding: 12px 16px;
        font-size: 14px;
    }

    .btn-add {
        padding: 10px 12px;
        font-size: 12px;
    }
}


.cfg-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 24px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    border-radius: var(--radius) var(--radius) 0 0;
}
.cfg-toolbar-spacer { flex: 1; }


.cfg-panel {
    display: grid !important;
    grid-template-columns: 280px 1fr 240px;
    gap: 0;
    min-height: calc(100vh - 200px);
    overflow: hidden;
    position: relative;
}


.cfg-sidebar {
    background: var(--bg-surface);
    border-right: 1px solid var(--border);
    padding: 16px;
    overflow-y: auto;
    overflow-x: hidden;
    max-height: calc(100vh - 200px);
    min-width: 280px;
    max-width: 280px;
    border-radius: 0 !important;
    box-shadow: none !important;
    position: relative;
    z-index: 1;
}

.cfg-empty-list {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 40px 16px;
    color: var(--text-tertiary);
    font-size: 13px;
    text-align: center;
}
.cfg-empty-list svg { opacity: 0.3; }

.cfg-pkg-group { margin-bottom: 16px; min-width: 0; }
.cfg-pkg-group-title {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 0 8px 6px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cfg-pkg-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s;
    margin-bottom: 2px;
    min-width: 0;
    overflow: hidden;
}
.cfg-pkg-item:hover { background: var(--bg-hover); }
.cfg-pkg-item.active {
    background: var(--primary-light);
    border: 1px solid var(--primary);
}
.cfg-pkg-item-info { flex: 1; min-width: 0; }
.cfg-pkg-item-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cfg-pkg-item-meta {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 3px;
    white-space: nowrap;
}
.cfg-dot { margin: 0 3px; }

.cfg-pkg-remove {
    width: 24px;
    height: 24px;
    min-width: 24px;
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.15s;
    flex-shrink: 0;
}
.cfg-pkg-item:hover .cfg-pkg-remove { opacity: 1; }
.cfg-pkg-remove:hover { background: var(--danger-light); color: var(--danger); }


.cfg-workspace {
    padding: 24px 32px;
    overflow-y: auto;
    overflow-x: hidden;
    max-height: calc(100vh - 200px);
    background: var(--bg-body);
    min-width: 0;
    width: 100%;
    position: relative;
    z-index: 2;
}

.cfg-welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 24px;
    text-align: center;
    color: var(--text-secondary);
}
.cfg-welcome-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    color: var(--text-tertiary);
}
.cfg-welcome h2 {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}
.cfg-welcome p { font-size: 14px; color: var(--text-secondary); }


.cfg-section {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 20px;
    overflow: hidden;
}
.cfg-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-surface);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}
.cfg-section-icon { color: var(--primary); flex-shrink: 0; }
.cfg-count {
    margin-left: auto;
    background: var(--bg-hover);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    flex-shrink: 0;
}
.cfg-section-body { padding: 20px; }


.cfg-field-row {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}
.cfg-field-row:last-child { margin-bottom: 0; }
.cfg-field-group { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cfg-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cfg-required-star { color: var(--danger); }


.cfg-input-with-btn {
    display: flex;
    gap: 6px;
    align-items: center;
}
.cfg-input-with-btn input {
    flex: 1;
    min-width: 0;
}
.cfg-copy-btn {
    width: 38px;
    min-width: 38px;
    height: 40px;
    border: 1px solid var(--border);
    background: var(--bg-surface);
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}
.cfg-copy-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}


.cfg-field-group input[type="text"],
.cfg-field-group input[type="number"],
.cfg-field-group select {
    height: 40px;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-body);
    color: var(--text-primary);
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    transition: all 0.2s;
    outline: none;
    min-width: 0;
}
.cfg-field-group input:focus,
.cfg-field-group select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}
.cfg-field-group input::placeholder { color: var(--text-tertiary); }
.cfg-input-key {
    font-family: 'Montserrat', monospace !important;
    font-weight: 600 !important;
    font-size: 13px !important;
}


.cfg-select-type {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px !important;
}


.cfg-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary);
    user-select: none;
    padding-top: 20px;
}
.cfg-checkbox {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}


.cfg-file-list { margin-bottom: 12px; }
.cfg-file-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--bg-body);
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
    font-size: 13px;
    transition: background 0.15s;
}
.cfg-file-item:hover { background: var(--bg-hover); }
.cfg-file-icon { color: var(--primary); flex-shrink: 0; }
.cfg-file-name {
    flex: 1;
    color: var(--text-secondary);
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cfg-file-remove {
    width: 28px;
    height: 28px;
    min-width: 28px;
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    flex-shrink: 0;
}
.cfg-file-remove:hover { background: var(--danger-light); color: var(--danger); }


.cfg-actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-bottom: 20px;
}


.cfg-btn-add {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 22px;
    border: none;
    border-radius: var(--radius);
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #fff;
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(34,197,94,0.25);
}
.cfg-btn-add:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(34,197,94,0.35);
}
.cfg-btn-add:active {
    transform: translateY(0);
}


.cfg-btn-scan {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 22px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-surface);
    color: var(--text-primary);
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.cfg-btn-scan:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.cfg-btn-scan:active {
    transform: translateY(0);
}
.cfg-btn-scan:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}


.cfg-btn-scan-sync {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 22px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-surface);
    color: var(--text-primary);
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.cfg-btn-scan-sync:hover {
    border-color: var(--warning);
    color: var(--warning);
    background: rgba(245, 158, 11, 0.08);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.15);
}
.cfg-btn-scan-sync:active {
    transform: translateY(0);
}
.cfg-btn-scan-sync:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.cfg-add-row {
    display: flex;
    gap: 10px;
    align-items: center;
}
.cfg-add-row input {
    flex: 1;
    height: 38px;
    padding: 0 14px;
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-body);
    color: var(--text-primary);
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    outline: none;
    transition: all 0.2s;
    min-width: 0;
}
.cfg-add-row input:focus {
    border-style: solid;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}
.cfg-add-row input::placeholder { color: var(--text-tertiary); }

.cfg-placeholder {
    padding: 20px;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 13px;
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
}


.cfg-field-card {
    background: var(--bg-body);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 12px;
    overflow: hidden;
    transition: all 0.2s;
}
.cfg-field-card:hover {
    border-color: var(--text-tertiary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.cfg-field-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-surface);
}
.cfg-field-type-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 5px;
    line-height: 1;
}
.cfg-field-type-badge svg { flex-shrink: 0; }
.cfg-field-card-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}
.cfg-field-action,
.cfg-field-duplicate,
.cfg-field-remove {
    width: 28px;
    height: 28px;
    min-width: 28px;
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}
.cfg-field-action:hover { background: var(--bg-hover); color: var(--text-primary); }
.cfg-field-action:disabled { opacity: 0.3; cursor: not-allowed; }
.cfg-field-duplicate:hover { background: var(--primary-light); color: var(--primary); }
.cfg-field-remove:hover { background: var(--danger-light); color: var(--danger); }

.cfg-field-card-body { padding: 16px; }


.cfg-toc-sidebar {
    background: var(--bg-surface);
    border-left: 1px solid var(--border);
    padding: 16px;
    overflow-y: auto;
    overflow-x: hidden;
    max-height: calc(100vh - 200px);
    min-width: 240px;
    max-width: 240px;
    border-radius: 0 !important;
    box-shadow: none !important;
    position: relative;
    z-index: 3;
}
.cfg-toc-title {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding-bottom: 8px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cfg-toc-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 12px;
    color: var(--text-secondary);
    transition: all 0.15s;
    margin-bottom: 2px;
    min-width: 0;
}
.cfg-toc-item:hover { background: var(--bg-hover); }
.cfg-toc-badge {
    width: 22px;
    height: 22px;
    min-width: 22px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
}
.cfg-toc-badge svg { width: 12px; height: 12px; }
.cfg-toc-label {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cfg-toc-req {
    color: var(--danger);
    font-weight: 700;
    font-size: 11px;
    flex-shrink: 0;
}
.cfg-toc-empty {
    color: var(--text-tertiary);
    font-size: 12px;
    text-align: center;
    padding: 24px 8px;
}


[data-theme="dark"] .cfg-select-type {
    color: var(--text-primary);
}
[data-theme="dark"] .cfg-select-type option {
    background-color: var(--bg-surface);
    color: var(--text-primary);
}


@media (max-width: 1024px) {
    .cfg-panel {
        grid-template-columns: 240px 1fr;
    }
    .cfg-toc-sidebar { display: none; }
}
@media (max-width: 768px) {
    .cfg-panel {
        grid-template-columns: 1fr;
    }
    .cfg-sidebar {
        border-right: none;
        border-bottom: 1px solid var(--border);
        max-height: 200px;
    }
    .cfg-workspace {
        padding: 16px;
        max-height: none;
    }
    .cfg-field-row {
        flex-direction: column;
    }
    .cfg-toolbar {
        flex-wrap: wrap;
        padding: 12px 16px;
    }
}


.app-toast-container {
    position: fixed;
    right: 20px;
    bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 10050;
    pointer-events: none;
    max-width: min(420px, calc(100vw - 24px));
}

.app-toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--bg-surface);
    color: var(--text-primary);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.2);
    transform: translateY(10px);
    opacity: 0;
    transition: transform 0.22s ease, opacity 0.22s ease;
}

.app-toast.show {
    transform: translateY(0);
    opacity: 1;
}

.app-toast.hide {
    transform: translateY(8px);
    opacity: 0;
}

.app-toast__icon {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 1px;
}

.app-toast__body {
    min-width: 0;
    flex: 1;
}

.app-toast__title {
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 2px;
}

.app-toast__message {
    font-size: 12px;
    line-height: 1.35;
    color: var(--text-secondary);
    word-break: break-word;
}

.app-toast__close {
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 0 2px;
}

.app-toast__close:hover {
    color: var(--text-primary);
}

.app-toast--success {
    border-color: rgba(34, 197, 94, 0.35);
}

.app-toast--success .app-toast__icon {
    color: #15803d;
    background: rgba(34, 197, 94, 0.15);
}

.app-toast--error {
    border-color: rgba(239, 68, 68, 0.4);
}

.app-toast--error .app-toast__icon {
    color: #b91c1c;
    background: rgba(239, 68, 68, 0.15);
}

.app-toast--warning {
    border-color: rgba(245, 158, 11, 0.45);
}

.app-toast--warning .app-toast__icon {
    color: #b45309;
    background: rgba(245, 158, 11, 0.2);
}

.app-toast--info {
    border-color: rgba(59, 130, 246, 0.4);
}

.app-toast--info .app-toast__icon {
    color: #1d4ed8;
    background: rgba(59, 130, 246, 0.15);
}
