/* ==========================================
   VARIABLES DE COLORES
   ========================================== */
:root {
    --bg-body: #f3f4f6;
    --bg-surface: #ffffff;
    --bg-sidebar: #ffffff;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --btn-secondary-bg: #f9fafb;
    --btn-secondary-text: #374151;
    --cat-event: #e0e7ff;
    --cat-event-text: #3730a3;
    --cat-task: #fce7f3;
    --cat-task-text: #9d174d;
    --cat-visit: #d1fae5;
    --cat-visit-text: #065f46;
    --cat-habit: #fef3c7;
    --cat-habit-text: #92400e;
    --cat-payment: #d1fae5;
    --cat-payment-text: #065f46;
    --cat-health: #fee2e2;
    --cat-health-text: #991b1b;
    --cat-birthday: #fce7f3;
    --cat-birthday-text: #9d174d;
    --cat-deadline: #ede9fe;
    --cat-deadline-text: #5b21b6;
    --cat-travel: #cffafe;
    --cat-travel-text: #155e75;
    --priority-high: #dc2626;
    --priority-medium: #f59e0b;
    --priority-low: #10b981;
    --priority-none: #9ca3af;
}

body.dark-mode {
    --bg-body: #0f172a;
    --bg-surface: #1e293b;
    --bg-sidebar: #1e293b;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --border-color: #334155;
    --primary-color: #818cf8;
    --primary-hover: #6366f1;
    --btn-secondary-bg: #334155;
    --btn-secondary-text: #e2e8f0;
    --cat-event: #312e81;
    --cat-event-text: #c7d2fe;
    --cat-task: #831843;
    --cat-task-text: #fbcfe8;
    --cat-visit: #064e3b;
    --cat-visit-text: #a7f3d0;
    --cat-habit: #78350f;
    --cat-habit-text: #fcd34d;
    --cat-payment: #064e3b;
    --cat-payment-text: #6ee7b7;
    --cat-health: #7f1d1d;
    --cat-health-text: #fca5a5;
    --cat-birthday: #831843;
    --cat-birthday-text: #fbcfe8;
    --cat-deadline: #4c1d95;
    --cat-deadline-text: #ddd6fe;
    --cat-travel: #164e63;
    --cat-travel-text: #a5f3fc;
    --priority-high: #ef4444;
    --priority-medium: #fbbf24;
    --priority-low: #34d399;
    --priority-none: #6b7280;
}

/* ==========================================
   RESET Y BASE
   ========================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
    transition: background-color 0.3s, color 0.3s;
}

body {
    background-color: var(--bg-body);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
}

/* ==========================================
   HEADER
   ========================================== */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    height: 60px;
    gap: 15px;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.logo-area h1 {
    font-size: 1.1rem;
    white-space: nowrap;
}

.logo-icon {
    color: var(--primary-color);
    font-size: 1.3rem;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    flex: 1;
    justify-content: flex-end;
}

.theme-toggle {
    background: none;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 6px 8px;
    border-radius: 6px;
    flex-shrink: 0;
    text-decoration: none;
}

.theme-toggle:hover {
    background: var(--bg-body);
    color: var(--primary-color);
}

.btn-notes-toggle,
.btn-contacts-toggle,
.btn-stats {
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-notes-toggle:hover,
.btn-notes-toggle.active,
.btn-contacts-toggle:hover,
.btn-contacts-toggle.active,
.btn-stats:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.btn-notes-toggle i { color: #fbbf24; }
.btn-contacts-toggle i { color: #6366f1; }
.btn-notes-toggle:hover i,
.btn-notes-toggle.active i,
.btn-contacts-toggle:hover i,
.btn-contacts-toggle.active i { color: white; }

.btn-stats i { color: #10b981; }
.btn-stats:hover i { color: white; }

.btn-admin-toggle {
    background: #dc2626;
    color: white;
    border: none;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-admin-toggle:hover {
    background: #b91c1c;
    transform: translateY(-1px);
}

/* ==========================================
   🔔 CAMPANITA DE NOTIFICACIONES
   ========================================== */
.btn-notificaciones {
    position: relative;
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 1rem;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.btn-notificaciones:hover {
    background: #fef3c7;
    border-color: #f59e0b;
    color: #92400e;
    transform: translateY(-1px);
}

.btn-notificaciones i { color: #f59e0b; }

.btn-notificaciones:hover i {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: rotate(0); }
    25% { transform: rotate(-15deg); }
    75% { transform: rotate(15deg); }
}

.notif-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #dc2626;
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    border: 2px solid var(--bg-surface);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* ==========================================
   ✏️ BOTÓN EDITAR NOMBRE
   ========================================== */
.btn-edit-nombre {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    transition: 0.2s;
    margin-left: 4px;
    vertical-align: middle;
}

.btn-edit-nombre:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.1);
}

.btn-edit-nombre i { pointer-events: none; }

/* ==========================================
   🏢 BADGE DE GRUPO
   ========================================== */
.grupo-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-left: 6px;
    border: 1px solid rgba(99, 102, 241, 0.2);
    white-space: nowrap;
}

.grupo-badge i { font-size: 0.65rem; }

/* ==========================================
   🔑 BOTÓN CAMBIAR CONTRASEÑA
   ========================================== */
.btn-cambiar-pass {
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: 0.2s;
    text-decoration: none;
    flex-shrink: 0;
}

.btn-cambiar-pass:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

.btn-cambiar-pass i { font-size: 0.85rem; }

/* ==========================================
   📱 BOTÓN HAMBURGUESA (MÓVIL)
   ========================================== */
.btn-sidebar-toggle {
    display: none;
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 1.2rem;
    transition: 0.2s;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.btn-sidebar-toggle:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 499;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* ==========================================
   USER-AREA
   ========================================== */
.user-area {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.welcome-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    white-space: nowrap;
}

.avatar-container {
    position: relative;
    width: 36px;
    height: 36px;
    cursor: pointer;
    flex-shrink: 0;
}

.avatar-container img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
}

.avatar-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: 0.2s;
    color: white;
    font-size: 0.8rem;
}

.avatar-container:hover .avatar-overlay { opacity: 1; }

.logout-btn {
    background: none;
    border: 1px solid var(--border-color);
    padding: 5px 10px;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.8rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    flex-shrink: 0;
}

.logout-btn:hover {
    background: #fee2e2;
    color: #dc2626;
    border-color: #fee2e2;
}

/* ==========================================
   LAYOUT PRINCIPAL
   ========================================== */
.main-layout {
    display: flex;
    height: calc(100vh - 60px);
}

.sidebar {
    width: 320px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
}

/* ==========================================
   📱 MENÚ DE USUARIO MÓVIL
   ========================================== */
.mobile-user-menu {
    display: none;
    padding-bottom: 15px;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.mobile-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-body);
    border-radius: 10px;
    margin-bottom: 12px;
}

.mobile-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
    cursor: pointer;
}

