/**
 * Pixelio Chat Admin - Estilos principales
 */

/* Variables de color */
:root {
    --brand: #0A1F3D;
    /* Fondo Azul Cobalto Profundo (Clientes) */
    --brand-light: #162C4E;
    /* Azul ligeramente más claro para contrastes */
    --brand-dark: #051021;
    /* Azul casi negro para profundidad */
    --highlight: #4ECDC4;
    /* Verde turquesa vibrante */
    --danger: #FF6B6B;
    /* Rojo coral para alertas */
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --primary-color: var(--highlight);
    --dark-color: var(--brand);
    --light-color: #FFFFFF;
    --border-color: var(--glass-border);
    --shadow-color: rgba(0, 0, 0, 0.37);
    --background-color: transparent;
    --accent-light: rgba(78, 205, 196, 0.1);
}

/* Reset y estilos base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: #050a14 radial-gradient(circle at 50% -20%, #1e3a5f 0%, #050a14 70%) !important;
    background-attachment: fixed !important;
    color: white;
    min-height: 100vh;
    overflow-x: hidden;
}

.dashboard-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* Tipografía */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Sora', sans-serif;
    font-weight: 800;
    margin-bottom: 0.5em;
    letter-spacing: -0.5px;
    color: white;
}

h1 {
    font-size: 24px;
}

h2 {
    font-size: 20px;
}

h3 {
    font-size: 18px;
}

h4 {
    font-size: 16px;
}

p {
    margin-bottom: 1em;
    line-height: 1.5;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--dark-color);
}

/* Layout */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.sidebar {
    width: 260px;
    height: calc(100vh - 40px);
    background: rgba(10, 20, 40, 0.4);
    backdrop-filter: blur(30px) saturate(150%);
    -webkit-backdrop-filter: blur(30px) saturate(150%);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 30px;
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 20px;
    top: 20px;
    z-index: 1000;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
}

