.container {
    width: 100%;
}

.header {
    position: relative;
}

.header.fixed {
    width: 100%;
}

.back-btn {
    position: absolute;
    top: 14px;
    left: 14px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.3s;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.content {
    padding: 20px;
    max-width: 1100px;
    margin: 0 auto;
}

.section {
    margin-bottom: 30px;
    padding: 20px;
    background: white;
    border-radius: 12px;
}

.section h2 {
    color: #333;
    margin-bottom: 15px;
    font-size: 20px;
    border-bottom: 2px solid var(--color-primary);
    padding-bottom: 10px;
}

.model-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    border: 2px solid #e0e0e0;
    transition: all 0.3s;
}

.model-card:hover {
    border-color: var(--color-primary);
    box-shadow: 0 4px 12px rgba(45, 106, 79, 0.15);
}

.model-card.disabled {
    opacity: 0.6;
    border-color: #dc3545;
}

.model-card.temp-disabled {
    border-color: #ffc107;
    background: #fff8e1;
}

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

.model-name {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.model-status {
    display: flex;
    gap: 8px;
}

.status-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge.enabled {
    background: #d4edda;
    color: #155724;
}

.status-badge.disabled {
    background: #f8d7da;
    color: #721c24;
}

.status-badge.temp-disabled {
    background: #fff3cd;
    color: #856404;
}

.status-badge.default {
    background: #cce5ff;
    color: #004085;
}

.model-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.field-group {
    display: flex;
    flex-direction: column;
}

.field-group label {
    font-size: 12px;
    color: #666;
    margin-bottom: 4px;
}

.field-group input,
.field-group select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.model-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.add-model-btn {
    width: 100%;
    padding: 15px;
    background: var(--color-tint);
    color: var(--color-primary-dark);
    border: 2px dashed var(--color-primary-light);
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    margin-top: 15px;
}

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

.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    padding: 15px 0;
    position: sticky;
    top: 0;
    background: #f8f9fa;
    z-index: 100;
    border-bottom: 1px solid #e0e0e0;
}

.tab {
    padding: 10px 20px;
    background: #e9ecef;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.tab.active {
    background: var(--color-primary-gradient);
    color: white;
}

.tab-content {
    display: none;
}

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

.mapping-card {
    background: white;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    border: 1px solid #e0e0e0;
}

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

.mapping-task {
    font-weight: 600;
    color: #333;
}

.model-checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.model-checkbox {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background: #f8f9fa;
    border-radius: 6px;
    cursor: pointer;
}

.model-checkbox input {
    cursor: pointer;
}

.model-checkbox.selected {
    background: var(--color-tint);
    border: 1px solid var(--color-primary);
}

.collapse-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    color: var(--color-primary);
    padding: 5px 10px;
}

.collapse-content {
    display: none;
    padding-top: 15px;
}

.collapse-content.show {
    display: block;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.stat-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
}

.stat-value {
    font-size: 24px;
    font-weight: 600;
    color: var(--color-primary);
}

