/* css/styles.css */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}


body {
    --background: #ffffff;
    --background-content: #ffffff;
    --background-secondary: #f5f5f5;
    --text-primary: #000000;
    --text-secondary: #6c6c6c;
    --accent: #2688eb;
    --separator: #e7e8ec;
    --negative: #e64646;
    --positive: #4bb34b;
    
    background: var(--background-secondary);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    color: var(--text-primary);
    --tabs-bg: #f5f5f5;
    --tabs-item-bg: #ffffff;
    --tabs-item-active-bg: #e8f3ff;
    --tabs-item-hover-bg: #ebebeb;    
}


@media (prefers-color-scheme: dark) {
    body {
        --background: #191919;
        --background-content: #1e1e1e;
        --background-secondary: #0a0a0a;
        --text-primary: #ffffff;
        --text-secondary: #a0a0a0;
        --accent: #5c9ce6;
        --separator: #2c2c2c;
        --negative: #e64646;
        --positive: #4bb34b;
        --tabs-bg: #1e1e1e;
        --tabs-item-bg: #2c2c2c;
        --tabs-item-active-bg: #2a3a4a;
        --tabs-item-hover-bg: #3a3a3a;        
    }
}

body.vkui--dark {
    --background: #191919;
    --background-content: #1e1e1e;
    --background-secondary: #0a0a0a;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --accent: #5c9ce6;
    --separator: #2c2c2c;
    --tabs-bg: #1e1e1e;
    --tabs-item-bg: #2c2c2c;
    --tabs-item-active-bg: #2a3a4a;
    --tabs-item-hover-bg: #3a3a3a;    
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 12px;
}


.card {
    background: var(--background-content);
    border-radius: 12px;
    margin-bottom: 12px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.card__header {
    padding: 16px;
    border-bottom: 1px solid var(--separator);
    font-weight: 500;
    font-size: 16px;
    color: var(--text-primary);
}

.card__content {
    padding: 16px;
}

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

.form-item__label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.input {
    width: 100%;
    padding: 10px 12px;
    background: var(--background-secondary);
    border: 1px solid var(--separator);
    border-radius: 10px;
    font-size: 15px;
    color: var(--text-primary);
    transition: all 0.2s;
}

.input:focus {
    outline: none;
    border-color: var(--accent);
}

.select {
    width: 100%;
    padding: 10px 12px;
    background: var(--background-secondary);
    border: 1px solid var(--separator);
    border-radius: 10px;
    font-size: 15px;
    color: var(--text-primary);
    cursor: pointer;
}

.button {
    width: 100%;
    padding: 10px 16px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s;
}

.button:hover {
    opacity: 0.9;
}

.button--secondary {
    background: var(--background-secondary);
    color: var(--text-primary);
    border: 1px solid var(--separator);
}

.button--destructive {
    background: var(--negative);
    color: white;
}

.simple-cell {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--separator);
}

.simple-cell:last-child {
    border-bottom: none;
}

.simple-cell__before {
    margin-right: 12px;
    width: 40px;
    text-align: center;
    font-size: 24px;
}

.simple-cell__content {
    flex: 1;
}

.simple-cell__title {
    font-weight: 500;
    font-size: 15px;
    color: var(--text-primary);
}

.simple-cell__subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.simple-cell__after {
    text-align: right;
    font-weight: 500;
}

.div {
    padding: 16px;
}

.spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

.spinner__dot {
    width: 32px;
    height: 32px;
    border: 3px solid var(--separator);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.balance {
    font-size: 32px;
    font-weight: 700;
    color: var(--accent);
    text-align: center;
    padding: 16px;
}

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

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
}

.status-connected {
    background: rgba(75, 179, 75, 0.15);
    color: var(--positive);
}

.status-error {
    background: rgba(230, 70, 70, 0.15);
    color: var(--negative);
}

.status-warning {
    background: rgba(255, 193, 7, 0.15);
    color: #ffc107;
}

.role-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
    background: var(--background-secondary);
}

.role-admin {
    background: rgba(38, 136, 235, 0.15);
    color: var(--accent);
}