.main-content {
    flex: 1;
    margin-left: 300px;
    padding: 30px;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* Sidebar Collapsed State */
.dashboard-wrapper.collapsed .sidebar {
    width: 85px;
}

.dashboard-wrapper.collapsed .main-content {
    margin-left: 125px;
}

.sidebar .sidebar-header h1,
.sidebar .sidebar-header h2,
.sidebar .nav-link span,
.sidebar .sidebar-footer div div {
    transition: opacity 0.3s ease, transform 0.3s ease;
    white-space: nowrap;
    overflow: hidden;
}

.dashboard-wrapper.collapsed .sidebar .sidebar-header h1,
.dashboard-wrapper.collapsed .sidebar .sidebar-header h2,
.dashboard-wrapper.collapsed .sidebar .nav-link span,
.dashboard-wrapper.collapsed .sidebar .sidebar-footer div div {
    opacity: 0;
    pointer-events: none;
    width: 0;
}


.dashboard-wrapper.collapsed .sidebar .nav-link {
    width: 48px;
    height: 48px;
    margin: 8px auto;
    padding: 0;
    gap: 0;
    justify-content: center;
    align-items: center;
    border-radius: 14px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 14px 18px;
    border-radius: 18px;
    color: rgba(255, 255, 255, 0.4);
    text-decoration: none;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
}

.nav-link:hover,
.nav-link.active {
    background: rgba(78, 205, 196, 0.1) !important;
    color: var(--highlight);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.nav-link i {
    width: 22px;
    height: 22px;
}

[data-lucide] {
    stroke-width: 2.2px;
}

.sidebar-header {
    padding: 0 24px 24px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.sidebar-header h1 {
    font-family: 'Sora', sans-serif;
    font-size: 20px;
    font-weight: 800;
    margin: 0;
    background: linear-gradient(135deg, #fff 0%, var(--highlight) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Sidebar Menu */
.sidebar-menu {
    flex: 1;
    padding: 0 15px;
}

.sidebar-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: auto;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: rgba(78, 205, 196, 0.1);
    color: var(--highlight);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-family: 'Sora', sans-serif;
}

.user-details {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-weight: 700;
    font-size: 0.9rem;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px;
    background: rgba(255, 107, 107, 0.1);
    color: #FF6B6B;
    border-radius: 14px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 700;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 107, 107, 0.1);
}

.logout-btn:hover {
    background: rgba(255, 107, 107, 0.2);
    border-color: rgba(255, 107, 107, 0.3);
}

.logout-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Encabezado de página */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.page-title {
    font-size: 24px;
    font-weight: 600;
}

/* Tarjetas Glassmorphism */
.card,
.card-glass {
    position: relative;
    background: rgba(255, 255, 255, 0.03) !important;
    backdrop-filter: blur(20px) saturate(120%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(120%) !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    border-radius: 32px !important;
    padding: 30px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
    margin-bottom: 24px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover,
.card-glass:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.04) !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4) !important;
}

.card-header {
    padding: 30px 40px 10px;
    border-bottom: none !important;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.card-body {
    padding: 30px 40px;
}

.card-footer {
    padding: 20px 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.03);
    background-color: transparent;
}

/* Botones de Header */
.header-btn {
    background: transparent !important;
    border: none !important;
    height: 48px;
    border-radius: 24px !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    color: white;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.header-btn:hover {
    background: rgba(255, 255, 255, 0.05) !important;
    transform: scale(1.1);
}

.header-btn.profile-capsule {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    padding: 0 20px;
    width: auto;
    gap: 10px;
}

/* Menús Desplegables Premium */
.dropdown-menu {
    display: none;
    position: absolute;
    top: 65px;
    right: 0;
    width: 200px;
    background: rgba(10, 25, 45, 0.9);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
    z-index: 2000;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.dropdown-menu.active {
    display: block;
    animation: dropdownPop 0.3s ease;
}

@keyframes dropdownPop {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.dropdown-item {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 16px;
    transition: all 0.2s ease;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--highlight);
    transform: translateX(5px);
}

/* Formularios */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 14px;
}

.form-control {
    width: 100%;
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 16px !important;
    padding: 16px 20px !important;
    color: #ffffff !important;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
}

.form-control:focus {
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: var(--highlight) !important;
    box-shadow: 0 0 20px rgba(78, 205, 196, 0.15);
    transform: translateY(-2px);
}

.form-control::placeholder {
    color: rgba(255, 255, 255, 0.15);
}

.error-message {
    font-size: 12px;
    color: var(--danger-color);
    margin-top: 5px;
}

/* Botones */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 24px;
    height: 48px;
    background-color: var(--primary-color);
    color: var(--brand);
    /* Text color should match Clientes brand */
    border: none;
    border-radius: 18px;
    font-family: 'Sora', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    text-decoration: none;
    line-height: 1;
}

.btn:hover {
    background-color: #40b3ae;
    transform: translateY(-1px);
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--brand) !important;
}

.btn-secondary {
    background-color: var(--dark-color);
    color: var(--light-color);
}

.btn-success {
    background-color: var(--success-color);
    color: var(--light-color);
}

.btn-danger {
    background-color: var(--danger-color);
    color: var(--light-color);
}

.btn-warning {
    background-color: var(--warning-color);
    color: var(--dark-color);
}

.btn-info {
    background-color: var(--info-color);
    color: var(--light-color);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-lg {
    padding: 12px 24px;
    font-size: 16px;
}

.btn-block {
    display: block;
    width: 100%;
}

/* Alertas */
.alert {
    padding: 12px 16px;
    margin-bottom: 20px;
    border-radius: 8px;
    font-size: 14px;
}

.alert-success {
    background-color: rgba(76, 175, 80, 0.1);
    color: var(--success-color);
    border: 1px solid rgba(76, 175, 80, 0.2);
}

.alert-danger {
    background-color: rgba(244, 67, 54, 0.1);
    color: var(--danger-color);
    border: 1px solid rgba(244, 67, 54, 0.2);
}

.alert-warning {
    background-color: rgba(255, 152, 0, 0.1);
    color: var(--warning-color);
    border: 1px solid rgba(255, 152, 0, 0.2);
}

.alert-info {
    background-color: rgba(33, 150, 243, 0.1);
    color: var(--info-color);
    border: 1px solid rgba(33, 150, 243, 0.2);
}

/* Tablas */
.table-container {
    overflow-x: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--light-color);
    font-size: 14px;
}

th,
td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    font-weight: 600;
    background-color: var(--background-color);
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background-color: var(--accent-light);
}

/* Estados y badges */
.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.status-active {
    background-color: rgba(76, 175, 80, 0.1);
    color: var(--success-color);
}

