* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; }

body {
    background-color: #f4f7f6;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

.login-container {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

.login-box h2 { color: #333; margin-bottom: 10px; text-align: center; }
.login-box p { color: #666; font-size: 14px; margin-bottom: 25px; text-align: center; }

.input-group { margin-bottom: 20px; }
.input-group label { display: block; margin-bottom: 5px; color: #333; font-weight: 500; font-size: 14px; }
.input-group input {
    width: 100%; padding: 12px; border: 1px solid #ddd;
    border-radius: 6px; font-size: 15px; outline: none; transition: border-color 0.3s;
}
.input-group input:focus { border-color: #007bff; }

button {
    width: 100%; padding: 12px; background-color: #007bff; color: white;
    border: none; border-radius: 6px; font-size: 16px; font-weight: bold;
    cursor: pointer; transition: background 0.3s;
}
button:hover { background-color: #0056b3; }

.error-msg { color: #dc3545; font-size: 14px; margin-top: 15px; text-align: center; display: none; }

/* --- ESTILOS ADICIONALES PARA EL DASHBOARD --- */
.dashboard-body {
    display: flex;
    height: 100vh;
    background-color: #eef2f5;
    overflow: hidden;
}

.sidebar {
    width: 260px;
    background-color: #1e293b;
    color: white;
    padding: 25px;
    display: flex;
    flex-direction: column;
}
.sidebar h2 { margin-bottom: 5px; font-size: 22px; color: #38bdf8; }
.user-badge { font-size: 12px; color: #94a3b8; margin-bottom: 30px; word-break: break-all; }

.sidebar nav { flex-grow: 1; display: flex; flex-direction: column; gap: 10px; }
.sidebar nav a {
    color: #cbd5e1; text-decoration: none; padding: 12px; border-radius: 6px;
    font-weight: 500; transition: background 0.3s;
}
.sidebar nav a.active, .sidebar nav a:hover { background-color: #334155; color: white; }

.btn-secondary { background-color: #ef4444; margin-top: auto; }
.btn-secondary:hover { background-color: #dc2626; }

.main-content { flex-grow: 1; display: flex; flex-direction: column; height: 100%; }

.workspace-header {
    background: white; padding: 15px 30px; display: flex;
    justify-content: space-between; align-items: center; border-bottom: 1px solid #e2e8f0;
}
.workspace-header h1 { font-size: 20px; color: #0f172a; }
#btn-generate-pdf { width: auto; padding: 10px 20px; background-color: #10b981; }
#btn-generate-pdf:hover { background-color: #059669; }

.workspace-container {
    flex-grow: 1; overflow-y: auto; padding: 40px;
    display: flex; justify-content: center; background-color: #cbd5e1;
}

/* Simulación de Hoja Tamaño Carta Real */
.pdf-sheet {
    background: white; 
    width: 100%; 
    max-width: 800px; 
    /* ELIMINAMOS min-height: 1000px; */
    min-height: auto; 
    padding: 60px; 
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    display: flex; 
    flex-direction: column;
}

/* NUEVO: Estilo visual para que el usuario sepa que la imagen es editable */
.inserted-image {
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}
.inserted-image:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.doc-title {
    font-size: 26px; border-bottom: 2px solid #3b82f6;
    padding-bottom: 10px; margin-bottom: 25px; outline: none; color: #1e3a8a;
}
.doc-content { font-size: 16px; line-height: 1.6; color: #334155; outline: none; flex-grow: 1; }

/* Sección de la firma visual dentro de la hoja */
.signature-section { margin-top: 50px; border-top: 1px dashed #cbd5e1; padding-top: 20px; width: 350px; }
.signature-label { font-size: 14px; font-weight: bold; color: #475569; margin-bottom: 10px; }
.canvas-container { border: 1px solid #94a3b8; background-color: #f8fafc; border-radius: 4px; }
canvas { display: block; cursor: crosshair; }
.btn-mini { width: auto; padding: 4px 10px; font-size: 11px; margin-top: 5px; background-color: #64748b; }