:root { --primary-color: #635bff; }
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Roboto', sans-serif;
}

body {
    overflow: hidden;
    color: #202124;
}

/* Header */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px;
    background-color: #f6f8fc;
    height: 64px;
}

.header-left {
    display: flex;
    align-items: center;
    min-width: 238px;
    padding-left: 12px;
}

.menu-icon {
    padding: 12px;
    border-radius: 50%;
    cursor: pointer;
    color: #5f6368;
    margin-right: 4px;
}
.menu-icon:hover { background-color: rgba(60,64,67,0.08); }

.logo img {
    height: 40px;
    vertical-align: middle;
}

.header-middle {
    flex: 1;
    
}

.search-bar {
    display: flex;
    align-items: center;
    background-color: #eaf1fb;
    padding: 0 16px;
    border-radius: 24px;
    height: 48px;
}

.search-bar input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 10px;
    font-size: 16px;
    outline: none;
}

.search-bar .material-icons-outlined {
    color: #5f6368;
    cursor: pointer;
}

.header-right {
    display: flex;
    align-items: center;
    padding-right: 12px;
    gap: 10px;
}

.header-right .material-icons-outlined {
    padding: 8px;
    border-radius: 50%;
    cursor: pointer;
    color: #5f6368;
}
.header-right .material-icons-outlined:hover { background-color: rgba(60,64,67,0.08); }

.profile-icon {
    font-size: 32px;
    color: #5f6368;
    cursor: pointer;
}

