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

:root {
    --bg-primary: #000000;
    --bg-secondary: #0a0a0a;
    --bg-card: #141414;
    --bg-card-hover: #1a1a1a;
    --text-primary: #ffffff;
    --text-secondary: #666666;
    --text-muted: #444444;
    --border: #222222;
    --accent: #ffffff;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

.app {
    min-height: 100vh;
}

/* Header - Hidden */
.header {
    display: none;
}

/* Content */
.content {
    padding: 40px 24px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Loading */
.loading-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.loading-screen p {
    margin-top: 16px;
    color: var(--text-secondary);
    font-size: 13px;
}

/* Dashboard Title - Hidden */
.dashboard-title {
    display: none;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

/* Stats Grid - Hidden */
.stats-grid {
    display: none;
}

/* Info Banner - Hidden */
.info-banner {
    display: none;
}

/* Section Title */
.section-title {
    display: none;
}

/* User Info Card - Elegant */
.user-info-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 28px;
    margin-bottom: 40px;
    opacity: 0;
    animation: cardSlideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.05s forwards;
}

.user-main {
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

.user-avatar {
    font-size: 48px;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border);
    flex-shrink: 0;
}

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

.user-name-row {
    margin-bottom: 12px;
}

.user-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-right: 8px;
}

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

.user-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: var(--text-secondary);
}

.user-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.meta-icon {
    font-size: 14px;
}

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

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

.user-meta-divider {
    color: var(--text-muted);
}

.user-divider {
    height: 1px;
    background: var(--border);
    margin: 20px 0;
}

.user-permissions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: var(--text-secondary);
}

.permission-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.permission-icon {
    font-size: 16px;
}

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

.permission-divider {
    color: var(--text-muted);
}

.user-functions {
    margin-top: 0;
}

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

.functions-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.function-tag {
    display: inline-block;
    font-size: 12px;
    color: var(--text-secondary);
    padding: 6px 12px;
    background: var(--bg-secondary);
    border-radius: 6px;
    border: 1px solid var(--border);
    transition: all 0.2s ease;
}

.function-tag:hover {
    border-color: var(--accent);
    color: var(--text-primary);
}

@media (max-width: 768px) {
    .user-main {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .user-meta {
        justify-content: center;
    }
}

/* Actions Grid - КРУПНЫЕ КАРТЫ */
.actions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

@media (max-width: 900px) {
    .actions-grid {
        grid-template-columns: 1fr;
    }
}

/* КНОПКИ КАК ИГРАЛЬНЫЕ КАРТЫ */
.action-btn {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 48px 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 20px;
    cursor: pointer;
    min-height: 240px;
    opacity: 0;
    animation: cardSlideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}

.action-btn:nth-child(1) {
    animation-delay: 0.1s;
}

.action-btn:nth-child(2) {
    animation-delay: 0.15s;
}

.action-btn:nth-child(3) {
    animation-delay: 0.2s;
}

.action-btn:nth-child(4) {
    animation-delay: 0.25s;
}

.action-btn:nth-child(5) {
    animation-delay: 0.3s;
}

.action-btn:nth-child(6) {
    animation-delay: 0.35s;
}

@keyframes cardSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.action-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(255, 255, 255, 0.08);
}

.action-btn:active {
    transform: translateY(-2px);
}

.action-icon {
    font-size: 56px;
    transition: transform 0.3s ease;
}

.action-btn:hover .action-icon {
    transform: scale(1.1);
}

.action-content {
    width: 100%;
}

.action-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.action-desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Page Transitions - FAST */
#ownerDashboard,
#rolesPanel,
#roleFormPanel {
    animation: pageIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes pageIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pageOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

.hidden {
    display: none !important;
}

/* Panel Header */
.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    flex-wrap: wrap;
    gap: 16px;
}

.panel-title {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

/* Buttons */
.btn {
    background: var(--accent);
    color: var(--bg-primary);
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
}

.btn:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent);
}

/* Roles List */
.roles-list {
    display: grid;
    gap: 16px;
}

.role-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.role-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(255, 255, 255, 0.06);
}

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

.role-name {
    font-size: 18px;
    font-weight: 700;
}

.role-key {
    font-size: 12px;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid var(--border);
    font-family: 'Courier New', monospace;
}

