* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #5e72e4;
    --secondary-color: #8392ab;
    --success-color: #2dce89;
    --warning-color: #fb6340;
    --danger-color: #f5365c;
    --dark-color: #172b4d;
    --light-color: #f7fafc;
    --border-color: #e9ecef;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(to bottom right, #020617 0%, #172554 50%, #020617 100%);
    color: white;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(to bottom right, #020617 0%, #172554 50%, #020617 100%);
}

/* Header */
header {
    background: linear-gradient(135deg, #1a2332 0%, #2d3748 100%);
    padding: 1.25rem 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid rgba(59, 130, 246, 0.3);
}

header h1 {
    color: white;
    font-size: 1.75rem;
    font-weight: 600;
    margin: 0;
    letter-spacing: -0.5px;
}

.header-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

/* Botones */
.btn {
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
    font-weight: 500;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.3);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.3);
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

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

/* Status Bar */
.status-bar {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(10px);
    color: rgba(255, 255, 255, 0.9);
    padding: 0.75rem 2rem;
    font-size: 0.9rem;
    font-weight: 500;
    border-bottom: 1px solid rgba(59, 130, 246, 0.2);
}

/* Main Content */
.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(10px);
    border-right: 1px solid rgba(59, 130, 246, 0.2);
    padding: 1.5rem 0;
}

.menu-item {
    padding: 1rem 1.75rem;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    margin: 0.25rem 0.75rem;
    border-radius: 8px;
    font-weight: 500;
}

.menu-item {
    color: rgba(255, 255, 255, 0.7);
}

.menu-item:hover {
    background: rgba(59, 130, 246, 0.1);
    color: rgba(255, 255, 255, 0.9);
}

.menu-item.active {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
}

.menu-item.active .icon {
    font-weight: bold;
}

.menu-item.active .count {
    background: rgba(255, 255, 255, 0.25);
    color: white;
}

.menu-item .icon {
    margin-right: 1rem;
    font-size: 0.95rem;
    font-weight: 600;
    width: 30px;
    text-align: center;
}

.menu-item .count {
    margin-left: auto;
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.65rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    min-width: 24px;
    text-align: center;
}

/* Email List */
.email-list {
    flex: 1;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    max-width: 420px;
    border-right: 1px solid rgba(59, 130, 246, 0.2);
}

.list-header {
    padding: 1.25rem 1.75rem;
    border-bottom: 1px solid rgba(59, 130, 246, 0.2);
    background: rgba(15, 23, 42, 0.5);
}

.list-header h2 {
    font-size: 1.25rem;
    color: white;
    font-weight: 600;
    margin: 0;
}

.emails {
    flex: 1;
    overflow-y: auto;
}

.email-item {
    padding: 1.25rem 1.75rem;
    border-bottom: 1px solid rgba(59, 130, 246, 0.1);
    cursor: pointer;
    transition: all 0.2s;
    border-left: 3px solid transparent;
    color: rgba(255, 255, 255, 0.8);
}

.email-item:hover {
    background: rgba(59, 130, 246, 0.1);
    border-left-color: rgba(59, 130, 246, 0.5);
    color: white;
}

.email-item.unread {
    background: rgba(59, 130, 246, 0.15);
    font-weight: 600;
    border-left-color: #3b82f6;
    color: white;
}

.email-item.active {
    background: rgba(59, 130, 246, 0.25);
    border-left-color: #3b82f6;
    color: white;
}

.email-subject {
    font-weight: 600;
    margin-bottom: 0.3rem;
    color: white;
}