.profile-menu {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background-color: #fff;
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.dropdown-content a {
    color: #333;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    font-size: 14px;
}

.dropdown-content a:hover {
    background-color: #f1f3f4;
}

.profile-menu:hover .dropdown-content {
    display: block;
}

/* Main Container */
.main-container {
    display: flex;
    height: calc(100vh - 64px);
    background-color: #f6f8fc;
}

/* Sidebar */
.sidebar {
    width: 256px;
    padding-right: 16px;
}

.compose-btn {
    display: flex;
    align-items: center;
    background-color: #E0F2F5;
    border: none;
    padding: 0 24px 0 16px;
    height: 56px;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 500;
    color: #001d35;
    cursor: pointer;
    margin: 8px 0 16px 8px;
    box-shadow: 0 1px 2px 0 rgba(60,64,67,.3), 0 1px 3px 1px rgba(60,64,67,.15);
    transition: background-color 0.2s, box-shadow 0.2s;
}
.compose-btn:hover {
    background-color: #BFE3E8;
    box-shadow: 0 1px 3px 0 rgba(60,64,67,.3), 0 4px 8px 3px rgba(60,64,67,.15);
}

.compose-btn .material-icons-outlined {
    margin-right: 12px;
}

.nav-links {
    list-style: none;
}

.nav-links li {
    display: flex;
    align-items: center;
    height: 32px;
    padding: 0 12px 0 26px;
    border-radius: 0 16px 16px 0;
    cursor: pointer;
    color: #202124;
    font-size: 14px;
    margin-bottom: 2px;
}

.nav-links li:hover { background-color: rgba(32,33,36,0.04); }

.nav-links li.active {
    background-color: #D4EDF0;
    font-weight: 700;
}

.nav-links li .material-icons,
.nav-links li .material-icons-outlined {
    margin-right: 18px;
    font-size: 20px;
    color: #5f6368;
}

.nav-links li.active .material-icons { color: #0B4F5B; }

.badge {
    margin-left: auto;
    font-size: 12px;
}

/* Content Area */
.content {
    flex: 1;
    background-color: #fff;
    border-radius: 16px;
    margin-right: 16px;
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-bottom: 1px solid #f1f3f4;
}

.list-header-left, .list-header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.list-header .material-icons-outlined {
    color: #5f6368;
    cursor: pointer;
    font-size: 20px;
}

.pagination {
    font-size: 12px;
    color: #5f6368;
}

.email-list-container {
    flex: 1;
    overflow-y: auto;
}

.loading-state {
    padding: 20px;
    text-align: center;
    color: #5f6368;
    font-size: 14px;
}

/* Email Row */
.email-row {
    display: flex;
    align-items: center;
    padding: 0 16px;
    height: 40px;
    border-bottom: 1px solid #f1f3f4;
    cursor: pointer;
    font-size: 14px;
    color: #202124;
    background-color: #f2f6fc; /* default unread background */
}
.email-row.read {
    background-color: #fff;
    color: #5f6368;
}

.email-row:hover {
    box-shadow: inset 1px 0 0 #dadce0, inset -1px 0 0 #dadce0, 0 1px 2px 0 rgba(60,64,67,.3), 0 1px 3px 1px rgba(60,64,67,.15);
    z-index: 1;
    border-bottom: transparent;
}

.email-icons {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 68px;
}
.email-icons .material-icons-outlined {
    color: #c4c7c5;
    font-size: 20px;
}

.email-sender {
    width: 168px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 16px;
}
.email-row.read .email-sender { font-weight: 400; }

.email-subject {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 16px;
}
.subject-text { font-weight: 700; }
.email-row.read .subject-text { font-weight: 400; }
.snippet-text { color: #5f6368; margin-left: 6px; }

.email-date {
    width: 80px;
    text-align: right;
    font-weight: 700;
    font-size: 12px;
}
.email-row.read .email-date { font-weight: 400; }

/* Email View */
.email-view-container {
    flex: 1;
    overflow-y: auto;
    background: #fff;
    display: flex;
    flex-direction: column;
}

.view-header {
    display: flex;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid #f1f3f4;
    gap: 24px;
}

.back-btn {
    cursor: pointer;
    border-radius: 50%;
    padding: 8px;
    color: #5f6368;
    transition: background-color 0.2s;
}
.back-btn:hover { background-color: rgba(60,64,67,0.08); }

.view-actions {
    display: flex;
    gap: 16px;
    color: #5f6368;
}
.view-actions .material-icons-outlined {
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
}
.view-actions .material-icons-outlined:hover { background-color: rgba(60,64,67,0.08); }

.view-subject {
    font-size: 22px;
    padding: 20px 16px 8px 72px;
    color: #202124;
}

.view-sender {
    display: flex;
    align-items: center;
    padding: 16px 16px 16px 20px;
    gap: 12px;
}

.view-sender .material-icons {
    font-size: 40px;
    color: #c4c7c5;
}

.sender-info {
    flex: 1;
}

.sender-name {
    font-weight: 700;
    font-size: 14px;
    color: #202124;
}

.sender-email {
    font-size: 12px;
    color: #5f6368;
    margin-left: 4px;
}

.view-date {
    font-size: 12px;
    color: #5f6368;
    padding-right: 16px;
}

.view-body {
    padding: 16px 16px 32px 72px;
    font-size: 14px;
    color: #202124;
    line-height: 1.5;
        
}

/* Star Toggle */
.star-active {
    color: #f4b400 !important;
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #5f6368;
    margin-top: 60px;
}
.empty-state .material-icons-outlined {
    font-size: 64px;
    margin-bottom: 16px;
    color: #dadce0;
}

/* Compose Window */
.compose-window {
    position: fixed;
    bottom: 0;
    right: 80px;
    width: 500px;
    background: #fff;
    border-radius: 8px 8px 0 0;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    display: none;
    flex-direction: column;
    z-index: 1000;
}

.compose-header {
    background: #f2f6fc;
    padding: 10px 16px;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 500;
    font-size: 14px;
    color: #202124;
}

.compose-header-actions span {
    font-size: 16px;
    margin-left: 8px;
    cursor: pointer;
    color: #444746;
}

.compose-body {
    display: flex;
    flex-direction: column;
}

.compose-input {
    border: none;
    border-bottom: 1px solid #f1f3f4;
    padding: 12px 16px;
    font-size: 14px;
    outline: none;
}

.compose-textarea {
    border: none;
    padding: 16px;
    font-size: 14px;
    height: 300px;
    resize: none;
    outline: none;
    font-family: inherit;
}

.compose-footer {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-top: 1px solid #f1f3f4;
}

.send-btn {
    background: #0b57d0;
    color: white;
    border: none;
    padding: 8px 24px;
    border-radius: 24px;
    font-weight: 500;
    cursor: pointer;
    margin-right: 16px;
}
.send-btn:hover { background: #0842a0; }

.compose-footer-tools {
    flex: 1;
    display: flex;
    gap: 12px;
    color: #444746;
}
.compose-footer-tools span { cursor: pointer; font-size: 20px; }
.delete-compose { cursor: pointer; color: #444746; font-size: 20px; }

/* Toast Notifications */
.toast-notification {
    position: fixed;
    bottom: 24px;
    left: 24px;
    background: #323232;
    color: white;
    padding: 14px 24px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    font-size: 14px;
    box-shadow: 0 3px 5px -1px rgba(0,0,0,.2), 0 6px 10px 0 rgba(0,0,0,.14), 0 1px 18px 0 rgba(0,0,0,.12);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.toast-notification.show {
    opacity: 1;
    visibility: visible;
}

.toast-action {
    color: #fbbc04;
    font-weight: 500;
    margin-left: 24px;
    margin-right: 16px;
    cursor: pointer;
}

.toast-close {
    font-size: 18px;
    cursor: pointer;
    color: #9aa0a6;
}
.compose-actions {
    display: flex;
    align-items: center;
    gap: 15px;
    color: #5f6368;
}

.compose-actions span, .compose-actions label {
    cursor: pointer;
}

.compose-actions span:hover, .compose-actions label:hover {
    color: #202124;
}

/* Autocomplete Dropdown */
.autocomplete-dropdown {
    position: absolute;
    top: 50px;
    left: 20px;
    right: 20px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    z-index: 1000;
    max-height: 150px;
    overflow-y: auto;
}
.autocomplete-item {
    padding: 10px 15px;
    cursor: pointer;
    font-size: 14px;
}
.autocomplete-item:hover {
    background: #f1f3f4;
}

/* Attachment Chips */


/* Email Tag / Chip Inputs */
.chip-input-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
    padding: 5px 0;
    width: 100%;
    cursor: text;
}
.chip-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}
.email-chip {
    background: #e8eaed;
    color: #202124;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 13px;
    display: flex;
    align-items: center;
    border: 1px solid #dadce0;
}
.chip-remove {
    margin-left: 6px;
    cursor: pointer;
    font-size: 15px;
    font-weight: bold;
    color: #5f6368;
    line-height: 1;
}
.chip-remove:hover {
    color: #d93025;
}
.chip-ghost-input {
    border: none;
    outline: none;
    flex-grow: 1;
    min-width: 150px;
    font-size: 14px;
    font-family: inherit;
    background: transparent;
}

.attachment-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 20px;
    background: #fff;
}
.attachment-chip {
    background: #e8eaed;
    color: #202124;
    padding: 5px 12px;
    border-radius: 16px;
    font-size: 13px;
    display: flex;
    align-items: center;
}
/* Sobrescribir variables y fuentes para un look Premium (Stripe-like) */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

body {
    font-family: 'Inter', sans-serif !important;
    background-color: #f7f9fc !important;
    color: #1a1f36;
}

/* Modal Compose Premium */
.compose-window {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(10, 37, 64, 0.5); /* Fondo oscuro Stripe */
    backdrop-filter: blur(8px);
    display: none; /* Flex cuando está activo */
    align-items: center;
    justify-content: center;
    z-index: 9999;
    border-radius: 0;
    box-shadow: none;
    border: none;
}

.compose-inner {
    background: #ffffff;
    width: 90%;
    max-width: 850px;
    height: 85vh;
    border-radius: 16px;
    box-shadow: 0 50px 100px -20px rgba(50, 50, 93, 0.25), 0 30px 60px -30px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalPop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPop {
    0% { transform: scale(0.95) translateY(20px); opacity: 0; }
    100% { transform: scale(1) translateY(0); opacity: 1; }
}

.compose-header {
    background: #ffffff;
    padding: 20px 24px;
    border-bottom: 1px solid #e3e8ee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.compose-header span {
    font-weight: 600;
    font-size: 16px;
    color: #1a1f36;
}
.compose-header .material-icons-outlined {
    color: #8792a2;
    cursor: pointer;
    transition: color 0.2s;
}
.compose-header .material-icons-outlined:hover {
    color: #1a1f36;
}

.compose-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow-y: auto;
}

.compose-input {
    border: none;
    border-bottom: 1px solid #e3e8ee;
    padding: 16px 24px;
    font-size: 15px;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: background 0.2s;
}
.compose-input:focus {
    background: #f7f9fc;
}

#editor-container {
    flex: 1;
    border: none !important;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
}
.ql-toolbar.ql-snow {
    border: none !important;
    border-bottom: 1px solid #e3e8ee !important;
    padding: 12px 24px !important;
    background: #f7f9fc;
}
.ql-container.ql-snow {
    border: none !important;
}
.ql-editor {
    padding: 24px !important;
}

.compose-footer {
    background: #f7f9fc;
    padding: 16px 24px;
    border-top: 1px solid #e3e8ee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 24px;
    font-weight: 600;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.08);
    transition: all 0.2s ease;
}
.btn-primary:hover {
    background-color: #0a2540;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.12);
}

.compose-actions {
    color: #8792a2;
}
.compose-actions span:hover, .compose-actions label:hover {
    color: var(--primary-color);
}

/* View Email Premium */
.email-view-container {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
    margin: 10px;
    height: calc(100% - 20px);
    display: flex;
    flex-direction: column;
}

.view-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e3e8ee;
    display: flex;
    align-items: center;
    background: #ffffff;
    border-radius: 12px 12px 0 0;
}