.role-stats {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.role-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.role-actions .action-btn {
    flex: 1;
    padding: 12px 16px;
    min-height: auto;
    font-size: 14px;
    color: var(--text-primary);
}

.owner-role-badge {
    flex: 1;
    padding: 12px 16px;
    background: rgba(52, 199, 89, 0.15);
    border: 1px solid rgba(52, 199, 89, 0.4);
    border-radius: 8px;
    color: #34c759;
    font-size: 14px;
    font-weight: 700;
    text-align: center;
}

.edit-btn,
.delete-btn {
    padding: 10px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.edit-btn {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.edit-btn:hover {
    background: var(--accent);
    color: var(--bg-primary);
    border-color: var(--accent);
    transform: translateY(-2px);
}

.delete-btn {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.delete-btn:hover {
    background: var(--text-secondary);
    color: var(--bg-primary);
    border-color: var(--text-secondary);
    transform: translateY(-2px);
}

/* Forms */
.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 16px;
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.05);
}

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

.form-error {
    font-size: 12px;
    color: #ff4444;
    margin-top: 6px;
}

/* Permissions Grid - Column Layout with Balance */
.permissions-grid {
    column-count: 1;
    column-gap: 16px;
    margin-bottom: 24px;
}

@media (min-width: 768px) {
    .permissions-grid {
        column-count: 2;
    }
}

@media (min-width: 1024px) {
    .permissions-grid {
        column-count: 3;
    }
}

.permission-category {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.2s ease;
    break-inside: avoid;
    page-break-inside: avoid;
    margin-bottom: 16px;
    display: block;
}

.permission-category:hover {
    border-color: var(--accent);
}

.category-header {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.permission-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    transition: all 0.2s ease;
    gap: 12px;
}

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

.permission-item:hover {
    padding-left: 4px;
}

.permission-info {
    flex: 1;
    min-width: 0;
}

.permission-name {
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 4px;
}

.permission-description {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-top: 4px;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
}

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

.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    transition: all 0.3s ease;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background: var(--text-muted);
    transition: all 0.3s ease;
    border-radius: 50%;
}

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

input:checked+.toggle-slider:before {
    background: var(--bg-primary);
    transform: translateX(20px);
}

.toggle-slider:hover {
    border-color: var(--accent);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 80px 20px;
}

.empty-state-icon {
    font-size: 56px;
    margin-bottom: 20px;
    opacity: 0.3;
}

.empty-state h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
}

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

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Mobile */
@media (max-width: 768px) {
    .content {
        padding: 24px 16px;
    }

    .dashboard-title {
        font-size: 24px;
        margin-bottom: 32px;
    }

    .action-btn {
        padding: 40px 24px;
        min-height: 200px;
    }

    .action-icon {
        font-size: 48px;
    }

    .action-title {
        font-size: 18px;
    }
}

/* Stat
s Grid for Statistics */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
}

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

/* Logs Container */
.logs-container {
    display: grid;
    gap: 12px;
}

.log-entry {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    transition: all 0.2s ease;
}

.log-entry:hover {
    border-color: var(--accent);
    background: var(--bg-card-hover);
}

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

.log-action {
    font-size: 14px;
    font-weight: 600;
}

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

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

