:root {
    --primary-color: #0084ff;
    --primary-hover: #0066cc;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-bg: #f8f9fa;
    --border-color: #dee2e6;
    --text-color: #212529;
    --text-muted: #6c757d;
    --shadow: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 12px rgba(0,0,0,0.15);
}

/* Toggle Switch Styles */
.toggle-container {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 10px 0;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: var(--success-color);
}

input:disabled + .toggle-slider {
    opacity: 0.5;
    cursor: not-allowed;
}

input:checked + .toggle-slider:before {
    transform: translateX(26px);
}

.toggle-status {
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 14px;
}

.toggle-status.status-enabled {
    background-color: #d4edda;
    color: #155724;
}

.toggle-status.status-disabled {
    background-color: #f8d7da;
    color: #721c24;
}

.settings-divider {
    height: 1px;
    background: var(--border-color);
    margin: 20px 0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--text-color);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    background: white;
    border-radius: 12px;
    padding: 20px 30px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-lg);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

h1 {
    font-size: 28px;
    color: var(--primary-color);
}

.server-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--light-bg);
    border-radius: 20px;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.status-indicator.online {
    background: var(--success-color);
}

.status-indicator.offline {
    background: var(--danger-color);
    animation: none;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Tabs */
.tabs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.tab {
    background: transparent;
    border: 2px solid transparent;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.3s ease;
    color: var(--text-muted);
}

.tab:hover {
    background: var(--light-bg);
    color: var(--text-color);
}

.tab.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Main Content */
main {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: var(--shadow-lg);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
    padding: 25px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    font-size: 48px;
}

.stat-value {
    font-size: 36px;
    font-weight: bold;
    line-height: 1;
}

.stat-label {
    font-size: 14px;
    opacity: 0.9;
    margin-top: 5px;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

@media (max-width: 968px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* Cards */
.card {
    background: var(--light-bg);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.card h2 {
    font-size: 20px;
    margin-bottom: 15px;
    color: var(--text-color);
}

/* Activity List */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.activity-icon {
    font-size: 24px;
}

.activity-text {
    flex: 1;
}

.activity-time {
    color: var(--text-muted);
    font-size: 13px;
}

/* Quick Actions */
.quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.btn-icon {
    background: transparent;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
    transition: transform 0.2s ease;
}

.btn-icon:hover {
    transform: scale(1.2);
}

.btn-icon.danger:hover {
    filter: brightness(1.2);
}

/* Toolbar */
.toolbar {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.search-input {
    flex: 1;
    min-width: 250px;
    padding: 10px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Tables */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

thead {
    background: var(--primary-color);
    color: white;
}

th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
}

td {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
}

tr:last-child td {
    border-bottom: none;
}

tbody tr:hover {
    background: var(--light-bg);
}

td.actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 40px;
    font-style: italic;
}

.error {
    color: var(--danger-color);
    text-align: center;
    padding: 20px;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.badge-aim {
    background: #0084ff;
    color: white;
}

.badge-icq {
    background: #28a745;
    color: white;
}

.badge-unified {
    background: linear-gradient(135deg, #0084ff 50%, #28a745 50%);
    color: white;
    font-weight: 600;
}

.badge-bot {
    background: #6c757d;
    color: white;
}

.badge-admin {
    background: #ffc107;
    color: #333;
    font-weight: 600;
}

.badge-user {
    background: #e9ecef;
    color: #495057;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
}

.badge-online {
    background: #d4edda;
    color: #155724;
    font-weight: 600;
}

.badge-offline {
    background: #e9ecef;
    color: #6c757d;
}

.user-online {
    background: linear-gradient(90deg, rgba(40, 167, 69, 0.05) 0%, transparent 100%);
}

.badge-discord {
    background: #5865F2;
    color: white;
    font-weight: 500;
}

.discord-link-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
    padding: 8px;
    background: rgba(88, 101, 242, 0.1);
    border-radius: 6px;
}

.discord-mini-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

/* Unified Account Styles */
.unified-account {
    background: linear-gradient(90deg, rgba(0, 132, 255, 0.05) 0%, rgba(40, 167, 69, 0.05) 100%);
}

.linked-identity {
    color: #6c757d;
    font-size: 0.85em;
}

/* Warning Level Bar */
.warning-level {
    display: flex;
    align-items: center;
    gap: 8px;
}

.warning-bar {
    height: 8px;
    background: var(--danger-color);
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary-color);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.toolbar-info {
    color: var(--text-muted);
    font-size: 14px;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s;
}

.modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 0;
    max-width: 500px;
    width: 90%;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    margin: 0;
    font-size: 18px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 32px;
    cursor: pointer;
    color: var(--text-muted);
    line-height: 1;
}

.modal-close:hover {
    color: var(--text-color);
}

.modal-content form {
    padding: 20px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-color);
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="number"] {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: var(--text-muted);
    font-size: 12px;
}

.form-group input[type="checkbox"] {
    margin-right: 8px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* Settings */
.settings-group {
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 1px solid var(--border-color);
}

.settings-group:last-child {
    border-bottom: none;
}

.settings-input {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    margin-top: 8px;
}

.settings-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.settings-help {
    margin-top: 8px;
    color: var(--text-muted);
    font-size: 13px;
}

.settings-textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    min-height: 120px;
    resize: vertical;
    margin-top: 8px;
}

.settings-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.card-description {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 20px;
}

.toggle-label-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.toggle-label-group strong {
    font-size: 15px;
}

.toggle-help {
    font-size: 13px;
    color: var(--text-muted);
}

/* API Key Styles */
.api-key-list {
    margin-bottom: 20px;
}

.api-key-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: var(--light-bg);
    border-radius: 8px;
    margin-bottom: 10px;
}

.api-key-info {
    flex: 1;
}

.api-key-name {
    font-weight: 600;
    font-size: 15px;
}

.api-key-scope {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 3px;
}

.api-key-value {
    font-family: monospace;
    font-size: 13px;
    background: white;
    padding: 5px 10px;
    border-radius: 4px;
    margin-right: 15px;
}

.api-key-actions {
    display: flex;
    gap: 10px;
}

.api-key-form {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.form-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.form-row .settings-input {
    flex: 1;
    min-width: 150px;
    margin-top: 0;
}

/* Banned Users Styles */
.banned-user-form {
    margin-bottom: 20px;
}

.banned-users-list {
    max-height: 400px;
    overflow-y: auto;
}

.banned-user-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: var(--light-bg);
    border-left: 4px solid var(--danger-color);
    border-radius: 0 8px 8px 0;
    margin-bottom: 10px;
}

.banned-user-info {
    flex: 1;
}

.banned-user-name {
    font-weight: 600;
}

.banned-user-reason {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 3px;
}

.banned-user-expires {
    font-size: 12px;
    color: var(--danger-color);
    margin-top: 3px;
}

.checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
    margin-top: 10px;
    padding: 15px;
    background: var(--bg-secondary);
    border-radius: 8px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
}

.checkbox-group label:hover {
    color: var(--primary-color);
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.info-grid {
    display: grid;
    gap: 15px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    padding: 12px;
    background: white;
    border-radius: 8px;
}

/* Notifications */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    transform: translateX(400px);
    transition: transform 0.3s ease;
    z-index: 2000;
    max-width: 350px;
}

.notification.show {
    transform: translateX(0);
}

.notification-success {
    background: var(--success-color);
}

.notification-error {
    background: var(--danger-color);
}

.notification-warning {
    background: var(--warning-color);
    color: var(--text-color);
}

.notification-info {
    background: var(--info-color);
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header {
        padding: 15px;
    }
    
    .header-content {
        flex-direction: column;
        gap: 15px;
    }
    
    main {
        padding: 15px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .quick-actions {
        grid-template-columns: 1fr;
    }
    
    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-input {
        min-width: 100%;
    }
    
    table {
        font-size: 13px;
    }
    
    th, td {
        padding: 10px;
    }
}

/* User Details Modal Styles */
.user-details {
    padding: 10px 0;
}

.detail-item {
    padding: 12px;
    margin-bottom: 8px;
    background: var(--light-bg);
    border-radius: 6px;
    border-left: 3px solid var(--primary-color);
}

.detail-item strong {
    display: inline-block;
    min-width: 140px;
    color: var(--text-color);
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

/* Modal content body - provide ample padding for non-form modals (user details, info) */
.modal-body {
    padding: 24px 30px;
    max-height: 500px;
    overflow-y: auto;
}

/* Server Control Styles */
.server-controls {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 15px;
}

.server-controls .btn {
    padding: 15px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.2s;
}

.server-controls .btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-success {
    background: var(--success-color);
    color: white;
    border: none;
}

.btn-success:hover {
    background: #218838;
}

.btn-warning {
    background: var(--warning-color);
    color: #212529;
    border: none;
}

.btn-warning:hover {
    background: #e0a800;
}

.server-control-status {
    padding: 12px;
    background: var(--light-bg);
    border-radius: 6px;
    text-align: center;
}

.server-control-status .info-text {
    color: var(--text-muted);
    font-size: 14px;
    margin: 0;
}

/* Checkbox Label */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 10px;
    background: var(--light-bg);
    border-radius: 6px;
    transition: background 0.2s;
}

.checkbox-label:hover {
    background: #e9ecef;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.checkbox-label span {
    font-weight: 500;
}

/* Discord Bridge Styles */
.discord-status {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--light-bg);
    border-radius: 8px;
    margin-bottom: 20px;
}

.discord-status .status-indicator {
    width: 14px;
    height: 14px;
}

.status-indicator.warning {
    background: var(--warning-color);
}

.button-group {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.commands-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.command-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 16px;
    background: var(--light-bg);
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.command-item code {
    font-family: 'Consolas', 'Monaco', monospace;
    background: #e9ecef;
    padding: 4px 10px;
    border-radius: 4px;
    color: #5865F2; /* Discord blurple */
    font-weight: 600;
    white-space: nowrap;
}

.command-item span {
    color: var(--text-muted);
    font-size: 14px;
}

/* Badge for ICQ type */
.badge-icq {
    background: #00cc00;
    color: white;
}

.badge-aim {
    background: #ffcc00;
    color: #333;
}

.badge-bot {
    background: #9b59b6;
    color: white;
}

.badge-admin {
    background: #e74c3c;
    color: white;
}

.badge-user {
    background: #95a5a6;
    color: white;
}

/* Code in tables */
td code {
    font-family: 'Consolas', 'Monaco', monospace;
    background: #e9ecef;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
}

/* Form improvements */
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    background: white;
}

.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 132, 255, 0.1);
}