.back-btn {
    background: #f7f9fc;
    padding: 8px;
    border-radius: 50%;
    color: #1a1f36;
    margin-right: 15px;
    transition: all 0.2s;
}
.back-btn:hover {
    background: #e3e8ee;
}

.view-actions .material-icons-outlined {
    color: #8792a2;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.2s;
    cursor: pointer;
}
.view-actions .material-icons-outlined:hover {
    background: #f7f9fc;
    color: #1a1f36;
}

.view-subject {
    font-size: 24px;
    font-weight: 600;
    color: #1a1f36;
    padding: 24px 24px 0 24px;
    margin: 0;
}

.view-sender-info {
    padding: 20px 24px;
    display: flex;
    align-items: center;
}
.sender-avatar {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #0a2540 100%);
    border-radius: 50%;
    margin-right: 16px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 18px;
}
.sender-details {
    display: flex;
    flex-direction: column;
}
.sender-name {
    font-weight: 600;
    font-size: 15px;
    color: #1a1f36;
}
.sender-email {
    font-size: 13px;
    color: #8792a2;
    margin-top: 2px;
}
.view-date {
    margin-left: auto;
    font-size: 13px;
    color: #8792a2;
}

.view-body {
    padding: 0 24px 24px 24px;
    flex: 1;
    overflow-y: auto;
    font-size: 15px;
    line-height: 1.6;
    color: #3c4257;
}