/* Restriction Menu */
.restriction-menu {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

.restriction-menu-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 32px;
    max-width: 400px;
    width: 90%;
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.restriction-menu-content h3 {
    font-size: 20px;
    margin-bottom: 20px;
    text-align: center;
}

.restriction-buttons {
    display: grid;
    gap: 12px;
    margin-bottom: 20px;
}

.restriction-btn {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.restriction-btn:hover {
    background: var(--accent);
    color: var(--bg-primary);
    border-color: var(--accent);
    transform: translateY(-2px);
}

.cancel-btn {
    width: 100%;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cancel-btn:hover {
    background: var(--bg-secondary);
    border-color: var(--accent);
}

/* Clickable cards */
.role-card[onclick] {
    cursor: pointer;
}

/* OTP Panel */
.otp-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 32px;
    margin-top: 24px;
}

.otp-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 12px;
}

.otp-description {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.otp-key-card {
    background: var(--bg-secondary);
    border: 2px solid var(--accent);
    border-radius: 12px;
    padding: 32px;
    text-align: center;
    margin-bottom: 24px;
}

.otp-key-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.otp-key-value {
    font-size: 32px;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    letter-spacing: 4px;
    margin-bottom: 16px;
    color: var(--accent);
    word-break: break-all;
    line-height: 1.4;
}

@media (max-width: 768px) {
    .otp-key-value {
        font-size: 24px;
        letter-spacing: 2px;
    }
}

@media (max-width: 480px) {
    .otp-key-value {
        font-size: 20px;
        letter-spacing: 1px;
    }
}

.otp-key-timer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
}

.timer-icon {
    font-size: 20px;
}

.otp-key-hint {
    font-size: 12px;
    color: var(--text-secondary);
    padding: 12px;
    background: var(--bg-card);
    border-radius: 8px;
}

.otp-key-hint code {
    background: var(--bg-primary);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
}

.otp-cooldown-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 32px;
    text-align: center;
    margin-bottom: 24px;
}

.cooldown-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.cooldown-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
}

.cooldown-message {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.cooldown-timer {
    font-size: 24px;
    font-weight: 700;
    color: var(--accent);
}

.cooldown-reason {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 16px;
    padding: 12px;
    background: var(--bg-card);
    border-radius: 8px;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: normal;
}

/* Restriction Display */
#otpRestrictionDisplay .otp-cooldown-card {
    border: 2px solid #ff4444;
    background: rgba(255, 68, 68, 0.05);
}

#otpRestrictionDisplay .cooldown-icon {
    opacity: 1;
}

#otpRestrictionDisplay .cooldown-title {
    color: #ff4444;
}

#otpRestrictionDisplay .cooldown-timer {
    color: #ff4444;
}

/* Session Display */
.otp-session-card {
    background: var(--bg-secondary);
    border: 2px solid var(--accent);
    border-radius: 12px;
    padding: 32px;
    text-align: center;
    margin-bottom: 24px;
}

.session-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.session-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
}

.session-info {
    text-align: left;
    margin-bottom: 16px;
}

.session-detail {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.session-detail:last-child {
    border-bottom: none;
}

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

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

/* Restriction Badge */
.restriction-badge {
    display: inline-block;
    margin-top: 8px;
    padding: 6px 12px;
    background: rgba(255, 0, 0, 0.1);
    border: 1px solid rgba(255, 0, 0, 0.3);
    border-radius: 6px;
    font-size: 12px;
    color: #ff6b6b;
    font-weight: 600;
}

.restriction-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 20px;
    text-align: center;
}

.delete-admin-btn {
    background: rgba(255, 0, 0, 0.1) !important;
    color: #ff6b6b !important;
    border: 1px solid rgba(255, 0, 0, 0.3) !important;
}

.delete-admin-btn:hover {
    background: rgba(255, 0, 0, 0.2) !important;
    border-color: #ff6b6b !important;
}

.cooldown-reason {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 12px;
    padding: 12px;
    background: var(--bg-card);
    border-radius: 8px;
}


/* Statistics */
.stat-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 8px;
}

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

/* Logs */
.logs-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.log-entry {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 16px;
}

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

.log-action {
    font-weight: 600;
    color: var(--text-primary);
}

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

.log-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 13px;
    color: var(--text-secondary);
}


/* Restriction reason */
.cooldown-reason {
    margin-top: 12px;
    padding: 12px;
    background: rgba(255, 59, 48, 0.1);
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-primary);
    text-align: center;
}


/* Custom Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
    display: none;
}

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

.modal-content {
    background: var(--card-bg);
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

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

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

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

.modal-footer {
    padding: 20px !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
    display: flex !important;
    gap: 16px !important;
    justify-content: center !important;
    align-items: center !important;
}

.modal-footer .btn {
    min-width: 140px !important;
    flex: 1 !important;
    max-width: 200px !important;
    margin: 0 !important;
}

.modal-footer .btn:only-child {
    max-width: 100% !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Form inputs in modal */
.modal-body .form-group {
    margin-bottom: 20px;
}

