/* ==================== IMPORTAR FONTES ==================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ==================== RESET & VARIÁVEIS ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #f59e0b;
    --primary-dark: #d97706;
    --primary-light: #fbbf24;
    --gold: #eab308;
    
    --bg-dark-1: #0f172a;
    --bg-dark-2: #1e293b;
    --bg-dark-3: #334155;
    --bg-dark-4: #475569;
    
    --bg-primary: #1a1f2e;
    --bg-secondary: #242b3d;
    --bg-tertiary: #2d3548;

    --error: #ef4444;

    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    
    --border-color: rgba(255, 255, 255, 0.1);
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, var(--bg-dark-1) 0%, var(--bg-dark-2) 50%, var(--bg-dark-3) 100%);
    min-height: 100vh;
    color: var(--text-primary);
    overflow: hidden;
}

/* ==================== SCROLLBAR ==================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ==================== LOGIN PAGE ==================== */
body:not(.chat-body) {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

body:not(.chat-body)::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(245, 158, 11, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(234, 179, 8, 0.08) 0%, transparent 50%);
    animation: pulse 8s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.login-box {
    background: rgba(30, 41, 59, 0.85);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    padding: 40px;
    width: 100%;
    max-width: 420px;
    animation: slideUp 0.6s ease-out;
    position: relative;
}

.login-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--primary), var(--gold), transparent);
    border-radius: 24px 24px 0 0;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    text-align: center;
    margin-bottom: 35px;
}

.logo-container {
    margin-bottom: 24px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.logo {
    width: 100px;
    height: auto;
    display: block;
    margin: 0 auto;
    filter: drop-shadow(0 0 20px rgba(245, 158, 11, 0.5));
}

.login-header h1 {
    font-size: 28px;
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.login-header p {
    color: var(--text-muted);
    font-size: 14px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 14px;
    transition: color 0.3s;
}

.form-group label svg {
    color: var(--primary);
    transition: transform 0.3s;
}

.form-group:hover label svg {
    transform: scale(1.1);
}

.form-group input {
    width: 100%;
    padding: 14px 16px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 14px;
    color: var(--text-primary);
    transition: all 0.3s;
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.form-group input:focus {
    outline: none;
    background: rgba(15, 23, 42, 0.8);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1), 0 0 20px rgba(245, 158, 11, 0.2);
    transform: translateY(-2px);
}

.form-group input:hover:not(:focus) {
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-login {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--gold) 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
    position: relative;
    overflow: hidden;
}

.btn-login::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.btn-login:hover::before {
    left: 100%;
}

.btn-login:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--gold) 0%, var(--primary) 100%);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(245, 158, 11, 0.6);
}

.btn-login:active:not(:disabled) {
    transform: translateY(-1px);
}

.btn-login:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-login svg {
    transition: transform 0.3s;
}

.btn-login:hover:not(:disabled) svg {
    transform: translateX(5px);
}

.erro-mensagem {
    background: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 16px;
    font-size: 14px;
    border-left: 4px solid var(--danger);
    backdrop-filter: blur(10px);
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.login-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
}

.login-footer svg {
    color: var(--primary);
}

.login-footer small {
    font-size: 13px;
}

/* ==================== CHAT LAYOUT ==================== */
.chat-body {
    overflow: hidden;
}

.chat-container-main {
    display: flex;
    height: 100vh;
    background: var(--bg-dark-1);
}

.chat-container {
    display: flex;
    height: 100vh;
    background: var(--bg-primary);
}

/* ==================== SIDEBAR ==================== */
.chat-sidebar {
    width: 300px;
    background: var(--bg-dark-2);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    text-align: center;
}

.sidebar-logo {
    margin-bottom: 12px;
}

.logo-img {
    width: 60px;
    height: auto;
    filter: drop-shadow(0 0 10px rgba(245, 158, 11, 0.5));
}

.logo-placeholder {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary), var(--gold));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    margin: 0 auto;
}

.sidebar-title {
    font-size: 20px;
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

.user-profile-card {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-profile-avatar {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary), var(--gold));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.4);
}

.user-profile-info {
    flex: 1;
    min-width: 0;
}