iframe {
    width: 100%;
    
    border: 1px solid #e3e8ee !important;
    border-radius: 8px;
    margin-top: 10px;
    background: #fff;
}
/* Revertir Modal Stripe a Ventana Flotante Gmail */
.compose-window {
    position: fixed !important;
    top: auto !important;
    left: auto !important;
    right: 80px !important;
    bottom: 0 !important;
    width: 775px !important;
    height: auto !important;
    background: transparent !important;
    backdrop-filter: none !important;
    z-index: 1000 !important;
    display: none;
    align-items: stretch !important;
    justify-content: flex-end !important;
}

.compose-inner {
    width: 100% !important;
    height: 700px !important;
    max-height: 80vh;
    border-radius: 8px 8px 0 0 !important;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2) !important;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.2s ease-out;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.compose-header {
    background: #f2f6fc !important;
    padding: 12px 16px !important;
    border-radius: 8px 8px 0 0 !important;
}

#editor-container {
    height: 450px !important;
}

/* Inline Reply Editor */
.inline-reply-container {
    margin-top: 16px;
    border: 1px solid #e3e8ee;
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
    display: none;
}
.inline-reply-header {
    padding: 12px 16px;
    background: #f7f9fc;
    border-bottom: 1px solid #e3e8ee;
    display: flex;
    align-items: center;
}
.inline-reply-editor {
    height: 150px;
    border: none !important;
}
.inline-reply-footer {
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
}

/* Estado Minimizado */
.compose-window.minimized .compose-inner {
    height: auto !important;
    min-height: 0 !important;
}
.compose-window.minimized .compose-content,
.compose-window.minimized .compose-footer {
    display: none !important;
}
.compose-window.minimized .compose-header {
    border-radius: 8px 8px 0 0 !important;
}