.modal-body .form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-body .form-input,
.modal-body .form-textarea,
.modal-body input,
.modal-body textarea,
input.form-input,
textarea.form-textarea {
    width: 100% !important;
    padding: 14px 16px !important;
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 10px !important;
    color: var(--text-primary) !important;
    font-size: 15px !important;
    transition: all 0.2s !important;
    box-sizing: border-box !important;
}

.modal-body .form-textarea,
.modal-body textarea,
textarea.form-textarea {
    min-height: 100px !important;
    resize: vertical !important;
    font-family: inherit !important;
    line-height: 1.5 !important;
}

.modal-body .form-input:focus,
.modal-body .form-textarea:focus,
.modal-body input:focus,
.modal-body textarea:focus,
input.form-input:focus,
textarea.form-textarea:focus {
    outline: none !important;
    border-color: var(--primary-color) !important;
    background: rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.1) !important;
}

.modal-body .form-hint {
    margin-top: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Alert styles */
.modal-alert {
    padding: 16px 20px;
    border-radius: 10px;
    margin-bottom: 0;
    font-size: 15px;
    line-height: 1.5;
}

.modal-alert.success {
    background: rgba(52, 199, 89, 0.15);
    border: 1px solid rgba(52, 199, 89, 0.4);
    color: #34c759;
}

.modal-alert.error {
    background: rgba(255, 59, 48, 0.15);
    border: 1px solid rgba(255, 59, 48, 0.4);
    color: #ff3b30;
}

.modal-alert.warning {
    background: rgba(255, 204, 0, 0.15);
    border: 1px solid rgba(255, 204, 0, 0.4);
    color: #ffcc00;
}

.modal-alert.info {
    background: rgba(10, 132, 255, 0.15);
    border: 1px solid rgba(10, 132, 255, 0.4);
    color: #0a84ff;
}

.modal-body p {
    margin: 16px 0;
    line-height: 1.6;
    color: var(--text-primary);
}

.modal-body ul {
    margin: 12px 0;
    padding-left: 24px;
}

.modal-body ul li {
    margin: 8px 0;
    line-height: 1.5;
}

.modal-body code {
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

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

.modal-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    gap: 12px;
    justify-content: center;
    align-items: center;
}

.modal-footer .btn {
    min-width: 140px;
    flex: 1;
    max-width: 200px;
    margin: 0;
    padding: 14px 24px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 10px;
    transition: all 0.3s;
}

.modal-footer .btn:only-child {
    max-width: 100%;
}

.modal-footer .btn-primary {
    background: var(--accent);
    color: var(--bg-primary);
}

.modal-footer .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.3);
}

.modal-footer .btn-secondary {
    background: #2a2a2a;
    color: #fff;
    border: 1px solid #444;
}

.modal-footer .btn-secondary:hover {
    background: #333;
    border-color: #555;
    transform: translateY(-2px);
}

/* Form inputs in modal */
.modal-body .form-group {
    margin-bottom: 20px;
}

.modal-body .form-label {
    display: block;
    margin-bottom: 10px;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
}

.modal-body .form-input,
.modal-body .form-textarea,
.modal-body input,
.modal-body textarea,
input.form-input,
textarea.form-textarea {
    width: 100%;
    padding: 14px 16px;
    background: #0d0d0d;
    border: 1px solid #333;
    border-radius: 10px;
    color: #fff;
    font-size: 15px;
    transition: all 0.3s;
    box-sizing: border-box;
}

.modal-body .form-textarea,
.modal-body textarea,
textarea.form-textarea {
    min-height: 100px;
    resize: vertical;
    font-family: inherit;
    line-height: 1.5;
}