.hidden {
    display: none;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.whitelist-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--separator);
}

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

.flex-row {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.flex-row .input {
    flex: 1;
}

.flex-row .button {
    width: auto;
    padding: 10px 20px;
}

.status-ok {
    color: var(--positive);
}

.text-center {
    text-align: center;
    color: var(--text-primary);
}

.mt-16 {
    margin-top: 16px;
}

.mb-8 {
    margin-bottom: 8px;
}

.cursor-pointer {
    cursor: pointer;
}

.key-masked {
    font-family: monospace;
    background: var(--background-secondary);
    padding: 4px 8px;
    border-radius: 6px;
    display: inline-block;
}

.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1050;
}

.toast {
    background: var(--background-content);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    min-width: 250px;
    max-width: 350px;
}

.toast .toast-body {
    padding: 12px 16px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.toast.text-bg-success {
    background: #d4edda;
    border-left: 4px solid #28a745;
    color: #155724;
}

.toast.text-bg-danger {
    background: #f8d7da;
    border-left: 4px solid #dc3545;
    color: #721c24;
}

.toast.text-bg-warning {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    color: #856404;
}

.toast.text-bg-info {
    background: #d1ecf1;
    border-left: 4px solid #17a2b8;
    color: #0c5460;
}

.toast .btn-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: inherit;
    opacity: 0.7;
    transition: all 0.2s ease;
    margin-left: auto;
}

.toast .btn-close:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.1);
}

.constructor-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.constructor-item {
    background: var(--background-secondary);
    border-radius: 10px;
    padding: 12px;
    transition: all 0.2s;
    border: 1px solid var(--separator);
}

.constructor-item.muted {
    opacity: 0.6;
    background: var(--background-secondary);
}

.constructor-item.draggable {
    cursor: grab;
}

.constructor-item.draggable:active {
    cursor: grabbing;
}

.constructor-item.dragging {
    opacity: 0.5;
}

.constructor-item.drag-over {
    border: 2px dashed var(--accent);
    background: rgba(38, 136, 235, 0.1);
}

.constructor-item-header {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.constructor-item-handle {
    cursor: grab;
    color: var(--text-secondary);
}

.constructor-item-handle.hidden {
    display: none;
}

.constructor-item-title {
    flex: 1;
    font-weight: 500;
    color: var(--text-primary);
}

.constructor-item-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.drag-controls {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

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

.drag-controls i:hover {
    color: var(--accent);
}

.constructor-item-weight {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--separator);
}

.constructor-item-weight label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

.constructor-item-weight input {
    width: 80px;
    padding: 4px 8px;
    background: var(--background-content);
    border: 1px solid var(--separator);
    border-radius: 6px;
    color: var(--text-primary);
}

.constructor-footer {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--separator);
}

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

.info-text.error {
    color: var(--negative);
}

.badge-required {
    font-size: 10px;
    background: var(--accent);
    color: white;
    padding: 2px 6px;
    border-radius: 12px;
    margin-left: 6px;
}

.badge-free {
    font-size: 10px;
    background: var(--negative);
    color: white;
    padding: 2px 6px;
    border-radius: 12px;
    margin-left: 6px;
}

.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch input:disabled + .slider {
    opacity: 0.5;
    cursor: not-allowed;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--separator);
    transition: 0.3s;
    border-radius: 20px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--accent);
}

input:checked + .slider:before {
    transform: translateX(20px);
}

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

.tooltip-icon {
    cursor: help;
    color: var(--text-secondary);
}

.tooltip-icon:hover {
    color: var(--accent);
}

.custom-tooltip {
    background: var(--background-content);
    border: 1px solid var(--separator);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
    max-width: 250px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    z-index: 1000;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(2px);
}

.modal-overlay .modal-content {
    background: var(--background-content);
    border-radius: 16px;
    padding: 20px 24px;
    min-width: 300px;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    animation: modalFadeIn 0.2s ease;
}

.modal-content h3 {
    margin: 0 0 16px 0;
    font-size: 18px;
    color: var(--text-primary);
}