.status-pending {
    background-color: rgba(255, 152, 0, 0.1);
    color: var(--warning-color);
}

.status-closed {
    background-color: rgba(158, 158, 158, 0.1);
    color: #616161;
}

.unread-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    background-color: var(--primary-color);
    color: var(--light-color);
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    padding: 0 6px;
}

/* Paginación */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
}

.page-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--light-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.page-btn:hover:not(.disabled) {
    background-color: var(--accent-light);
    border-color: var(--primary-color);
}

.page-btn.active {
    background-color: var(--primary-color);
    color: var(--light-color);
    border-color: var(--primary-color);
}

.page-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.prev-btn,
.next-btn {
    width: auto;
    padding: 0 12px;
}

.page-ellipsis {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    font-size: 14px;
}

/* Loaders */
.loading-indicator {
    display: none;
    align-items: center;
    justify-content: center;
    padding: 30px;
    color: var(--primary-color);
    font-size: 14px;
}

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--accent-light);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.modal.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background-color: var(--light-color);
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 10px 30px var(--shadow-color);
    transform: translateY(-20px);
    transition: transform 0.3s ease;
}

.modal.active .modal-content {
    transform: translateY(0);
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--dark-color);
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.modal-close:hover {
    opacity: 1;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Estilos de la interfaz de chat */
.chat-container {
    display: flex;
    height: calc(100vh - 100px);
    margin-top: 20px;
    overflow: hidden;
}

.chat-sidebar {
    width: 320px;
    background-color: var(--light-color);
    border-radius: 12px 0 0 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.chat-sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.conversation-list {
    flex: 1;
    overflow-y: auto;
}


.conversation-avatar {
    width: 40px;
    height: 40px;
    background-color: var(--dark-color);
    color: var(--light-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-right: 12px;
    flex-shrink: 0;
}

.conversation-info {
    flex: 1;
    overflow: hidden;
}

.conversation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.conversation-name {
    font-weight: 500;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conversation-time {
    font-size: 12px;
    color: rgba(10, 31, 61, 0.5);
}

.conversation-preview {
    font-size: 13px;
    color: rgba(10, 31, 61, 0.7);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
}

.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--light-color);
    border-radius: 0 12px 12px 0;
    box-shadow: 4px 4px 12px rgba(0, 0, 0, 0.05);
}

.chat-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-title {
    font-weight: 600;
    font-size: 16px;
}

.chat-actions {
    display: flex;
    gap: 10px;
}

.chat-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.message {
    max-width: 80%;
    display: flex;
    flex-direction: column;
}

.message-sender {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--dark-color);
}

.message-content {
    background-color: var(--background-color);
    padding: 12px 16px;
    border-radius: 12px;
    position: relative;
}

.visitor-message {
    align-self: flex-start;
}

.visitor-message .message-content {
    background-color: var(--background-color);
    border-top-left-radius: 4px;
}

.agent-message {
    align-self: flex-end;
}

.agent-message .message-content {
    background-color: var(--primary-color);
    color: var(--dark-color);
    border-top-right-radius: 4px;
}

.bot-message {
    align-self: flex-start;
}

.bot-message .message-content {
    background-color: var(--accent-light);
    border-top-left-radius: 4px;
}

.system-message {
    align-self: center;
    max-width: 60%;
}

.system-message .message-content {
    background-color: rgba(0, 0, 0, 0.05);
    padding: 8px 12px;
    font-size: 12px;
    color: rgba(10, 31, 61, 0.6);
}

.message-time {
    font-size: 10px;
    color: rgba(10, 31, 61, 0.5);
    margin-top: 4px;
    text-align: right;
}

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    background-color: var(--background-color);
    border-radius: 12px;
    width: fit-content;
    margin-top: 8px;
    align-self: flex-start;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background-color: var(--dark-color);
    border-radius: 50%;
    opacity: 0.4;
    animation: typing-animation 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) {
    animation-delay: 0s;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing-animation {

    0%,
    100% {
        transform: scale(0.7);
        opacity: 0.4;
    }

    50% {
        transform: scale(1);
        opacity: 0.8;
    }
}

.chat-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
}

.chat-form {
    display: flex;
    gap: 10px;
}

.chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 24px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    resize: none;
    outline: none;
    max-height: 120px;
    transition: all 0.2s ease;
}

.chat-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.send-button {
    width: 40px;
    height: 40px;
    background-color: var(--primary-color);
    color: var(--light-color);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    align-self: flex-end;
}

.send-button:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(78, 205, 196, 0.3);
}

.visitor-info {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    background-color: var(--background-color);
}

.visitor-details h3 {
    margin-bottom: 10px;
}

.visitor-details p {
    margin-bottom: 5px;
    font-size: 14px;
}

.empty-chat,
.loading-chat {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: rgba(10, 31, 61, 0.4);
    background-color: var(--light-color);
}

.empty-chat p,
.loading-chat p {
    margin-top: 15px;
    font-size: 16px;
}

/* Responsive */
@media (max-width: 992px) {
    .chat-container {
        flex-direction: column;
        height: auto;
    }

    .chat-sidebar {
        width: 100%;
        border-radius: 12px 12px 0 0;
        height: 300px;
    }

    .chat-main {
        border-radius: 0 0 12px 12px;
        height: calc(100vh - 420px);
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 70px;
        padding: 20px 0;
    }

    .sidebar-header {
        justify-content: center;
        padding: 0 0 20px;
    }

    .sidebar-header h1,
    .user-details,
    .sidebar-menu span {
        display: none;
    }

    .main-content {
        margin-left: 70px;
        padding: 20px;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .chat-main {
        height: calc(100vh - 400px);
    }
}

/* --- Data Tables --- */
.table-container {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 15px 20px !important;
    font-size: 0.75rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    color: rgba(255, 255, 255, 0.3) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
    background: rgba(255, 255, 255, 0.02) !important;
}

td {
    padding: 18px 20px !important;
    font-size: 0.9rem !important;
    color: rgba(255, 255, 255, 0.7) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03) !important;
}

tr:hover td {
    background: rgba(255, 255, 255, 0.01) !important;
}

/* --- Chat Interface --- */
.chat-messages {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 20px;
}

.message {
    max-width: 80%;
    display: flex;
    flex-direction: column;
}

.message-sender {
    font-size: 0.7rem !important;
    font-weight: 700 !important;
    margin-bottom: 4px !important;
    color: rgba(255, 255, 255, 0.4) !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
}

.message-content {
    padding: 12px 18px !important;
    border-radius: 18px !important;
    font-size: 0.95rem !important;
    line-height: 1.5 !important;
    position: relative !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1) !important;
}

.visitor-message {
    align-self: flex-start;
}

.visitor-message .message-content {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    color: white !important;
    border-bottom-left-radius: 4px !important;
    border-top-left-radius: 18px !important;
}

.agent-message {
    align-self: flex-end;
}

.agent-message .message-content {
    background: var(--highlight) !important;
    color: var(--brand) !important;
    font-weight: 500 !important;
    border-bottom-right-radius: 4px !important;
    border-top-right-radius: 18px !important;
}

.bot-message {
    align-self: flex-start;
}

.bot-message .message-content {
    background: rgba(78, 205, 196, 0.1) !important;
    border: 1px solid rgba(78, 205, 196, 0.2) !important;
    color: var(--highlight) !important;
    border-bottom-left-radius: 4px !important;
    border-top-left-radius: 18px !important;
}

.message-time {
    font-size: 0.7rem !important;
    opacity: 0.5 !important;
    margin-top: 5px !important;
    text-align: right !important;
    color: inherit !important;
}



/* --- Authentication & Authorization --- */
.auth-container {
    min-height: 100vh !important;
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 20px !important;
    background: #050a14 radial-gradient(circle at 50% -20%, #1e3a5f 0%, #050a14 70%) !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    z-index: 9999 !important;
}

.auth-card {
    width: 100%;
    max-width: 480px;
    background: rgba(255, 255, 255, 0.02) !important;
    backdrop-filter: blur(40px) !important;
    -webkit-backdrop-filter: blur(40px) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 32px !important;
    padding: 40px !important;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3) !important;
    position: relative !important;
    animation: authFadeIn 0.8s ease-out;
}

@keyframes authFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-header {
    text-align: center;
    margin-bottom: 35px;
}