.modal-body .form-input:focus,
.modal-body .form-textarea:focus,
.modal-body input:focus,
.modal-body textarea:focus,
input.form-input:focus,
textarea.form-textarea:focus {
    outline: none;
    border-color: var(--accent);
    background: #111;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

.modal-body .form-hint {
    margin-top: 8px;
    font-size: 13px;
    color: #888;
    line-height: 1.4;
}

/* Alert styles */
.modal-alert {
    padding: 16px 20px;
    border-radius: 10px;
    margin-bottom: 0;
    font-size: 15px;
    line-height: 1.5;
}

.modal-alert.success {
    background: rgba(52, 199, 89, 0.15);
    border: 1px solid rgba(52, 199, 89, 0.4);
    color: #34c759;
}

.modal-alert.error {
    background: rgba(255, 59, 48, 0.15);
    border: 1px solid rgba(255, 59, 48, 0.4);
    color: #ff3b30;
}

.modal-alert.warning {
    background: rgba(255, 204, 0, 0.15);
    border: 1px solid rgba(255, 204, 0, 0.4);
    color: #ffcc00;
}

.modal-alert.info {
    background: rgba(10, 132, 255, 0.15);
    border: 1px solid rgba(10, 132, 255, 0.4);
    color: #0a84ff;
}

.modal-body p {
    margin: 16px 0;
    line-height: 1.6;
    color: var(--text-primary);
}

.modal-body ul {
    margin: 12px 0;
    padding-left: 24px;
}

.modal-body ul li {
    margin: 8px 0;
    line-height: 1.5;
}

.modal-body code {
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 20000;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

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

.loading-content {
    text-align: center;
    padding: 40px;
    background: var(--bg-card);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-width: 280px;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    margin: 0 auto 24px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

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

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

/* ===
========== ANTICHEAT STYLES ============= */

/* Панель античита */
#anticheatPanel {
    position: relative;
}

/* Секция сферы - отдельный блок сверху */
.anticheat-sphere-section {
    position: relative;
    width: 100%;
    height: 400px;
    margin-bottom: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

#anticheatCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.anticheat-rings-wrapper {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    --glow-color: rgba(255, 255, 255, 0.15);
}

.anticheat-rings {
    animation: anticheatSpin 7s linear infinite;
    transform-style: preserve-3d;
    height: 280px;
    width: 280px;
    position: relative;
}

.anticheat-ring {
    height: 280px;
    width: 280px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    position: absolute;
    top: 0;
    left: 0;
    will-change: transform;
    transition: border-color 0.8s ease, opacity 0.8s ease, box-shadow 0.8s ease;
}

/* Свечение из центра сферы - НЕ вращается */
.anticheat-rings-wrapper::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 250px;
    height: 250px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--glow-color) 0%, transparent 60%);
    transition: background 0.8s ease;
    pointer-events: none;
    z-index: -1;
}

@keyframes anticheatSpin {
    from {
        transform: rotateY(360deg) rotateX(-360deg) rotateZ(360deg);
    }
}

/* Информационная панель */
.anticheat-info-panel {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    max-width: 400px;
    margin: 0 auto 40px auto;
}

/* Контейнер игроков */
.anticheat-players-container {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    margin-top: 40px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.anticheat-header {
    font-size: 16px;
    color: var(--accent);
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 12px;
}

.anticheat-status-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent);
    animation: pulse 2s infinite;
}

.anticheat-players-list {
    padding: 4px;
}

.anticheat-player-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.anticheat-player-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
    transition: left 0.5s;
}

.anticheat-player-item:hover::before {
    left: 100%;
}

.anticheat-player-item:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(255, 255, 255, 0.06);
}

.anticheat-player-item.active {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

.anticheat-player-item.expanded {
    background: rgba(255, 255, 255, 0.08);
}

.anticheat-player-name {
    font-size: 16px;
    color: var(--text-primary);
    margin-bottom: 12px;
    font-weight: 600;
}

.anticheat-player-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}

.anticheat-threat-level {
    font-weight: bold;
}

.anticheat-threat-low {
    color: #00ff88;
}

.anticheat-threat-medium {
    color: #ffaa00;
}

.anticheat-threat-high {
    color: #ff4444;
}

.anticheat-progress-bar {
    width: 60%;
    height: 8px;
    background: var(--bg-primary);
    border-radius: 4px;
    overflow: hidden;
}

.anticheat-progress-fill {
    height: 100%;
    transition: width 0.8s ease, background-color 0.8s ease;
}

/* Детали читов */
.anticheat-cheat-details {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    display: none;
}

.anticheat-player-item.expanded .anticheat-cheat-details {
    display: block;
}

.anticheat-cheat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 13px;
}

.anticheat-cheat-name {
    color: var(--text-secondary);
}

.anticheat-cheat-value {
    font-weight: bold;
}