.user-profile-name {
    display: block;
    font-size: 16px;
    color: var(--text-primary);
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.online-users-section {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.chats-section {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
    font-weight: 600;
}

.section-title svg {
    color: var(--primary);
}

.online-users-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.online-user-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    transition: all 0.3s;
    position: relative;
    cursor: pointer;
}

.online-user-item:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateX(4px);
}

.online-user-item:active {
    transform: scale(0.98);
}

.online-user-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--bg-dark-3), var(--bg-dark-4));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    flex-shrink: 0;
}

.online-user-info {
    flex: 1;
    min-width: 0;
}

.online-user-name {
    display: block;
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

.status-indicator-dot {
    width: 10px;
    height: 10px;
    background: var(--success);
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 10px var(--success);
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.sidebar-buttons {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-admin,
.btn-logout-sidebar,
.btn-logout {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s;
}

.btn-admin {
    background: rgba(245, 158, 11, 0.15);
    color: var(--primary-light);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.btn-admin:hover {
    background: rgba(245, 158, 11, 0.25);
    transform: translateY(-2px);
}

.btn-logout-sidebar,
.btn-logout {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-logout-sidebar:hover,
.btn-logout:hover {
    background: rgba(239, 68, 68, 0.25);
    transform: translateY(-2px);
}

/* ==================== CARGO BADGES ==================== */
.cargo-badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
}

.cargo-recepcionista { background: #dbeafe; color: #1e40af; }
.cargo-gerente { background: #fef3c7; color: #92400e; }
.cargo-dono { background: #fce7f3; color: #9f1239; }
.cargo-ti { background: #e0e7ff; color: #3730a3; }
.cargo-financeiro { background: #d1fae5; color: #065f46; }
.cargo-governança { background: #ede9fe; color: #5b21b6; }
.cargo-manutenção { background: #fed7aa; color: #9a3412; }
.cargo-garçom { background: #ccfbf1; color: #115e59; }

/* ==================== CHAT MAIN ==================== */
.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-dark-1);
    position: relative;
}

.chat-main-header {
    padding: 20px 24px;
    background: var(--bg-dark-2);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 80px;
}

.chat-title {
    font-size: 24px;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.typing-indicator,
.typing-indicator-privado {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 14px;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: var(--primary);
    border-radius: 50%;
    animation: typing-dot 1.4s infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing-dot {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-10px);
    }
}

/* ==================== MESSAGES ==================== */
.messages-container,
.messages-container-privado {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: var(--bg-dark-1);
}

.welcome-message {
    text-align: center;
    padding: 60px 20px;
}

.welcome-icon {
    font-size: 64px;
    margin-bottom: 20px;
    animation: float 3s ease-in-out infinite;
}

.welcome-message h3 {
    font-size: 24px;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.welcome-message p {
    color: var(--text-muted);
    font-size: 16px;
}

.message-item {
    display: flex;
    gap: 12px;
    animation: messageSlide 0.3s ease-out;
    max-width: 70%;
    align-items: flex-end;
}

@keyframes messageSlide {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-other {
    align-self: flex-start;
}

.message-own {
    flex-direction: row-reverse;
    align-self: flex-end;
}

.message-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--bg-dark-3), var(--bg-dark-4));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    flex-shrink: 0;
}

.message-own .message-avatar {
    background: linear-gradient(135deg, var(--primary), var(--gold));
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.4);
}

.message-bubble {
    max-width: 100%;
    background: var(--bg-dark-2);
    border-radius: 16px;
    padding: 12px 16px;
    box-shadow: var(--shadow);
}

.message-own .message-bubble {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(234, 179, 8, 0.15));
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.message-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.message-author {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.message-time,
.message-time-own {
    font-size: 12px;
    color: var(--text-muted);
}

.message-time-own {
    text-align: right;
    margin-top: 6px;
}

.message-text {
    color: var(--text-primary);
    font-size: 15px;
    line-height: 1.5;
    word-wrap: break-word;
}

.message-footer-own {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    margin-top: 4px;
}

.check-sent {
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 700;
}

.check-read {
    color: #3b82f6;
    font-size: 14px;
    font-weight: 700;
    animation: checkBounce 0.3s ease-out;
}

@keyframes checkBounce {
    0% { transform: scale(0.8); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* ==================== CHAT INPUT ==================== */
.chat-input-container {
    padding: 20px 24px;
    background: var(--bg-dark-2);
    border-top: 1px solid var(--border-color);
}

.chat-form {
    display: flex;
    gap: 12px;
    align-items: center;
}

.chat-input {
    flex: 1;
    padding: 14px 18px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 15px;
    color: var(--text-primary);
    transition: all 0.3s;
}

.chat-input::placeholder {
    color: var(--text-muted);
}

.chat-input:focus {
    outline: none;
    background: rgba(15, 23, 42, 0.8);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
}

.btn-anexo {
    width: 44px;
    height: 44px;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 10px;
    color: var(--primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    flex-shrink: 0;
}

.btn-anexo:hover {
    background: rgba(245, 158, 11, 0.2);
    transform: translateY(-2px);
}

.btn-send {
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, var(--primary), var(--gold));
    border: none;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
    flex-shrink: 0;
}

.btn-send:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.5);
}

.btn-send:active {
    transform: translateY(0) scale(1);
}

.btn-send svg {
    color: white;
}

/* ==================== PREVIEW & ANEXOS ==================== */
.preview-anexo {
    padding: 16px;
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid var(--border-color);
}

.preview-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.preview-image {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
    object-fit: contain;
}

.preview-file {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
}

.preview-file svg {
    color: var(--primary);
    flex-shrink: 0;
}

.preview-file strong {
    display: block;
    color: var(--text-primary);
    font-size: 14px;
    margin-bottom: 4px;
}

.preview-file span {
    display: block;
    color: var(--text-muted);
    font-size: 12px;
}

.preview-actions {
    display: flex;
    gap: 8px;
}

.btn-preview-cancel,
.btn-preview-send {
    flex: 1;
    padding: 10px 16px;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-preview-cancel {
    background: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-preview-cancel:hover {
    background: rgba(239, 68, 68, 0.2);
}

.btn-preview-send {
    background: linear-gradient(135deg, var(--primary), var(--gold));
    color: white;
}

.btn-preview-send:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

.message-attachment {
    margin-top: 8px;
}

.message-image {
    max-width: 300px;
    max-height: 400px;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.3s;
    display: block;
}

.message-image:hover {
    transform: scale(1.02);
}

.message-file {
    background: rgba(255, 255, 255, 0.05);
    padding: 12px 16px;
    border-radius: 10px;
    border-left: 3px solid var(--primary);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 280px;
}

.message-file-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.message-file-info {
    flex: 1;
    min-width: 0;
}

.message-file-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.message-file-size {
    font-size: 12px;
    color: var(--text-muted);
}

.message-file-download {
    background: rgba(245, 158, 11, 0.15);
    color: var(--primary);
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid rgba(245, 158, 11, 0.3);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s;
    flex-shrink: 0;
}

.message-file-download:hover {
    background: rgba(245, 158, 11, 0.25);
    transform: translateY(-2px);
}

.message-bubble:has(.message-attachment):not(:has(.message-text)) {
    background: transparent;
    padding: 8px;
}

/* ==================== CONVERSAS ==================== */
.chat-geral-item,
.chat-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 8px;
}

.chat-geral-item:hover,
.chat-item:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(4px);
}

.chat-item-avatar {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary), var(--gold));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.chat-item-info {
    flex: 1;
    min-width: 0;
}

.chat-item-info strong {
    display: block;
    font-size: 15px;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.chat-item-desc {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
}

.conversas-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.conversa-item {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    transition: all 0.3s;
}

.conversa-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.conversa-conteudo {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    cursor: pointer;
}

.conversa-avatar {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary), var(--gold));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.conversa-info {
    flex: 1;
    min-width: 0;
}

.conversa-info strong {
    display: block;
    font-size: 15px;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.btn-remover-conversa {
    width: 32px;
    height: 32px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    color: #fca5a5;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s;
    flex-shrink: 0;
}

.conversa-item:hover .btn-remover-conversa {
    opacity: 1;
}

.btn-remover-conversa:hover {
    background: rgba(239, 68, 68, 0.2);
    transform: scale(1.1);
}

.online-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.online-user:hover {
    background: rgba(255, 255, 255, 0.05);
}

.badge-notif {
    background: var(--error);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    min-width: 20px;
    text-align: center;
}

.badge-msg-nao-lida {
    background: var(--error);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    min-width: 18px;
    text-align: center;
}

/* ==================== WELCOME SCREEN ==================== */
.welcome-screen {
    display: none;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 40px;
    text-align: center;
    background: var(--bg-primary);
}

.welcome-screen.active {
    display: flex;
}

.welcome-content {
    max-width: 500px;
}

.welcome-logo {
    margin-bottom: 24px;
}

.welcome-logo svg {
    color: var(--primary);
    filter: drop-shadow(0 0 20px rgba(245, 158, 11, 0.3));
}

.welcome-screen h1 {
    font-size: 32px;
    color: var(--text-primary);
    margin-bottom: 12px;
    background: linear-gradient(135deg, var(--primary), var(--gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.welcome-screen p {
    font-size: 16px;
    color: var(--text-muted);
    margin-bottom: 40px;
}

.welcome-features {
    display: flex;
    flex-direction: column;
    gap: 16px;
    text-align: left;
}

.welcome-feature {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    border-left: 3px solid var(--primary);
}

.feature-icon {
    font-size: 24px;
}

.chat-view {
    display: none;
    flex-direction: column;
    height: 100%;
}

.chat-view.active {
    display: flex;
}

.btn-voltar {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.3s;
}

.btn-voltar:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.chat-header-avatar {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary), var(--gold));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.chat-subtitle-cargo {
    font-size: 13px;
    color: var(--text-muted);
}

/* ==================== MODAL ==================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

.modal-dialog {
    background: var(--bg-dark-2);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: modalSlide 0.3s ease-out;
}

@keyframes modalSlide {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-dialog-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-dialog-header h2 {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 24px;
    color: var(--text-primary);
}

.btn-close-modal {
    width: 40px;
    height: 40px;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 10px;
    color: #fca5a5;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.btn-close-modal:hover {
    background: rgba(239, 68, 68, 0.25);
    transform: rotate(90deg);
}

.modal-dialog-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.modal-section {
    background: rgba(255, 255, 255, 0.03);
    padding: 24px;
    border-radius: 16px;
    margin-bottom: 24px;
}

.form-field {
    margin-bottom: 20px;
}

.form-field label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.form-field input,
.form-field select {
    width: 100%;
    padding: 12px 14px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 14px;
    color: var(--text-primary);
    transition: all 0.3s;
}

.form-field input:focus,
.form-field select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
}

.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.alert-error,
.alert-success {
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
    border-left: 4px solid var(--danger);
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: #6ee7b7;
    border-left: 4px solid var(--success);
}

.btn-create-user {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--primary), var(--gold));
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.btn-create-user:hover {
    background: linear-gradient(135deg, var(--gold), var(--primary));
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.5);
}

.users-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.user-list-card {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    transition: all 0.3s;
}

.user-list-card:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateX(4px);
}

.user-list-avatar {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary), var(--gold));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.user-list-details {
    flex: 1;
}

.user-list-name {
    font-size: 16px;
    color: var(--text-primary);
}

.user-list-email {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

/* ==================== PAINEL ADMIN ==================== */
.admin-container {
    display: flex;
    height: 100vh;
    background: var(--bg-primary);
}

.admin-sidebar {
    width: 280px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    padding: 24px;
    display: flex;
    flex-direction: column;
}

.admin-main {
    flex: 1;
    overflow-y: auto;
    padding: 24px 40px;
    width: 100%;
}

.admin-tabs {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.admin-tab {
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid transparent;
    border-radius: 10px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
}

.admin-tab:hover {
    background: rgba(255, 255, 255, 0.05);
}

.admin-tab.active {
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.3);
    color: var(--primary);
}

.admin-content {
    display: none;
}

.admin-content.active {
    display: block;
}

.admin-header {
    margin-bottom: 32px;
}

.admin-header h1 {
    font-size: 28px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.admin-header p {
    color: var(--text-muted);
}

.users-table {
    background: var(--bg-secondary);
    border-radius: 12px;
    overflow: hidden;
}

.table-header {
    display: grid;
    grid-template-columns: 1.2fr 1.5fr 1fr 1fr auto;
    gap: 16px;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    font-size: 13px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.table-row {
    display: grid;
    grid-template-columns: 1.2fr 1.5fr 1fr 1fr auto;
    gap: 16px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    align-items: center;
}

.table-row:last-child {
    border-bottom: none;
}

.btn-view-profile {
    padding: 8px 16px;
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 8px;
    color: var(--primary);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-view-profile:hover {
    background: rgba(245, 158, 11, 0.25);
    transform: translateY(-2px);
}

.btn-edit-user {
    padding: 8px 16px;
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 8px;
    color: #93c5fd;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-edit-user:hover {
    background: rgba(59, 130, 246, 0.25);
    transform: translateY(-2px);
}

.ultimo-acesso {
    font-size: 12px;
    color: var(--text-muted);
}

.ultimo-acesso.online {
    color: var(--success);
    font-weight: 600;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 32px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: modalSlide 0.3s ease-out;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.modal-header h2 {
    font-size: 24px;
    color: var(--text-primary);
}

.btn-close {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.btn-close:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

.profile-field {
    margin-bottom: 20px;
}

.profile-field label {
    display: block;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.profile-field-value {
    background: rgba(255, 255, 255, 0.03);
    padding: 12px 16px;
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-copy {
    padding: 6px 12px;
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 6px;
    color: var(--primary);
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s;
}

.btn-copy:hover {
    background: rgba(245, 158, 11, 0.25);
}

.btn-change-password {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, var(--primary), var(--gold));
    border: none;
    border-radius: 10px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-change-password:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

.password-form {
    display: none;
    margin-top: 20px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
}

.password-form.active {
    display: block;
}

.btn-save-password {
    width: 100%;
    padding: 12px;
    background: var(--success);
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    margin-top: 16px;
}

.cargos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.cargo-card {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cargo-card strong {
    color: var(--text-primary);
    font-size: 16px;
}

.btn-delete-cargo {
    width: 32px;
    height: 32px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    color: #fca5a5;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.btn-delete-cargo:hover {
    background: rgba(239, 68, 68, 0.2);
    transform: scale(1.1);
}

.btn-add-cargo {
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--primary), var(--gold));
    border: none;
    border-radius: 10px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.btn-add-cargo:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .chat-sidebar {
        width: 100%;
        position: absolute;
        z-index: 100;
        height: 100%;
    }
    
    .chat-main {
        width: 100%;
    }
    
    .message-item {
        max-width: 85%;
    }
    
    .form-grid-2 {
        grid-template-columns: 1fr;
    }
    
    .table-header,
    .table-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .admin-container {
        flex-direction: column;
    }
    
    .admin-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
}

/* ==================== PAINEL ADMIN MODERNO ==================== */

/* Logo Container */
.admin-logo-container {
    text-align: center;
    padding: 32px 20px;
    border-bottom: 1px solid var(--border-color);
}

.admin-logo {
    width: 120px;
    height: auto;
    display: block;
    margin: 0 auto;
    filter: drop-shadow(0 0 20px rgba(245, 158, 11, 0.5));
    transition: transform 0.3s;
}

.admin-logo:hover {
    transform: scale(1.05);
}

.admin-logo-placeholder {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary), var(--gold));
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    margin: 0 auto;
    box-shadow: 0 8px 32px rgba(245, 158, 11, 0.4);
    animation: float 3s ease-in-out infinite;
}

/* Título do Admin */
.admin-title {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border-color);
}

.admin-title h2 {
    font-size: 20px;
    color: var(--text-primary);
    margin-bottom: 6px;
    font-weight: 700;
}

.admin-title p {
    font-size: 13px;
    color: var(--text-muted);
}

/* Navegação Moderna */
.admin-nav {
    flex: 1;
    padding: 24px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.admin-nav-btn {
    position: relative;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid transparent;
    border-radius: 12px;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.3s;
    overflow: hidden;
}

.admin-nav-btn svg {
    flex-shrink: 0;
}

.admin-nav-btn span {
    flex: 1;
}

.admin-nav-btn .nav-indicator {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%) scaleY(0);
    width: 4px;
    height: 24px;
    background: linear-gradient(135deg, var(--primary), var(--gold));
    border-radius: 0 4px 4px 0;
    transition: transform 0.3s;
}

.admin-nav-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    transform: translateX(4px);
}

.admin-nav-btn.active {
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.3);
    color: var(--primary);
}

.admin-nav-btn.active .nav-indicator {
    transform: translateY(-50%) scaleY(1);
}

/* Botão Voltar */
.admin-back-btn {
    margin: 12px;
    padding: 16px 20px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 12px;
    color: #fca5a5;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.3s;
    position: relative;
    z-index: 10;
    pointer-events: auto;
}

.admin-back-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    transform: translateY(-2px);
}

/* Header da Página */
.admin-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    flex-wrap: wrap;
    gap: 20px;
}

.admin-page-header h1 {
    font-size: 32px;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-weight: 700;
}

.admin-page-header p {
    color: var(--text-muted);
    font-size: 15px;
}

/* Grid de Usuários (Cards) */
.users-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
}

.user-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    transition: all 0.3s;
    opacity: 0;
    animation: slideInUp 0.4s ease-out forwards;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    border-color: rgba(245, 158, 11, 0.3);
}

.user-card-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.user-card-avatar {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--primary), var(--gold));
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 8px 24px rgba(245, 158, 11, 0.4);
}

.user-card-info {
    flex: 1;
    min-width: 0;
}

.user-card-info h3 {
    font-size: 18px;
    color: var(--text-primary);
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 600;
}

.user-card-info p {
    font-size: 14px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-card-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 20px;
}

.user-card-field {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.field-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.field-label svg {
    color: var(--primary);
}

/* Status Online/Offline */
.status-online {
    color: var(--success);
    font-weight: 600;
    font-size: 14px;
}

.status-recent {
    color: #3b82f6;
    font-weight: 600;
    font-size: 14px;
}

.status-today {
    color: var(--primary);
    font-weight: 600;
    font-size: 14px;
}

.status-yesterday {
    color: #a78bfa;
    font-weight: 600;
    font-size: 14px;
}

.status-week {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 14px;
}

.status-old {
    color: var(--text-muted);
    font-size: 13px;
}

.status-offline {
    color: var(--danger);
    font-weight: 600;
    font-size: 14px;
}

.user-card-footer {
    display: flex;
    gap: 12px;
}

.btn-card-action {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--gold));
    color: white;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.5);
}

/* Botão Adicionar Moderno */
.btn-add-modern {
    padding: 14px 28px;
    background: linear-gradient(135deg, var(--primary), var(--gold));
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
    position: relative;
    z-index: 10;
    pointer-events: auto;
}

.btn-add-modern:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.5);
}

/* Grid de Cargos Moderno */
.cargos-grid-modern {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.cargo-card-modern {
    position: relative;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 32px 24px;
    text-align: center;
    transition: all 0.3s;
}

.cargo-card-modern:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border-color: rgba(245, 158, 11, 0.3);
}

.cargo-card-icon {
    width: 64px;
    height: 64px;
    background: rgba(245, 158, 11, 0.15);
    border: 2px solid rgba(245, 158, 11, 0.3);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    color: var(--primary);
}

.cargo-card-modern h3 {
    font-size: 18px;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-weight: 600;
}

.btn-delete-modern {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    color: #fca5a5;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    opacity: 0;
}

.cargo-card-modern:hover .btn-delete-modern {
    opacity: 1;
}

.btn-delete-modern:hover {
    background: rgba(239, 68, 68, 0.2);
    transform: scale(1.1);
}

/* Modal Moderno */
.modal-modern {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal-modern.active {
    display: flex;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
}

.modal-modern-content {
    position: relative;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
    animation: modalSlide 0.3s ease-out;
}

.modal-modern-header {
    padding: 28px 32px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-modern-header h2 {
    font-size: 24px;
    color: var(--text-primary);
    font-weight: 700;
}

.btn-close-modern {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: all 0.3s;
}

.btn-close-modern:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    transform: rotate(90deg);
}

.modal-modern-body {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
}

/* Profile Card Moderno */
.profile-card-modern {
    text-align: center;
}

.profile-avatar-large {
    width: 120px;
    height: 120px;
    background: linear-gradient(135deg, var(--primary), var(--gold));
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    font-weight: 700;
    color: white;
    margin: 0 auto 24px;
    box-shadow: 0 12px 40px rgba(245, 158, 11, 0.4);
}

.profile-name {
    font-size: 28px;
    color: var(--text-primary);
    margin-bottom: 32px;
    font-weight: 700;
}

.profile-fields {
    text-align: left;
}

.profile-field-modern {
    margin-bottom: 24px;
}

.profile-field-modern label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.profile-field-modern label svg {
    color: var(--primary);
}

.profile-value {
    background: rgba(255, 255, 255, 0.03);
    padding: 14px 18px;
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--border-color);
}

.btn-icon-modern {
    width: 32px;
    height: 32px;
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 8px;
    color: var(--primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    flex-shrink: 0;
}

.btn-icon-modern:hover {
    background: rgba(245, 158, 11, 0.25);
    transform: scale(1.1);
}

/* Form Field Moderno */
.form-field-modern {
    margin-bottom: 24px;
}

.form-field-modern label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: 10px;
}

.form-field-modern label svg {
    color: var(--primary);
}

.form-field-modern input {
    width: 100%;
    padding: 14px 18px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 15px;
    color: var(--text-primary);
    transition: all 0.3s;
}

.form-field-modern input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.1);
}