.auth-header h1 {
    font-family: 'Sora', sans-serif;
    font-size: 2rem;
    letter-spacing: -1px;
    margin-bottom: 10px;
    color: white;
}

.auth-header p {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.9rem;
}

.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-toggle {
    position: absolute;
    right: 20px;
    color: rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.password-toggle:hover {
    color: var(--highlight);
}

.btn-block {
    display: flex !important;
    width: 100% !important;
    height: 52px !important;
}

/* Premium Table Styles */
.table-container table thead th {
    font-family: 'Sora', sans-serif;
    font-weight: 700;
}

.action-btn-glass {
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    color: var(--highlight);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 10px;
    cursor: pointer;
}

.action-btn-glass:hover {
    background: rgba(78, 205, 196, 0.1) !important;
    border-color: rgba(78, 205, 196, 0.3) !important;
    color: var(--highlight) !important;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    opacity: 1 !important;
}

.spinner {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(255, 255, 255, 0.05);
    border-top: 3px solid var(--highlight);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.spinner.mini {
    width: 16px;
    height: 16px;
    border-width: 2px;
    opacity: 0.4;
}

/* Dynamic Filter Buttons */
.filter-btn {
    padding: 10px 20px;
    border-radius: 12px;
    border: none;
    background: transparent;
    color: white;
    font-weight: 700;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-btn.active {
    background: var(--highlight) !important;
    color: var(--brand) !important;
}

.filter-btn:hover:not(.active) {
    background: rgba(255, 255, 255, 0.05);
}

.search-container input.form-control {
    padding-left: 60px !important;
    height: 52px;
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 16px !important;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Base Chat Layout */
.chat-wrapper {
    display: flex;
    height: calc(100vh - 120px);
    gap: 24px;
    min-height: 600px;
}

/* Conversation List refinements */
.conversation-item {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    background: transparent;
    border: none !important;
}

.conversation-item.active {
    background: rgba(78, 205, 196, 0.1) !important;
}

/* --- Conversation List Items --- */
.conversation-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px !important;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03) !important;
}

.conversation-item:hover {
    background: rgba(255, 255, 255, 0.02) !important;
}

.conversation-avatar {
    width: 44px !important;
    height: 44px !important;
    border-radius: 12px !important;
    background: rgba(255, 255, 255, 0.05) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: var(--highlight) !important;
    font-family: 'Sora', sans-serif !important;
    font-weight: 700 !important;
    flex-shrink: 0 !important;
}

.conversation-info {
    flex: 1;
    min-width: 0;
}

.conversation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.conversation-name {
    font-family: 'Sora', sans-serif !important;
    font-weight: 700 !important;
    font-size: 0.9rem !important;
    color: white !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conversation-time {
    font-size: 0.75rem !important;
    color: rgba(255, 255, 255, 0.3) !important;
}

.conversation-preview {
    font-size: 0.85rem !important;
    color: rgba(255, 255, 255, 0.4) !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0 !important;
}

.unread-badge {
    background: var(--highlight) !important;
    color: var(--brand) !important;
    font-size: 0.7rem !important;
    font-weight: 800 !important;
    min-width: 20px !important;
    height: 20px !important;
    border-radius: 10px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 6px !important;
}

.conversation-item:hover:not(.active) .btn-delete-conv {
    opacity: 0.6 !important;
}

.btn-delete-conv:hover {
    opacity: 1 !important;
    transform: scale(1.1);
}

.action-btn-glass {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.action-btn-glass:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

/* Chat Bubbles (Tickets Pattern) */
.msg-bubble {
    max-width: 85%;
    padding: 18px 22px;
    border-radius: 20px;
    position: relative;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    animation: fadeIn 0.3s ease-out;
}

.msg-bubble-staff {
    background: rgba(78, 205, 196, 0.08);
    border: 1px solid rgba(78, 205, 196, 0.15);
    border-bottom-right-radius: 4px;
    align-self: flex-end;
}

.msg-bubble-visitor {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom-left-radius: 4px;
    align-self: flex-start;
}

/* Floating Input Bar (Capsule Style) */
.chat-footer-floating {
    position: sticky;
    bottom: 25px;
    margin-top: 20px;
    z-index: 100;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    width: 95%;
}

.chat-input-capsule {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(14, 22, 35, 0.85);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 8px 10px 8px 20px;
    border-radius: 40px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
}

.chat-attachment-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    cursor: pointer;
    color: rgba(255, 255, 255, 0.4);
    transition: all 0.4s ease;
    flex-shrink: 0;
}

.chat-attachment-btn:hover {
    background: rgba(78, 205, 196, 0.1);
    color: var(--highlight);
    border-color: rgba(78, 205, 196, 0.3);
}

.chat-send-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    padding: 0;
    background: var(--highlight) !important;
    color: var(--brand) !important;
    border: none !important;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    flex-shrink: 0;
}

.chat-send-btn:hover {
    transform: scale(1.05);
}

/* Sidebar Details Cards */
.visitor-details-card {
    background: rgba(255, 255, 255, 0.01);
    padding: 12px 15px;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.03);
    margin-bottom: 15px;
}

.visitor-details-label {
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.3);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
    font-weight: 700;
}