/* Информационная панель */
.anticheat-info-panel {
    position: relative;
    z-index: 10;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    max-width: 400px;
    margin: 0 auto;
}

.anticheat-info-title {
    font-size: 14px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.anticheat-info-value {
    font-size: 32px;
    font-weight: bold;
    color: var(--accent);
}

/* Адаптация под мобильные */
@media (max-width: 768px) {
    .anticheat-rings {
        height: 200px;
        width: 200px;
    }

    .anticheat-ring {
        height: 200px;
        width: 200px;
    }

    .anticheat-rings-wrapper::before {
        width: 180px;
        height: 180px;
    }

    .anticheat-players-container {
        padding: 16px;
    }



    .anticheat-player-item {
        padding: 12px;
    }

    .anticheat-player-name {
        font-size: 14px;
    }

    .anticheat-player-stats {
        font-size: 12px;
    }

    .anticheat-info-value {
        font-size: 24px;
    }
}

/* ===
========== CHAT STYLES ============= */

.chat-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    height: 500px;
    display: flex;
    flex-direction: column;
    margin-bottom: 16px;
    overflow: hidden;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-message {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    animation: messageSlideIn 0.3s ease;
}

.chat-message.no-animation {
    animation: none;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.chat-message-author {
    font-weight: 600;
    color: var(--text-primary);
}

.chat-message-role {
    font-size: 12px;
    color: var(--text-secondary);
    margin-left: 8px;
}

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

.chat-message-text {
    color: var(--text-primary);
    line-height: 1.5;
    word-wrap: break-word;
}

.chat-message-mention {
    color: var(--accent);
    font-weight: 600;
}

.chat-all-mention {
    color: #ffaa00;
    font-weight: 700;
    background: rgba(255, 170, 0, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
}

.chat-input-container {
    display: flex;
    gap: 12px;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    width: 100%;
}

.chat-input {
    flex: 1;
    width: 100%;
    min-width: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 16px;
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.2s ease;
}

.chat-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.05);
}

.chat-send-btn {
    background: var(--accent);
    color: var(--bg-primary);
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chat-send-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
}

.chat-send-btn:active {
    transform: translateY(0);
}

/* Chat mute display */
.chat-mute-card {
    background: rgba(255, 68, 68, 0.1);
    border: 2px solid #ff4444;
    border-radius: 12px;
    padding: 32px;
    text-align: center;
    margin-bottom: 16px;
}

.mute-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.mute-title {
    font-size: 20px;
    font-weight: 700;
    color: #ff4444;
    margin-bottom: 16px;
}

.mute-timer {
    font-size: 24px;
    font-weight: 700;
    color: #ff4444;
    margin-bottom: 12px;
}

.mute-reason {
    font-size: 14px;
    color: var(--text-secondary);
    padding: 12px;
    background: var(--bg-card);
    border-radius: 8px;
}

/* ============= NOTIFICATION STYLES ============= */

.notification-badge {
    position: absolute;
    top: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    background: var(--accent);
    color: var(--bg-primary);
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
}

/* Show only in dashboards */
#ownerDashboard .notification-badge,
#adminDashboard .notification-badge {
    display: flex;
}

.notification-badge:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(255, 255, 255, 0.4);
}

.notification-badge:active {
    transform: translateY(-2px);
}

.notification-icon {
    position: relative;
}

.notification-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ff4444;
    color: white;
    font-size: 12px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

.notifications-list {
    display: grid;
    gap: 12px;
}

.notification-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.notification-item:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent);
    transform: translateY(-2px);
}

.notification-item.unread {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.05);
}

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

.notification-title {
    font-weight: 600;
    color: var(--text-primary);
}

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

.notification-message {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
}

.notification-type-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    margin-top: 8px;
}

.notification-type-mention {
    background: rgba(255, 170, 0, 0.2);
    color: #ffaa00;
}

.notification-type-system {
    background: rgba(0, 170, 255, 0.2);
    color: #00aaff;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .chat-container {
        height: 400px;
    }
    
    .notification-badge {
        bottom: 16px;
        right: 16px;
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
}


/* Chat autocomplete */
.chat-autocomplete {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px 8px 0 0;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.3);
}