/* Password Form Moderno */
.password-form-modern {
    display: none;
    margin-top: 24px;
    padding: 24px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.password-form-modern.active {
    display: block;
}

/* Modal Actions */
.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.btn-cancel-modern {
    flex: 1;
    padding: 14px 24px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-cancel-modern:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-submit-modern {
    flex: 1;
    padding: 14px 24px;
    background: linear-gradient(135deg, var(--primary), var(--gold));
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.btn-submit-modern:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.5);
}

/* Error Message */
.error-message {
    text-align: center;
    padding: 60px 20px;
}

.error-message svg {
    color: var(--danger);
    margin-bottom: 24px;
}

.error-message h3 {
    font-size: 24px;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.error-message p {
    color: var(--text-muted);
    font-size: 16px;
}

/* Responsive */
@media (max-width: 1200px) {
    .users-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

@media (max-width: 768px) {
    .users-grid {
        grid-template-columns: 1fr;
    }
    
    .admin-page-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .btn-add-modern {
        width: 100%;
    }
}

/* ==================== CARDS GRANDES (VERSÃO AMPLIADA) ==================== */

.users-grid-large {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 28px;
    padding: 0;
    width: 100%;
}

.user-card-large {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 28px;
    transition: all 0.3s;
    opacity: 0;
}

.user-card-large:hover {
    transform: translateY(-12px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
    border-color: rgba(245, 158, 11, 0.4);
}

.user-card-header-large {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 28px;
    padding-bottom: 28px;
    border-bottom: 1px solid var(--border-color);
}

.user-card-avatar-large {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--primary), var(--gold));
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 8px 32px rgba(245, 158, 11, 0.5);
}

.user-card-info-large {
    flex: 1;
    min-width: 0;
}

.user-card-info-large h3 {
    font-size: 18px;
    color: var(--text-primary);
    margin-bottom: 6px;
    font-weight: 700;
}

.user-card-info-large p {
    font-size: 14px;
    color: var(--text-muted);
}

.user-card-body-large {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 28px;
}

.user-card-field-large {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
}

.field-label-large {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    color: var(--text-muted);
    font-weight: 600;
}

.field-label-large svg {
    color: var(--primary);
}

.user-card-footer-large {
    display: flex;
    gap: 12px;
}

.btn-card-action-large {
    flex: 1;
    padding: 16px 24px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s;
}

.btn-primary-large {
    background: linear-gradient(135deg, var(--primary), var(--gold));
    color: white;
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.4);
}

.btn-primary-large:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 28px rgba(245, 158, 11, 0.6);
}