.modal-content input {
    width: 100%;
    padding: 10px 12px;
    background: var(--background-secondary);
    border: 1px solid var(--separator);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    margin-bottom: 20px;
}

.modal-buttons {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.modal-buttons button {
    padding: 8px 16px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 14px;
}

.modal-cancel {
    background: var(--background-secondary);
    color: var(--text-secondary);
}

.modal-ok {
    background: var(--accent);
    color: white;
}

.context-menu {
    background: var(--background-content);
    border: 1px solid var(--separator);
    border-radius: 8px;
    padding: 4px 0;
    min-width: 180px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.context-menu-item {
    padding: 8px 16px;
    cursor: pointer;
    color: var(--text-primary);
    transition: background 0.2s;
}

.context-menu-item:hover {
    background: var(--background-secondary);
}

.constructor-item-menu {
    cursor: pointer;
    color: var(--text-secondary);
    padding: 4px;
}

.constructor-item-menu:hover {
    color: var(--accent);
}

.constructor-item-weight-badge {
    background: var(--background-secondary);
    border-radius: 16px;
    padding: 4px 10px;
    margin-right: 8px;
}

.weight-value {
    font-weight: 600;
    color: var(--positive);
    font-size: 13px;
}

body.modal-open {
    overflow: hidden;
}

.titles-container {
    margin-top: 16px;
}

.titles-container.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.titles-header {
    display: flex;
    gap: 16px;
    padding: 12px;
    background: var(--background-secondary);
    border-radius: 8px;
    font-weight: 600;
    margin-bottom: 12px;
}

.titles-range {
    flex: 2;
}

.titles-name {
    flex: 3;
}

.titles-actions {
    width: 40px;
}

.titles-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.titles-item {
    display: flex;
    gap: 16px;
    align-items: center;
    padding: 12px;
    background: var(--background-secondary);
    border-radius: 8px;
}

.titles-range-inputs {
    flex: 2;
    display: flex;
    gap: 8px;
    align-items: center;
}

.titles-range-inputs input {
    width: 80px;
    padding: 6px 8px;
    background: var(--background-content);
    border: 1px solid var(--separator);
    border-radius: 6px;
    color: var(--text-primary);
}

.titles-name-input {
    flex: 3;
}

.titles-name-input input {
    width: 100%;
    padding: 6px 8px;
    background: var(--background-content);
    border: 1px solid var(--separator);
    border-radius: 6px;
    color: var(--text-primary);
}

.titles-actions-buttons {
    width: 40px;
    text-align: center;
}

.titles-remove {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--negative);
    font-size: 16px;
}

.titles-remove:hover {
    opacity: 0.8;
}

.titles-add {
    margin-top: 8px;
}

.whitelist-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 400px;
    overflow-y: auto;
    padding: 4px;
}

.whitelist-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--background-secondary);
    border-radius: 10px;
    transition: background 0.2s ease;
}

.whitelist-item:hover {
    background: var(--background-content);
}

.whitelist-item-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.whitelist-item-left i {
    font-size: 16px;
    width: 24px;
    text-align: center;
}

.whitelist-user-link {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.whitelist-user-link:hover {
    color: var(--accent);
    text-decoration: underline;
}

.whitelist-item-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.whitelist-item-right button {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 14px;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.whitelist-item-right button:hover {
    background: var(--background-secondary);
    color: var(--accent);
}

.whitelist-item-right .whitelist-remove:hover {
    color: var(--negative);
    background: rgba(230, 70, 70, 0.1);
}

.whitelist-item-right .whitelist-refresh:hover {
    color: var(--positive);
}

.user-info-modal {
    max-width: 400px;
    width: 90%;
}

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

.modal-overlay .modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-overlay .modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s;
}

.modal-overlay .modal-close:hover {
    background: var(--background-secondary);
    color: var(--text-primary);
}

.modal-overlay .modal-buttons {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 20px;
}

.modal-overlay .modal-buttons button {
    padding: 10px 20px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.modal-overlay .modal-buttons button:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.modal-overlay .modal-cancel {
    background: var(--background-secondary);
    color: var(--text-primary);
    border: 1px solid var(--separator);
}

.modal-overlay .modal-ok {
    background: var(--accent);
    color: white;
}

.modal-overlay .modal-body p {
    color: var(--text-primary);
}

.modal-overlay #modalPromptInput {
    width: 100%;
    padding: 10px 12px;
    background: var(--background-secondary);
    border: 1px solid var(--separator);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 15px;
}

.modal-overlay #modalPromptInput:focus {
    outline: none;
    border-color: var(--accent);
}