.mobile-user-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.mobile-user-details strong {
    font-size: 1rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.mobile-user-details small {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.mobile-user-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.btn-mobile-action {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: 0.2s;
    width: 100%;
    text-align: left;
}

.btn-mobile-action:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.btn-mobile-action i {
    width: 20px;
    text-align: center;
}

.btn-mobile-action.logout {
    background: #fee2e2;
    color: #dc2626;
    border-color: #fecaca;
    margin-top: 6px;
}

.btn-mobile-action.logout:hover {
    background: #dc2626;
    color: white;
}

/* ==========================================
   MENÚ DESPLEGABLE
   ========================================== */
.create-menu {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.btn-create-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    width: 100%;
    text-align: left;
    background: var(--primary-color);
    color: white;
}

.btn-create-toggle:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(99, 102, 241, 0.3);
}

.btn-create-toggle .toggle-icon {
    margin-left: auto;
    transition: transform 0.3s ease;
}

.btn-create-toggle.active .toggle-icon {
    transform: rotate(180deg);
}

.create-menu-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.3s ease;
    opacity: 0;
    background: var(--bg-body);
    border-radius: 0 0 8px 8px;
}

.create-menu-content.show {
    max-height: 600px;
    opacity: 1;
    margin-top: 5px;
    padding: 5px 0;
}

.btn-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-primary);
    width: 100%;
    text-align: left;
    transition: all 0.2s;
}

.btn-menu-item:hover {
    background: var(--bg-surface);
    padding-left: 20px;
    color: var(--primary-color);
}

.btn-menu-item i {
    width: 20px;
    text-align: center;
    color: var(--text-secondary);
}

.btn-menu-item:hover i { color: var(--primary-color); }

.btn-menu-item.btn-template {
    border-top: 1px dashed var(--border-color);
    margin-top: 5px;
    padding-top: 12px;
    font-style: italic;
}

/* ==========================================
   🔍 BÚSQUEDA Y FILTROS
   ========================================== */
.search-filters-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box i {
    position: absolute;
    left: 12px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    pointer-events: none;
}

.search-box input {
    width: 100%;
    padding: 9px 12px 9px 36px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-body);
    color: var(--text-primary);
    font-size: 0.85rem;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.filter-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-select {
    flex: 1;
    min-width: 120px;
    padding: 8px 10px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-body);
    color: var(--text-primary);
    font-size: 0.8rem;
    cursor: pointer;
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.filter-chip {
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    cursor: pointer;
    transition: 0.2s;
}

.filter-chip:hover,
.filter-chip.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.list-count {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 400;
    margin-left: 4px;
}

/* ==========================================
   LISTA LATERAL
   ========================================== */