/* Modal Grande */
.modal-large {
    max-width: 800px;
}

/* Profile Card Grande */
.profile-card-large {
    text-align: center;
}

.profile-avatar-xlarge {
    width: 140px;
    height: 140px;
    background: linear-gradient(135deg, var(--primary), var(--gold));
    border-radius: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 64px;
    font-weight: 700;
    color: white;
    margin: 0 auto 32px;
    box-shadow: 0 16px 48px rgba(245, 158, 11, 0.5);
}

.profile-name-large {
    font-size: 36px;
    color: var(--text-primary);
    margin-bottom: 40px;
    font-weight: 700;
}

.profile-fields-large {
    text-align: left;
}

.profile-field-large {
    margin-bottom: 28px;
}

.profile-field-large label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.profile-field-large label svg {
    color: var(--primary);
}

.profile-value-large {
    background: rgba(255, 255, 255, 0.03);
    padding: 18px 24px;
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 17px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--border-color);
    gap: 12px;
}

.btn-icon-large {
    width: 40px;
    height: 40px;
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 10px;
    color: var(--primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    flex-shrink: 0;
}

.btn-icon-large:hover {
    background: rgba(245, 158, 11, 0.3);
    transform: scale(1.15);
}

.password-form-large {
    display: none;
    margin-top: 24px;
    padding: 28px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    border: 1px solid var(--border-color);
}

.password-form-large.active {
    display: block;
}

.form-trocar-cargo {
    margin-top: 16px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.form-trocar-cargo label {
    display: block;
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 12px;
}

.form-trocar-cargo select {
    width: 100%;
    padding: 14px 18px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 15px;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.form-grid-2cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

@media (max-width: 1400px) {
    .users-grid-large {
        grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    }
}

@media (max-width: 900px) {
    .users-grid-large {
        grid-template-columns: 1fr;
    }
    
    .form-grid-2cols {
        grid-template-columns: 1fr;
    }
}

/* Alertas de Sucesso/Erro */
.alert-success {
    padding: 16px 20px;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 12px;
    color: #10b981;
    font-size: 15px;
    margin-top: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-error {
    padding: 16px 20px;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 12px;
    color: #fca5a5;
    font-size: 15px;
    margin-top: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Ajustes para tela cheia */
.admin-container {
    width: 100%;
    max-width: 100%;
}

.admin-content {
    width: 100%;
}

/* Responsivo ajustado */
@media (max-width: 1600px) {
    .users-grid-large {
        grid-template-columns: repeat(auto-fill, minmax(450px, 1fr));
    }
}

@media (max-width: 1200px) {
    .users-grid-large {
        grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    }
}


/* Botão de Excluir Usuário */
.btn-delete-user {
    padding: 14px 24px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 10px;
    color: #fca5a5;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s;
    width: 100%;
    justify-content: center;
}

.btn-delete-user:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-delete-user:active {
    transform: translateY(0);
}

/* Campo de Busca de Usuários */
.search-users-container {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 12px;
    transition: all 0.3s;
}

.search-input-wrapper:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
}

.search-input-wrapper svg {
    color: var(--text-muted);
    margin-right: 8px;
    flex-shrink: 0;
}

.search-users-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
}

.search-users-input::placeholder {
    color: var(--text-muted);
}

/* Ajuste na lista de usuários online */
.online-user-item {
    transition: opacity 0.2s;
}

.online-user-item[style*="display: none"] {
    display: none !important;
}

/* Header do Chat - Nome e Cargo Lado a Lado COMPACTO */
.chat-header-info {
    flex: 1;
    min-width: 0;
}

.chat-title-line {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 2px;
}

.chat-title-line .chat-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-title-line .chat-subtitle-cargo {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 3px;
    flex-shrink: 0;
}

.chat-visto-por-ultimo {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 0;
}

.chat-visto-por-ultimo:empty {
    display: none;
}

/* Ajustes no typing indicator */
.typing-indicator-privado {
    margin-top: 2px;
}

/* Header mais compacto */
.chat-main-header {
    padding: 12px 20px !important;
    min-height: auto !important;
}