.user-avatar {
    flex-shrink: 0;
}

.user-avatar img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--separator);
}

.user-details {
    flex: 1;
    min-width: 150px;
}

.user-details p {
    margin: 8px 0;
    word-break: break-word;
    font-size: 14px;
    color: var(--text-primary);
}

.user-details p strong {
    color: var(--text-secondary);
    font-weight: 500;
}

.user-details a {
    color: var(--accent);
    text-decoration: none;
    word-break: break-all;
}

.user-details a:hover {
    text-decoration: underline;
}

#whitelist_user {
    flex: 1;
}

#addWhitelistBtn {
    white-space: nowrap;
}

.whitelist-container::-webkit-scrollbar {
    width: 6px;
}

.whitelist-container::-webkit-scrollbar-track {
    background: var(--background-secondary);
    border-radius: 3px;
}

.whitelist-container::-webkit-scrollbar-thumb {
    background: var(--separator);
    border-radius: 3px;
}

.whitelist-container::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

.transactions-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.transaction-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: var(--background-secondary);
    border-radius: 8px;
}

.transaction-info {
    flex: 1;
}

.transaction-description {
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.transaction-date {
    font-size: 11px;
    color: var(--text-secondary);
}

.transaction-amount {
    font-size: 16px;
    font-weight: 600;
}

.transaction-positive {
    color: var(--positive);
}

.transaction-negative {
    color: var(--negative);
}

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

@keyframes fa-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.code-editor-container {
    border: 1px solid var(--separator);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 8px;
}

.code-editor-container .CodeMirror {
    height: 400px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    border-radius: 0;
}

.error-message {
    position: relative;
    padding: 12px 16px;
    margin-top: 12px;
    border-radius: 8px;
    font-family: monospace;
    font-size: 12px;
    white-space: pre-wrap;
    word-break: break-all;
    transition: all 0.3s ease;
}

.error-message.hidden {
    display: none;
}

.error-close-btn {
    position: absolute;
    top: 8px;
    right: 12px;
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.error-close-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    color: var(--text-primary);
}

.transactions-list-container {
    max-height: 400px;
    overflow-y: auto;
    scrollbar-width: thin;
}

.transactions-list-container::-webkit-scrollbar {
    width: 6px;
}

.transactions-list-container::-webkit-scrollbar-track {
    background: var(--background-secondary);
    border-radius: 3px;
}

.transactions-list-container::-webkit-scrollbar-thumb {
    background: var(--separator);
    border-radius: 3px;
}

.transactions-list-container::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

.filter-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 6px 12px;
    background: var(--background-secondary);
    border-radius: 20px;
    transition: background 0.2s;
    color: var(--text-primary);
}

.filter-label:hover {
    background: var(--background-content);
}

.filter-label input {
    margin: 0;
    cursor: pointer;
}

.filter-label span {
    color: var(--text-primary);
}