.list-section h3 {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.item-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.item-list li {
    background: var(--bg-body);
    padding: 10px;
    border-radius: 8px;
    font-size: 0.85rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    border-left: 4px solid transparent;
    position: relative;
}

.item-list li.type-event { border-left-color: var(--primary-color); }
.item-list li.type-task { border-left-color: #ec4899; }
.item-list li.type-visit { border-left-color: #10b981; }
.item-list li.type-habit { border-left-color: #f59e0b; }
.item-list li.type-payment { border-left-color: #10b981; }
.item-list li.type-health { border-left-color: #ef4444; }
.item-list li.type-birthday { border-left-color: #ec4899; }
.item-list li.type-deadline { border-left-color: #8b5cf6; }
.item-list li.type-travel { border-left-color: #06b6d4; }

.item-list li.priority-high {
    border-left-color: var(--priority-high) !important;
    background: rgba(220, 38, 38, 0.05);
}

.item-list li.priority-medium {
    border-left-color: var(--priority-medium) !important;
    background: rgba(245, 158, 11, 0.05);
}

.item-list li.priority-low {
    border-left-color: var(--priority-low) !important;
    background: rgba(16, 185, 129, 0.05);
}

body.dark-mode .item-list li.priority-high { background: rgba(239, 68, 68, 0.1); }
body.dark-mode .item-list li.priority-medium { background: rgba(251, 191, 36, 0.1); }
body.dark-mode .item-list li.priority-low { background: rgba(52, 211, 153, 0.1); }

.item-title-row {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    flex-wrap: wrap;
}

.item-title-text {
    font-weight: 500;
    flex: 1;
    min-width: 0;
    word-break: break-word;
}

.item-date-info {
    color: var(--text-secondary);
    font-size: 0.75rem;
    white-space: nowrap;
    margin-left: auto;
}

.creator-badge {
    font-size: 0.65rem;
    background: var(--bg-surface);
    color: var(--text-secondary);
    padding: 2px 6px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    white-space: nowrap;
}

.creator-badge i {
    font-size: 0.6rem;
    margin-right: 3px;
}

.item-actions {
    display: flex;
    gap: 4px;
    margin-left: auto;
    flex-wrap: nowrap;
    width: 100%;
    justify-content: flex-end;
}

.btn-edit,
.btn-delete,
.btn-share {
    background: none;
    border: none;
    padding: 4px 6px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
    color: var(--text-secondary);
    transition: 0.2s;
}

.btn-edit:hover { background: var(--primary-color); color: white; }
.btn-delete:hover { background: #dc2626; color: white; }
.btn-share:hover { background: #3b82f6; color: white; }

.readonly-badge {
    font-size: 0.7rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

.tag-badge {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.tag-badge::before { content: '#'; }

body.dark-mode .tag-badge {
    background: #312e81;
    color: #c7d2fe;
}

.recurrence-badge {
    font-size: 0.7rem;
    background: #fef3c7;
    color: #92400e;
    padding: 2px 6px;
    border-radius: 10px;
    border: 1px solid #f59e0b;
    white-space: nowrap;
}

body.dark-mode .recurrence-badge {
    background: #78350f;
    color: #fcd34d;
    border-color: #92400e;
}

.priority-badge {
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 600;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.priority-badge.priority-high { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.priority-badge.priority-medium { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
.priority-badge.priority-low { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }

body.dark-mode .priority-badge.priority-high { background: #7f1d1d; color: #fca5a5; border-color: #991b1b; }
body.dark-mode .priority-badge.priority-medium { background: #78350f; color: #fcd34d; border-color: #92400e; }
body.dark-mode .priority-badge.priority-low { background: #064e3b; color: #6ee7b7; border-color: #065f46; }

.priority-inline {
    display: inline-block;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
    margin-left: 6px;
}

.priority-inline.priority-high { background: #fee2e2; color: #991b1b; }
.priority-inline.priority-medium { background: #fef3c7; color: #92400e; }
.priority-inline.priority-low { background: #d1fae5; color: #065f46; }

/* ==========================================
   🗑️ BOTÓN PAPELERA
   ========================================== */
.btn-trash-toggle {
    background: var(--bg-body);
    border: 1px dashed var(--border-color);
    color: var(--text-secondary);
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: 0.2s;
    width: 100%;
    text-align: left;
}

.btn-trash-toggle:hover {
    background: #fee2e2;
    color: #dc2626;
    border-color: #dc2626;
    border-style: solid;
}

.btn-trash-toggle i { color: #dc2626; }

.trash-count {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-left: auto;
}

/* ==========================================
   NOTAS GENERALES
   ========================================== */
.general-notes-section {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 15px;
    margin-top: 10px;
}

.general-notes-section h3 {
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.general-notes-section h3 i { color: #f59e0b; }

.general-notes-section textarea {
    width: 100%;
    min-height: 120px;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-body);
    color: var(--text-primary);
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.85rem;
    resize: vertical;
}

.general-notes-section textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.save-status {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 5px;
    height: 15px;
    text-align: right;
}

/* ==========================================
   SECCIONES CALENDARIO Y NOTAS
   ========================================== */
.calendar-section,
.notes-section,
.contacts-section {
    flex: 1;
    padding: 25px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.notes-section,
.contacts-section {
    background: var(--bg-body);
}

.calendar-header,
.notes-header,
.contacts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.notes-title-area,
.contacts-title-area {
    display: flex;
    align-items: center;
    gap: 15px;
}

.notes-title-area h2,
.contacts-title-area h2 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.date-navigation {
    display: flex;
    align-items: center;
    gap: 15px;
}

#calendar-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.btn-icon,
.btn-today {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-primary);
    font-weight: 500;
    transition: 0.2s;
}

.btn-icon:hover,
.btn-today:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* ==========================================
   📤 ACCIONES DEL CALENDARIO
   ========================================== */
.calendar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.export-buttons {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.btn-export {
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    padding: 7px 12px;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.8rem;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-export:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

.btn-export i { font-size: 0.85rem; }

.view-toggles {
    background: var(--bg-sidebar);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 4px;
    display: flex;
}

.view-btn {
    background: none;
    border: none;
    padding: 6px 16px;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.85rem;
}

.view-btn.active {
    background: var(--primary-color);
    color: white;
}

.calendar-container {
    flex: 1;
    background: var(--bg-surface);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    padding: 20px;
    overflow-y: auto;
}

/* ==========================================
   📊 MINI RESUMEN
   ========================================== */
.mini-resumen {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 18px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.mini-resumen-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg-body);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    flex: 1;
    min-width: 100px;
    justify-content: center;
}

.mini-resumen-item i { font-size: 0.9rem; }

.mini-num {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.mini-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.mini-resumen-fecha {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: capitalize;
    padding-left: 10px;
    border-left: 1px solid var(--border-color);
    white-space: nowrap;
}

/* ==========================================
   VISTA MES
   ========================================== */
.month-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: var(--border-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.month-header {
    background: var(--bg-surface);
    padding: 12px;
    text-align: center;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.month-cell {
    background: var(--bg-surface);
    min-height: 100px;
    padding: 8px;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    flex-direction: column;
    position: relative;
}

.month-cell:hover { background: var(--bg-body); }
.month-cell.empty { background: var(--bg-body); cursor: default; }
.month-cell.today { background: rgba(99, 102, 241, 0.05); }

.month-day-number {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.month-cell.today .month-day-number {
    background: var(--primary-color);
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.month-event {
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.month-event.cat-event { background: var(--cat-event); color: var(--cat-event-text); }
.month-event.cat-task { background: var(--cat-task); color: var(--cat-task-text); }
.month-event.cat-visit { background: var(--cat-visit); color: var(--cat-visit-text); }
.month-event.cat-habit { background: var(--cat-habit); color: var(--cat-habit-text); }
.month-event.cat-payment { background: var(--cat-payment); color: var(--cat-payment-text); }
.month-event.cat-health { background: var(--cat-health); color: var(--cat-health-text); }
.month-event.cat-birthday { background: var(--cat-birthday); color: var(--cat-birthday-text); }
.month-event.cat-deadline { background: var(--cat-deadline); color: var(--cat-deadline-text); }
.month-event.cat-travel { background: var(--cat-travel); color: var(--cat-travel-text); }

.month-more {
    font-size: 0.7rem;
    color: var(--text-secondary);
    padding: 2px 6px;
}

.note-indicator {
    position: absolute;
    top: 6px;
    right: 6px;
    color: #fbbf24;
    font-size: 0.85rem;
    opacity: 0.8;
}

/* ==========================================
   VISTA SEMANA
   ========================================== */
.week-grid {
    display: grid;
    grid-template-columns: 60px repeat(7, 1fr);
    gap: 1px;
    background: var(--border-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.week-header-corner { background: var(--bg-surface); padding: 12px; }

.week-header {
    background: var(--bg-surface);
    padding: 12px;
    text-align: center;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.week-header.today {
    background: var(--primary-color);
    color: white;
}

.week-time {
    background: var(--bg-surface);
    padding: 8px;
    text-align: right;
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.week-cell {
    background: var(--bg-surface);
    min-height: 60px;
    padding: 4px;
    position: relative;
}

.week-event {
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.week-event.cat-event { background: var(--cat-event); color: var(--cat-event-text); }
.week-event.cat-task { background: var(--cat-task); color: var(--cat-task-text); }
.week-event.cat-visit { background: var(--cat-visit); color: var(--cat-visit-text); }
.week-event.cat-habit { background: var(--cat-habit); color: var(--cat-habit-text); }
.week-event.cat-payment { background: var(--cat-payment); color: var(--cat-payment-text); }
.week-event.cat-health { background: var(--cat-health); color: var(--cat-health-text); }
.week-event.cat-birthday { background: var(--cat-birthday); color: var(--cat-birthday-text); }
.week-event.cat-deadline { background: var(--cat-deadline); color: var(--cat-deadline-text); }
.week-event.cat-travel { background: var(--cat-travel); color: var(--cat-travel-text); }

/* ==========================================
   VISTA DÍA
   ========================================== */
.day-grid { display: flex; flex-direction: column; }

.day-slot {
    display: flex;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
    min-height: 60px;
}

.day-time {
    width: 60px;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.day-content { flex: 1; }

.event-card {
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
}

.event-card.cat-event { background: var(--cat-event); color: var(--cat-event-text); }
.event-card.cat-task { background: var(--cat-task); color: var(--cat-task-text); }
.event-card.cat-visit { background: var(--cat-visit); color: var(--cat-visit-text); }
.event-card.cat-habit { background: var(--cat-habit); color: var(--cat-habit-text); }
.event-card.cat-payment { background: var(--cat-payment); color: var(--cat-payment-text); }
.event-card.cat-health { background: var(--cat-health); color: var(--cat-health-text); }
.event-card.cat-birthday { background: var(--cat-birthday); color: var(--cat-birthday-text); }
.event-card.cat-deadline { background: var(--cat-deadline); color: var(--cat-deadline-text); }
.event-card.cat-travel { background: var(--cat-travel); color: var(--cat-travel-text); }

.event-archivos-mini {
    display: flex;
    gap: 4px;
    margin-top: 6px;
    flex-wrap: wrap;
}

.event-archivos-mini span { font-size: 0.9rem; }

.daily-notes-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.daily-notes-card h3 {
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.daily-notes-card textarea {
    width: 100%;
    min-height: 120px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-body);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
}

.daily-notes-card textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* ==========================================
   NOTAS INDEPENDIENTES
   ========================================== */
.notes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    padding-bottom: 20px;
}

.note-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s, box-shadow 0.2s;
}

.note-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.note-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.note-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    word-break: break-word;
}

.note-card-date {
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.note-card-content {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
    flex-grow: 1;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 150px;
    overflow: hidden;
    position: relative;
}

.note-card-content::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30px;
    background: linear-gradient(transparent, var(--bg-surface));
}

.note-card-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
}

.empty-notes {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
    grid-column: 1 / -1;
}

.empty-notes i {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

#btn-new-note {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(99, 102, 241, 0.2);
    width: auto;
    text-align: center;
}

#btn-new-note:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

/* ==========================================
   📇 CONTACTOS
   ========================================== */
.contacts-search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.contacts-search-box i {
    position: absolute;
    left: 12px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    pointer-events: none;
}

.contacts-search-box input {
    width: 220px;
    padding: 9px 12px 9px 36px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-surface);
    color: var(--text-primary);
    font-size: 0.85rem;
}

.contacts-search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.contacts-count {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.contacts-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.contacts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
    padding-bottom: 20px;
}

.contact-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.contact-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
    border-color: var(--primary-color);
}

.contact-card.favorite {
    border-color: #fbbf24;
    background: linear-gradient(135deg, var(--bg-surface) 0%, rgba(251, 191, 36, 0.05) 100%);
}

.contact-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.contact-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.contact-card-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.contact-card-nombre {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    word-break: break-word;
    display: flex;
    align-items: center;
    gap: 6px;
}

.contact-card-categoria {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    width: fit-content;
}

.contact-card-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.contact-card-body > div {
    display: flex;
    align-items: center;
    gap: 6px;
    word-break: break-word;
}

.contact-card-body i {
    font-size: 0.8rem;
    width: 14px;
    color: var(--text-secondary);
}

.contact-card-footer {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
}

.contact-card-action {
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.contact-card-action:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: scale(1.05);
}

.btn-delete-contact:hover {
    background: #dc2626;
    border-color: #dc2626;
}

.btn-fav-contact {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 4px 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: 0.2s;
}

.btn-fav-contact:hover {
    color: #fbbf24;
    transform: scale(1.2);
}

.empty-contacts {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
    grid-column: 1 / -1;
}

.empty-contacts i {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.5;
    display: block;
}

.empty-contacts h3 {
    margin: 10px 0 5px 0;
    color: var(--text-primary);
}

.view-contact-body {
    padding: 25px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.view-contact-header-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: var(--bg-body);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.view-contact-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1.8rem;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.view-contact-main-info {
    flex: 1;
    min-width: 0;
}

.view-contact-main-info h3 {
    margin: 0 0 4px 0;
    font-size: 1.3rem;
    color: var(--text-primary);
    word-break: break-word;
}

.view-contact-empresa {
    margin: 0 0 8px 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.view-contact-details {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.view-contact-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 12px;
    background: var(--bg-body);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.view-contact-row i {
    font-size: 1rem;
    width: 20px;
    text-align: center;
    margin-top: 2px;
    flex-shrink: 0;
}

.view-contact-row span {
    flex: 1;
    font-size: 0.9rem;
    color: var(--text-primary);
    word-break: break-word;
}

.view-contact-row a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.view-contact-row a:hover { text-decoration: underline; }

.view-contact-notas {
    background: rgba(139, 92, 246, 0.05);
    border-color: rgba(139, 92, 246, 0.2);
}

.view-contact-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
}

.btn-action-contact {
    flex: 1;
    min-width: 100px;
    padding: 10px 14px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: 0.2s;
    text-decoration: none;
    color: white;
}

.btn-call { background: #10b981; }
.btn-call:hover { background: #059669; transform: translateY(-1px); }
.btn-email { background: #f59e0b; }
.btn-email:hover { background: #d97706; transform: translateY(-1px); }
.btn-birthday { background: #ec4899; }
.btn-birthday:hover { background: #db2777; transform: translateY(-1px); }
.btn-action-contact.btn-edit { background: var(--primary-color); }
.btn-action-contact.btn-edit:hover { background: var(--primary-hover); transform: translateY(-1px); }
.btn-action-contact.btn-delete { background: #dc2626; }
.btn-action-contact.btn-delete:hover { background: #b91c1c; transform: translateY(-1px); }

/* ==========================================
   MODAL COMPARTIR
   ========================================== */
.share-preview {
    background: var(--bg-body);
    padding: 15px 25px;
    border-left: 4px solid var(--primary-color);
}

.share-preview h4 {
    margin: 0 0 5px 0;
    font-size: 1rem;
    color: var(--text-primary);
}

.share-preview p {
    margin: 2px 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.share-buttons-row {
    display: flex;
    gap: 10px;
    padding: 15px 25px;
    background: var(--bg-body);
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.btn-share-wa,
.btn-share-tg,
.btn-share-email {
    flex: 1;
    min-width: 120px;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
    color: white;
}

.btn-share-wa { background: #25D366; }
.btn-share-wa:hover { background: #128C7E; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3); }
.btn-share-tg { background: #0088cc; }
.btn-share-tg:hover { background: #006699; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0, 136, 204, 0.3); }
.btn-share-email { background: #6366f1; }
.btn-share-email:hover { background: #4f46e5; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3); }

.btn-share-wa i,
.btn-share-tg i,
.btn-share-email i { font-size: 1.1rem; }

/* ==========================================
   MODALES (BASE)
   ========================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-surface);
    width: 90%;
    max-width: 500px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    transform: translateY(-20px);
    transition: transform 0.3s ease;
    overflow: hidden;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-content.admin-modal { max-width: 900px; width: 95%; max-height: 92vh; }
.modal-content.notif-modal { max-width: 900px; width: 95%; max-height: 90vh; }
.modal-content.boleta-modal { max-width: 600px; width: 95%; }
.modal-content.trash-modal { max-width: 700px; width: 95%; max-height: 90vh; }
.modal-content.stats-modal { max-width: 1000px; width: 95%; max-height: 92vh; }

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.close-modal:hover { color: var(--primary-color); }

form { padding: 25px; }

.form-group { margin-bottom: 15px; }

.form-row { display: flex; gap: 15px; }

.form-row .form-group { flex: 1; }

label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

input,
textarea,
select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-body);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.btn-cancel,
.btn-save {
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    font-weight: 500;
    cursor: pointer;
    font-size: 0.9rem;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-cancel { background: var(--bg-body); color: var(--text-secondary); }
.btn-cancel:hover { background: var(--border-color); }
.btn-save { background: var(--primary-color); color: white; }
.btn-save:hover { background: var(--primary-hover); }

.btn-danger {
    background: #dc2626;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    font-size: 0.9rem;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-danger:hover { background: #b91c1c; transform: translateY(-1px); }

.btn-warning {
    background: #f59e0b;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    font-size: 0.9rem;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-warning:hover { background: #d97706; transform: translateY(-1px); }

/* ==========================================
   🎯 SELECT DE PRIORIDAD Y ESTADO
   ========================================== */
.priority-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-body);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
    cursor: pointer;
}

.priority-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

#item-status {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-body);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
    cursor: pointer;
}

#item-status:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-left: 6px;
}

.status-badge.status-pendiente { background: #e5e7eb; color: #374151; }
.status-badge.status-en_progreso { background: #fef3c7; color: #92400e; }
.status-badge.status-hecho { background: #d1fae5; color: #065f46; }

/* ==========================================
   🎨 COLOR PERSONALIZADO
   ========================================== */
.color-picker-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.color-picker-row input[type="color"] {
    width: 50px;
    height: 40px;
    padding: 2px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    background: var(--bg-body);
    flex-shrink: 0;
}

.color-picker-row input[type="text"] {
    flex: 1;
    min-width: 100px;
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
}

.btn-color-reset {
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.2s;
    font-size: 0.85rem;
    width: auto;
}

.btn-color-reset:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* ==========================================
   🔄 RECURRENCIA
   ========================================== */
.recurrence-section {
    background: var(--bg-body);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.recurrence-section > label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.recurrence-section > label i { color: var(--primary-color); }

.recurrence-select { margin-top: 4px; }
.recurrence-days { margin-top: 10px; }

.days-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.day-check {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 10px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: 0.2s;
    margin-bottom: 0;
}

.day-check:hover { border-color: var(--primary-color); }

.day-check input {
    width: auto;
    margin: 0;
    accent-color: var(--primary-color);
}

.day-check:has(input:checked) {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.recurrence-end { margin-top: 10px; }

/* ==========================================
   🔔 MODAL DE NOTIFICACIONES
   ========================================== */
.notif-body {
    padding: 20px 25px;
    overflow-y: auto;
    max-height: calc(90vh - 70px);
}

.notif-section-full {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.notif-section-full h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.notif-section-full h4 i { color: var(--primary-color); }

.notif-columns {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.notif-column {
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.notif-column h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 12px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.notif-column h4 i { color: var(--primary-color); }

.notif-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.notif-stat {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: transform 0.2s;
}

.notif-stat:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.notif-stat-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.notif-stat-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.notif-stat-num {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.notif-stat-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notif-lista {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    overflow-y: auto;
    max-height: 350px;
    padding-right: 5px;
}

.notif-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    transition: 0.2s;
    flex-shrink: 0;
}

.notif-item:hover {
    border-color: var(--primary-color);
    transform: translateX(3px);
}

.notif-item-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.notif-item-icon.cat-event { background: var(--cat-event); color: var(--cat-event-text); }
.notif-item-icon.cat-task { background: var(--cat-task); color: var(--cat-task-text); }
.notif-item-icon.cat-visit { background: var(--cat-visit); color: var(--cat-visit-text); }
.notif-item-icon.cat-habit { background: var(--cat-habit); color: var(--cat-habit-text); }
.notif-item-icon.cat-payment { background: var(--cat-payment); color: var(--cat-payment-text); }
.notif-item-icon.cat-health { background: var(--cat-health); color: var(--cat-health-text); }
.notif-item-icon.cat-birthday { background: var(--cat-birthday); color: var(--cat-birthday-text); }
.notif-item-icon.cat-deadline { background: var(--cat-deadline); color: var(--cat-deadline-text); }
.notif-item-icon.cat-travel { background: var(--cat-travel); color: var(--cat-travel-text); }

.notif-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.notif-item-info strong {
    font-size: 0.85rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notif-item-info span {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.notif-empty {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
    padding: 20px 10px;
    font-style: italic;
}

/* ==========================================
   📄 MODAL DE BOLETAS
   ========================================== */
.boleta-body { padding: 25px; }

.boleta-step {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.boleta-step h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.boleta-hint {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0;
}

.boleta-preview-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.boleta-preview-info span {
    flex: 1;
    font-size: 0.9rem;
    color: var(--text-primary);
    word-break: break-all;
}

.boleta-sugerencia {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 8px;
    margin-top: 10px;
}

.boleta-sugerencia i { font-size: 1.2rem; }
.boleta-sugerencia span { flex: 1; font-size: 0.85rem; color: #92400e; }

body.dark-mode .boleta-sugerencia { background: #78350f; border-color: #f59e0b; }
body.dark-mode .boleta-sugerencia span { color: #fcd34d; }

/* ==========================================
   🗑️ MODAL PAPELERA
   ========================================== */
.trash-body {
    padding: 20px 25px;
    overflow-y: auto;
    max-height: calc(90vh - 70px);
}

.trash-hint {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 15px;
    padding: 10px;
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    border-radius: 4px;
}

body.dark-mode .trash-hint {
    background: #78350f;
    color: #fcd34d;
}

.trash-actions-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    gap: 10px;
    flex-wrap: wrap;
}

.trash-info {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.trash-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 500px;
    overflow-y: auto;
}

.trash-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    border-left: 4px solid var(--border-color);
    gap: 10px;
    flex-wrap: wrap;
}

.trash-item.type-event { border-left-color: var(--primary-color); }
.trash-item.type-task { border-left-color: #ec4899; }
.trash-item.type-visit { border-left-color: #10b981; }
.trash-item.type-habit { border-left-color: #f59e0b; }
.trash-item.type-payment { border-left-color: #10b981; }
.trash-item.type-health { border-left-color: #ef4444; }
.trash-item.type-birthday { border-left-color: #ec4899; }
.trash-item.type-deadline { border-left-color: #8b5cf6; }
.trash-item.type-travel { border-left-color: #06b6d4; }

.trash-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 200px;
}

.trash-item-info strong { font-size: 0.95rem; color: var(--text-primary); }
.trash-item-info span { font-size: 0.8rem; color: var(--text-secondary); }
.trash-item-info small { font-size: 0.7rem; color: var(--text-secondary); font-style: italic; }

.trash-item-actions { display: flex; gap: 6px; }

.btn-restore,
.btn-delete-permanent {
    color: white;
    border: none;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: 0.2s;
}

.btn-restore { background: #10b981; }
.btn-restore:hover { background: #059669; }
.btn-delete-permanent { background: #dc2626; }
.btn-delete-permanent:hover { background: #b91c1c; }

.trash-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
    font-style: italic;
}

.trash-empty i {
    font-size: 3rem;
    margin-bottom: 10px;
    opacity: 0.4;
    display: block;
}

/* ==========================================
   📊 MODAL ESTADÍSTICAS
   ========================================== */
.stats-body {
    padding: 20px 25px;
    overflow-y: auto;
    max-height: calc(92vh - 70px);
}

.stats-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 25px;
}

.stat-card-mini {
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: transform 0.2s;
}

.stat-card-mini:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.stat-card-mini-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.stat-card-mini-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.stat-card-mini-num {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.stat-card-mini-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stats-charts {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.chart-container {
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
}

.chart-container:nth-child(3) {
    grid-column: 1 / -1;
    max-width: 500px;
    margin: 0 auto;
    width: 100%;
}

.chart-container h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chart-container h4 i { color: var(--primary-color); }
.chart-container canvas { max-height: 300px; }

/* ==========================================
   🔔 TOAST DE RECORDATORIO
   ========================================== */
.reminder-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--bg-surface);
    border: 1px solid #f59e0b;
    border-left: 4px solid #f59e0b;
    border-radius: 10px;
    padding: 15px 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    z-index: 3000;
    align-items: center;
    gap: 12px;
    max-width: 350px;
    opacity: 0;
    transform: translateX(120%);
    transition: opacity 0.3s ease, transform 0.3s ease;
    display: none;
}

.reminder-toast.visible {
    opacity: 1;
    transform: translateX(0);
    display: flex;
}

.reminder-toast-icon {
    width: 40px;
    height: 40px;
    background: #fef3c7;
    color: #92400e;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
    animation: shake 0.5s ease-in-out infinite alternate;
}

body.dark-mode .reminder-toast-icon {
    background: #78350f;
    color: #fcd34d;
}

.reminder-toast-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.reminder-toast-content strong {
    font-size: 0.9rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.reminder-toast-content span {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.reminder-toast-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.3rem;
    cursor: pointer;
    padding: 0 5px;
    line-height: 1;
}

.reminder-toast-close:hover { color: var(--text-primary); }

/* ==========================================
   PANEL DE ADMINISTRACIÓN
   ========================================== */
.admin-body {
    padding: 20px 25px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.admin-categories {
    display: flex;
    gap: 8px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
}

.admin-cat-btn {
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    padding: 10px 18px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-secondary);
    transition: 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-cat-btn:hover { background: var(--bg-surface); color: var(--primary-color); }
.admin-cat-btn.active { background: var(--primary-color); color: white; border-color: var(--primary-color); }

.admin-tabs {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.admin-tab {
    background: none;
    border: none;
    padding: 8px 14px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: 6px;
    transition: 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.admin-tab:hover { background: var(--bg-body); color: var(--primary-color); }
.admin-tab.active { background: var(--primary-color); color: white; }

.admin-content {
    flex: 1;
    overflow-y: auto;
    max-height: 60vh;
    padding-right: 5px;
}

.admin-tab-content { display: none; }

.admin-tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

.admin-tab-content h4 {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.admin-form-group { margin-bottom: 18px; }

.admin-form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.admin-form-group small {
    display: block;
    margin-top: 6px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.admin-form-group small code {
    background: var(--bg-body);
    padding: 1px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    color: var(--primary-color);
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 8px 12px;
    background: var(--bg-body);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: 0.2s;
}

.toggle-label:hover { border-color: var(--primary-color); }

.toggle-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
    cursor: pointer;
}

.toggle-label span {
    flex: 1;
    font-size: 0.9rem;
    color: var(--text-primary);
}

/* ==========================================
   PANEL - USUARIOS Y CÓDIGOS
   ========================================== */
.admin-users-list,
.admin-codigos-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 500px;
    overflow-y: auto;
    padding-right: 5px;
}

.admin-user-item,
.admin-codigo-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: var(--bg-body);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 10px;
}

.admin-user-info,
.admin-codigo-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 200px;
}

.admin-user-info strong,
.admin-codigo-info strong {
    font-size: 1rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.admin-user-email,
.admin-codigo-destinatario { font-size: 0.8rem; color: var(--text-secondary); }
.admin-user-date,
.admin-codigo-date { font-size: 0.7rem; color: var(--text-secondary); }
.admin-codigo-usuarios { font-size: 0.7rem; color: var(--primary-color); font-style: italic; }

.admin-user-actions,
.admin-codigo-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.role-badge,
.codigo-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.role-admin { background: #fee2e2; color: #dc2626; }
.role-user { background: #e0e7ff; color: #4f46e5; }
.codigo-badge.activo { background: #d1fae5; color: #065f46; }
.codigo-badge.inactivo { background: #fee2e2; color: #991b1b; }

.badge-original {
    display: inline-block;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
}

.badge-super {
    display: inline-block;
    background: linear-gradient(135deg, #f59e0b 0%, #dc2626 100%);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
}

.badge-inactivo {
    display: inline-block;
    background: #374151;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
}

.btn-toggle-role,
.btn-toggle-codigo,
.btn-toggle-activo,
.btn-reset-pass,
.btn-delete-user,
.btn-delete-codigo,
.btn-download-backup,
.btn-delete-backup {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: 0.2s;
}

.btn-toggle-role:hover,
.btn-toggle-codigo:hover,
.btn-toggle-activo:hover,
.btn-reset-pass:hover { background: var(--primary-hover); }

.btn-delete-user,
.btn-delete-codigo,
.btn-delete-backup { background: #dc2626; }

.btn-delete-user:hover,
.btn-delete-codigo:hover,
.btn-delete-backup:hover { background: #b91c1c; }

.btn-download-backup { background: #10b981; }
.btn-download-backup:hover { background: #059669; }

.admin-section-header {
    background: var(--bg-body);
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 8px;
    margin-top: 12px;
    border-left: 4px solid var(--primary-color);
}

.admin-section-header:first-child { margin-top: 0; }

.admin-section-header h4 {
    margin: 0 0 2px 0;
    font-size: 0.95rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-section-header p { margin: 0; }

.codigo-crear-form {
    background: var(--bg-body);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    margin-bottom: 15px;
}

.codigo-crear-form label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.codigo-crear-row { display: flex; gap: 10px; }
.codigo-crear-row input { flex: 1; }

.admin-user-item code {
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    background: var(--bg-surface);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--primary-color);
}

/* ==========================================
   PANEL - ESTADÍSTICAS
   ========================================== */
.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 15px;
}

.stat-card {
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stat-card.full-width { grid-column: 1 / -1; }

.stat-card h5 {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.stat-big {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-top: 1px solid var(--border-color);
    font-size: 0.85rem;
}

.stat-row span { color: var(--text-secondary); }
.stat-row strong { color: var(--text-primary); font-weight: 600; }

/* ==========================================
   PANEL - MANTENIMIENTO
   ========================================== */
.admin-card {
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 18px;
    margin-bottom: 15px;
}

.admin-card h5 {
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.mant-row { display: flex; gap: 10px; align-items: center; }
.mant-row input { max-width: 120px; }

/* ==========================================
   PANEL - BACKUPS
   ========================================== */
.admin-backups-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
    max-height: 400px;
    overflow-y: auto;
}

.admin-backup-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: var(--bg-body);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 10px;
}

.admin-backup-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 200px;
}

.admin-backup-info strong {
    font-size: 0.95rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.admin-backup-info span { font-size: 0.75rem; color: var(--text-secondary); }
.admin-backup-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.admin-loading {
    text-align: center;
    padding: 20px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ==========================================
   ARCHIVOS ADJUNTOS
   ========================================== */
.archivos-dropzone {
    border: 2px dashed var(--border-color);
    border-radius: 10px;
    padding: 25px 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg-body);
    margin-bottom: 10px;
}

.archivos-dropzone:hover,
.archivos-dropzone.drag-over {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.05);
}

.archivos-dropzone i {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 8px;
    display: block;
}

.archivos-dropzone p {
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.archivos-dropzone small { font-size: 0.75rem; color: var(--text-secondary); }

.archivos-dropzone .link-archivo {
    color: var(--primary-color);
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    display: inline;
}

.archivos-progress {
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 10px;
}

.progress-bar {
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 6px;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 4px;
}

.progress-text { font-size: 0.75rem; color: var(--text-secondary); }

.archivos-lista {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 200px;
    overflow-y: auto;
}

.archivo-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.85rem;
}

.archivo-icono { font-size: 1.2rem; width: 24px; text-align: center; flex-shrink: 0; }

.archivo-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.archivo-nombre {
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.archivo-meta { font-size: 0.7rem; color: var(--text-secondary); }

.archivo-acciones { display: flex; gap: 4px; flex-shrink: 0; }

.archivo-acciones button {
    background: none;
    border: none;
    padding: 4px 6px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
    color: var(--text-secondary);
    transition: 0.2s;
}

.archivo-acciones button:hover {
    background: var(--primary-color);
    color: white;
}

.archivo-acciones .btn-eliminar-archivo:hover { background: #dc2626; }

/* ==========================================
   LIGHTBOX
   ========================================== */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    padding: 20px;
}

.lightbox-overlay.active { opacity: 1; visibility: visible; }

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 2rem;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    transition: 0.2s;
    z-index: 2001;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.lightbox-content {
    background: var(--bg-surface);
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.lightbox-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: var(--bg-body);
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 10px;
}

.lightbox-header h3 {
    font-size: 1rem;
    color: var(--text-primary);
    margin: 0;
    word-break: break-word;
    flex: 1;
    min-width: 200px;
}

.lightbox-actions { display: flex; gap: 8px; }

.lightbox-body {
    flex: 1;
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    min-height: 300px;
    max-height: calc(90vh - 70px);
}

.lightbox-img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lightbox-iframe { width: 100%; height: calc(90vh - 70px); border: none; background: white; }

.lightbox-no-preview {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
    background: var(--bg-surface);
    width: 100%;
}

.lightbox-no-preview p { font-size: 0.95rem; margin-bottom: 10px; }

/* ==========================================
   LANDING PAGE
   ========================================== */
.landing-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    overflow: auto;
}

.landing-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.landing-logo {
    display: flex;
    align-items: center;
    gap: 15px;
    color: white;
    margin-bottom: 60px;
}

.landing-logo i { font-size: 2.5rem; }
.landing-logo h1 { font-size: 1.8rem; font-weight: 700; }

.landing-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    flex: 1;
}

.landing-text h2 {
    color: white;
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 20px;
}

.landing-text .highlight { color: #fbbf24; }

.landing-text p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    margin-bottom: 30px;
    line-height: 1.6;
}

.features { display: flex; flex-direction: column; gap: 15px; }

.feature {
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
    font-size: 1rem;
}

.feature i { color: #fbbf24; font-size: 1.2rem; }

.login-card {
    background: white;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.login-card h3 { font-size: 1.8rem; color: #111827; margin-bottom: 10px; }
.login-card > p { color: #6b7280; margin-bottom: 30px; }

.auth-buttons { display: flex; flex-direction: column; gap: 12px; }

.btn-auth {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 24px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.2s;
}

.btn-auth.primary { background: #6366f1; color: white; }
.btn-auth.primary:hover {
    background: #4f46e5;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
}

.btn-auth.secondary { background: #f3f4f6; color: #374151; border: 2px solid #e5e7eb; }
.btn-auth.secondary:hover { border-color: #6366f1; color: #6366f1; transform: translateY(-2px); }

.landing-footer {
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 40px;
    padding-top: 20px;
}

/* ==========================================
   PÁGINAS DE AUTENTICACIÓN
   ========================================== */
.auth-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
}

.auth-container {
    width: 100%;
    max-width: 450px;
    margin: auto;
    padding: 20px 0;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: white;
    text-decoration: none;
    margin-bottom: 20px;
    font-weight: 500;
    transition: 0.2s;
}

.back-link:hover { opacity: 0.8; }

.auth-card {
    background: white;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.auth-header { text-align: center; margin-bottom: 30px; }

.auth-header .logo-icon {
    font-size: 3rem;
    color: #6366f1;
    margin-bottom: 15px;
    display: block;
}

.auth-header h2 { font-size: 1.8rem; color: #111827; margin-bottom: 8px; }
.auth-header p { color: #6b7280; }

.auth-form .form-group { margin-bottom: 15px; }

.auth-form label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
}

.auth-form input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: 0.2s;
    background: #ffffff;
    color: #111827;
}

.auth-form input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.btn-auth-submit {
    width: 100%;
    padding: 14px;
    background: #6366f1;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
}

.btn-auth-submit:hover {
    background: #4f46e5;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
}

.btn-auth-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.auth-error {
    background: #fee2e2;
    color: #dc2626;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 0.9rem;
    border-left: 4px solid #dc2626;
}

.auth-success {
    background: #d1fae5;
    color: #065f46;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 0.9rem;
    border-left: 4px solid #10b981;
}

.auth-footer {
    text-align: center;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
    color: #6b7280;
}

.auth-footer a {
    color: #6366f1;
    text-decoration: none;
    font-weight: 600;
}

.auth-footer a:hover { text-decoration: underline; }

/* ==========================================
   🏢 SELECTOR DE TIPO DE CUENTA (REGISTRO)
   ========================================== */
.tipo-cuenta-selector {
    display: flex;
    gap: 10px;
    margin-top: 5px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: 0.2s;
    flex: 1;
    font-size: 0.85rem;
    background: var(--bg-body);
}

.radio-label:hover {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.05);
}

.radio-label input[type="radio"] {
    accent-color: var(--primary-color);
    width: 16px;
    height: 16px;
}

.radio-label:has(input:checked) {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.08);
    font-weight: 500;
}

.grupo-input-container {
    animation: fadeIn 0.3s ease;
    background: var(--bg-body);
    padding: 12px;
    border-radius: 8px;
    border: 1px dashed var(--primary-color);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================
   📤 ESTILOS DE IMPRESIÓN
   ========================================== */
@media print {
    body {
        overflow: visible !important;
        height: auto !important;
    }
    .top-header,
    .sidebar,
    .calendar-header,
    .mini-resumen,
    .modal-overlay,
    .lightbox-overlay,
    .reminder-toast,
    .calendar-actions {
        display: none !important;
    }
    .main-layout { height: auto !important; }
    .calendar-section { padding: 0 !important; }
    .calendar-container {
        border: none !important;
        padding: 0 !important;
    }
}

/* ==========================================
   RESPONSIVE - TABLETS
   ========================================== */
@media (max-width: 1200px) {
    .welcome-text { font-size: 0.8rem; }
    .btn-notes-toggle span,
    .btn-contacts-toggle span,
    .btn-stats span,
    .btn-admin-toggle span {
        display: none;
    }
    .btn-notes-toggle,
    .btn-contacts-toggle,
    .btn-stats,
    .btn-admin-toggle {
        padding: 6px 8px;
    }
}

@media (max-width: 1024px) {
    .notif-stats { grid-template-columns: repeat(2, 1fr); }
    .notif-columns { grid-template-columns: 1fr 1fr; }
    .mini-resumen { gap: 10px; }
    .mini-resumen-item { min-width: 80px; padding: 5px 8px; }
    .stats-summary { grid-template-columns: repeat(2, 1fr); }
    .stats-charts { grid-template-columns: 1fr; }
    .top-header { padding: 8px 15px; gap: 10px; }
    .logo-area h1 { font-size: 1rem; }
    .grupo-badge { display: none; }
    .sidebar { width: 280px; }
}

/* ==========================================
   📱 RESPONSIVE - MÓVIL
   ========================================== */
@media (max-width: 768px) {
    /* Mostrar botón hamburguesa */
    .btn-sidebar-toggle {
        display: flex !important;
    }

    /* Mostrar menú de usuario móvil */
    .mobile-user-menu {
        display: block;
    }

    /* Header compacto */
    .top-header {
        padding: 10px 15px;
        height: 60px;
        gap: 10px;
    }

    .logo-area h1 { font-size: 1rem; }
    .logo-icon { font-size: 1.2rem; }
    .header-right { gap: 6px; }
    .btn-notificaciones { padding: 6px 10px; font-size: 1rem; }
    .theme-toggle { padding: 6px; font-size: 1rem; }
    .user-area { gap: 8px; }
    .welcome-text { display: none; }
    .avatar-container { width: 34px; height: 34px; }
    .logout-btn { padding: 5px 8px; font-size: 0.75rem; }

    /* SIDEBAR COMO DRAWER */
    .sidebar {
        display: flex !important;
        position: fixed;
        top: 0;
        left: -100%;
        width: 85%;
        max-width: 320px;
        height: 100vh;
        z-index: 1000;
        transition: left 0.3s ease;
        box-shadow: none;
        padding-top: 20px;
        overflow-y: auto;
        background: var(--bg-sidebar);
    }

    .sidebar.mobile-open {
        left: 0;
        box-shadow: 5px 0 30px rgba(0, 0, 0, 0.3);
    }

    /* Overlay */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .sidebar-overlay.active {
        display: block;
        opacity: 1;
    }

    /* Layout */
    .main-layout { height: calc(100vh - 60px); }
    .calendar-section,
    .notes-section,
    .contacts-section {
        padding: 15px;
    }

    /* Mini resumen compacto */
    .mini-resumen { padding: 8px 10px; gap: 6px; margin-bottom: 10px; }
    .mini-resumen-item { min-width: 60px; padding: 4px 6px; gap: 3px; }
    .mini-resumen-item i { font-size: 0.7rem; }
    .mini-num { font-size: 0.85rem; }
    .mini-label { font-size: 0.55rem; }
    .mini-resumen-fecha { display: none; }

    /* Calendar header */
    .calendar-header { flex-direction: column; gap: 10px; margin-bottom: 15px; }
    .date-navigation { width: 100%; justify-content: space-between; }
    #calendar-title { font-size: 1.1rem; }
    .calendar-actions { width: 100%; flex-direction: column; gap: 8px; }
    .export-buttons {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 5px;
        flex-wrap: nowrap;
        justify-content: flex-start;
    }
    .btn-export { padding: 6px 10px; font-size: 0.7rem; white-space: nowrap; flex-shrink: 0; }
    .view-toggles { width: 100%; justify-content: center; }
    .view-btn { padding: 6px 10px; font-size: 0.75rem; flex: 1; }

    /* Vistas de calendario */
    .month-cell { min-height: 50px; padding: 3px; }
    .month-day-number { font-size: 0.75rem; }
    .month-cell.today .month-day-number { width: 22px; height: 22px; font-size: 0.7rem; }
    .month-event { font-size: 0.6rem; padding: 2px 4px; }
    .month-header { font-size: 0.7rem; padding: 8px 4px; }
    .week-grid { overflow-x: auto; font-size: 0.75rem; }
    .week-time { font-size: 0.65rem; padding: 4px; }
    .week-header { font-size: 0.7rem; padding: 8px 4px; }
    .week-event { font-size: 0.6rem; }
    .day-time { width: 45px; font-size: 0.75rem; }
    .event-card { padding: 8px 10px; font-size: 0.8rem; }

    /* Notas y Contactos */
    .notes-header,
    .contacts-header { flex-direction: column; align-items: stretch; gap: 10px; }
    .contacts-actions { flex-direction: column; }
    .contacts-search-box input { width: 100%; }
    .btn-new-contact,
    .btn-new-note { width: 100%; justify-content: center; }
    .notes-grid,
    .contacts-grid { grid-template-columns: 1fr; }

    /* Modales en móvil */
    .modal-overlay.active .modal-content {
        width: 95% !important;
        max-width: 95% !important;
        max-height: 90vh !important;
        margin: auto;
        border-radius: 12px;
        transform: translateY(0);
    }
    .modal-header { padding: 15px; }
    .modal-header h3 { font-size: 1.1rem; }
    form { padding: 15px; }
    .form-group { margin-bottom: 12px; }
    input,
    textarea,
    select { padding: 10px; font-size: 16px; }
    .modal-footer {
        flex-direction: column;
        gap: 8px;
        padding: 0 15px 15px 15px;
    }
    .modal-footer button { width: 100%; justify-content: center; }
    .modal-content.admin-modal,
    .modal-content.notif-modal,
    .modal-content.boleta-modal,
    .modal-content.trash-modal,
    .modal-content.stats-modal {
        width: 95% !important;
        max-height: 92vh !important;
    }
    .admin-categories,
    .admin-tabs { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 8px; }
    .admin-cat-btn,
    .admin-tab { white-space: nowrap; font-size: 0.75rem; flex-shrink: 0; }
    .stats-summary { grid-template-columns: 1fr 1fr; gap: 8px; }
    .stat-card-mini { padding: 10px; }
    .stat-card-mini-icon { width: 32px; height: 32px; font-size: 1rem; }
    .stat-card-mini-num { font-size: 1.2rem; }
    .stats-charts { grid-template-columns: 1fr; }
    .chart-container:nth-child(3) { max-width: 100%; }

    /* Lightbox */
    .lightbox-content { max-width: 100%; max-height: 95vh; border-radius: 0; }
    .lightbox-close { top: 10px; right: 10px; width: 40px; height: 40px; }
    .lightbox-iframe { height: calc(95vh - 60px); }

    /* Toast */
    .reminder-toast { left: 10px; right: 10px; bottom: 10px; max-width: none; }

    /* Kanban */
    .kanban-board { grid-template-columns: 1fr; gap: 15px; }
    .kanban-column { min-height: 200px; }

    /* Filtros */
    .filter-row { flex-direction: column; }
    .filter-select { width: 100%; }

    /* Archivos */
    .archivo-item { flex-wrap: wrap; }
    .archivo-acciones { width: 100%; justify-content: flex-end; }

    /* Share buttons */
    .share-buttons-row { flex-direction: column; }
    .btn-share-wa,
    .btn-share-tg,
    .btn-share-email { width: 100%; }

    /* Trash */
    .trash-item { flex-direction: column; align-items: flex-start; }
    .trash-item-actions { width: 100%; justify-content: flex-end; }

    /* Admin panel */
    .admin-categories { flex-wrap: wrap; }
    .admin-cat-btn { flex: 1; min-width: 90px; justify-content: center; font-size: 0.75rem; padding: 8px 8px; }
    .admin-stats-grid { grid-template-columns: 1fr; }
    .admin-user-item,
    .admin-codigo-item,
    .admin-backup-item { flex-direction: column; align-items: flex-start; }
    .admin-user-actions,
    .admin-codigo-actions,
    .admin-backup-actions { width: 100%; justify-content: flex-start; flex-wrap: wrap; }

    /* Notificaciones modal */
    .notif-stats { grid-template-columns: 1fr 1fr; }
    .notif-columns { grid-template-columns: 1fr; }

    /* Color picker */
    .color-picker-row { flex-direction: column; align-items: stretch; }
    .color-picker-row input[type="color"] { width: 100%; height: 45px; }

    /* Form rows */
    .form-row { flex-direction: column; gap: 10px; }

    /* Contactos */
    .view-contact-header-card { flex-direction: column; text-align: center; }
    .view-contact-actions { flex-direction: column; }
    .btn-action-contact { width: 100%; }

    .btn-cambiar-pass span { display: none; }
    .btn-cambiar-pass { padding: 5px 8px; }
}

@media (max-width: 480px) {
    .logo-area h1 { display: none; }
    .btn-notificaciones { padding: 6px 8px; }
}