.chat-autocomplete-item {
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-autocomplete-item:hover {
    background: var(--bg-secondary);
}

.chat-autocomplete-item.selected {
    background: var(--bg-secondary);
}

.chat-autocomplete-name {
    font-weight: 600;
    color: var(--text-primary);
}

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

.chat-autocomplete-command {
    font-family: 'Courier New', monospace;
    color: var(--accent);
}

.chat-autocomplete-desc {
    font-size: 12px;
    color: var(--text-secondary);
    margin-left: auto;
}


/* Color picker */
.form-color-input {
    width: 60px;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    background: var(--bg-secondary);
}

.form-color-input::-webkit-color-swatch-wrapper {
    padding: 4px;
}

.form-color-input::-webkit-color-swatch {
    border: none;
    border-radius: 4px;
}

/* Chat message preview */
.chat-message-preview {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    border-left: 3px solid #ffffff;
    transition: all 0.3s ease;
}

/* ============= TODO-ЛИСТЫ (features/todo.js) ============= */
.todo-dash { display: flex; flex-wrap: wrap; gap: 8px; margin: -4px 0 18px; }
.todo-dash:empty { display: none; }
.todo-dash-item { font-size: 12px; color: var(--text-secondary); background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px; }
.todo-dash-item strong { color: var(--text-primary); }
.todo-dash-mine { border-color: #6b7486; }

.todo-toolbar { display: flex; gap: 10px; margin-bottom: 14px; }
.todo-search { flex: 1; min-width: 0; }
.todo-toggle { background: var(--bg-card); color: var(--text-secondary); border: 1px solid var(--border); border-radius: 9px; padding: 0 16px; min-height: 42px; cursor: pointer; font-weight: 600; }
.todo-toggle.active { background: var(--accent); color: #15171b; border-color: var(--accent); }

.todo-lists { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 10px; margin-bottom: 8px; scrollbar-width: thin; align-items: stretch; }
.todo-list-card { --todo-tag: #d9dce2; flex: 0 0 auto; min-width: 150px; max-width: 230px; display: flex; flex-direction: column; gap: 6px; text-align: left; background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; color: var(--text-primary); cursor: pointer; transition: border-color 150ms, background-color 150ms; }
.todo-list-card:hover { background: var(--bg-card-hover); }
.todo-list-card.active { border-color: var(--todo-tag); box-shadow: inset 0 0 0 1px var(--todo-tag); }
.todo-list-name { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
.todo-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--todo-tag); flex: 0 0 auto; }
.todo-list-meta { font-size: 12px; color: var(--text-secondary); }
.todo-progress { height: 4px; background: var(--bg-secondary); border-radius: 2px; overflow: hidden; }
.todo-progress span { display: block; height: 100%; background: var(--todo-tag); border-radius: 2px; }
.todo-list-edit { flex: 0 0 auto; align-self: center; background: none; border: 1px dashed var(--border); color: var(--text-secondary); border-radius: 10px; padding: 10px 14px; cursor: pointer; }

.todo-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.todo-tab { --todo-status: var(--accent); flex: 0 0 auto; background: var(--bg-card); border: 1px solid var(--border); border-radius: 999px; color: var(--text-secondary); padding: 6px 12px; font-size: 13px; font-weight: 600; cursor: pointer; display: flex; align-items: center; gap: 8px; }
.todo-tab.active { color: var(--text-primary); border-color: var(--todo-status); background: color-mix(in srgb, var(--todo-status) 18%, var(--bg-card)); }
.todo-tab-count { font-size: 12px; background: var(--bg-secondary); border-radius: 999px; padding: 1px 8px; color: var(--text-secondary); }
.todo-tab.active .todo-tab-count { color: var(--text-primary); }

.todo-items { display: flex; flex-direction: column; gap: 10px; }
.todo-card { --todo-priority: #8a93a6; display: flex; align-items: stretch; background: var(--bg-card); border: 1px solid var(--border); border-left: 3px solid var(--todo-priority); border-radius: 12px; overflow: hidden; }
.todo-card-main { flex: 1; min-width: 0; background: none; border: none; color: var(--text-primary); text-align: left; padding: 12px 14px; cursor: pointer; display: flex; flex-direction: column; gap: 6px; }
.todo-card-main:hover { background: var(--bg-card-hover); }
.todo-card-top { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.todo-card-title { font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.todo-card-meta { font-size: 12px; color: var(--text-muted); }
.todo-advance { flex: 0 0 auto; background: var(--bg-secondary); border: none; border-left: 1px solid var(--border); color: var(--text-secondary); padding: 0 14px; font-size: 12px; font-weight: 600; cursor: pointer; max-width: 120px; }
.todo-advance:hover { color: var(--text-primary); background: var(--bg-card-hover); }

.todo-chip { --todo-tag: #d9dce2; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--text-primary); border: 1px solid var(--todo-tag); border-radius: 999px; padding: 1px 9px; background: color-mix(in srgb, var(--todo-tag) 14%, transparent); }
.todo-chip-pick { cursor: pointer; border-color: var(--border); background: var(--bg-secondary); }
.todo-chip-pick:hover { border-color: var(--accent); }
.todo-priority { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; color: var(--todo-priority, #8a93a6); }
.todo-status { font-size: 11px; font-weight: 600; border-radius: 6px; padding: 1px 7px; background: var(--bg-secondary); }

.todo-status-todo { --todo-status: #8a93a6; }
.todo-status-in_progress { --todo-status: #3e9cf0; }
.todo-status-review { --todo-status: #f5a524; }
.todo-status-done { --todo-status: #46a758; }
.todo-status, .todo-dash-item.todo-status-todo, .todo-dash-item.todo-status-in_progress, .todo-dash-item.todo-status-review, .todo-dash-item.todo-status-done { color: var(--todo-status); }
.todo-tab-todo { --todo-status: #8a93a6; }
.todo-tab-in_progress { --todo-status: #3e9cf0; }
.todo-tab-review { --todo-status: #f5a524; }
.todo-tab-done { --todo-status: #46a758; }
.todo-select { width: 100%; }

.todo-detail { display: flex; flex-direction: column; gap: 14px; }
.todo-detail-people { font-size: 13px; color: var(--text-secondary); line-height: 1.6; }
.todo-detail-people strong { color: var(--text-primary); }
.todo-description { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; font-size: 14px; }
.todo-status-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.todo-status-btn { background: var(--bg-secondary); border: 1px solid var(--border); color: var(--text-secondary); border-radius: 9px; padding: 9px 4px; font-size: 12px; font-weight: 600; cursor: pointer; }
.todo-status-btn.active { color: #15171b; background: var(--todo-status); border-color: var(--todo-status); }
.todo-detail-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.todo-danger { color: #ff8f8f; }
.todo-section-title { font-size: 13px; font-weight: 600; color: var(--text-secondary); margin-top: 4px; }
.todo-comment-box { display: flex; flex-direction: column; gap: 8px; }
.todo-comment-box .form-textarea { min-height: 70px; }
.todo-history { display: flex; flex-direction: column; gap: 8px; }
.todo-event { border-left: 2px solid var(--border); padding: 2px 0 2px 10px; }
.todo-event-comment { border-left-color: var(--accent); }
.todo-event-head { font-size: 12px; color: var(--text-muted); }
.todo-event-text { font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; }
.todo-muted { font-size: 13px; color: var(--text-muted); }

.todo-tag-picks { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.todo-form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0 12px; }
.todo-form-error { color: #ff8f8f; font-size: 13px; background: rgba(229, 72, 77, .12); border: 1px solid rgba(229, 72, 77, .35); border-radius: 8px; padding: 8px 12px; }
.todo-color-input { width: 64px; height: 40px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-secondary); padding: 2px; }

@media (max-width: 600px) {
    .todo-status-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .todo-advance { max-width: 92px; padding: 0 10px; }
    .todo-list-card { min-width: 132px; }
}

/* ЗБТ платформы VEORA (features/zbt.js) */
.zbt-hint { color: var(--text-secondary); font-size: 14px; margin: 0 0 16px; }
.zbt-projects { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 16px; }
.zbt-check { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-card); cursor: pointer; }
.zbt-check input { width: 18px; height: 18px; accent-color: var(--accent); }
.zbt-members { margin-top: 20px; }
.zbt-chip { display: inline-block; margin: 0 6px 6px 0; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border); font-size: 13px; }