.email-from {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

.email-preview {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
    margin-top: 0.3rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.email-date {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
    margin-top: 0.3rem;
}

/* Email View */
.email-view {
    flex: 2;
    background: rgba(15, 23, 42, 0.3);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: rgba(255, 255, 255, 0.5);
    padding: 3rem;
}

.empty-icon {
    font-size: 5rem;
    margin-bottom: 1rem;
}

.empty-state h3 {
    margin-bottom: 0.5rem;
}

/* Loading */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: rgba(255, 255, 255, 0.8);
}

.loading p {
    color: rgba(255, 255, 255, 0.6);
    margin-top: 1rem;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 2px solid #3b82f6;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Email Content */
.email-content {
    padding: 2rem;
    height: 100%;
    overflow-y: auto;
    color: rgba(255, 255, 255, 0.9);
}

.email-header {
    border-bottom: 1px solid rgba(59, 130, 246, 0.2);
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
}

.email-header h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: white;
}

.email-meta {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    margin-top: 0.75rem;
}

.email-meta-line {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.email-meta strong {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    margin-right: 0.25rem;
}

.email-actions {
    margin-top: 1rem;
    display: flex;
    gap: 0.5rem;
}

.email-body {
    max-width: 100%;
    overflow-x: auto;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.8;
}

.email-html-content {
    max-width: 100%;
    word-wrap: break-word;
}

.email-html-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0.5rem 0;
}

.email-body img {
    max-width: 100%;
    height: auto;
}

.email-body pre {
    background: rgba(15, 23, 42, 0.5);
    padding: 1rem;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(2, 6, 23, 0.8);
    backdrop-filter: blur(5px);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Modal de confirmación - centrado y más pequeño */
.confirm-modal {
    display: none;
    align-items: center;
    justify-content: center;
}

.confirm-modal.show,
.confirm-modal[style*="flex"] {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.confirm-modal-content {
    max-width: 380px;
    width: 90%;
    margin: auto;
}

.modal-content {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 12px;
    color: white;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid rgba(59, 130, 246, 0.2);
}

.modal-header h2 {
    font-size: 1.3rem;
    color: white;
}

.close {
    font-size: 2rem;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.6);
    transition: color 0.3s;
}

.close:hover {
    color: white;
}

.modal-body {
    padding: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="password"],
.form-group input[type="email"] {
    width: 100%;
    padding: 0.75rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 6px;
    font-size: 1rem;
    color: white;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #3b82f6;
    background: rgba(15, 23, 42, 0.8);
}

.form-group input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.form-group input[type="checkbox"] {
    margin-right: 0.5rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
}

/* Responsive */
@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        display: flex;
        overflow-x: auto;
    }
    
    .email-list,
    .email-view {
        max-width: 100%;
    }
    
    .email-view {
        display: none;
    }
    
    .email-view.active {
        display: block;
    }
}