.visitor-details-value {
    font-weight: 600;
    font-size: 0.9rem;
    color: #ffffff;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Badge Capsule (Premium Style) */
.badge-capsule {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border: 1px solid transparent;
    transition: all 0.3s ease;
}

/* Modals Refined */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 10, 20, 0.8);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 32px;
    padding: 35px;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6);
    transform: translateY(20px) scale(0.95);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.modal-overlay.active .modal-content {
    transform: translateY(0) scale(1);
}

.modal-close:hover {
    opacity: 1 !important;
    transform: rotate(90deg);
}

/* Notification Sidebar Panel (Modern Style) */
.notif-panel {
    position: fixed;
    top: 20px;
    right: -420px;
    /* Hidden state */
    width: 380px;
    height: calc(100vh - 40px);
    background: rgba(10, 20, 40, 0.4);
    backdrop-filter: blur(30px) saturate(160%);
    -webkit-backdrop-filter: blur(30px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 30px;
    z-index: 3000;
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: -20px 25px 50px rgba(0, 0, 0, 0.4);
    padding: 35px;
    display: flex;
    flex-direction: column;
}

.notif-panel.active {
    right: 20px;
}

.notif-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 2999;
    display: none;
    transition: all 0.5s ease;
}

.notif-overlay.active {
    display: block;
}

.btn-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 10px;
    height: 10px;
    background: var(--highlight);
    border: 2px solid var(--brand-dark);
    border-radius: 50%;
    animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
    0% {
        box-shadow: 0 0 0 0 rgba(78, 205, 196, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(78, 205, 196, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(78, 205, 196, 0);
    }
}

/* Custom Scrollbar Premium (Global) */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Custom Premium Flatpickr Glassmorphism Theme */
.flatpickr-calendar {
    background: rgba(13, 27, 42, 0.45) !important;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 16px !important;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5) !important;
    font-family: 'Inter', sans-serif !important;
    margin-top: 10px !important;
}

.flatpickr-calendar:before,
.flatpickr-calendar:after {
    display: none !important;
}

.flatpickr-time {
    background: transparent !important;
    border: none !important;
    color: white !important;
}

.flatpickr-time input,
.flatpickr-time .flatpickr-time-separator,
.flatpickr-time .flatpickr-am-pm {
    color: white !important;
    border-radius: 8px !important;
}

.flatpickr-time input:hover,
.flatpickr-time .flatpickr-am-pm:hover,
.flatpickr-time input:focus,
.flatpickr-time .flatpickr-am-pm:focus {
    background: rgba(255, 255, 255, 0.05) !important;
}

/* Fix selection color in flatpickr inputs */
.flatpickr-time input::selection {
    background: transparent !important;
    color: var(--highlight) !important;
}

.flatpickr-time input::-moz-selection {
    background: transparent !important;
    color: var(--highlight) !important;
}

/* Enhanced Focus States for Time Pickers */
.time-picker {
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.time-picker:focus {
    border-color: var(--highlight) !important;
    box-shadow: 0 0 0 4px rgba(78, 205, 196, 0.1), 0 0 20px rgba(78, 205, 196, 0.15) !important;
    background: rgba(255, 255, 255, 0.03) !important;
}

.time-picker:focus+i {
    color: var(--highlight) !important;
    opacity: 0.8 !important;
}

/* Hide Spin Buttons from Number Inputs */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type=number] {
    -moz-appearance: textfield;
    appearance: none;
}