/* === GSA Drive CSS === */
.drive-file-card {
    background: #fff;
    border: 1px solid #dadce0;
    border-radius: 8px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    cursor: pointer;
    transition: box-shadow 0.2s, background 0.2s;
}
.drive-file-card:hover {
    background: #f8f9fa;
    box-shadow: 0 1px 3px rgba(60,64,67,0.3);
}
.file-icon-area {
    width: 100%;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f3f4;
    border-radius: 4px;
    margin-bottom: 12px;
}
.file-info-area {
    width: 100%;
    text-align: left;
}
.file-name {
    font-size: 14px;
    font-weight: 500;
    color: #202124;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}
.file-meta {
    font-size: 12px;
    color: #5f6368;
    display: flex;
    justify-content: space-between;
}
.file-menu-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    color: #5f6368;
    opacity: 0;
    transition: opacity 0.2s;
}
.drive-file-card:hover .file-menu-btn {
    opacity: 1;
}
.file-menu-btn:hover {
    background: #f1f3f4;
}
.file-context-menu {
    position: absolute;
    top: 55px;
    right: 20px;
    background: #fff;
    border: 1px solid #dadce0;
    border-radius: 4px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    z-index: 100;
    display: none;
    flex-direction: column;
    min-width: 150px;
}
.file-context-menu.active {
    display: flex;
}
.file-menu-item {
    padding: 10px 16px;
    font-size: 14px;
    color: #3c4043;
    cursor: pointer;
    text-align: left;
}
.file-menu-item:hover {
    background: #f1f3f4;
}

/* ── Compose: fix overflow para que el botón Enviar siempre sea visible ─── */
.compose-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    min-height: 0;
}

/* ── Campo "Para" con toggles CC/CCO ──────────────────────────────────────── */
.compose-field-row {
    display: flex;
    align-items: center;
    border-bottom: 1px solid #e3e8ee;
}
.compose-field-row .compose-input {
    flex: 1;
    border: none !important;
    border-bottom: none !important;
}
.compose-field-toggles {
    display: flex;
    gap: 4px;
    padding-right: 16px;
    flex-shrink: 0;
}
.compose-field-toggles span {
    font-size: 12px;
    color: #5f6368;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: background 0.15s;
}
.compose-field-toggles span:hover { background: #f1f3f4; }

/* ── Botones inline (Responder / Reenviar al pie del hilo) ─────────────────── */
.inline-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    border: 1px solid #747775;
    background: #fff;
    border-radius: 24px;
    color: #444746;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    transition: background 0.2s, box-shadow 0.2s;
}
.inline-action-btn:hover {
    background: #f1f3f4;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

/* ── Editor Compose: altura controlada ─────────────────────────────────────── */
#editor-container .ql-editor {
    min-height: 160px;
    max-height: 300px;
    overflow-y: auto;
}