/* Panel Admin */
.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: linear-gradient(135deg, var(--primary-color), #4a5fd0);
    color: white;
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.stat-label {
    display: block;
    font-size: 0.9rem;
    opacity: 0.9;
}

.account-item {
    padding: 1rem;
    border-bottom: 1px solid rgba(59, 130, 246, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.3s;
    background: rgba(15, 23, 42, 0.4);
}

.account-item:hover {
    background: rgba(15, 23, 42, 0.6);
}

.account-item:last-child {
    border-bottom: none;
}

.account-info {
    flex: 1;
}

.account-email {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 0.3rem;
}

.account-path {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
}

.account-actions {
    display: flex;
    gap: 0.5rem;
}

.account-actions .btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

/* Pantalla de Login */
.login-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(to bottom right, #020617 0%, #172554 50%, #020617 100%);
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

.login-screen::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(59, 130, 246, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(59, 130, 246, 0.08) 0%, transparent 50%);
    background-size: 100% 100%;
    opacity: 0.5;
    pointer-events: none;
}

.login-container {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 16px;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.5),
        0 0 1px rgba(59, 130, 246, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    padding: 0;
    width: 100%;
    max-width: 440px;
    position: relative;
    z-index: 1;
}

.login-logo {
    text-align: center;
    padding: 2rem 3rem 1rem;
}

.login-logo-icon {
    width: 60px;
    height: 60px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.login-logo-icon img,
.login-logo-icon svg {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(59, 130, 246, 0.4));
    transition: filter 0.3s;
}

.login-logo-icon img {
    filter: 
        brightness(0) saturate(100%) invert(48%) sepia(98%) saturate(3122%) hue-rotate(208deg) brightness(100%) contrast(100%),
        drop-shadow(0 2px 8px rgba(59, 130, 246, 0.4));
}

.login-logo-icon img:hover {
    filter: 
        brightness(0) saturate(100%) invert(48%) sepia(98%) saturate(3122%) hue-rotate(208deg) brightness(110%) contrast(100%),
        drop-shadow(0 4px 12px rgba(59, 130, 246, 0.6));
}

.login-logo-icon svg:hover {
    filter: drop-shadow(0 4px 12px rgba(59, 130, 246, 0.6));
    transform: scale(1.05);
}


.login-content {
    padding: 2rem 3rem 3rem;
}

.login-header {
    margin-bottom: 2rem;
    text-align: center;
}

.login-header h1 {
    font-size: 1.75rem;
    color: white;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.login-header p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.95rem;
}

.login-form {
    margin-bottom: 1.5rem;
}

.login-form .form-group {
    margin-bottom: 1.5rem;
}

.login-form label {
    display: block;
    margin-bottom: 0.5rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    font-size: 0.9rem;
    position: relative;
    z-index: 1;
}

.login-form .input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.login-form .input-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.6);
    z-index: 2;
    pointer-events: none;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.login-form .input-icon svg {
    width: 100%;
    height: 100%;
    stroke: currentColor;
}

.login-form input {
    width: 100%;
    padding: 12px 16px !important;
    padding-left: 2.75rem !important;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 10px;
    font-size: 1rem;
    color: white;
    transition: all 0.3s;
    box-sizing: border-box;
    position: relative;
    z-index: 0;
    line-height: 1.5;
    height: 48px;
    display: block;
}

.login-form input[type="password"] {
    font-family: 'Courier New', monospace;
    letter-spacing: 0;
}

.login-form input::placeholder {
    color: rgba(255, 255, 255, 0.3);
    opacity: 1;
    line-height: 1.5;
}

.login-form input:focus {
    outline: none;
    border-color: #3b82f6;
    background: rgba(15, 23, 42, 0.8);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.login-form .error-message {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-block {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    font-weight: 600;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border: none;
    color: white;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.btn-block:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
    transform: translateY(-1px);
}

.btn-block:active {
    transform: translateY(0);
}

.btn-block:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.spinner-small {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-left: 0.5rem;
    vertical-align: middle;
}

.login-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 0;
    border-top: none;
}

.login-footer p {
    margin: 0;
}

.login-footer a {
    color: #3b82f6;
    text-decoration: none;
    transition: color 0.3s;
}

.login-footer a:hover {
    color: #60a5fa;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Sistema de Notificaciones Moderno */
.notification {
    min-width: 300px;
    max-width: 400px;
    padding: 1rem 1.25rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideInRight 0.3s ease-out;
    backdrop-filter: blur(10px);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.notification.notification-out {
    animation: slideOutRight 0.3s ease-out;
}

.notification-success {
    background: rgba(34, 197, 94, 0.9);
    border-left: 4px solid #22c55e;
    color: white;
}

.notification-error {
    background: rgba(239, 68, 68, 0.9);
    border-left: 4px solid #ef4444;
    color: white;
}

.notification-info {
    background: rgba(59, 130, 246, 0.9);
    border-left: 4px solid #3b82f6;
    color: white;
}

.notification-warning {
    background: rgba(251, 191, 36, 0.9);
    border-left: 4px solid #fbbf24;
    color: white;
}

.notification-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.notification-content {
    flex: 1;
}

.notification-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
    font-size: 0.95rem;
}

.notification-message {
    font-size: 0.85rem;
    opacity: 0.95;
    line-height: 1.4;
}

.notification-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s;
    flex-shrink: 0;
}

.notification-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