.stat-label {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

.stats-row {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.stat-card {
    flex: 1;
    background: white;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.stat-card .stat-value {
    font-size: 32px;
    font-weight: 700;
    color: #333;
}

.stat-card .stat-value.online {
    color: #28a745;
}

.stat-card .stat-value.banned {
    color: #dc3545;
}

.users-subtabs {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.subtab {
    padding: 8px 16px;
    background: #e9ecef;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.3s;
}

.subtab.active {
    background: var(--color-primary);
    color: white;
}

.users-subcontent {
    display: none;
}

.users-subcontent.active {
    display: block;
}

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

.users-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

.users-table th,
.users-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.users-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
    font-size: 13px;
}

.users-table tr:hover {
    background: #f8f9fa;
}

.users-table .status-online {
    color: #28a745;
    font-weight: 500;
}

.users-table .status-offline {
    color: #6c757d;
}

.users-table .status-banned {
    color: #dc3545;
    font-weight: 500;
}

.users-table .actions {
    display: flex;
    gap: 8px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 4px;
}

.btn-danger {
    background: #dc3545;
    color: white;
    border: none;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-warning {
    background: #ffc107;
    color: #333;
    border: none;
}

.btn-warning:hover {
    background: #e0a800;
}

.btn-success {
    background: #28a745;
    color: white;
    border: none;
}

.btn-success:hover {
    background: #218838;
}

.btn-secondary {
    background: #6c757d;
    color: white;
    border: none;
}

.btn-secondary:hover {
    background: #5a6268;
}

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

.action-badge.login {
    background: #d4edda;
    color: #155724;
}

.action-badge.logout {
    background: #f8d7da;
    color: #721c24;
}

.action-badge.force_logout {
    background: #fff3cd;
    color: #856404;
}

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

.role-badge.admin {
    background: var(--color-primary);
    color: white;
}

.role-badge.user {
    background: #e9ecef;
    color: #333;
}

.online-indicator {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.online-indicator::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #6c757d;
}

.online-indicator.active::before {
    background: #28a745;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.4);
    }
    70% {
        box-shadow: 0 0 0 6px rgba(40, 167, 69, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0);
    }
}

.logs-filter {
    background: white;
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.filter-row {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.filter-group label {
    font-size: 12px;
    color: #666;
}

.filter-group select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    min-width: 150px;
}

.logs-stats {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.logs-stats .stat-card {
    flex: 1;
    background: white;
    padding: 15px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.logs-stats .stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #333;
}

.logs-stats .stat-value.error {
    color: #dc3545;
}

.logs-stats .stat-value.warn {
    color: #ffc107;
}

.logs-table-container {
    overflow-x: auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

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

.logs-table th,
.logs-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.logs-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
    font-size: 13px;
    position: sticky;
    top: 0;
}

.logs-table tr:hover {
    background: #f8f9fa;
}

.logs-table tr.level-error {
    background: #fff5f5;
}

.logs-table tr.level-error:hover {
    background: #ffe8e8;
}

.logs-table tr.level-warn {
    background: #fffdf5;
}

.logs-table tr.level-warn:hover {
    background: #fff8e8;
}

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

.log-badge.level-info {
    background: var(--color-tint);
    color: #004085;
}

.log-badge.level-warn {
    background: #fff3cd;
    color: #856404;
}

.log-badge.level-error {
    background: #f8d7da;
    color: #721c24;
}

.log-badge.category-system {
    background: #e2e3e5;
    color: #383d41;
}

.log-badge.category-auth {
    background: #d4edda;
    color: #155724;
}

.log-badge.category-translate {
    background: #cce5ff;
    color: #004085;
}

.log-badge.category-model {
    background: #e0f2f1;
    color: #00695c;
}

.log-badge.category-user {
    background: #fff0e6;
    color: #8a4a00;
}

.log-badge.category-error {
    background: #f8d7da;
    color: #721c24;
}

.log-message {
    max-width: 400px;
    word-break: break-word;
}

.logs-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
    padding: 15px;
    background: white;
    border-radius: 12px;
}

.logs-pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#logsPageInfo {
    color: #666;
    font-size: 14px;
}

.btn-link {
    background: none;
    border: none;
    color: var(--color-primary);
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
}

.btn-link:hover {
    color: var(--color-primary-dark);
}

.save-tip {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    transition: all 0.3s;
    min-width: 100px;
    text-align: center;
}

.save-tip.success {
    background: #d4edda;
    color: #155724;
}

.save-tip.error {
    background: #f8d7da;
    color: #721c24;
}

.save-tip.warning {
    background: #fff3cd;
    color: #856404;
}

.disabled-section {
    pointer-events: none;
    opacity: 0.5;
    background: #f5f5f5;
    border-radius: 12px;
    padding: 20px;
    margin-top: 15px;
}

.disabled-section.enabled {
    pointer-events: auto;
    opacity: 1;
    background: transparent;
}

@media (max-width: 768px) {
    .content {
        padding: 12px;
    }

    .section {
        padding: 15px;
        border-radius: 10px;
    }

    .tabs {
        gap: 6px;
        padding: 10px 0;
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .tab {
        padding: 8px 14px;
        font-size: 13px;
        white-space: nowrap;
    }

    .stats-row,
    .logs-stats {
        flex-direction: column;
    }

    .filter-row {
        flex-direction: column;
    }

    .users-subtabs {
        overflow-x: auto;
    }

    .model-fields {
        grid-template-columns: 1fr;
    }

    .back-btn {
        top: 10px;
        left: 10px;
        padding: 5px 10px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .content {
        padding: 10px;
    }

    .section h2 {
        font-size: 17px;
    }

    .stat-card .stat-value {
        font-size: 26px;
    }
}