/* ── Settings Modal Tab ────────────────────────────────────────────────────── */
.settings-tab {
    padding: 12px 0;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    color: #5f6368;
    border-bottom: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s;
}
.settings-tab.active-tab {
    color: var(--primary-color, #635bff);
    border-bottom-color: var(--primary-color, #635bff);
}
.settings-tab:hover { color: #1a1f36; }

/* ── Firma del correo ─────────────────────────────────────────────────────── */
.email-signature {
    font-size: 13px;
    color: #5f6368;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #e3e8ee;
}

/* ── Autocomplete Avanzado Estilo Gmail ──────────────────────────────────── */
.autocomplete-dropdown {
    position: absolute;
    background: #fff;
    border: 1px solid #dadce0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    max-height: 250px;
    overflow-y: auto;
    width: calc(100% - 32px);
    margin-top: 4px;
    display: none;
}
.autocomplete-item {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid #f1f3f4;
}
.autocomplete-item:last-child {
    border-bottom: none;
}
.autocomplete-item:hover, .autocomplete-item.active {
    background: #f1f3f4;
}
.ac-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-color, #635bff);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 500;
    margin-right: 12px;
    flex-shrink: 0;
}
.ac-details {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.ac-name {
    font-size: 14px;
    color: #202124;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ac-email {
    font-size: 12px;
    color: #5f6368;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}



/* ============================================================
   PERFIL DE USUARIO EN HEADER
   ============================================================ */
.user-avatar-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-color, #635bff);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid transparent;
    transition: border-color 0.2s;
}
.user-avatar-btn:hover {
    border-color: rgba(255,255,255,0.4);
}

.user-dropdown {
    border-radius: 12px !important;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15) !important;
    overflow: hidden;
}
.user-dropdown a:hover {
    background: #f8f9fa;
}

/* Badge de correos no leidos en el sidebar */
.new-badge {
    background: #d93025;
    color: #fff;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    padding: 1px 6px;
    margin-left: auto;
    animation: badgePop 0.3s ease;
}
@keyframes badgePop {
    0% { transform: scale(0); }
    70% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* ============================================================
   SETTINGS MODAL - MULTI-TAB
   ============================================================ */
.settings-modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.45);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}
.settings-modal-overlay.active {
    display: flex;
}
.settings-modal-box {
    background: #fff;
    border-radius: 14px;
    width: 720px;
    max-width: 96vw;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 64px rgba(0,0,0,0.25);
    overflow: hidden;
}
.settings-modal-header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid #e3e8ee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}
.settings-modal-title {
    margin: 0;
    font-size: 18px;
    font-weight: 500;
    color: #1a1f36;
}
.settings-close-btn {
    cursor: pointer;
    color: #5f6368;
    transition: color 0.15s;
}
.settings-close-btn:hover { color: #1a1f36; }

.settings-tabs {
    padding: 0 24px;
    border-bottom: 1px solid #e3e8ee;
    display: flex;
    gap: 0;
    flex-shrink: 0;
}
.settings-tab {
    padding: 13px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    color: #5f6368;
    transition: color 0.15s, border-color 0.15s;
    white-space: nowrap;
}
.settings-tab:hover { color: #1a1f36; }
.settings-tab.active-tab {
    border-bottom-color: var(--primary-color);
    color: var(--primary-color);
}

.settings-tab-content {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

/* Avatar section in settings */
.settings-avatar-section {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 10px;
}
.settings-avatar-preview {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--primary-color, #635bff);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.btn-upload-avatar {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--primary-color, #635bff);
    color: #fff;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.15s;
}
.btn-upload-avatar:hover { opacity: 0.85; }

.settings-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.settings-form-group {
    display: flex;
    flex-direction: column;
}
.settings-label {
    font-size: 12px;
    font-weight: 600;
    color: #5f6368;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}
.settings-input {
    padding: 9px 12px;
    border: 1px solid #dadce0;
    border-radius: 8px;
    font-size: 14px;
    color: #1a1f36;
    font-family: inherit;
    transition: border-color 0.15s;
    width: 100%;
    box-sizing: border-box;
}
.settings-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(var(--primary-color-rgb, 99,91,255),0.12);
}
.settings-input[type="password"] { letter-spacing: 2px; }
.settings-input[type="password"]::placeholder { letter-spacing: normal; }

/* Toggle switch (vacaciones) */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 26px;
    flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #ccc;
    border-radius: 26px;
    transition: background 0.2s;
}
.toggle-slider:before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    left: 3px;
    top: 3px;
    transition: transform 0.2s;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.toggle-switch input:checked + .toggle-slider { background: var(--primary-color); }
.toggle-switch input:checked + .toggle-slider:before { transform: translateX(20px); }

/* Settings modal footer */
.settings-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #e3e8ee;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    flex-shrink: 0;
    background: #fafafa;
}
.btn-settings-cancel {
    padding: 8px 20px;
    border: 1px solid #dadce0;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    font-size: 14px;
    color: #1a1f36;
    font-family: inherit;
    transition: background 0.15s;
}
.btn-settings-cancel:hover { background: #f1f3f4; }

/* Chips Inputs */
.chips-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    width: 100%;
    min-height: 24px;
}
.chip {
    background-color: #f1f3f4;
    border: 1px solid #dadce0;
    border-radius: 16px;
    padding: 2px 8px 2px 10px;
    font-size: 13px;
    color: #202124;
    display: inline-flex;
    align-items: center;
    margin: 2px 0;
}
.chip-close {
    margin-left: 6px;
    cursor: pointer;
    font-size: 14px;
    color: #5f6368;
    line-height: 1;
}
.chip-close:hover {
    color: #202124;
}
.chips-input {
    flex: 1;
    min-width: 150px;
    border: none !important;
    outline: none !important;
    padding: 0 !important;
    height: 24px !important;
}
.chips-row {
    padding: 6px 16px;
}


.drag-active { border: 2px dashed var(--primary-color) !important; background-color: rgba(99, 91, 255, 0.05); }