.resume-info, .resume-info.warning {
    margin-top: 12px;
    padding: 12px;
    border-radius: 8px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.resume-info {
    background: rgba(75, 179, 75, 0.15);
    border-left: 3px solid var(--positive);
    color: var(--positive);
}

.resume-info.warning {
    background: rgba(230, 70, 70, 0.15);
    border-left: 3px solid var(--negative);
    color: var(--negative);
}

.resume-info i, .resume-info.warning i {
    font-size: 18px;
}

.resume-info span, .resume-info.warning span {
    color: inherit;
}

@media (prefers-color-scheme: light) {
    .resume-info {
        background: #d4edda;
        color: #155724;
    }
    .resume-info.warning {
        background: #f8d7da;
        color: #721c24;
    }
    .toast .btn-close {
        color: #000000;
        opacity: 0.6;
    }
    .toast .btn-close:hover {
        background: rgba(0, 0, 0, 0.1);
        opacity: 1;
    }
}

@media (prefers-color-scheme: dark) {
    .resume-info {
        background: rgba(75, 179, 75, 0.2);
        color: #6fbf6f;
    }
    .resume-info.warning {
        background: rgba(230, 70, 70, 0.2);
        color: #f5a5a5;
    }
    .toast.text-bg-success {
        background: #1a3a2a;
        border-left-color: #28a745;
        color: #a5d6a5;
    }
    .toast.text-bg-danger {
        background: #3a1a1a;
        border-left-color: #dc3545;
        color: #f5a5a5;
    }
    .toast.text-bg-warning {
        background: #3a2a1a;
        border-left-color: #ffc107;
        color: #ffd966;
    }
    .toast.text-bg-info {
        background: #1a2a3a;
        border-left-color: #17a2b8;
        color: #a5d6d6;
    }
    .toast .btn-close {
        color: #ffffff;
        opacity: 0.8;
    }
    .toast .btn-close:hover {
        background: rgba(255, 255, 255, 0.2);
        opacity: 1;
    }
}

#tab-whitelist .toast .btn-close,
.toast-container .toast .btn-close {
    color: inherit !important;
    background: none !important;
    border: none !important;
}

.toast .btn-close::before {
    content: "×";
    font-size: 20px;
    font-weight: bold;
    line-height: 1;
}

.badge-connection {
    display: inline-block;
    background: #ff9800;
    color: white;
    font-size: 11px;
    font-weight: bold;
    border-radius: 12px;
    padding: 2px 6px;
    margin-left: 6px;
    min-width: 18px;
    text-align: center;
    line-height: 1.2;
}

.badge-connection.hidden {
    display: none !important;
}

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

.help-section-item {
    padding: 12px 16px;
    background: var(--background-secondary);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 12px;
}

.help-section-item .help-icon {
    display: none;
}

.help-section-item:hover {
    background: var(--background-content);
    transform: translateX(4px);
}

.help-section-item i {
    font-size: 18px;
    color: var(--accent);
    width: 24px;
    text-align: center;
}

.help-section-title {
    font-weight: 500;
    color: var(--text-primary);
}

.help-section-desc {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.payments-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.payment-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--background-secondary);
    border-radius: 10px;
    transition: all 0.2s ease;
}

.payment-item:hover {
    background: var(--background-content);
}

.payment-info {
    flex: 1;
}

.payment-description {
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 4px;
    font-weight: 500;
}

.payment-date {
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 2px;
}

.payment-id {
    font-size: 10px;
    color: var(--text-secondary);
    font-family: monospace;
}

.payment-amount {
    font-size: 18px;
    font-weight: 600;
}

.payment-amount.positive {
    color: var(--positive);
}

.payment-amount.negative {
    color: var(--negative);
}

.status-success {
    color: var(--positive);
}

.status-warning {
    color: #ff9800;
}

.status-error {
    color: var(--negative);
}

.payments-list-container {
    max-height: 500px;
    overflow-y: auto;
    scrollbar-width: thin;
}

.payments-list-container::-webkit-scrollbar {
    width: 6px;
}

.payments-list-container::-webkit-scrollbar-track {
    background: var(--background-secondary);
    border-radius: 3px;
}

.payments-list-container::-webkit-scrollbar-thumb {
    background: var(--separator);
    border-radius: 3px;
}

.payments-list-container::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

.diagnostic-item {
    transition: all 0.2s ease;
    color: var(--text-primary);
}

.diagnostic-item.diagnostic-ok {
    background: rgba(75, 179, 75, 0.15);
    border-left: 3px solid var(--positive);
}

