:root {
    --bg-main: #f0f4f8;
    --panel-bg: #ffffff;
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --border-color: #cbd5e1;
    --primary: #3b82f6;
    --accent-success: #10b981;
    --accent-danger: #ef4444;
    --note-bg: #ffffff;
    --note-text: #1e293b;
}

.theme-default { --note-bg: #ffffff; --note-text: #1e293b; }
.theme-personal { --note-bg: #fef2f2; --note-text: #991b1b; }
.theme-business { --note-bg: #f0fdf4; --note-text: #166534; }
.theme-ideas { --note-bg: #fef9c3; --note-text: #854d0e; }
.theme-dark { --note-bg: #1e293b; --note-text: #f8fafc; }

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: Arial, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-dark);
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.workspace { display: flex; flex: 1; height: calc(100vh - 25px); position: relative; }

/* --- DISEÑO PARA MÓVIL (POR DEFECTO) --- */
.menu-toggle {
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 999;
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.sidebar {
    position: fixed;
    top: 0;
    left: -320px; /* Oculto en el cel */
    width: 300px;
    height: 100%;
    background-color: #f8fafc;
    border-right: 1px solid var(--border-color);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 995;
    transition: left 0.25s ease-in-out;
    overflow-y: auto;
}
.sidebar.open { left: 0 !important; } /* Abre en el cel */

/* Cabecera del menú en móvil */
.sidebar-header-mobile { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    font-weight: bold; 
    border-bottom: 1px solid var(--border-color); 
    padding-bottom: 10px; 
    color: var(--text-dark); 
}

.weather-widget { background: linear-gradient(135deg, #e0f2fe, #bae6fd); border-radius: 12px; padding: 12px; display: flex; align-items: center; justify-content: space-between; border: 1px solid #7dd3fc; }
.weather-info { display: flex; flex-direction: column; }
.weather-temp { font-size: 22px; font-weight: bold; color: #0369a1; }
.weather-loc { font-size: 12px; color: #0284c7; font-weight: bold; }
.weather-icon { font-size: 28px; }
.clock-display { font-size: 20px; font-weight: 700; text-align: center; }

.sidebar-section h3 { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); border-bottom: 1px solid var(--border-color); padding-bottom: 4px; margin-bottom: 8px; }
.category-item, .note-thumb { padding: 12px; border-radius: 6px; cursor: pointer; font-size: 14px; background: #ffffff; border: 1px solid var(--border-color); margin-bottom: 5px; }
.category-item.active, .note-thumb.active { background-color: #e2e8f0; font-weight: bold; border-color: var(--primary); }

.notes-list { display: flex; flex-direction: column; max-height: 200px; overflow-y: auto; }

.editor-container { flex: 1; display: flex; flex-direction: column; background-color: var(--note-bg); color: var(--note-text); margin: 0; height: 100%; position: relative; }

.toolbar { background-color: #f1f5f9; padding: 60px 10px 10px 10px; border-bottom: 1px solid var(--border-color); display: flex; gap: 5px; align-items: center; flex-wrap: wrap; }
.toolbar button, .calendar-tool { background: #ffffff; border: 1px solid var(--border-color); padding: 8px 10px; border-radius: 4px; font-weight: bold; font-size: 12px; color: var(--text-dark); }

.btn-new-note { background-color: var(--accent-success) !important; color: white !important; border-color: var(--accent-success) !important; }
.btn-delete-note { background-color: var(--accent-danger) !important; color: white !important; border-color: var(--accent-danger) !important; }
.btn-tool { background-color: #e2e8f0 !important; }
.calendar-tool { background-color: #e2e8f0; display: inline-flex; align-items: center; }
.calendar-tool input { border: none; background: transparent; font-weight: bold; font-size: 12px; width: 100px; cursor: pointer; }

.theme-selector { display: flex; gap: 8px; align-items: center; margin-left: auto; padding: 5px 0; }
.theme-dot { width: 22px; height: 22px; border-radius: 50%; cursor: pointer; border: 2px solid transparent; box-shadow: 0 0 3px rgba(0,0,0,0.2); }
.theme-dot.active { border-color: #1e293b; }

.notepad-wrapper { flex: 1; padding: 15px; overflow-y: auto; display: flex; flex-direction: column; }
.note-title-input { width: 100%; border: none; background: transparent; font-size: 20px; font-weight: 700; margin-bottom: 10px; outline: none; color: inherit; }
.notepad { flex: 1; font-size: 15px; line-height: 1.5; outline: none; color: inherit; min-height: 200px; }

/* Calculadora */
.calc-popup { position: absolute; top: 110px; right: 10px; left: 10px; background: #ffffff; border: 1px solid var(--border-color); border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); padding: 12px; display: none; z-index: 200; color: #1e293b; }
.calc-screen { width: 100%; height: 40px; background: #f1f5f9; border: none; text-align: right; padding: 5px 10px; font-size: 18px; margin-bottom: 10px; border-radius: 4px; outline: none; font-weight: bold; }
.calc-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.calc-grid button { padding: 12px; border: 1px solid #cbd5e1; background: #f8fafc; cursor: pointer; border-radius: 4px; font-weight: bold; font-size: 16px; }
.btn-calc-equal { background: var(--primary) !important; color: white !important; }

.status-bar { height: 25px; padding: 4px 10px; background-color: #f1f5f9; font-size: 10px; color: var(--text-muted); display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--border-color); }
.firma-status { display: none; }


/* --- 🖥️ VISTA PARA COMPUTADORA (PANTALLA GRANDE) --- */
@media (min-width: 769px) {
    .menu-toggle { display: none !important; } 
    
    /* DESAPARECE LA INSCRIPCIÓN EN LA PC */
    .sidebar-header-mobile { display: none !important; } 
    
    .sidebar {
        position: relative;
        left: 0 !important;
        width: 310px;
        height: auto;
    }
    
    .editor-container { margin: 20px; border-radius: 8px; border: 1px solid var(--border-color); box-shadow: 0 4px 14px rgba(0,0,0,0.06); height: auto; }
    .toolbar { padding: 10px 15px; }
    .notepad-wrapper { padding: 25px; }
    .note-title-input { font-size: 24px; }
    .notepad { font-size: 16px; }
    .calc-popup { width: 230px; left: auto; right: 20px; top: 55px; }
    .firma-status { display: inline; }
    .status-bar { padding: 4px 16px; font-size: 11px; }
}