/* Settings help link */
.settings-help a {
    color: var(--primary-color);
    text-decoration: none;
}

.settings-help a:hover {
    text-decoration: underline;
}
/* Logs Tab Styles */
.logs-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 15px;
}

.logs-header h2 {
    margin: 0;
}

.logs-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.logs-controls label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    white-space: nowrap;
}

.logs-controls select {
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 13px;
}

.logs-container {
    background: #1e1e1e;
    border-radius: 8px;
    padding: 15px;
    height: 600px;
    overflow-y: auto;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
}

.log-output {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.log-entry {
    display: grid;
    grid-template-columns: 90px 70px 1fr;
    gap: 12px;
    padding: 6px 10px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.log-entry:hover {
    background: rgba(255, 255, 255, 0.05);
}

.log-time {
    color: #858585;
    font-size: 12px;
}

.log-level {
    font-weight: 600;
    font-size: 12px;
    text-align: center;
    padding: 2px 8px;
    border-radius: 4px;
}

.log-message {
    color: #d4d4d4;
    word-break: break-word;
}

/* Log level colors */
.log-debug .log-level {
    background: #3a3a3a;
    color: #858585;
}

.log-info .log-level {
    background: #264f78;
    color: #4fc3f7;
}

.log-warn .log-level {
    background: #4d3800;
    color: #ffb74d;
}

.log-error .log-level {
    background: #5a1a1a;
    color: #f48771;
}

.log-debug .log-message {
    color: #858585;
}

.log-warn .log-message {
    color: #ffb74d;
}

.log-error .log-message {
    color: #f48771;
}

.logs-stats {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 15px;
    padding: 12px;
    background: var(--light-bg);
    border-radius: 6px;
    font-size: 13px;
}

.logs-stats strong {
    font-weight: 600;
}

.error-count {
    color: var(--danger-color);
}

.warn-count {
    color: var(--warning-color);
}

/* Log filter hidden state */
.log-entry.hidden {
    display: none;
}

/* ============================================
   Modern Create User Modal Styles
   ============================================ */

/* Modal size override for create user */
.modal-large {
    max-width: 800px !important;
    width: 90% !important;
}

/* Unified Account Toggle */
.unified-toggle-section {
    background: linear-gradient(135deg, rgba(127, 90, 240, 0.1), rgba(78, 205, 196, 0.1));
    border: 2px solid rgba(127, 90, 240, 0.3);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.unified-toggle-label {
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    user-select: none;
}

.toggle-checkbox {
    position: relative;
    width: 54px;
    height: 28px;
    background: #ccc;
    border-radius: 28px;
    transition: background 0.3s ease;
    flex-shrink: 0;
}

.toggle-checkbox::after {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: white;
    top: 3px;
    left: 3px;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.unified-toggle-label input[type="checkbox"] {
    display: none;
}

.unified-toggle-label input[type="checkbox"]:checked ~ .toggle-checkbox {
    background: var(--success-color);
}

.unified-toggle-label input[type="checkbox"]:checked ~ .toggle-checkbox::after {
    transform: translateX(26px);
}

.toggle-text {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.toggle-text strong {
    font-size: 1.1rem;
    color: var(--text-color);
}

.toggle-text small {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Identity Grid Layout */
.identity-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .identity-grid {
        grid-template-columns: 1fr;
    }
}

.identity-section {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.identity-section:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.aim-section {
    background: rgba(37, 99, 235, 0.05);
    border-color: rgba(37, 99, 235, 0.2);
}

.icq-section {
    background: rgba(124, 58, 237, 0.05);
    border-color: rgba(124, 58, 237, 0.2);
}

.identity-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.identity-icon {
    font-size: 1.5rem;
}

.identity-label {
    font-weight: 600;
    font-size: 1.05rem;
    flex: 1;
}

.field-hint {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.4rem;
}

/* Single Identity Section */
.single-identity-section {
    margin-bottom: 2rem;
}

/* Section Headers */
.section-divider {
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(0,0,0,0.1), transparent);
    margin: 1.5rem 0 1rem 0;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.section-icon {
    font-size: 1.3rem;
}

/* Password Section */
.password-section {
    margin-bottom: 1.5rem;
}

.password-requirements {
    margin-bottom: 0.75rem;
}

.password-requirements small {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: 6px;
    color: #856404;
    font-size: 0.85rem;
}

/* Password Strength Bar */
.password-strength {
    width: 100%;
    height: 6px;
    background: rgba(0, 0, 0, 0.08);
    border-radius: 3px;
    margin-top: 0.5rem;
    overflow: hidden;
}

.strength-bar {
    height: 100%;
    width: 0%;
    transition: all 0.3s ease;
    border-radius: 3px;
}

.strength-bar.weak {
    background: linear-gradient(90deg, #dc3545, #ff6b6b);
}

.strength-bar.medium {
    background: linear-gradient(90deg, #ffc107, #ffb74d);
}

.strength-bar.strong {
    background: linear-gradient(90deg, #28a745, #4caf50);
}

.password-char-count {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.4rem;
    text-align: right;
}

/* Email Section */
.email-section {
    margin-bottom: 1.5rem;
}

.email-section .section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.email-section .section-icon {
    font-size: 1.3rem;
}

.email-section .form-group input[type="email"] {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.email-section .form-group input[type="email"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 132, 255, 0.1);
}

.email-section .form-group input[type="email"]:invalid {
    border-color: var(--danger-color);
}

.email-section .field-hint {
    display: inline-block;
    margin-top: 0.4rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Validation Messages */
.validation-message {
    font-size: 0.85rem;
    margin-top: 0.4rem;
    padding: 0.3rem 0;
    min-height: 1.2rem;
}

.validation-message.error {
    color: var(--danger-color);
}

.validation-message.warning {
    color: var(--warning-color);
}

.validation-message.success {
    color: var(--success-color);
}

/* Additional Options */
.additional-options {
    margin-bottom: 2rem;
    padding: 1rem;
    background: var(--light-bg);
    border-radius: 8px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    user-select: none;
    font-size: 0.95rem;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Button Icon */
.btn-icon {
    margin-right: 0.5rem;
}

/* Form Group Enhancements for Modal */
#createUserModal .form-group input[type="text"],
#createUserModal .form-group input[type="password"] {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

#createUserModal .form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 132, 255, 0.1);
}

#createUserModal .form-group input:invalid {
    border-color: var(--danger-color);
}

/* Unified Account Badge Enhancement */
.badge-unified {
    background: linear-gradient(135deg, #7f5af0, #4ecdc4);
    color: white;
}

/* Account Type Options Section */
.account-type-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 8px;
    border-left: 3px solid var(--primary-color);
}

.account-type-section .checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-color);
}

.account-type-section .checkbox-label input[type="checkbox"] {
    cursor: pointer;
}

.account-type-section .checkbox-label:hover {
    color: var(--primary-color);
}

/* End Modern Create User Modal Styles */