.diagnostic-item.diagnostic-warning {
    background: rgba(255, 193, 7, 0.15);
    border-left: 3px solid #ffc107;
}

.diagnostic-item.diagnostic-error {
    background: rgba(230, 70, 70, 0.15);
    border-left: 3px solid var(--negative);
}

.diagnostic-item.diagnostic-info {
    background: rgba(38, 136, 235, 0.15);
    border-left: 3px solid var(--accent);
}

.diagnostic-item .diagnostic-title {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
}

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

.diagnostic-summary {
    margin-top: 16px;
    padding: 14px 16px;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.5;
}

.diagnostic-summary.error {
    background: rgba(230, 70, 70, 0.15);
    border-left: 3px solid var(--negative);
    color: var(--text-primary);
}

.diagnostic-summary.warning {
    background: rgba(255, 193, 7, 0.15);
    border-left: 3px solid #ffc107;
    color: var(--text-primary);
}

.diagnostic-summary.ok {
    background: rgba(75, 179, 75, 0.15);
    border-left: 3px solid var(--positive);
    color: var(--text-primary);
}

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

/* Титулы */
.titles-container {
    margin-top: 16px;
}

.titles-container.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.titles-container.disabled input,
.titles-container.disabled button {
    pointer-events: none;
}

/* Публичный рейтинг */
.public-rating-table {
    color: var(--text-primary);
}

.public-rating-table table {
    width: 100%;
    border-collapse: collapse;
}

.public-rating-table th {
    color: var(--text-primary);
    background: var(--background-secondary);
}

.public-rating-table td {
    color: var(--text-primary);
}

.public-rating-table a {
    color: var(--accent);
    text-decoration: none;
}

.public-rating-table a:hover {
    text-decoration: underline;
}

.rating-table-wrapper {
    overflow-x: auto;
}

.user-avatar-img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

#tab-about {
    color: var(--text-primary);
}

#tab-about .card__content {
    color: var(--text-primary);
}

#tab-about h3 {
    color: var(--text-primary);
}

#tab-about p {
    color: var(--text-primary);
}

#tab-about ul {
    color: var(--text-primary);
}

#tab-about li {
    color: var(--text-primary);
}

#tab-about a {
    color: var(--accent);
}

#tab-about a:hover {
    text-decoration: underline;
}

.select {
    width: 100%;
    padding: 10px 28px 10px 12px;
    background: var(--background-secondary);
    border: 1px solid var(--separator);
    border-radius: 10px;
    font-size: 15px;
    color: var(--text-primary);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236c6c6c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'></polyline></svg>");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
}

@media (prefers-color-scheme: dark) {
    .select {
        background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a0a0a0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'></polyline></svg>");
    }
}

.select:focus {
    outline: none;
    border-color: var(--accent);
}

.about-contacts {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 12px;
}

.about-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: var(--background-secondary);
    border-radius: 12px;
    color: var(--accent);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
    width: fit-content;
    max-width: 100%;
}

.about-link i {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.about-link:hover {
    background: var(--background-content);
    transform: translateX(4px);
    color: var(--accent);
    text-decoration: none;
}

@media (max-width: 600px) {
    .about-link {
        width: 100%;
        box-sizing: border-box;
    }
}

.constructor-item-title-ellipsis {
    flex: 1;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

@media (max-width: 600px) {
    .constructor-item-title-ellipsis {
        max-width: 120px;
    }
}

#helpModal .modal-content {
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

#helpModal .modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

#helpModal .modal-body::-webkit-scrollbar {
    width: 6px;
}

#helpModal .modal-body::-webkit-scrollbar-track {
    background: var(--background-secondary);
    border-radius: 3px;
}

#helpModal .modal-body::-webkit-scrollbar-thumb {
    background: var(--separator);
    border-radius: 3px;
}

#helpModal .modal-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

#helpModal .modal-buttons {
    flex-shrink: 0;
    padding: 16px 20px;
    border-top: 1px solid var(--separator);
    display: flex;
    justify-content: center;
}

.diagnostic-message {
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: normal;
}

