* { 
    box-sizing: border-box; 
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
    margin: 0; 
    padding: 0; 
}

body { 
    background-color: #f8fafc; 
    color: #334155; 
    display: flex; 
    height: 100vh; 
    overflow: hidden; 
}

.app-container {
    display: flex;
    width: 100%;
    height: 100vh;
}

/* Sidebar Limpia y Clara */
.sidebar { 
    width: 270px; 
    background: #ffffff; 
    color: #475569; 
    padding: 20px 0; 
    display: flex; 
    flex-direction: column; 
    flex-shrink: 0; 
    border-right: 1px solid #e2e8f0; 
}
.sidebar h2 { 
    font-size: 15px; 
    text-align: center; 
    margin-bottom: 20px; 
    padding: 0 10px; 
    color: #0f172a; 
    font-weight: 700; 
    letter-spacing: 0.5px;
}
.menu-section { 
    font-size: 11px; 
    text-transform: uppercase; 
    color: #94a3b8; 
    padding: 12px 20px 4px; 
    font-weight: 700; 
    letter-spacing: 0.8px;
}
.nav-btn { 
    background: none; 
    border: none; 
    color: #64748b; 
    padding: 11px 20px; 
    text-align: left; 
    width: 100%; 
    cursor: pointer; 
    font-size: 13px; 
    transition: all 0.2s ease; 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
}
.nav-btn:hover { 
    background: #f1f5f9; 
    color: #0f172a; 
}
.nav-btn.active { 
    background: #e0f2fe; 
    color: #0369a1; 
    border-left: 4px solid #0284c7; 
    font-weight: 600;
}
.badge { 
    background: #f1f5f9; 
    color: #0369a1; 
    font-size: 10px; 
    padding: 2px 7px; 
    border-radius: 10px; 
    font-weight: 600;
}

/* Contenido Principal y Topbar */
.main-content { 
    flex: 1; 
    display: flex; 
    flex-direction: column; 
    overflow: hidden; 
    background: #f8fafc;
}
.topbar { 
    background: #ffffff; 
    padding: 15px 25px; 
    border-bottom: 1px solid #e2e8f0; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}
.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}
.view-section { 
    padding: 24px; 
    flex: 1; 
    overflow-y: auto; 
    display: none; 
}
.view-section.active { 
    display: block; 
}

/* Tarjetas y Tablas */
.card { 
    background: #ffffff; 
    border-radius: 8px; 
    border: 1px solid #e2e8f0; 
    padding: 20px; 
    margin-bottom: 20px; 
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02); 
}
.table { 
    width: 100%; 
    border-collapse: collapse; 
    margin-top: 15px; 
}
.table th, .table td { 
    padding: 12px 14px; 
    text-align: left; 
    border-bottom: 1px solid #e2e8f0; 
    font-size: 13px; 
}
.table th { 
    background: #f1f5f9; 
    font-weight: 600; 
    color: #475569; 
    border-top: 1px solid #e2e8f0;
}
.table tr:hover td {
    background-color: #f8fafc;
}

/* Botones claros y definidos */
.btn { 
    padding: 7px 14px; 
    border: none; 
    border-radius: 6px; 
    cursor: pointer; 
    font-size: 12px; 
    font-weight: 600; 
    transition: all 0.2s; 
    display: inline-flex; 
    align-items: center; 
    gap: 6px; 
}
.btn-primary { background: #0284c7; color: #ffffff; }
.btn-primary:hover { background: #0369a1; }

.btn-success { background: #10b981; color: #ffffff; }
.btn-success:hover { background: #059669; }

.btn-warning { background: #f59e0b; color: #ffffff; }
.btn-warning:hover { background: #d97706; }

.btn-danger { background: #ef4444; color: #ffffff; }
.btn-danger:hover { background: #dc2626; }

.btn-secondary { background: #e2e8f0; color: #475569; }
.btn-secondary:hover { background: #cbd5e1; }

/* Modales */
.modal { 
    display: none; 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background: rgba(15, 23, 42, 0.4); 
    backdrop-filter: blur(2px);
    justify-content: center; 
    align-items: center; 
    z-index: 1000; 
}
.modal.active { 
    display: flex; 
}
.modal-content { 
    background: #ffffff; 
    border-radius: 8px; 
    width: 480px; 
    padding: 24px; 
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08); 
    border: 1px solid #e2e8f0;
}
.modal-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    border-bottom: 1px solid #e2e8f0; 
    padding-bottom: 12px; 
    margin-bottom: 16px; 
}

/* Editor */
.editor-full { 
    display: flex; 
    flex-direction: column; 
    height: calc(100vh - 120px); 
    background: #ffffff; 
    border-radius: 8px; 
    overflow: hidden; 
    border: 1px solid #e2e8f0;
}
.editor-toolbar { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    background: #f8fafc; 
    padding: 12px 20px; 
    border-bottom: 1px solid #e2e8f0; 
}
#doc-iframe { 
    width: 100%; 
    height: 100%; 
    border: none; 
    background: #ffffff; 
}

/* Formularios */
.form-group { 
    margin-bottom: 14px; 
}
.form-group label { 
    display: block; 
    font-size: 12px; 
    font-weight: 600; 
    margin-bottom: 5px; 
    color: #475569; 
}
.form-group input, .form-group select, .form-group textarea { 
    width: 100%; 
    padding: 8px 10px; 
    border: 1px solid #cbd5e1; 
    border-radius: 6px; 
    font-size: 13px; 
    color: #1e293b;
    background-color: #ffffff;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none;
    border-color: #0284c7;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

/* Login Overlay */
.login-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #a1a1a1 0%, #a1a1a1 100%);
    justify-content: center;
    align-items: center;
    z-index: 9999;
}
.login-overlay.active {
    display: flex;
}
.login-card {
    background: #ffffff;
    border-radius: 12px;
    width: 420px;
    max-width: 92%;
    padding: 36px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.35);
}
.login-title {
    font-size: 22px;
    color: #0f172a;
    text-align: center;
    margin-bottom: 4px;
    font-weight: 700;
}
.login-subtitle {
    font-size: 13px;
    color: #64748b;
    text-align: center;
    margin-bottom: 20px;
}
.login-error {
    background: #fef2f2;
    color: #dc2626;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 14px;
    border: 1px solid #fecaca;
}
.login-hint {
    font-size: 11px;
    color: #94a3b8;
    text-align: center;
    margin-top: 14px;
}
.btn-login {
    width: 100%;
    padding: 10px;
    background: #0284c7;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-login:hover {
    background: #0369a1;
}
.btn-logout {
    background: #ef4444;
    color: #ffffff;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-logout:hover {
    background: #dc2626;
}