.diagnostic-message span[title] {
    border-bottom: 1px dotted var(--text-secondary);
    cursor: help;
}

.diagnostic-tooltip {
    border-bottom: 1px dotted var(--text-secondary);
    cursor: help;
}

#mainInterface .card:first-child .flex-row {
    align-items: flex-end;
}

#mainInterface .card:first-child .flex-row > div {
    display: flex;
    flex-direction: column;
}

#mainInterface .card:first-child .form-item__label {
    margin-bottom: 6px;
}

#editGroupNameBtn,
#addToCommunityBtn {
    height: 42px;
    box-sizing: border-box;
}

#mainInterface .card:first-child .button {
    margin-top: 0;
}




.tabs-container {
    position: relative;
    margin-bottom: 12px;
    background: var(--tabs-bg);
    border-radius: 12px;
    overflow: visible;
}

.tabs {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    background: var(--tabs-bg);
    border-bottom: 1px solid var(--separator);
    white-space: nowrap;
    gap: 6px;
    padding: 10px 50px;
    border-radius: 12px;
    min-height: 52px;
    align-items: center;
    scroll-behavior: smooth;
}

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


.tabs-scroll-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    background: var(--background-content);
    border: 1px solid var(--accent);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    z-index: 20;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.tabs-scroll-btn:hover {
    background: var(--accent);
    color: white;
    box-shadow: 0 4px 12px rgba(38, 136, 235, 0.3);
}

.tabs-scroll-btn:active {
    transform: translateY(-50%) scale(0.96);
    background: var(--accent);
    color: white;
}

.tabs-scroll-btn.left {
    left: 0;
    border-radius: 12px 0 0 12px;
}

.tabs-scroll-btn.right {
    right: 0;
    border-radius: 0 12px 12px 0;
}

.tabs-scroll-btn.hidden {
    display: none !important;
}


.tab {
    flex: 0 0 auto;
    padding: 10px 16px;
    text-align: center;
    background: var(--tabs-item-bg);
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 40px;
    line-height: 1;
}

.tab i, .tab .tab-icon {
    font-size: 14px;
}

.tab--active {
    color: var(--accent);
    background: var(--tabs-item-active-bg);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.tab:hover:not(.tab--active) {
    color: var(--text-primary);
    background: var(--tabs-item-hover-bg);
}


@media (max-width: 600px) {
    .tabs-scroll-btn {
        width: 36px;
        height: 36px;
    }
    
    .tabs {
        padding: 8px 40px;
        gap: 4px;
    }
    
    .tab {
        padding: 8px 12px;
        font-size: 13px;
        height: 36px;
    }
}


@media (prefers-color-scheme: dark) {
    .tabs-scroll-btn {
        background: #2c2c2c;
        border-color: #5c9ce6;
        color: #5c9ce6;
    }
    
    .tabs-scroll-btn:hover {
        background: #5c9ce6;
        color: #1e1e1e;
    }
}

.badge-required,
.badge-free {
    display: inline-block;
    white-space: nowrap;  
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 12px;
    margin-left: 6px;
    vertical-align: middle;
    line-height: 1.2;
}


@media (max-width: 480px) {
    .badge-required,
    .badge-free {
        font-size: 8px;
        padding: 2px 4px;
        margin-left: 4px;
    }
    

    .constructor-item-title {
        font-size: 13px;
    }
    
    .constructor-item-header {
        flex-wrap: wrap;
        gap: 8px;
    }
}


.rating-stars {
    display: flex;
    gap: 8px;
    cursor: pointer;
}

.rating-star {
    font-size: 28px;
    color: #ffc107;
    cursor: pointer;
    transition: transform 0.2s ease;
    display: inline-block;
}

.rating-star:hover {
    transform: scale(1.1);
}

.rating-star.active {
    color: #ff9800;
    text-shadow: 0 0 2px rgba(255, 152, 0, 0.5);
}

.rating-star.disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.rating-star.disabled:hover {
    transform: none;
}

#rating-status {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}

#rating-status.success {
    color: var(--positive);
}

#rating-status.error {
    color: var(--negative);
}